src/HOL/Cardinals/Wellfounded_More.thy
author wenzelm
Fri Oct 27 13:50:08 2017 +0200 (23 months ago)
changeset 66924 b4d4027f743b
parent 66453 cc19f7ca2ed6
child 67006 b1278ed3cd46
permissions -rw-r--r--
more permissive;
     1 (*  Title:      HOL/Cardinals/Wellfounded_More.thy
     2     Author:     Andrei Popescu, TU Muenchen
     3     Copyright   2012
     4 
     5 More on well-founded relations.
     6 *)
     7 
     8 section \<open>More on Well-Founded Relations\<close>
     9 
    10 theory Wellfounded_More
    11 imports HOL.Wellfounded Order_Relation_More
    12 begin
    13 
    14 subsection \<open>Well-founded recursion via genuine fixpoints\<close>
    15 
    16 (*2*)lemma adm_wf_unique_fixpoint:
    17 fixes r :: "('a * 'a) set" and
    18       H :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b" and
    19       f :: "'a \<Rightarrow> 'b" and g :: "'a \<Rightarrow> 'b"
    20 assumes WF: "wf r" and ADM: "adm_wf r H" and fFP: "f = H f" and gFP: "g = H g"
    21 shows "f = g"
    22 proof-
    23   {fix x
    24    have "f x = g x"
    25    proof(rule wf_induct[of r "(\<lambda>x. f x = g x)"],
    26          auto simp add: WF)
    27      fix x assume "\<forall>y. (y, x) \<in> r \<longrightarrow> f y = g y"
    28      hence "H f x = H g x" using ADM adm_wf_def[of r H] by auto
    29      thus "f x = g x" using fFP and gFP by simp
    30    qed
    31   }
    32   thus ?thesis by (simp add: ext)
    33 qed
    34 
    35 (*2*)lemma wfrec_unique_fixpoint:
    36 fixes r :: "('a * 'a) set" and
    37       H :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b" and
    38       f :: "'a \<Rightarrow> 'b"
    39 assumes WF: "wf r" and ADM: "adm_wf r H" and
    40         fp: "f = H f"
    41 shows "f = wfrec r H"
    42 proof-
    43   have "H (wfrec r H) = wfrec r H"
    44   using assms wfrec_fixpoint[of r H] by simp
    45   thus ?thesis
    46   using assms adm_wf_unique_fixpoint[of r H "wfrec r H"] by simp
    47 qed
    48 
    49 end