diff -r edd71fd83a2d -r 86fba2c4eeef LamEx.thy --- a/LamEx.thy Wed Nov 25 10:39:53 2009 +0100 +++ b/LamEx.thy Wed Nov 25 10:52:21 2009 +0100 @@ -218,21 +218,24 @@ apply (tactic {* lift_tac_lam @{context} @{thm a3} 1 *}) done -ML {* val alpha_cases = lift_thm_lam @{context} @{thm alpha.cases} *} -lemma "\(x\lam) = (xa\lam); \(a\name) b\name. \x = Var a; xa = Var b; a = b\ \ P\bool; - \(x\lam) (xa\lam) (xb\lam) xc\lam. \x = App x xb; xa = App xa xc; x = xa; xb = xc\ \ P; - \(x\lam) (a\name) (b\name) xa\lam. \x = Lam a x; xa = Lam b xa; x = [(a, b)] \ xa; a \ fv (Lam b x)\ \ P\ +lemma alpha_cases: "\a1 = a2; \a b. \a1 = Var a; a2 = Var b; a = b\ \ P; + \x xa xb xc. \a1 = App x xb; a2 = App xa xc; x = xa; xb = xc\ \ P; + \x a b xa. \a1 = Lam a x; a2 = Lam b xa; x = [(a, b)] \ xa; a \ fv (Lam b x)\ \ P\ \ P" -apply (tactic {* procedure_tac @{thm alpha.cases} @{context} 1 *}) -sorry -ML {* val alpha_induct = lift_thm_lam @{context} @{thm alpha.induct} *} -lemma "\(qx\lam) = (qxa\lam); \(a\name) b\name. a = b \ (qxb\lam \ lam \ bool) (Var a) (Var b); +apply (tactic {* lift_tac_lam @{context} @{thm alpha.cases} 1 *}) +done + +ML {* val aps = findaps rty (prop_of (atomize_thm @{thm alpha.induct})) *} +ML {* val app_prs_thms = map (applic_prs @{context} rty qty absrep) aps *} +lemma alpha_induct: "\(qx\lam) = (qxa\lam); \(a\name) b\name. a = b \ (qxb\lam \ lam \ bool) (Var a) (Var b); \(x\lam) (xa\lam) (xb\lam) xc\lam. \x = xa; qxb x xa; xb = xc; qxb xb xc\ \ qxb (App x xb) (App xa xc); \(x\lam) (a\name) (b\name) xa\lam. \x = [(a, b)] \ xa; qxb x ([(a, b)] \ xa); a \ fv (Lam b x)\ \ qxb (Lam a x) (Lam b xa)\ \ qxb qx qxa" -(* apply (tactic {* lift_tac_lam @{context} @{thm alpha.induct} 1 *}) *) -sorry +apply (tactic {* lift_tac_lam @{context} @{thm alpha.induct} 1 *}) +apply (tactic {* REPEAT_ALL_NEW (EqSubst.eqsubst_tac @{context} [0] app_prs_thms) 1 *}) +apply (tactic {* simp_tac (HOL_ss addsimps [reps_same]) 1 *}) +done lemma var_inject: "(Var a = Var b) = (a = b)" apply (tactic {* lift_tac_lam @{context} @{thm rvar_inject} 1 *})