author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Mon, 20 Jun 2011 08:50:13 +0900 | |
changeset 2871 | b58073719b06 |
parent 1024 | b3deb964ad26 |
permissions | -rw-r--r-- |
226 | 1 |
(*notation ( output) "prop" ("#_" [1000] 1000) *) |
2 |
notation ( output) "Trueprop" ("#_" [1000] 1000) |
|
101
4f93c5a026d2
Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
|
912
aa960d16570f
Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
870
diff
changeset
|
4 |
syntax |
980
9d35c6145dd2
Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
948
diff
changeset
|
5 |
"Bex1_rel" :: "id \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" ("(3\<exists>!!_\<in>_./ _)" [0, 0, 10] 10) |
912
aa960d16570f
Lifted Peter's Sigma lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
870
diff
changeset
|
6 |
translations |
980
9d35c6145dd2
Renamed Bexeq to Bex1_rel
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
948
diff
changeset
|
7 |
"\<exists>!!x\<in>A. P" == "Bex1_rel A (%x. P)" |
806
43336511993f
Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
685
diff
changeset
|
8 |
|
685
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
9 |
(*interpretation code *) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
10 |
(*val bindd = ((Binding.make ("", Position.none)), ([]: Attrib.src list)) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
11 |
val ((_, [eqn1pre]), lthy5) = Variable.import true [ABS_def] lthy4; |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
12 |
val eqn1i = Thm.prop_of (symmetric eqn1pre) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
13 |
val ((_, [eqn2pre]), lthy6) = Variable.import true [REP_def] lthy5; |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
14 |
val eqn2i = Thm.prop_of (symmetric eqn2pre) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
15 |
|
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
16 |
val exp_morphism = ProofContext.export_morphism lthy6 (ProofContext.init (ProofContext.theory_of lthy6)); |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
17 |
val exp_term = Morphism.term exp_morphism; |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
18 |
val exp = Morphism.thm exp_morphism; |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
19 |
|
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
20 |
val mthd = Method.SIMPLE_METHOD ((rtac quot_thm 1) THEN |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
21 |
ALLGOALS (simp_tac (HOL_basic_ss addsimps [(symmetric (exp ABS_def)), (symmetric (exp REP_def))]))) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
22 |
val mthdt = Method.Basic (fn _ => mthd) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
23 |
val bymt = Proof.global_terminal_proof (mthdt, NONE) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
24 |
val exp_i = [(@{const_name QUOT_TYPE}, ((("QUOT_TYPE_I_" ^ (Binding.name_of qty_name)), true), |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
25 |
Expression.Named [("R", rel), ("Abs", abs), ("Rep", rep) ]))]*) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
26 |
|
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
27 |
(*||> Local_Theory.theory (fn thy => |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
28 |
let |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
29 |
val global_eqns = map exp_term [eqn2i, eqn1i]; |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
30 |
(* Not sure if the following context should not be used *) |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
31 |
val (global_eqns2, lthy7) = Variable.import_terms true global_eqns lthy6; |
b12f0321dfb0
moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents:
303
diff
changeset
|
32 |
val global_eqns3 = map (fn t => (bindd, t)) global_eqns2; |
806
43336511993f
Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
685
diff
changeset
|
33 |
in ProofContext.theory_of (bymt (Expression.interpretation (exp_i, []) global_eqns3 thy)) end)*) |