1 (*notation ( output) "prop" ("#_" [1000] 1000) *) |
1 (*notation ( output) "prop" ("#_" [1000] 1000) *) |
2 notation ( output) "Trueprop" ("#_" [1000] 1000) |
2 notation ( output) "Trueprop" ("#_" [1000] 1000) |
|
3 |
|
4 function(sequential) |
|
5 akind :: "kind \<Rightarrow> kind \<Rightarrow> bool" ("_ \<approx>ki _" [100, 100] 100) |
|
6 and aty :: "ty \<Rightarrow> ty \<Rightarrow> bool" ("_ \<approx>ty _" [100, 100] 100) |
|
7 and atrm :: "trm \<Rightarrow> trm \<Rightarrow> bool" ("_ \<approx>tr _" [100, 100] 100) |
|
8 where |
|
9 a1: "(Type) \<approx>ki (Type) = True" |
|
10 | a2: "(KPi A x K) \<approx>ki (KPi A' x' K') = (A \<approx>ty A' \<and> (\<exists>pi. (rfv_kind K - {atom x} = rfv_kind K' - {atom x'} \<and> (rfv_kind K - {atom x})\<sharp>* pi \<and> (pi \<bullet> K) \<approx>ki K' \<and> (pi \<bullet> x) = x')))" |
|
11 | "_ \<approx>ki _ = False" |
|
12 | a3: "(TConst i) \<approx>ty (TConst j) = (i = j)" |
|
13 | a4: "(TApp A M) \<approx>ty (TApp A' M') = (A \<approx>ty A' \<and> M \<approx>tr M')" |
|
14 | a5: "(TPi A x B) \<approx>ty (TPi A' x' B') = ((A \<approx>ty A') \<and> (\<exists>pi. rfv_ty B - {atom x} = rfv_ty B' - {atom x'} \<and> (rfv_ty B - {atom x})\<sharp>* pi \<and> (pi \<bullet> B) \<approx>ty B' \<and> (pi \<bullet> x) = x'))" |
|
15 | "_ \<approx>ty _ = False" |
|
16 | a6: "(Const i) \<approx>tr (Const j) = (i = j)" |
|
17 | a7: "(Var x) \<approx>tr (Var y) = (x = y)" |
|
18 | a8: "(App M N) \<approx>tr (App M' N') = (M \<approx>tr M' \<and> N \<approx>tr N')" |
|
19 | a9: "(Lam A x M) \<approx>tr (Lam A' x' M') = (A \<approx>ty A' \<and> (\<exists>pi. rfv_trm M - {atom x} = rfv_trm M' - {atom x'} \<and> (rfv_trm M - {atom x})\<sharp>* pi \<and> (pi \<bullet> M) \<approx>tr M' \<and> (pi \<bullet> x) = x'))" |
|
20 | "_ \<approx>tr _ = False" |
|
21 apply (pat_completeness) |
|
22 apply simp_all |
|
23 done |
|
24 termination |
|
25 by (size_change) |
|
26 |
|
27 |
3 |
28 |
4 lemma regularize_to_injection: |
29 lemma regularize_to_injection: |
5 shows "(QUOT_TRUE l \<Longrightarrow> y) \<Longrightarrow> (l = r) \<longrightarrow> y" |
30 shows "(QUOT_TRUE l \<Longrightarrow> y) \<Longrightarrow> (l = r) \<longrightarrow> y" |
6 by(auto simp add: QUOT_TRUE_def) |
31 by(auto simp add: QUOT_TRUE_def) |
7 |
32 |