src/HOL/Tools/Quotient/quotient_tacs.ML
changeset 37560 1b5bbc4a14bc
parent 37493 2377d246a631
child 37563 6cf28a1dfd75
equal deleted inserted replaced
37559:9118ce1d1750 37560:1b5bbc4a14bc
   647 let
   647 let
   648   (* When the theorem is atomized, eta redexes are contracted,
   648   (* When the theorem is atomized, eta redexes are contracted,
   649      so we do it both in the original theorem *)
   649      so we do it both in the original theorem *)
   650   val thm' = Drule.eta_contraction_rule thm
   650   val thm' = Drule.eta_contraction_rule thm
   651   val ((_, [thm'']), ctxt') = Variable.import false [thm'] ctxt
   651   val ((_, [thm'']), ctxt') = Variable.import false [thm'] ctxt
   652   val goal = (quotient_lift_all qtys ctxt' o prop_of) thm''
   652   val goal = derive_qtrm qtys (prop_of thm'') ctxt' 
   653 in
   653 in
   654   Goal.prove ctxt' [] [] goal (K (lift_tac ctxt' [thm'] 1))
   654   Goal.prove ctxt' [] [] goal (K (lift_tac ctxt' [thm'] 1))
   655   |> singleton (ProofContext.export ctxt' ctxt)
   655   |> singleton (ProofContext.export ctxt' ctxt)
   656 end;
   656 end;
   657 
   657 
   658 (* An Attribute which automatically constructs the qthm *)
   658 (* An attribute which automatically constructs the qthm 
   659 val lifted_attrib = Thm.rule_attribute (fn ctxt => lifted [] (Context.proof_of ctxt))
   659    using all quotients defined so far.
       
   660 *)
       
   661 val lifted_attrib = Thm.rule_attribute (fn context => 
       
   662        let
       
   663          val ctxt = Context.proof_of context
       
   664          val qtys = map #qtyp (Quotient_Info.quotdata_dest ctxt)
       
   665        in
       
   666          lifted qtys ctxt
       
   667        end)
   660 
   668 
   661 end; (* structure *)
   669 end; (* structure *)