# HG changeset patch # User Cezary Kaliszyk # Date 1265112646 -3600 # Node ID 163d6917af629721c640fcac4a7295eb71e2549c # Parent 278253330b6ad3b55a7ac3cc9ef8fa14f26fb0a7 LF ported to alpha_gen, equivp solved and one of the missing proofs in support<-> fv solved. Still some supp properties left. diff -r 278253330b6a -r 163d6917af62 Quot/Nominal/LFex.thy --- a/Quot/Nominal/LFex.thy Tue Feb 02 12:48:12 2010 +0100 +++ b/Quot/Nominal/LFex.thy Tue Feb 02 13:10:46 2010 +0100 @@ -80,50 +80,25 @@ and atrm :: "trm \ trm \ bool" ("_ \tr _" [100, 100] 100) where a1: "(Type) \ki (Type)" -| a2: "\A \ty A'; \pi. (rfv_kind K - {atom x} = rfv_kind K' - {atom x'} \ (rfv_kind K - {atom x})\* pi \ (pi \ K) \ki K' \ (pi \ x) = x')\ \ (KPi A x K) \ki (KPi A' x' K')" +| a2: "\A \ty A'; \pi. (({atom a}, K) \gen akind rfv_kind pi ({atom b}, K'))\ \ (KPi A a K) \ki (KPi A' b K')" | a3: "i = j \ (TConst i) \ty (TConst j)" | a4: "\A \ty A'; M \tr M'\ \ (TApp A M) \ty (TApp A' M')" -| a5: "\A \ty A'; \pi. (rfv_ty B - {atom x} = rfv_ty B' - {atom x'} \ (rfv_ty B - {atom x})\* pi \ (pi \ B) \ty B' \ (pi \ x) = x')\ \ (TPi A x B) \ty (TPi A' x' B')" +| a5: "\A \ty A'; \pi. (({atom a}, B) \gen aty rfv_ty pi ({atom b}, B'))\ \ (TPi A a B) \ty (TPi A' b B')" | a6: "i = j \ (Const i) \tr (Const j)" | a7: "x = y \ (Var x) \tr (Var y)" | a8: "\M \tr M'; N \tr N'\ \ (App M N) \tr (App M' N')" -| a9: "\A \ty A'; \pi. (rfv_trm M - {atom x} = rfv_trm M' - {atom x'} \ (rfv_trm M - {atom x})\* pi \ (pi \ M) \tr M' \ (pi \ x) = x')\ \ (Lam A x M) \tr (Lam A' x' M')" - -(* -function(sequential) - akind :: "kind \ kind \ bool" ("_ \ki _" [100, 100] 100) -and aty :: "ty \ ty \ bool" ("_ \ty _" [100, 100] 100) -and atrm :: "trm \ trm \ bool" ("_ \tr _" [100, 100] 100) -where - a1: "(Type) \ki (Type) = True" -| a2: "(KPi A x K) \ki (KPi A' x' K') = (A \ty A' \ (\pi. (rfv_kind K - {atom x} = rfv_kind K' - {atom x'} \ (rfv_kind K - {atom x})\* pi \ (pi \ K) \ki K' \ (pi \ x) = x')))" -| "_ \ki _ = False" -| a3: "(TConst i) \ty (TConst j) = (i = j)" -| a4: "(TApp A M) \ty (TApp A' M') = (A \ty A' \ M \tr M')" -| a5: "(TPi A x B) \ty (TPi A' x' B') = ((A \ty A') \ (\pi. rfv_ty B - {atom x} = rfv_ty B' - {atom x'} \ (rfv_ty B - {atom x})\* pi \ (pi \ B) \ty B' \ (pi \ x) = x'))" -| "_ \ty _ = False" -| a6: "(Const i) \tr (Const j) = (i = j)" -| a7: "(Var x) \tr (Var y) = (x = y)" -| a8: "(App M N) \tr (App M' N') = (M \tr M' \ N \tr N')" -| a9: "(Lam A x M) \tr (Lam A' x' M') = (A \ty A' \ (\pi. rfv_trm M - {atom x} = rfv_trm M' - {atom x'} \ (rfv_trm M - {atom x})\* pi \ (pi \ M) \tr M' \ (pi \ x) = x'))" -| "_ \tr _ = False" -apply (pat_completeness) -apply simp_all -done -termination -by (size_change) -*) +| a9: "\A \ty A'; \pi. (({atom a}, M) \gen atrm rfv_trm pi ({atom b}, M'))\ \ (Lam A a M) \tr (Lam A' b M')" lemma akind_aty_atrm_inj: "(Type) \ki (Type) = True" - "(KPi A x K) \ki (KPi A' x' K') = (A \ty A' \ (\pi. (rfv_kind K - {atom x} = rfv_kind K' - {atom x'} \ (rfv_kind K - {atom x})\* pi \ (pi \ K) \ki K' \ (pi \ x) = x')))" + "((KPi A a K) \ki (KPi A' b K')) = ((A \ty A') \ (\pi. ({atom a}, K) \gen akind rfv_kind pi ({atom b}, K')))" "(TConst i) \ty (TConst j) = (i = j)" "(TApp A M) \ty (TApp A' M') = (A \ty A' \ M \tr M')" - "(TPi A x B) \ty (TPi A' x' B') = ((A \ty A') \ (\pi. rfv_ty B - {atom x} = rfv_ty B' - {atom x'} \ (rfv_ty B - {atom x})\* pi \ (pi \ B) \ty B' \ (pi \ x) = x'))" + "((TPi A a B) \ty (TPi A' b B')) = ((A \ty A') \ (\pi. (({atom a}, B) \gen aty rfv_ty pi ({atom b}, B'))))" "(Const i) \tr (Const j) = (i = j)" "(Var x) \tr (Var y) = (x = y)" "(App M N) \tr (App M' N') = (M \tr M' \ N \tr N')" - "(Lam A x M) \tr (Lam A' x' M') = (A \ty A' \ (\pi. rfv_trm M - {atom x} = rfv_trm M' - {atom x'} \ (rfv_trm M - {atom x})\* pi \ (pi \ M) \tr M' \ (pi \ x) = x'))" + "((Lam A a M) \tr (Lam A' b M')) = ((A \ty A') \ (\pi. (({atom a}, M) \gen atrm rfv_trm pi ({atom b}, M'))))" apply - apply (simp add: akind_aty_atrm.intros) @@ -167,45 +142,16 @@ "t3 \tr s3 \ (pi \ t3) \tr (pi \ s3)" apply(induct rule: akind_aty_atrm.inducts) apply (simp_all add: akind_aty_atrm.intros) -apply(rule a2) -apply simp -apply(erule conjE) -apply(erule exE) -apply(erule conjE) -apply(rule_tac x="pi \ pia" in exI) -apply(rule conjI) -apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1]) -apply(simp add: eqvts atom_eqvt) -apply(rule conjI) -apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) -apply(simp add: eqvts atom_eqvt) -apply(simp add: permute_eqvt[symmetric]) -apply(rule a5) -apply simp -apply(erule conjE) -apply(erule exE) -apply(erule conjE) -apply(rule_tac x="pi \ pia" in exI) -apply(rule conjI) -apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1]) -apply(simp add: eqvts atom_eqvt) -apply(rule conjI) -apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) -apply(simp add: eqvts atom_eqvt) -apply(simp add: permute_eqvt[symmetric]) -apply(rule a9) -apply simp -apply(erule conjE) -apply(erule exE) -apply(erule conjE) -apply(rule_tac x="pi \ pia" in exI) -apply(rule conjI) -apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1]) -apply(simp add: eqvts atom_eqvt) -apply(rule conjI) -apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) -apply(simp add: eqvts atom_eqvt) -apply(simp add: permute_eqvt[symmetric]) +apply (simp_all add: akind_aty_atrm_inj) +apply (rule alpha_gen_atom_eqvt) +apply (simp add: rfv_eqvt) +apply assumption +apply (rule alpha_gen_atom_eqvt) +apply (simp add: rfv_eqvt) +apply assumption +apply (rule alpha_gen_atom_eqvt) +apply (simp add: rfv_eqvt) +apply assumption done lemma al_refl: @@ -220,22 +166,85 @@ apply (rule a2) apply auto apply(rule_tac x="0" in exI) - apply(simp_all add: fresh_star_def fresh_zero_perm) + apply(simp_all add: fresh_star_def fresh_zero_perm alpha_gen) apply (rule a5) apply auto apply(rule_tac x="0" in exI) - apply(simp_all add: fresh_star_def fresh_zero_perm) + apply(simp_all add: fresh_star_def fresh_zero_perm alpha_gen) apply (rule a9) apply auto apply(rule_tac x="0" in exI) - apply(simp_all add: fresh_star_def fresh_zero_perm) + apply(simp_all add: fresh_star_def fresh_zero_perm alpha_gen) + done + +lemma al_sym: + fixes K K'::"kind" and A A'::"ty" and M M'::"trm" + shows "K \ki K' \ K' \ki K" + and "A \ty A' \ A' \ty A" + and "M \tr M' \ M' \tr M" + apply(induct K K' and A A' and M M' rule: akind_aty_atrm.inducts) + apply(simp_all add: akind_aty_atrm.intros) + apply (simp_all add: akind_aty_atrm_inj) + apply(rule alpha_gen_atom_sym) + apply(rule alpha_eqvt) + apply(assumption)+ + apply(rule alpha_gen_atom_sym) + apply(rule alpha_eqvt) + apply(assumption)+ + apply(rule alpha_gen_atom_sym) + apply(rule alpha_eqvt) + apply(assumption)+ + done + +lemma al_trans: + fixes K K' K''::"kind" and A A' A''::"ty" and M M' M''::"trm" + shows "K \ki K' \ K' \ki K'' \ K \ki K''" + and "A \ty A' \ A' \ty A'' \ A \ty A''" + and "M \tr M' \ M' \tr M'' \ M \tr M''" + apply(induct K K' and A A' and M M' arbitrary: K'' and A'' and M'' rule: akind_aty_atrm.inducts) + apply(simp_all add: akind_aty_atrm.intros) + apply(erule akind.cases) + apply(simp_all add: akind_aty_atrm.intros) + apply(simp add: akind_aty_atrm_inj) + apply(rule alpha_gen_atom_trans) + apply(rule alpha_eqvt) + apply(assumption)+ + apply(rotate_tac 4) + apply(erule aty.cases) + apply(simp_all add: akind_aty_atrm.intros) + apply(rotate_tac 3) + apply(erule aty.cases) + apply(simp_all add: akind_aty_atrm.intros) + apply(simp add: akind_aty_atrm_inj) + apply(rule alpha_gen_atom_trans) + apply(rule alpha_eqvt) + apply(assumption)+ + apply(rotate_tac 4) + apply(erule atrm.cases) + apply(simp_all add: akind_aty_atrm.intros) + apply(rotate_tac 3) + apply(erule atrm.cases) + apply(simp_all add: akind_aty_atrm.intros) + apply(simp add: akind_aty_atrm_inj) + apply(rule alpha_gen_atom_trans) + apply(rule alpha_eqvt) + apply(assumption)+ done lemma alpha_equivps: shows "equivp akind" and "equivp aty" and "equivp atrm" -sorry + apply(rule equivpI) + unfolding reflp_def symp_def transp_def + apply(auto intro: al_refl al_sym al_trans) + apply(rule equivpI) + unfolding reflp_def symp_def transp_def + apply(auto intro: al_refl al_sym al_trans) + apply(rule equivpI) + unfolding reflp_def symp_def transp_def + apply(auto intro: al_refl al_sym al_trans) + done quotient_type KIND = kind / akind by (rule alpha_equivps) @@ -312,7 +321,7 @@ (t1 \ty s1 \ rfv_ty t1 = rfv_ty s1) \ (t2 \tr s2 \ rfv_trm t2 = rfv_trm s2)" apply(rule akind_aty_atrm.induct) - apply(simp_all) + apply(simp_all add: alpha_gen) done lemma perm_rsp[quot_respect]: @@ -340,24 +349,24 @@ lemma kpi_rsp[quot_respect]: "(aty ===> op = ===> akind ===> akind) KPi KPi" apply (auto intro: a1 a2 a3 a4 a5 a6 a7 a8 a9) - apply (rule a2) apply simp + apply (rule a2) apply assumption apply (rule_tac x="0" in exI) - apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv) + apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv alpha_gen) done lemma tpi_rsp[quot_respect]: "(aty ===> op = ===> aty ===> aty) TPi TPi" apply (auto intro: a1 a2 a3 a4 a5 a6 a7 a8 a9) - apply (rule a5) apply simp + apply (rule a5) apply assumption apply (rule_tac x="0" in exI) - apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv) + apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv alpha_gen) done lemma lam_rsp[quot_respect]: "(aty ===> op = ===> atrm ===> atrm) Lam Lam" apply (auto intro: a1 a2 a3 a4 a5 a6 a7 a8 a9) - apply (rule a9) apply simp + apply (rule a9) apply assumption apply (rule_tac x="0" in exI) - apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv) + apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv alpha_gen) done lemma rfv_ty_rsp[quot_respect]: @@ -370,7 +379,12 @@ "(atrm ===> op =) rfv_trm rfv_trm" by (simp add: alpha_rfv) -lemma KIND_TY_TRM_induct: "\P10 TYP; \ty name kind. \P20 ty; P10 kind\ \ P10 (KPI ty name kind); \ident. P20 (TCONST ident); +thm kind_ty_trm.induct + +lemma KIND_TY_TRM_induct: + fixes P10 :: "KIND \ bool" and P20 :: "TY \ bool" and P30 :: "TRM \ bool" + shows +"\P10 TYP; \ty name kind. \P20 ty; P10 kind\ \ P10 (KPI ty name kind); \ident. P20 (TCONST ident); \ty trm. \P20 ty; P30 trm\ \ P20 (TAPP ty trm); \ty1 name ty2. \P20 ty1; P20 ty2\ \ P20 (TPI ty1 name ty2); \ident. P30 (CONS ident); \name. P30 (VAR name); \trm1 trm2. \P30 trm1; P30 trm2\ \ P30 (APP trm1 trm2); @@ -452,107 +466,108 @@ end -lemma "\P10 TYP TYP; - \A A' K x K' x'. - \(A :: TY) = A'; P20 A A'; - \pi. fv_kind K - {atom x} = fv_kind K' - {atom x'} \ - (fv_kind K - {atom x}) \* pi \ ((pi \ K) = K' \ P10 (pi \ K) K') \ pi \ x = x'\ - \ P10 (KPI A x K) (KPI A' x' K'); - \i j. i = j \ P20 (TCONST i) (TCONST j); - \A A' M M'. \A = A'; P20 A A'; M = M'; P30 M M'\ \ P20 (TAPP A M) (TAPP A' M'); - \A A' B x B' x'. - \A = A'; P20 A A'; - \pi. fv_ty B - {atom x} = fv_ty B' - {atom x'} \ - (fv_ty B - {atom x}) \* pi \ ((pi \ B) = B' \ P20 (pi \ B) B') \ pi \ x = x'\ - \ P20 (TPI A x B) (TPI A' x' B'); - \i j. i = j \ P30 (CONS i) (CONS j); \x y. x = y \ P30 (VAR x) (VAR y); - \M M' N N'. \M = M'; P30 M M'; N = N'; P30 N N'\ \ P30 (APP M N) (APP M' N'); - \A A' M x M' x'. - \A = A'; P20 A A'; - \pi. fv_trm M - {atom x} = fv_trm M' - {atom x'} \ - (fv_trm M - {atom x}) \* pi \ ((pi \ M) = M' \ P30 (pi \ M) M') \ pi \ x = x'\ - \ P30 (LAM A x M) (LAM A' x' M')\ -\ (x10 = x20 \ P10 x10 x20) \ - (x30 = x40 \ P20 x30 x40) \ (x50 = x60 \ P30 x50 x60)" -by (lifting akind_aty_atrm.induct) +lemma AKIND_ATY_ATRM_inducts: +"\z1 = z2; P1 TYP TYP; + \A A' a K b K'. + \A = A'; P2 A A'; + \pi. ({atom a}, + K) \gen (\x1 x2. + x1 = x2 \ P1 x1 x2) fv_kind pi ({atom b}, K')\ + \ P1 (KPI A a K) (KPI A' b K'); + \i j. i = j \ P2 (TCONST i) (TCONST j); + \A A' M M'. + \A = A'; P2 A A'; M = M'; P3 M M'\ + \ P2 (TAPP A M) (TAPP A' M'); + \A A' a B b B'. + \A = A'; P2 A A'; + \pi. ({atom a}, + B) \gen (\x1 x2. x1 = x2 \ P2 x1 x2) fv_ty pi ({atom b}, B')\ + \ P2 (TPI A a B) (TPI A' b B'); + \i j. i = j \ P3 (CONS i) (CONS j); + \x y. x = y \ P3 (VAR x) (VAR y); + \M M' N N'. + \M = M'; P3 M M'; N = N'; P3 N N'\ + \ P3 (APP M N) (APP M' N'); + \A A' a M b M'. + \A = A'; P2 A A'; + \pi. ({atom a}, + M) \gen (\x1 x2. + x1 = x2 \ P3 x1 x2) fv_trm pi ({atom b}, M')\ + \ P3 (LAM A a M) (LAM A' b M')\ +\ P1 z1 z2" +"\z3 = z4; P1 TYP TYP; + \A A' a K b K'. + \A = A'; P2 A A'; + \pi. ({atom a}, + K) \gen (\x1 x2. + x1 = x2 \ P1 x1 x2) fv_kind pi ({atom b}, K')\ + \ P1 (KPI A a K) (KPI A' b K'); + \i j. i = j \ P2 (TCONST i) (TCONST j); + \A A' M M'. + \A = A'; P2 A A'; M = M'; P3 M M'\ + \ P2 (TAPP A M) (TAPP A' M'); + \A A' a B b B'. + \A = A'; P2 A A'; + \pi. ({atom a}, + B) \gen (\x1 x2. x1 = x2 \ P2 x1 x2) fv_ty pi ({atom b}, B')\ + \ P2 (TPI A a B) (TPI A' b B'); + \i j. i = j \ P3 (CONS i) (CONS j); + \x y. x = y \ P3 (VAR x) (VAR y); + \M M' N N'. + \M = M'; P3 M M'; N = N'; P3 N N'\ + \ P3 (APP M N) (APP M' N'); + \A A' a M b M'. + \A = A'; P2 A A'; + \pi. ({atom a}, + M) \gen (\x1 x2. + x1 = x2 \ P3 x1 x2) fv_trm pi ({atom b}, M')\ + \ P3 (LAM A a M) (LAM A' b M')\ +\ P2 z3 z4" +"\z5 = z6; P1 TYP TYP; + \A A' a K b K'. + \A = A'; P2 A A'; + \pi. ({atom a}, + K) \gen (\x1 x2. + x1 = x2 \ P1 x1 x2) fv_kind pi ({atom b}, K')\ + \ P1 (KPI A a K) (KPI A' b K'); + \i j. i = j \ P2 (TCONST i) (TCONST j); + \A A' M M'. + \A = A'; P2 A A'; M = M'; P3 M M'\ + \ P2 (TAPP A M) (TAPP A' M'); + \A A' a B b B'. + \A = A'; P2 A A'; + \pi. ({atom a}, + B) \gen (\x1 x2. x1 = x2 \ P2 x1 x2) fv_ty pi ({atom b}, B')\ + \ P2 (TPI A a B) (TPI A' b B'); + \i j. i = j \ P3 (CONS i) (CONS j); + \x y. x = y \ P3 (VAR x) (VAR y); + \M M' N N'. + \M = M'; P3 M M'; N = N'; P3 N N'\ + \ P3 (APP M N) (APP M' N'); + \A A' a M b M'. + \A = A'; P2 A A'; + \pi. ({atom a}, + M) \gen (\x1 x2. + x1 = x2 \ P3 x1 x2) fv_trm pi ({atom b}, M')\ + \ P3 (LAM A a M) (LAM A' b M')\ +\ P3 z5 z6" +unfolding alpha_gen +apply (lifting akind_aty_atrm.inducts[unfolded alpha_gen]) +done -lemma AKIND_ATY_ATRM_inducts: -"\x10 = x20; P10 TYP TYP; - \A A' K x K' x'. - \A = A'; P20 A A'; - \pi. fv_kind K - {atom x} = fv_kind K' - {atom x'} \ - (fv_kind K - {atom x}) \* pi \ ((pi \ K) = K' \ P10 (pi \ K) K') \ pi \ x = x'\ - \ P10 (KPI A x K) (KPI A' x' K'); - \i j. i = j \ P20 (TCONST i) (TCONST j); - \A A' M M'. \A = A'; P20 A A'; M = M'; P30 M M'\ \ P20 (TAPP A M) (TAPP A' M'); - \A A' B x B' x'. - \A = A'; P20 A A'; - \pi. fv_ty B - {atom x} = fv_ty B' - {atom x'} \ - (fv_ty B - {atom x}) \* pi \ ((pi \ B) = B' \ P20 (pi \ B) B') \ pi \ x = x'\ - \ P20 (TPI A x B) (TPI A' x' B'); - \i j. i = j \ P30 (CONS i) (CONS j); \x y. x = y \ P30 (VAR x) (VAR y); - \M M' N N'. \M = M'; P30 M M'; N = N'; P30 N N'\ \ P30 (APP M N) (APP M' N'); - \A A' M x M' x'. - \A = A'; P20 A A'; - \pi. fv_trm M - {atom x} = fv_trm M' - {atom x'} \ - (fv_trm M - {atom x}) \* pi \ ((pi \ M) = M' \ P30 (pi \ M) M') \ pi \ x = x'\ - \ P30 (LAM A x M) (LAM A' x' M')\ -\ P10 x10 x20" -"\x30 = x40; P10 TYP TYP; - \A A' K x K' x'. - \A = A'; P20 A A'; - \pi. fv_kind K - {atom x} = fv_kind K' - {atom x'} \ - (fv_kind K - {atom x}) \* pi \ ((pi \ K) = K' \ P10 (pi \ K) K') \ pi \ x = x'\ - \ P10 (KPI A x K) (KPI A' x' K'); - \i j. i = j \ P20 (TCONST i) (TCONST j); - \A A' M M'. \A = A'; P20 A A'; M = M'; P30 M M'\ \ P20 (TAPP A M) (TAPP A' M'); - \A A' B x B' x'. - \A = A'; P20 A A'; - \pi. fv_ty B - {atom x} = fv_ty B' - {atom x'} \ - (fv_ty B - {atom x}) \* pi \ ((pi \ B) = B' \ P20 (pi \ B) B') \ pi \ x = x'\ - \ P20 (TPI A x B) (TPI A' x' B'); - \i j. i = j \ P30 (CONS i) (CONS j); \x y. x = y \ P30 (VAR x) (VAR y); - \M M' N N'. \M = M'; P30 M M'; N = N'; P30 N N'\ \ P30 (APP M N) (APP M' N'); - \A A' M x M' x'. - \A = A'; P20 A A'; - \pi. fv_trm M - {atom x} = fv_trm M' - {atom x'} \ - (fv_trm M - {atom x}) \* pi \ ((pi \ M) = M' \ P30 (pi \ M) M') \ pi \ x = x'\ - \ P30 (LAM A x M) (LAM A' x' M')\ - \ P20 x30 x40" -"\x50 = x60; P10 TYP TYP; - \A A' K x K' x'. - \A = A'; P20 A A'; - \pi. fv_kind K - {atom x} = fv_kind K' - {atom x'} \ - (fv_kind K - {atom x}) \* pi \ ((pi \ K) = K' \ P10 (pi \ K) K') \ pi \ x = x'\ - \ P10 (KPI A x K) (KPI A' x' K'); - \i j. i = j \ P20 (TCONST i) (TCONST j); - \A A' M M'. \A = A'; P20 A A'; M = M'; P30 M M'\ \ P20 (TAPP A M) (TAPP A' M'); - \A A' B x B' x'. - \A = A'; P20 A A'; - \pi. fv_ty B - {atom x} = fv_ty B' - {atom x'} \ - (fv_ty B - {atom x}) \* pi \ ((pi \ B) = B' \ P20 (pi \ B) B') \ pi \ x = x'\ - \ P20 (TPI A x B) (TPI A' x' B'); - \i j. i = j \ P30 (CONS i) (CONS j); \x y. x = y \ P30 (VAR x) (VAR y); - \M M' N N'. \M = M'; P30 M M'; N = N'; P30 N N'\ \ P30 (APP M N) (APP M' N'); - \A A' M x M' x'. - \A = A'; P20 A A'; - \pi. fv_trm M - {atom x} = fv_trm M' - {atom x'} \ - (fv_trm M - {atom x}) \* pi \ ((pi \ M) = M' \ P30 (pi \ M) M') \ pi \ x = x'\ - \ P30 (LAM A x M) (LAM A' x' M')\ -\ P30 x50 x60" -by (lifting akind_aty_atrm.inducts) - +thm akind_aty_atrm_inj lemma KIND_TY_TRM_INJECT: "(TYP) = (TYP) = True" - "(KPI A x K) = (KPI A' x' K') = (A = A' \ (\pi. (fv_kind K - {atom x} = fv_kind K' - {atom x'} \ (fv_kind K - {atom x})\* pi \ (pi \ K) = K' \ (pi \ x) = x')))" + "(KPI A x K) = (KPI A' x' K') = (A = A' \ (\pi. ({atom x}, K) \gen (op =) fv_kind pi ({atom x'}, K')))" "(TCONST i) = (TCONST j) = (i = j)" "(TAPP A M) = (TAPP A' M') = (A = A' \ M = M')" - "(TPI A x B) = (TPI A' x' B') = ((A = A') \ (\pi. fv_ty B - {atom x} = fv_ty B' - {atom x'} \ (fv_ty B - {atom x})\* pi \ (pi \ B) = B' \ (pi \ x) = x'))" + "(TPI A x B) = (TPI A' x' B') = (A = A' \ (\pi. ({atom x}, B) \gen (op =) fv_ty pi ({atom x'}, B')))" "(CONS i) = (CONS j) = (i = j)" "(VAR x) = (VAR y) = (x = y)" "(APP M N) = (APP M' N') = (M = M' \ N = N')" - "(LAM A x M) = (LAM A' x' M') = (A = A' \ (\pi. fv_trm M - {atom x} = fv_trm M' - {atom x'} \ (fv_trm M - {atom x})\* pi \ (pi \ M) = M' \ (pi \ x) = x'))" -by (lifting akind_aty_atrm_inj) + "(LAM A x M) = (LAM A' x' M') = (A = A' \ (\pi. ({atom x}, M) \gen (op =) fv_trm pi ({atom x'}, M')))" +unfolding alpha_gen +by (lifting akind_aty_atrm_inj[unfolded alpha_gen]) lemma fv_kind_ty_trm: "fv_kind TYP = {}" @@ -631,32 +646,24 @@ apply(induct t1 and t2 and t3 rule: KIND_TY_TRM_inducts) apply (simp_all add: supp_kind_ty_trm_easy) apply (simp_all add: fv_kind_ty_trm) -apply(subgoal_tac "supp (KPI ty name kind) = supp ty \ supp (Abst {atom name} kind)") -apply(simp add: supp_Abst Set.Un_commute) +apply(subgoal_tac "supp (KPI ty name kind) = supp ty \ supp (Abs {atom name} kind)") +apply(simp add: supp_Abs Set.Un_commute) apply(simp (no_asm) add: supp_def) apply(simp add: KIND_TY_TRM_INJECT) -apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric]) -apply(simp add: abs_eq alpha_gen) +apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric] alpha_gen) +apply(simp add: Abs_eq_iff alpha_gen) apply(simp add: Collect_imp_eq Collect_neg_eq Set.Un_commute) -apply(simp add: Collect_imp_eq[symmetric] Collect_neg_eq[symmetric]) -apply (fold supp_def) apply (tactic {* Cong_Tac.cong_tac @{thm cong} 1*} ) apply (rule refl) -apply(subst Set.Un_commute) -apply (tactic {* Cong_Tac.cong_tac @{thm cong} 1*} ) -apply (tactic {* Cong_Tac.cong_tac @{thm cong} 1*} ) -apply (rule refl) -prefer 2 -apply(simp add: eqvts supp_eqvt atom_eqvt) sorry (* Stuck *) -lemma supp_kpi_pre: "supp (KPI A x K) = (supp (Abst {atom x} K)) \ supp A" +lemma supp_kpi_pre: "supp (KPI A x K) = (supp (Abs {atom x} K)) \ supp A" (*apply (subst supp_Pair[symmetric])*) unfolding supp_def apply (simp add: permute_set_eq) -apply(subst abs_eq) +apply(subst Abs_eq_iff) apply(subst KIND_TY_TRM_INJECT) -apply(simp only: supp_fv) +apply(simp only: alpha_gen supp_fv) apply simp apply (simp_all add: Collect_imp_eq Collect_neg_eq) apply(subst Set.Un_commute) @@ -665,11 +672,16 @@ apply (rule refl) prefer 2 apply (rule refl) -sorry (* Stuck *) +apply (tactic {* Cong_Tac.cong_tac @{thm cong} 1*} ) +apply (tactic {* Cong_Tac.cong_tac @{thm cong} 1*} ) +apply (rule refl) +apply (simp_all) +apply (simp add: Collect_imp_eq[symmetric] Collect_neg_eq[symmetric]) +sorry (* should be true... *) lemma supp_kpi: "supp (KPI A x K) = supp A \ (supp K - {atom x})" apply(subst supp_kpi_pre) -apply(subst supp_Abst) +apply(subst supp_Abs) apply (simp only: Set.Un_commute) done