src/HOL/Nat.thy
changeset 60636 ee18efe9b246
parent 60562 24af00b010cf
child 60758 d8d85a8172b5
     1.1 --- a/src/HOL/Nat.thy	Thu Jul 02 16:14:20 2015 +0200
     1.2 +++ b/src/HOL/Nat.thy	Fri Jul 03 08:26:34 2015 +0200
     1.3 @@ -1416,6 +1416,42 @@
     1.4      using Kleene_iter_lpfp[OF assms(1)] lfp_unfold[OF assms(1)] by simp
     1.5  qed
     1.6  
     1.7 +lemma mono_pow:
     1.8 +  fixes f :: "'a \<Rightarrow> 'a::complete_lattice"
     1.9 +  shows "mono f \<Longrightarrow> mono (f ^^ n)"
    1.10 +  by (induction n) (auto simp: mono_def)
    1.11 +
    1.12 +lemma lfp_funpow:
    1.13 +  assumes f: "mono f" shows "lfp (f ^^ Suc n) = lfp f"
    1.14 +proof (rule antisym)
    1.15 +  show "lfp f \<le> lfp (f ^^ Suc n)"
    1.16 +  proof (rule lfp_lowerbound)
    1.17 +    have "f (lfp (f ^^ Suc n)) = lfp (\<lambda>x. f ((f ^^ n) x))"
    1.18 +      unfolding funpow_Suc_right by (simp add: lfp_rolling f mono_pow comp_def)
    1.19 +    then show "f (lfp (f ^^ Suc n)) \<le> lfp (f ^^ Suc n)"
    1.20 +      by (simp add: comp_def)
    1.21 +  qed
    1.22 +  have "(f^^n) (lfp f) = lfp f" for n
    1.23 +    by (induction n) (auto intro: f lfp_unfold[symmetric])
    1.24 +  then show "lfp (f^^Suc n) \<le> lfp f"
    1.25 +    by (intro lfp_lowerbound) (simp del: funpow.simps)
    1.26 +qed
    1.27 +
    1.28 +lemma gfp_funpow:
    1.29 +  assumes f: "mono f" shows "gfp (f ^^ Suc n) = gfp f"
    1.30 +proof (rule antisym)
    1.31 +  show "gfp f \<ge> gfp (f ^^ Suc n)"
    1.32 +  proof (rule gfp_upperbound)
    1.33 +    have "f (gfp (f ^^ Suc n)) = gfp (\<lambda>x. f ((f ^^ n) x))"
    1.34 +      unfolding funpow_Suc_right by (simp add: gfp_rolling f mono_pow comp_def)
    1.35 +    then show "f (gfp (f ^^ Suc n)) \<ge> gfp (f ^^ Suc n)"
    1.36 +      by (simp add: comp_def)
    1.37 +  qed
    1.38 +  have "(f^^n) (gfp f) = gfp f" for n
    1.39 +    by (induction n) (auto intro: f gfp_unfold[symmetric])
    1.40 +  then show "gfp (f^^Suc n) \<ge> gfp f"
    1.41 +    by (intro gfp_upperbound) (simp del: funpow.simps)
    1.42 +qed
    1.43  
    1.44  subsection {* Embedding of the naturals into any @{text semiring_1}: @{term of_nat} *}
    1.45