src/HOL/Lfp.ML
changeset 1125 13a3df2adbe5
parent 1114 c8dfb56a7e95
child 1264 3eb91524b938
equal deleted inserted replaced
1124:a6233ea105a4 1125:13a3df2adbe5
    35 
    35 
    36 val [mono] = goal Lfp.thy "mono(f) ==> lfp(f) = f(lfp(f))";
    36 val [mono] = goal Lfp.thy "mono(f) ==> lfp(f) = f(lfp(f))";
    37 by (REPEAT (resolve_tac [equalityI,lfp_lemma2,lfp_lemma3,mono] 1));
    37 by (REPEAT (resolve_tac [equalityI,lfp_lemma2,lfp_lemma3,mono] 1));
    38 qed "lfp_Tarski";
    38 qed "lfp_Tarski";
    39 
    39 
    40 
       
    41 (*** General induction rule for least fixed points ***)
    40 (*** General induction rule for least fixed points ***)
    42 
    41 
    43 val [lfp,mono,indhyp] = goal Lfp.thy
    42 val [lfp,mono,indhyp] = goal Lfp.thy
    44     "[| a: lfp(f);  mono(f);  				\
    43     "[| a: lfp(f);  mono(f);  				\
    45 \       !!x. [| x: f(lfp(f) Int {x.P(x)}) |] ==> P(x) 	\
    44 \       !!x. [| x: f(lfp(f) Int {x.P(x)}) |] ==> P(x) 	\
    61 by(res_inst_tac[("p","x")]PairE 1);
    60 by(res_inst_tac[("p","x")]PairE 1);
    62 by(hyp_subst_tac 1);
    61 by(hyp_subst_tac 1);
    63 by(asm_simp_tac (prod_ss addsimps prems) 1);
    62 by(asm_simp_tac (prod_ss addsimps prems) 1);
    64 qed"induct2";
    63 qed"induct2";
    65 
    64 
       
    65 (*** Fixpoint induction a la David Park ***)
       
    66 goal Lfp.thy "!!f. [| mono f; f A <= A |] ==> lfp(f) <= A";
       
    67 br subsetI 1;
       
    68 by(EVERY[etac induct 1, atac 1, etac subsetD 1, rtac subsetD 1,
       
    69                 atac 2, fast_tac (set_cs addSEs [monoD]) 1]);
       
    70 qed "Park_induct";
       
    71 
    66 (** Definition forms of lfp_Tarski and induct, to control unfolding **)
    72 (** Definition forms of lfp_Tarski and induct, to control unfolding **)
    67 
    73 
    68 val [rew,mono] = goal Lfp.thy "[| h==lfp(f);  mono(f) |] ==> h = f(h)";
    74 val [rew,mono] = goal Lfp.thy "[| h==lfp(f);  mono(f) |] ==> h = f(h)";
    69 by (rewtac rew);
    75 by (rewtac rew);
    70 by (rtac (mono RS lfp_Tarski) 1);
    76 by (rtac (mono RS lfp_Tarski) 1);