fact
stringlengths
1
2.11k
type
stringclasses
27 values
library
stringclasses
888 values
imports
listlengths
0
81
filename
stringlengths
9
106
symbolic_name
stringlengths
1
113
docstring
stringlengths
0
1.34k
relto_fun_intermediate: assumes "A \<subseteq> C" and "B \<subseteq> C" and rf: "relto_fun A B n as sel m (a,b)" shows "i \<le> m \<Longrightarrow> (a,as i) \<in> C^*" proof (induct i) case 0 from relto_funD[OF rf] show ?case by simp next case (Suc i) hence IH: "(a, as i) \<in> C^*" and im: "i < m" by auto ...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
relto_fun_intermediate
null
not_SN_on_rel_succ: assumes "\<not> SN_on (relto R E) {s}" shows "\<exists>t u. (s, t) \<in> E\<^sup>* \<and> (t, u) \<in> R \<and> \<not> SN_on (relto R E) {u}" proof - obtain v where "(s, v) \<in> relto R E" and v: "\<not> SN_on (relto R E) {v}" using assms by fast moreover then obtain t and u where "...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
not_SN_on_rel_succ
null
SN_on_relto_relcomp: "SN_on (relto R S) T = SN_on (S\<^sup>* O R) T" (is "?L T = ?R T") proof assume L: "?L T" { fix t assume "t \<in> T" hence "?L {t}" using L by fast } thus "?R T" by fast next { fix s have "SN_on (relto R S) {s} = SN_on (S\<^sup>* O R) {s}" proof let ?X = "{s. \<not>SN_on (re...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
SN_on_relto_relcomp
null
trans_relto: assumes trans: "trans R" and "S O R \<subseteq> R O S" shows "trans (relto R S)" proof fix a b c assume ab: "(a, b) \<in> S\<^sup>* O R O S\<^sup>*" and bc: "(b, c) \<in> S\<^sup>* O R O S\<^sup>*" from rtrancl_O_push [of S R] assms(2) have comm: "S\<^sup>* O R \<subseteq> R O S\<^sup>*" by blast...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
trans_relto
null
relative_ending: assumes chain: "chain (R \<union> S) t" and t0: "t 0 \<in> X" and SN: "SN_on (relto R S) X" shows "\<exists>j. \<forall>i\<ge>j. (t i, t (Suc i)) \<in> S - R" proof (rule ccontr) assume "\<not> ?thesis" with chain have "\<forall>i. \<exists>j. j \<ge> i \<and> (t j, t (Suc j)) \<in> R" ...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
relative_ending
null
SN_on_relto_Un: assumes closure: "relto (R \<union> R') S `` X \<subseteq> X" shows "SN_on (relto (R \<union> R') S) X \<longleftrightarrow> SN_on (relto R (R' \<union> S)) X \<and> SN_on (relto R' S) X" (is "?c \<longleftrightarrow> ?a \<and> ?b") proof(safe) assume SN: "?a" and SN': "?b" from SN have SN: "S...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
SN_on_relto_Un
from Geser's thesis [p.32, Corollary-1], generalized for @{term SN_on}.
SN_on_Un: "(R \<union> R')``X \<subseteq> X \<Longrightarrow> SN_on (R \<union> R') X \<longleftrightarrow> SN_on (relto R R') X \<and> SN_on R' X" using SN_on_relto_Un[of "{}"] by simp
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/Relative_Rewriting.thy
SN_on_Un
null
'aseq = "nat \<Rightarrow> 'a"
type_synonym
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
'a
Infinite sequences are represented by functions of type @{typ "nat \<Rightarrow> 'a"}.
cons_chainp: assumes "P x (S 0)" and "chainp P S" shows "chainp P (case_nat x S)" (is "chainp P ?S") proof fix i show "P (?S i) (?S (Suc i))" using assms by (cases i) simp_all qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
cons_chainp
Special version for relations. Extending a chain at the front.
cons_chain: assumes "(x, S 0) \<in> r" and "chain r S" shows "chain r (case_nat x S)" using cons_chainp[of "\<lambda>x y. (x, y) \<in> r", OF assms] .
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
cons_chain
Special version for relations.
chainp_imp_relpowp: assumes "chainp P S" shows "(P^^j) (S i) (S (i + j))" proof (induct "i + j" arbitrary: j) case (Suc n) thus ?case using assms by (cases j) auto qed simp
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
chainp_imp_relpowp
A chain admits arbitrary transitive steps.
chain_imp_relpow: assumes "chain r S" shows "(S i, S (i + j)) \<in> r^^j" proof (induct "i + j" arbitrary: j) case (Suc n) thus ?case using assms by (cases j) auto qed simp
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
chain_imp_relpow
null
chainp_imp_tranclp: assumes "chainp P S" and "i < j" shows "P^++ (S i) (S j)" proof - from less_imp_Suc_add[OF assms(2)] obtain n where "j = i + Suc n" by auto with chainp_imp_relpowp[of P S "Suc n" i, OF assms(1)] show ?thesis unfolding trancl_power[of "(S i, S j)", to_pred] by force qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
chainp_imp_tranclp
null
chain_imp_trancl: assumes "chain r S" and "i < j" shows "(S i, S j) \<in> r^+" proof - from less_imp_Suc_add[OF assms(2)] obtain n where "j = i + Suc n" by auto with chain_imp_relpow[OF assms(1), of i "Suc n"] show ?thesis unfolding trancl_power by force qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
chain_imp_trancl
null
chainp_imp_rtranclp: assumes "chainp P S" and "i \<le> j" shows "P^** (S i) (S j)" proof - from assms(2) obtain n where "j = i + n" by (induct "j - i" arbitrary: j) force+ with chainp_imp_relpowp[of P S, OF assms(1), of n i] show ?thesis by (simp add: relpow_imp_rtrancl[of "(S i, S (i + n))", to_pred]) qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
chainp_imp_rtranclp
A chain admits arbitrary reflexive and transitive steps.
chain_imp_rtrancl: assumes "chain r S" and "i \<le> j" shows "(S i, S j) \<in> r^*" proof - from assms(2) obtain n where "j = i + n" by (induct "j - i" arbitrary: j) force+ with chain_imp_relpow[OF assms(1), of i n] show ?thesis by (simp add: relpow_imp_rtrancl) qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
chain_imp_rtrancl
null
stepfun_imp_chainp': assumes "\<forall>i\<ge>n::nat. f i \<ge> i \<and> P (S i) (S (f i))" shows "chainp P (\<lambda>i. S ((f ^^ i) n))" (is "chainp P ?T") proof fix i from assms have "(f ^^ i) n \<ge> n" by (induct i) auto with assms[THEN spec[of _ "(f ^^ i) n"]] show "P (?T i) (?T (Suc i))" by simp qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
stepfun_imp_chainp'
null
stepfun_imp_chainp: assumes "\<forall>i\<ge>n::nat. f i > i \<and> P (S i) (S (f i))" shows "chainp P (\<lambda>i. S ((f ^^ i) n))" (is "chainp P ?T") using stepfun_imp_chainp'[of n f P S] and assms by force
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
stepfun_imp_chainp
null
subchain: assumes "\<forall>i::nat>n. \<exists>j>i. P (f i) (f j)" shows "\<exists>\<phi>. (\<forall>i j. i < j \<longrightarrow> \<phi> i < \<phi> j) \<and> (\<forall>i. P (f (\<phi> i)) (f (\<phi> (Suc i))))" proof - from assms have "\<forall>i\<in>{i. i > n}. \<exists>j>i. P (f i) (f j)" by simp from bchoice...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
subchain
null
steps_imp_chainp': assumes "\<forall>i\<ge>n::nat. \<exists>j\<ge>i. P (S i) (S j)" shows "\<exists>T. chainp P T" proof - from assms have "\<forall>i\<in>{i. i \<ge> n}. \<exists>j\<ge>i. P (S i) (S j)" by auto from bchoice [OF this] obtain f where "\<forall>i\<ge>n. f i \<ge> i \<and> P (S i) (S (f i))" by ...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
steps_imp_chainp'
null
steps_imp_chainp: assumes "\<forall>i\<ge>n::nat. \<exists>j>i. P (S i) (S j)" shows "\<exists>T. chainp P T" using steps_imp_chainp' [of n P S] and assms by force
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
steps_imp_chainp
from bchoice [OF this] choice could be replaced by an application of Least_Enum.infinitely_many2
infinitely_many= fixes p :: "nat \<Rightarrow> bool" assumes infinite: "INFM j. p j" begin
locale
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
infinitely_many
Predicates on Natural Numbers
inf: "\<exists>j\<ge>i. p j" using infinite[unfolded INFM_nat_le] by auto
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf
null
index:: "nat seq" where "index 0 = (LEAST n. p n)" | "index (Suc n) = (LEAST k. p k \<and> k > index n)"
fun
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index
null
index_p: "p (index n)" proof (induct n) case 0 from inf obtain j where "p j" by auto with LeastI[of p j] show ?case by auto next case (Suc n) from inf obtain k where "k \<ge> Suc (index n) \<and> p k" by auto with LeastI[of "\<lambda> k. p k \<and> k > index n" k] show ?case by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_p
null
index_ordered: "index n < index (Suc n)" proof - from inf obtain k where "k \<ge> Suc (index n) \<and> p k" by auto with LeastI[of "\<lambda> k. p k \<and> k > index n" k] show ?thesis by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_ordered
null
index_not_p_between: assumes i1: "index n < i" and i2: "i < index (Suc n)" shows "\<not> p i" proof - from not_less_Least[OF i2[simplified]] i1 show ?thesis by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_not_p_between
null
index_ordered_le: assumes "i \<le> j" shows "index i \<le> index j" proof - from assms have "j = i + (j - i)" by auto then obtain k where j: "j = i + k" by auto have "index i \<le> index (i + k)" proof (induct k) case (Suc k) with index_ordered[of "i + k"] show ?case by auto qed simp thus ?the...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_ordered_le
null
index_surj: assumes "k \<ge> index l" shows "\<exists>i j. k = index i + j \<and> index i + j < index (Suc i)" proof - from assms have "k = index l + (k - index l)" by auto then obtain u where k: "k = index l + u" by auto show ?thesis unfolding k proof (induct u) case 0 show ?case by (intro ex...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_surj
null
index_ordered_less: assumes "i < j" shows "index i < index j" proof - from assms have "Suc i \<le> j" by auto from index_ordered_le[OF this] have "index (Suc i) \<le> index j" . with index_ordered[of i] show ?thesis by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_ordered_less
null
index_not_p_start: assumes i: "i < index 0" shows "\<not> p i" proof - from i[simplified index.simps] have "i < Least p" . from not_less_Least[OF this] show ?thesis . qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
index_not_p_start
null
inf_concat_simple:: "(nat \<Rightarrow> nat) \<Rightarrow> nat \<Rightarrow> (nat \<times> nat)" where "inf_concat_simple f 0 = (0, 0)" | "inf_concat_simple f (Suc n) = ( let (i, j) = inf_concat_simple f n in if Suc j < f i then (i, Suc j) else (Suc i, 0))"
fun
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_simple
Assembling Infinite Words from Finite Words Concatenate infinitely many non-empty words to an infinite word.
inf_concat_simple_add: assumes ck: "inf_concat_simple f k = (i, j)" and jl: "j + l < f i" shows "inf_concat_simple f (k + l) = (i,j + l)" using jl proof (induct l) case 0 thus ?case using ck by simp next case (Suc l) hence c: "inf_concat_simple f (k + l) = (i, j+ l)" by auto show ?case by (simp ad...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_simple_add
null
inf_concat_simple_surj_zero: "\<exists> k. inf_concat_simple f k = (i,0)" proof (induct i) case 0 show ?case by (rule exI[of _ 0], simp) next case (Suc i) then obtain k where ck: "inf_concat_simple f k = (i,0)" by auto show ?case proof (cases "f i") case 0 show ?thesis by (rule exI[of _ "S...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_simple_surj_zero
null
inf_concat_simple_surj: assumes "j < f i" shows "\<exists> k. inf_concat_simple f k = (i,j)" proof - from assms have j: "0 + j < f i" by auto from inf_concat_simple_surj_zero obtain k where "inf_concat_simple f k = (i,0)" by auto from inf_concat_simple_add[OF this, OF j] show ?thesis by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_simple_surj
null
inf_concat_simple_mono: assumes "k \<le> k'" shows "fst (inf_concat_simple f k) \<le> fst (inf_concat_simple f k')" proof - from assms have "k' = k + (k' - k)" by auto then obtain l where k': "k' = k + l" by auto show ?thesis unfolding k' proof (induct l) case (Suc l) obtain i j where ckl: "inf_conca...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_simple_mono
null
inf_concat:: "(nat \<Rightarrow> nat) \<Rightarrow> nat \<Rightarrow> nat \<times> nat" where "inf_concat n 0 = (LEAST j. n j > 0, 0)" | "inf_concat n (Suc k) = (let (i, j) = inf_concat n k in (if Suc j < n i then (i, Suc j) else (LEAST i'. i' > i \<and> n i' > 0, 0)))"
fun
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat
inf_concat assembles infinitely many (possibly empty) words to an infinite word
inf_concat_bounds: assumes inf: "INFM i. n i > 0" and res: "inf_concat n k = (i,j)" shows "j < n i" proof (cases k) case 0 with res have i: "i = (LEAST i. n i > 0)" and j: "j = 0" by auto from inf[unfolded INFM_nat_le] obtain i' where i': "0 < n i'" by auto have "0 < n (LEAST i. n i > 0)" by (rule L...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_bounds
inf_concat assembles infinitely many (possibly empty) words to an infinite word
inf_concat_add: assumes res: "inf_concat n k = (i,j)" and j: "j + m < n i" shows "inf_concat n (k + m) = (i,j+m)" using j proof (induct m) case 0 show ?case using res by auto next case (Suc m) hence "inf_concat n (k + m) = (i, j+m)" by auto with Suc(2) show ?case by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_add
null
inf_concat_step: assumes res: "inf_concat n k = (i,j)" and j: "Suc (j + m) = n i" shows "inf_concat n (k + Suc m) = (LEAST i'. i' > i \<and> 0 < n i', 0)" proof - from j have "j + m < n i" by auto note res = inf_concat_add[OF res, OF this] show ?thesis by (simp add: res j) qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_step
null
inf_concat_surj_zero: assumes "0 < n i" shows "\<exists>k. inf_concat n k = (i, 0)" proof - { fix l have "\<forall> j. j < l \<and> 0 < n j \<longrightarrow> (\<exists> k. inf_concat n k = (j,0))" proof (induct l) case 0 thus ?case by auto next case (Suc l) show ?case ...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_surj_zero
null
inf_concat_surj: assumes j: "j < n i" shows "\<exists>k. inf_concat n k = (i, j)" proof - from j have "0 < n i" by auto from inf_concat_surj_zero[of n, OF this] obtain k where "inf_concat n k = (i,0)" by auto from inf_concat_add[OF this, of j] j show ?thesis by auto qed
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_surj
null
inf_concat_mono: assumes inf: "INFM i. n i > 0" and resk: "inf_concat n k = (i, j)" and reskp: "inf_concat n k' = (i', j')" and lt: "i < i'" shows "k < k'" proof - note bounds = inf_concat_bounds[OF inf] { assume "k' \<le> k" hence "k = k' + (k - k')" by auto then obtain l where k: "k = ...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_mono
null
inf_concat_Suc: assumes inf: "INFM i. n i > 0" and f: "\<And> i. f i (n i) = f (Suc i) 0" and resk: "inf_concat n k = (i, j)" and ressk: "inf_concat n (Suc k) = (i', j')" shows "f i' j' = f i (Suc j)" proof - note bounds = inf_concat_bounds[OF inf] from bounds[OF resk] have j: "j < n i" . show ?th...
lemma
Abstract-Rewriting
[ "Main", "HOL-Library.Infinite_Set" ]
Abstract-Rewriting/Seq.thy
inf_concat_Suc
null
non_strict_order= ord + assumes ge_refl: "x \<ge> (x :: 'a)" and ge_trans[trans]: "\<lbrakk>x \<ge> y; (y :: 'a) \<ge> z\<rbrakk> \<Longrightarrow> x \<ge> z" and max_comm: "max x y = max y x" and max_ge_x[intro]: "max x y \<ge> x" and max_id: "x \<ge> y \<Longrightarrow> max x y = x" and max_mono: "x \<ge>...
class
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
non_strict_order
null
max_ge_y[intro]: "max x y \<ge> y" unfolding max_comm[of x y] ..
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
max_ge_y
null
max_mono2: "x \<ge> y \<Longrightarrow> max x z \<ge> max y z" unfolding max_comm[of _ z] by (rule max_mono)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
max_mono2
null
ordered_ab_semigroup= non_strict_order + ab_semigroup_add + monoid_add + assumes plus_left_mono: "x \<ge> y \<Longrightarrow> x + z \<ge> y + z"
class
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
ordered_ab_semigroup
null
plus_right_mono: "y \<ge> (z :: 'a :: ordered_ab_semigroup) \<Longrightarrow> x + y \<ge> x + z" by (simp add: add.commute[of x], rule plus_left_mono, auto)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
plus_right_mono
null
ordered_semiring_0= ordered_ab_semigroup + semiring_0 + assumes times_left_mono: "z \<ge> 0 \<Longrightarrow> x \<ge> y \<Longrightarrow> x * z \<ge> y * z" and times_right_mono: "x \<ge> 0 \<Longrightarrow> y \<ge> z \<Longrightarrow> x * y \<ge> x * z" and times_left_anti_mono: "x \<ge> y \<Longrightarrow>...
class
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
ordered_semiring_0
null
ordered_semiring_1= ordered_semiring_0 + semiring_1 + assumes one_ge_zero: "1 \<ge> 0"
class
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
ordered_semiring_1
null
order_pair= fixes gt :: "'a :: {non_strict_order,zero} \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<succ>" 50) and default :: "'a" assumes compat[trans]: "\<lbrakk>x \<ge> y; y \<succ> z\<rbrakk> \<Longrightarrow> x \<succ> z" and compat2[trans]: "\<lbrakk>x \<succ> y; y \<ge> z\<rbrakk> \<Longrightarrow> x \...
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
order_pair
null
gt_trans[trans]: "\<lbrakk>x \<succ> y; y \<succ> z\<rbrakk> \<Longrightarrow> x \<succ> z" by (rule compat[OF gt_imp_ge])
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
gt_trans
null
one_mono_ordered_semiring_1= order_pair gt for gt :: "'a :: ordered_semiring_1 \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<succ>" 50) + assumes plus_gt_left_mono: "x \<succ> y \<Longrightarrow> x + z \<succ> y + z" and default_gt_zero: "default \<succ> 0" begin
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
one_mono_ordered_semiring_1
null
plus_gt_right_mono: "x \<succ> y \<Longrightarrow> a + x \<succ> a + y" unfolding add.commute[of a] by (rule plus_gt_left_mono)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
plus_gt_right_mono
null
plus_gt_both_mono: "x \<succ> y \<Longrightarrow> a \<succ> b \<Longrightarrow> x + a \<succ> y + b" by (rule gt_trans[OF plus_gt_left_mono plus_gt_right_mono])
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
plus_gt_both_mono
null
SN_one_mono_ordered_semiring_1= one_mono_ordered_semiring_1 + order_pair + assumes SN: "SN {(x,y) . y \<ge> 0 \<and> x \<succ> y}"
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
SN_one_mono_ordered_semiring_1
null
SN_strict_mono_ordered_semiring_1= SN_one_mono_ordered_semiring_1 + fixes mono :: "'a :: ordered_semiring_1 \<Rightarrow> bool" assumes mono: "\<lbrakk>mono x; y \<succ> z; x \<ge> 0\<rbrakk> \<Longrightarrow> x * y \<succ> x * z"
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
SN_strict_mono_ordered_semiring_1
null
both_mono_ordered_semiring_1= order_pair gt for gt :: "'a :: ordered_semiring_1 \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<succ>" 50) + fixes arc_pos :: "'a \<Rightarrow> bool" assumes plus_gt_both_mono: "\<lbrakk>x \<succ> y; z \<succ> u\<rbrakk> \<Longrightarrow> x + z \<succ> y + u" and times_gt_left_mon...
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
both_mono_ordered_semiring_1
null
max0_id: "max 0 (x :: 'a) = x" unfolding max_comm[of 0] by (rule max_id[OF zero_leastIII])
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
max0_id
null
SN_both_mono_ordered_semiring_1= both_mono_ordered_semiring_1 + assumes SN: "SN {(x,y) . arc_pos y \<and> x \<succ> y}"
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
SN_both_mono_ordered_semiring_1
null
weak_SN_strict_mono_ordered_semiring_1= fixes weak_gt :: "'a :: ordered_semiring_1 \<Rightarrow> 'a \<Rightarrow> bool" and default :: "'a" and mono :: "'a \<Rightarrow> bool" assumes weak_gt_mono: "\<forall> x y. (x,y) \<in> set xys \<longrightarrow> weak_gt x y \<Longrightarrow> \<exists> gt. SN_strict_mo...
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
weak_SN_strict_mono_ordered_semiring_1
null
weak_SN_both_mono_ordered_semiring_1= fixes weak_gt :: "'a :: ordered_semiring_1 \<Rightarrow> 'a \<Rightarrow> bool" and default :: "'a" and arc_pos :: "'a \<Rightarrow> bool" assumes weak_gt_both_mono: "\<forall> x y. (x,y) \<in> set xys \<longrightarrow> weak_gt x y \<Longrightarrow> \<exists> gt. SN_bot...
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
weak_SN_both_mono_ordered_semiring_1
null
poly_carrier= ordered_semiring_1 + comm_semiring_1
class
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
poly_carrier
null
poly_order_carrier= SN_one_mono_ordered_semiring_1 default gt for default :: "'a :: poly_carrier" and gt (infix "\<succ>" 50) + fixes power_mono :: "bool" and discrete :: "bool" assumes times_gt_mono: "\<lbrakk>y \<succ> z; x \<ge> 1\<rbrakk> \<Longrightarrow> y * x \<succ> z * x" and power_mono: "power_mon...
locale
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
poly_order_carrier
null
large_ordered_semiring_1= poly_carrier + assumes ex_large_of_nat: "\<exists> x. of_nat x \<ge> y" context ordered_semiring_1 begin
class
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
large_ordered_semiring_1
null
pow_mono: assumes ab: "a \<ge> b" and b: "b \<ge> 0" shows "a ^ n \<ge> b ^ n \<and> b ^ n \<ge> 0" proof (induct n) case 0 show ?case by (auto simp: ge_refl one_ge_zero) next case (Suc n) hence abn: "a ^ n \<ge> b ^ n" and bn: "b ^ n \<ge> 0" by auto have bsn: "b ^ Suc n \<ge> 0" unfolding power_Suc us...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
pow_mono
null
pow_ge_zero[intro]: assumes a: "a \<ge> (0 :: 'a)" shows "a ^ n \<ge> 0" proof (induct n) case 0 from one_ge_zero show ?case by simp next case (Suc n) show ?case using times_left_mono[OF Suc a] by simp qed
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
pow_ge_zero
null
of_nat_ge_zero[intro,simp]: "of_nat n \<ge> (0 :: 'a :: ordered_semiring_1)" proof (induct n) case 0 show ?case by (simp add: ge_refl) next case (Suc n) from plus_right_mono[OF Suc, of 1] have "of_nat (Suc n) \<ge> (1 :: 'a)" by simp also have "(1 :: 'a) \<ge> 0" using one_ge_zero . finally show ?case . qed
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
of_nat_ge_zero
null
mult_ge_zero[intro]: "(a :: 'a :: ordered_semiring_1) \<ge> 0 \<Longrightarrow> b \<ge> 0 \<Longrightarrow> a * b \<ge> 0" using times_left_mono[of b 0 a] by auto
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
mult_ge_zero
null
pow_mono_one: assumes a: "a \<ge> (1 :: 'a :: ordered_semiring_1)" shows "a ^ n \<ge> 1" proof (induct n) case (Suc n) show ?case unfolding power_Suc using ge_trans[OF times_right_mono[OF ge_trans[OF a one_ge_zero] Suc], of 1] a by (auto simp: field_simps) qed (auto simp: ge_refl)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
pow_mono_one
null
pow_mono_exp: assumes a: "a \<ge> (1 :: 'a :: ordered_semiring_1)" shows "n \<ge> m \<Longrightarrow> a ^ n \<ge> a ^ m" proof (induct m arbitrary: n) case 0 show ?case using pow_mono_one[OF a] by auto next case (Suc m nn) then obtain n where nn: "nn = Suc n" by (cases nn, auto) note Suc = Suc[unfolded nn] ...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
pow_mono_exp
null
mult_ge_one[intro]: assumes a: "(a :: 'a :: ordered_semiring_1) \<ge> 1" and b: "b \<ge> 1" shows "a * b \<ge> 1" proof - from ge_trans[OF b one_ge_zero] have b0: "b \<ge> 0" . from times_left_mono[OF b0 a] have "a * b \<ge> b" by simp from ge_trans[OF this b] show ?thesis . qed
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
mult_ge_one
null
sum_list_ge_mono: fixes as :: "('a :: ordered_semiring_0) list" assumes "length as = length bs" and "\<And> i. i < length bs \<Longrightarrow> as ! i \<ge> bs ! i" shows "sum_list as \<ge> sum_list bs" using assms proof (induct as arbitrary: bs) case (Nil bs) from Nil(1) show ?case by (simp add: ge_refl) ne...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
sum_list_ge_mono
null
sum_list_ge_0_nth: fixes xs :: "('a :: ordered_semiring_0)list" assumes ge: "\<And> i. i < length xs \<Longrightarrow> xs ! i \<ge> 0" shows "sum_list xs \<ge> 0" proof - let ?l = "replicate (length xs) (0 :: 'a)" have "length xs = length ?l" by simp from sum_list_ge_mono[OF this] ge have "sum_list xs \<ge> ...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
sum_list_ge_0_nth
null
sum_list_ge_0: fixes xs :: "('a :: ordered_semiring_0)list" assumes ge: "\<And> x. x \<in> set xs \<Longrightarrow> x \<ge> 0" shows "sum_list xs \<ge> 0" by (rule sum_list_ge_0_nth, insert ge[unfolded set_conv_nth], auto)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
sum_list_ge_0
null
foldr_max: "a \<in> set as \<Longrightarrow> foldr max as b \<ge> (a :: 'a :: ordered_ab_semigroup)" proof (induct as arbitrary: b) case Nil thus ?case by simp next case (Cons c as) show ?case proof (cases "a = c") case True show ?thesis unfolding True by auto next case False with Cons have "f...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
foldr_max
null
of_nat_mono[intro]: assumes "n \<ge> m" shows "(of_nat n :: 'a :: ordered_semiring_1) \<ge> of_nat m" proof - let ?n = "of_nat :: nat \<Rightarrow> 'a" from assms show ?thesis proof (induct m arbitrary: n) case 0 show ?case by auto next case (Suc m nn) then obtain n where nn: "nn = Suc n" by (...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
of_nat_mono
null
non_inf:: "'a rel \<Rightarrow> bool" where "non_inf r \<equiv> \<forall> a f. \<exists> i. (f i, f (Suc i)) \<notin> r \<or> (f i, a) \<notin> r"
definition
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
non_inf
non infinitesmal is the same as in the CADE07 bounded increase paper
non_infI[intro]: assumes "\<And> a f. \<lbrakk> \<And> i. (f i, f (Suc i)) \<in> r\<rbrakk> \<Longrightarrow> \<exists> i. (f i, a) \<notin> r" shows "non_inf r" using assms unfolding non_inf_def by blast
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
non_infI
non infinitesmal is the same as in the CADE07 bounded increase paper
non_infE[elim]: assumes "non_inf r" and "\<And> i. (f i, f (Suc i)) \<notin> r \<or> (f i, a) \<notin> r \<Longrightarrow> P" shows P using assms unfolding non_inf_def by blast
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
non_infE
null
non_inf_image: assumes ni: "non_inf r" and image: "\<And> a b. (a,b) \<in> s \<Longrightarrow> (f a, f b) \<in> r" shows "non_inf s" proof fix a g assume s: "\<And> i. (g i, g (Suc i)) \<in> s" define h where "h = f o g" from image[OF s] have h: "\<And> i. (h i, h (Suc i)) \<in> r" unfolding h_def comp_def ...
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
non_inf_image
null
SN_imp_non_inf: "SN r \<Longrightarrow> non_inf r" by (intro non_infI, auto)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
SN_imp_non_inf
null
non_inf_imp_SN_bound: "non_inf r \<Longrightarrow> SN {(a,b). (b,c) \<in> r \<and> (a,b) \<in> r}" by (rule, auto)
lemma
Abstract-Rewriting
[ "Abstract_Rewriting" ]
Abstract-Rewriting/SN_Orders.thy
non_inf_imp_SN_bound
null
nat:: large_ordered_semiring_1 begin
instantiation
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
nat
The standard semiring over the naturals
by(intro_classes, auto)
instance
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
by
The standard semiring over the naturals
nat_mono:: "nat \<Rightarrow> bool" where "nat_mono x \<equiv> x \<noteq> 0" interpretation nat_SN: SN_strict_mono_ordered_semiring_1 1 "(>) :: nat \<Rightarrow> nat \<Rightarrow> bool" nat_mono by (unfold_locales, insert SN_nat_gt, auto simp: nat_mono_def) interpretation nat_poly: poly_order_carrier 1 "(>) :: nat \<...
definition
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
nat_mono
null
delta_gt:: "'a :: floor_ceiling \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool" where "delta_gt \<delta> \<equiv> (\<lambda> x y. x - y \<ge> \<delta>)"
definition
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
delta_gt
The standard semiring over the Archimedean fields using delta-orderings
non_inf_delta_gt: assumes delta: "\<delta> > 0" shows "non_inf {(a,b) . delta_gt \<delta> a b}" (is "non_inf ?r") proof let ?gt = "delta_gt \<delta>" fix a :: 'a and f assume "\<And> i. (f i, f (Suc i)) \<in> ?r" hence gt: "\<And> i. ?gt (f i) (f (Suc i))" by simp { fix i have "f i \<le> f 0 - \<del...
lemma
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
non_inf_delta_gt
The standard semiring over the Archimedean fields using delta-orderings
delta_gt_SN: assumes dpos: "\<delta> > 0" shows "SN {(x,y). 0 \<le> y \<and> delta_gt \<delta> x y}" proof - from non_inf_imp_SN_bound[OF non_inf_delta_gt[OF dpos], of "- \<delta>"] show ?thesis unfolding delta_gt_def by auto qed
lemma
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
delta_gt_SN
null
delta_mono:: "'a :: floor_ceiling \<Rightarrow> bool" where "delta_mono x \<equiv> x \<ge> 1" subclass (in floor_ceiling) large_ordered_semiring_1 proof fix x :: 'a from ex_le_of_int[of x] obtain z where x: "x \<le> of_int z" by auto have "z \<le> int (nat z)" by auto with x have "x \<le> of_int (int (nat z))" ...
definition
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
delta_mono
null
delta_interpretation: assumes dpos: "\<delta> > 0" and default: "\<delta> \<le> def" shows "SN_strict_mono_ordered_semiring_1 def (delta_gt \<delta>) delta_mono" proof - from dpos default have defz: "0 \<le> def" by auto show ?thesis proof (unfold_locales) show "SN {(x,y). y \<ge> 0 \<and> delta_gt \<delta>...
lemma
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
delta_interpretation
null
delta_poly: assumes dpos: "\<delta> > 0" and default: "\<delta> \<le> def" shows "poly_order_carrier def (delta_gt \<delta>) (1 \<le> \<delta>) False" proof - from delta_interpretation[OF dpos default] interpret SN_strict_mono_ordered_semiring_1 "def" "delta_gt \<delta>" delta_mono . interpret poly_order_carrie...
lemma
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
delta_poly
null
delta_minimal_delta: assumes "\<And> x y. (x,y) \<in> set xys \<Longrightarrow> x > y" shows "\<exists> \<delta> > 0. \<forall> x y. (x,y) \<in> set xys \<longrightarrow> delta_gt \<delta> x y" using assms proof (induct xys) case Nil show ?case by (rule exI[of _ 1], auto) next case (Cons xy xys) show ?case ...
lemma
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
delta_minimal_delta
null
int_mono:: "int \<Rightarrow> bool" where "int_mono x \<equiv> x \<ge> 1"
definition
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
int_mono
The standard semiring over the integers
int:: large_ordered_semiring_1 begin
instantiation
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
int
The standard semiring over the integers
prooffix y :: int show "\<exists> x. of_nat x \<ge> y" by (rule exI[of _ "nat y"], simp) qed (auto simp: mult_right_mono mult_left_mono mult_right_mono_neg)
instance
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
proof
null
non_inf_int_gt: "non_inf {(a,b :: int) . a > b}" (is "non_inf ?r") by (rule non_inf_image[OF non_inf_delta_gt, of 1 _ rat_of_int], auto simp: delta_gt_def) interpretation int_SN: SN_strict_mono_ordered_semiring_1 1 "(>) :: int \<Rightarrow> int \<Rightarrow> bool" int_mono proof (unfold_locales) have [simp]: "\<And...
lemma
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
non_inf_int_gt
null
arctic= MinInfty | Num_arc int
datatype
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
arctic
The arctic semiring over the integers plus is interpreted as max, times is interpreted as plus, 0 is -infinity, 1 is 0
arctic:: ord begin
instantiation
Abstract-Rewriting
[ "SN_Orders", "HOL.Rat" ]
Abstract-Rewriting/SN_Order_Carrier.thy
arctic
plus is interpreted as max, times is interpreted as plus, 0 is -infinity, 1 is 0