[STATEMENT]
lemma F2set2_bd: "|F2set2 x| <o bd_F1 +c bd_F2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |F2set2 x| <o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule ordLess_ordLeq_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. |F2set2 x| <o ?r'
 2. ?r' \<le>o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule F2.set_bd(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bd_F2 \<le>o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule ordLeq_csum2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order bd_F2
[PROOF STEP]
apply (rule F2.bd_Card_order)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma markedElementsAppend:
  shows "markedElements (M1 @ M2) = markedElements M1 @ markedElements M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. markedElements (M1 @ M2) = markedElements M1 @ markedElements M2
[PROOF STEP]
by (induct M1) auto


[STATEMENT]
lemma not_or: "not (\<phi> or \<psi>) = (not \<phi>) aand (not \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs. \<not> (\<phi> xs \<or> \<psi> xs)) = (\<lambda>xs. \<not> \<phi> xs \<and> \<not> \<psi> xs)
[PROOF STEP]
by blast


[STATEMENT]
lemma perm_rows_transpose: "perm_rows (transpose M) p = transpose (perm_cols M p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perm_rows (Square_Matrix.transpose M) p = Square_Matrix.transpose (perm_cols M p)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma EF_induct: "(a::'a::state) \<in> EF f \<Longrightarrow>
    mono (\<lambda> Z. f \<union> EX' Z) \<Longrightarrow>
    (\<And>x. x \<in> ((\<lambda> Z. f \<union> EX' Z)(EF f \<inter> {x::'a::state. P x})) \<Longrightarrow> P x) \<Longrightarrow>
    P a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> EF f; mono (\<lambda>Z. f \<union> EX' Z); \<And>x. x \<in> f \<union> EX' (EF f \<inter> {x. P x}) \<Longrightarrow> P x\<rbrakk> \<Longrightarrow> P a
[PROOF STEP]
by (metis (mono_tags, lifting) EF_def def_lfp_induct_set)


[STATEMENT]
lemma measurable_trivial_measure_iff:
  "f \<in> M \<rightarrow>\<^sub>M trivial_measure X \<longleftrightarrow> f \<in> space M \<rightarrow> X \<and> f -` X \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M trivial_measure X) = (f \<in> space M \<rightarrow> X \<and> f -` X \<inter> space M \<in> sets M)
[PROOF STEP]
unfolding measurable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> {f \<in> space M \<rightarrow> space (trivial_measure X). \<forall>y\<in>sets (trivial_measure X). f -` y \<inter> space M \<in> sets M}) = (f \<in> space M \<rightarrow> X \<and> f -` X \<inter> space M \<in> sets M)
[PROOF STEP]
by (auto simp: sets_trivial_measure)


[STATEMENT]
lemma index_MV_Rel[transfer_rule]: "(MV_Rel ===> (=) ===> M_Rel)
    (\<lambda> v i. if i < dim_vec v then v $ i else 0) (\<lambda> v i. if i < dim_vec v then v $ i else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MV_Rel ===> (=) ===> M_Rel) (\<lambda>v i. if i < dim_vec v then v $ i else 0) (\<lambda>v i. if i < dim_vec v then v $ i else 0)
[PROOF STEP]
using lt_dim_vec_MV_Rel
[PROOF STATE]
proof (prove)
using this:
(MV_Rel ===> (=) ===> (=)) (\<lambda>v j. j < dim_vec v) (\<lambda>v j. j < dim_vec v)

goal (1 subgoal):
 1. (MV_Rel ===> (=) ===> M_Rel) (\<lambda>v i. if i < dim_vec v then v $ i else 0) (\<lambda>v i. if i < dim_vec v then v $ i else 0)
[PROOF STEP]
unfolding MV_Rel_def M_Rel_def M_def rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. vec_mod x = to_int_vec y \<longrightarrow> (\<forall>xa ya. xa = ya \<longrightarrow> (xa < dim_vec x) = (ya < dim_vec y))

goal (1 subgoal):
 1. \<forall>x y. vec_mod x = to_int_vec y \<longrightarrow> (\<forall>xa ya. xa = ya \<longrightarrow> (if xa < dim_vec x then x $ xa else 0) mod m = to_int_mod_ring (if ya < dim_vec y then y $ ya else 0))
[PROOF STEP]
by (simp, metis to_int_vec_index vec_mod_index)


[STATEMENT]
lemma Qp_p_int_nat_pow_pow:
  fixes n::int
  fixes m::nat
  shows "(\<pp> [^] (n*m)) = ((\<pp>[^]n)[^]m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] (n * int m) = (\<pp> [^] n) [^] m
[PROOF STEP]
by (simp add: Qp_int_nat_pow_pow p_nonzero)


[STATEMENT]
lemma inf_neg_pos_meas:
  assumes "0 < inf_neg E"
  shows "\<not> pos_meas_set E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> pos_meas_set E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < inf_neg E

goal (1 subgoal):
 1. \<not> pos_meas_set E
[PROOF STEP]
unfolding inf_neg_def
[PROOF STATE]
proof (prove)
using this:
0 < (if E \<notin> sets M \<or> pos_meas_set E then 0 else \<Sqinter> {n |n. 1 \<le> n \<and> (\<exists>B\<in>sets M. B \<subseteq> E \<and> \<mu> B < ereal (- 1 / real n))})

goal (1 subgoal):
 1. \<not> pos_meas_set E
[PROOF STEP]
by presburger


[STATEMENT]
theorem rbt_insert: "rbt t \<Longrightarrow> rbt (insert x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt t \<Longrightarrow> rbt (RBT_Set.insert x t)
[PROOF STEP]
by (simp add: invc_ins invh_ins color_paint_Black invh_paint rbt_def insert_def)


[STATEMENT]
lemma lin_polies_to_rat_mat_coeff_index:
  assumes "i < length L" and "j <  (max_dim_poly_list L)"
  shows "coeff (L ! i) j = (lin_polies_to_mat L) $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (L ! i) j = lin_polies_to_mat L $$ (i, j)
[PROOF STEP]
unfolding lin_polies_to_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (L ! i) j = mat (length L) (max_dim_poly_list L) (\<lambda>(x, y). Abstract_Linear_Poly.coeff (L ! x) y) $$ (i, j)
[PROOF STEP]
by (simp add: assms(1) assms(2))


[STATEMENT]
lemma exp_similiar_sq_mtx_diag:
  assumes "A \<sim> sq_mtx_diag f"
  shows "exp A \<sim> exp (sq_mtx_diag f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp A \<sim> exp (sq_mtx_diag f)
[PROOF STEP]
using assms exp_similiar_sq_mtx_diag_eq
[PROOF STATE]
proof (prove)
using this:
A \<sim> sq_mtx_diag f
\<lbrakk>mtx_invertible ?P; ?A = ?P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. ?f i) * ?P\<rbrakk> \<Longrightarrow> exp ?A = ?P\<^sup>-\<^sup>1 * exp (\<d>\<i>\<a>\<g> i. ?f i) * ?P

goal (1 subgoal):
 1. exp A \<sim> exp (sq_mtx_diag f)
[PROOF STEP]
unfolding similar_sq_mtx_def
[PROOF STATE]
proof (prove)
using this:
\<exists>P. mtx_invertible P \<and> A = P\<^sup>-\<^sup>1 * sq_mtx_diag f * P
\<lbrakk>mtx_invertible ?P; ?A = ?P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. ?f i) * ?P\<rbrakk> \<Longrightarrow> exp ?A = ?P\<^sup>-\<^sup>1 * exp (\<d>\<i>\<a>\<g> i. ?f i) * ?P

goal (1 subgoal):
 1. \<exists>P. mtx_invertible P \<and> exp A = P\<^sup>-\<^sup>1 * exp (sq_mtx_diag f) * P
[PROOF STEP]
by blast


[STATEMENT]
lemma real_add_minus_iff [simp]: "x + - a = 0 \<longleftrightarrow> x = a"
  for x a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + - a = 0) = (x = a)
[PROOF STEP]
by arith


[STATEMENT]
lemma has_bochner_integral_indicator:
  "A \<in> sets M \<Longrightarrow> emeasure M A < \<infinity> \<Longrightarrow>
    has_bochner_integral M (\<lambda>x. indicator A x *\<^sub>R c) (measure M A *\<^sub>R c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; emeasure M A < \<infinity>\<rbrakk> \<Longrightarrow> has_bochner_integral M (\<lambda>x. indicat_real A x *\<^sub>R c) (Sigma_Algebra.measure M A *\<^sub>R c)
[PROOF STEP]
by (intro has_bochner_integral_scaleR_left has_bochner_integral_real_indicator)


[STATEMENT]
lemma pdevs_val_pdevs_domain: "pdevs_val e X = (\<Sum>i\<in>pdevs_domain X. e i *\<^sub>R pdevs_apply X i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e X = (\<Sum>i\<in>pdevs_domain X. e i *\<^sub>R pdevs_apply X i)
[PROOF STEP]
by (auto simp: pdevs_val_def intro!: suminf_finite)


[STATEMENT]
lemma ChiPlus_ChiRel_int [rule_format]:
  "\<lbrakk> (T,S) \<in> (ChiPlus A)\<rbrakk> \<Longrightarrow> (ChiPlus A `` {T}) \<inter> (ChiRel A `` {S}) = (ChiRel A `` {S})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> ChiPlus A \<Longrightarrow> ChiPlus A `` {T} \<inter> ChiRel A `` {S} = ChiRel A `` {S}
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (ChiRel A)\<^sup>+ `` {T} \<inter> ChiRel A `` {S} = ChiRel A `` {S}
[PROOF STEP]
apply (rule_tac a="T" and b="S" and r="(ChiRel A)" in converse_trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (ChiRel A)\<^sup>+ `` {y} \<inter> ChiRel A `` {S} = ChiRel A `` {S}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; (ChiRel A)\<^sup>+ `` {z} \<inter> ChiRel A `` {S} = ChiRel A `` {S}\<rbrakk> \<Longrightarrow> (ChiRel A)\<^sup>+ `` {y} \<inter> ChiRel A `` {S} = ChiRel A `` {S}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ttm_children: "tree_to_multiset t =
  {#(val t,prio t)#} + queue_to_multiset (children t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_to_multiset t = {#(val t, prio t)#} + queue_to_multiset (children t)
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma frac_mult:
  assumes "a \<in> carrier Z\<^sub>p"
  assumes "b \<in> nonzero Z\<^sub>p"
  assumes "c \<in> carrier Z\<^sub>p"
  assumes "d \<in> nonzero Z\<^sub>p"
  shows "(frac a b) \<otimes> (frac c d) = (frac (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> c) (b \<otimes>\<^bsub>Z\<^sub>p\<^esub> d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction Z\<^sub>p a b \<otimes> fraction Z\<^sub>p c d = fraction Z\<^sub>p (a \<otimes>\<^bsub>Z\<^sub>p\<^esub> c) (b \<otimes>\<^bsub>Z\<^sub>p\<^esub> d)
[PROOF STEP]
by (simp add: Q\<^sub>p_def assms(1) assms(2) assms(3) assms(4) frac_mult)


[STATEMENT]
lemma perm_cols_transpose: "perm_cols (transpose M) p = transpose (perm_rows M p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perm_cols (Square_Matrix.transpose M) p = Square_Matrix.transpose (perm_rows M p)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma length_snoc: "length (xs @ [x]) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs @ [x]) = Suc (length xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma tan_mono_lt_eq:
  "-(pi/2) < x \<Longrightarrow> x < pi/2 \<Longrightarrow> -(pi/2) < y \<Longrightarrow> y < pi/2 \<Longrightarrow> tan x < tan y \<longleftrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- (pi / 2) < x; x < pi / 2; - (pi / 2) < y; y < pi / 2\<rbrakk> \<Longrightarrow> (tan x < tan y) = (x < y)
[PROOF STEP]
using tan_monotone'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- (pi / 2) < ?y; ?y < pi / 2; - (pi / 2) < ?x; ?x < pi / 2\<rbrakk> \<Longrightarrow> (?y < ?x) = (tan ?y < tan ?x)

goal (1 subgoal):
 1. \<lbrakk>- (pi / 2) < x; x < pi / 2; - (pi / 2) < y; y < pi / 2\<rbrakk> \<Longrightarrow> (tan x < tan y) = (x < y)
[PROOF STEP]
by blast


[STATEMENT]
theorem (in Congruence_Rule) Tri_SAS:
  assumes
    "Def (Tri (Tr A B C))"
    "Def (Tri (Tr A1 B1 C1))"
    "Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)"
    "Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)"
    "Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)"
  shows "Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
have P1 : "Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)
[PROOF STEP]
by (simp add:Tri_week_SAS)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
have P2 : "Eq (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An C A B)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eq (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An C A B)) add Emp)
[PROOF STEP]
by (simp add:Ang_roll)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An C A B)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
have P3 : "Eq (Geos (Ang (An C1 A1 B1)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eq (Geos (Ang (An C1 A1 B1)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
by (simp add:Ang_roll)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Ang (An C1 A1 B1)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms P2
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Eq (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An C A B)) add Emp)
[PROOF STEP]
have P4 : "Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Eq (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An C A B)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
by (blast intro:Ang_weektrans Eq_rev)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from P3 P4
[PROOF STATE]
proof (chain)
picking this:
Eq (Geos (Ang (An C1 A1 B1)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
have P5 : "Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Eq (Geos (Ang (An C1 A1 B1)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)
[PROOF STEP]
by (blast intro:Ang_weektrans Ang_rev Eq_rev)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms P1 P5
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)
[PROOF STEP]
have P6 : "\<not>\<not> Eq (Geos (Seg (Se B C)) add Emp) (Geos (Seg (Se B1 C1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)

goal (1 subgoal):
 1. \<not> \<not> Eq (Geos (Seg (Se B C)) add Emp) (Geos (Seg (Se B1 C1)) add Emp)
[PROOF STEP]
by (simp add:Tri_week_ASA)
[PROOF STATE]
proof (state)
this:
\<not> \<not> Eq (Geos (Seg (Se B C)) add Emp) (Geos (Seg (Se B1 C1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
have P7 : "Eq (Geos (Seg (Se C A)) add Emp) (Geos (Seg (Se C1 A1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Eq (Geos (Seg (Se C A)) add Emp) (Geos (Seg (Se C1 A1)) add Emp)
[PROOF STEP]
by (blast intro:Seg_rev Eq_rev Eq_trans)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Seg (Se C A)) add Emp) (Geos (Seg (Se C1 A1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
have P8 : "Def (Tri (Tr A C B))"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Def (Tri (Tr A C B))
[PROOF STEP]
by (blast intro:Tri_def_rev Tri_def_trans)
[PROOF STATE]
proof (state)
this:
Def (Tri (Tr A C B))

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
[PROOF STEP]
have P9 : "Def (Tri (Tr A1 C1 B1))"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)

goal (1 subgoal):
 1. Def (Tri (Tr A1 C1 B1))
[PROOF STEP]
by (blast intro:Tri_def_rev Tri_def_trans)
[PROOF STATE]
proof (state)
this:
Def (Tri (Tr A1 C1 B1))

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms P5 P8 P9
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)
Def (Tri (Tr A C B))
Def (Tri (Tr A1 C1 B1))
[PROOF STEP]
have P10 : "Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C A B)) add Emp) (Geos (Ang (An C1 A1 B1)) add Emp)
Def (Tri (Tr A C B))
Def (Tri (Tr A1 C1 B1))

goal (1 subgoal):
 1. Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
[PROOF STEP]
by (simp add:Tri_week_SAS)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
have P11 : "Eq (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An A C B)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eq (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An A C B)) add Emp)
[PROOF STEP]
by (simp add:Ang_roll)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An A C B)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
have P12 : "Eq (Geos (Ang (An B1 C1 A1)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eq (Geos (Ang (An B1 C1 A1)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)
[PROOF STEP]
by (simp add:Ang_roll)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Ang (An B1 C1 A1)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from P10 P11
[PROOF STATE]
proof (chain)
picking this:
Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
Eq (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An A C B)) add Emp)
[PROOF STEP]
have P13 : "Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
Eq (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An A C B)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
[PROOF STEP]
by (blast intro:Ang_weektrans Eq_rev)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from P10 P12 P13
[PROOF STATE]
proof (chain)
picking this:
Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
Eq (Geos (Ang (An B1 C1 A1)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)
Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
[PROOF STEP]
have P14 : "Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Cong (Geos (Ang (An B C A)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)
Eq (Geos (Ang (An B1 C1 A1)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)
Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An B1 C1 A1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)
[PROOF STEP]
by (blast intro:Ang_weektrans Ang_rev Eq_rev)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
from assms P1 P6 P7 P14
[PROOF STATE]
proof (chain)
picking this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)
\<not> \<not> Eq (Geos (Seg (Se B C)) add Emp) (Geos (Seg (Se B1 C1)) add Emp)
Eq (Geos (Seg (Se C A)) add Emp) (Geos (Seg (Se C1 A1)) add Emp)
Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)
[PROOF STEP]
show "Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)"
[PROOF STATE]
proof (prove)
using this:
Def (Tri (Tr A B C))
Def (Tri (Tr A1 B1 C1))
Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A1 B1)) add Emp)
Eq (Geos (Seg (Se A C)) add Emp) (Geos (Seg (Se A1 C1)) add Emp)
Cong (Geos (Ang (An B A C)) add Emp) (Geos (Ang (An B1 A1 C1)) add Emp)
Cong (Geos (Ang (An C B A)) add Emp) (Geos (Ang (An C1 B1 A1)) add Emp)
\<not> \<not> Eq (Geos (Seg (Se B C)) add Emp) (Geos (Seg (Se B1 C1)) add Emp)
Eq (Geos (Seg (Se C A)) add Emp) (Geos (Seg (Se C1 A1)) add Emp)
Cong (Geos (Ang (An A C B)) add Emp) (Geos (Ang (An A1 C1 B1)) add Emp)

goal (1 subgoal):
 1. Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)
[PROOF STEP]
by (simp add:Tri_Cong_def)
[PROOF STATE]
proof (state)
this:
Cong (Geos (Tri (Tr A B C)) add Emp) (Geos (Tri (Tr A1 B1 C1)) add Emp)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_min_asso: "p_min (p_min a b) c = p_min a (p_min b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p_min (p_min a b) c = p_min a (p_min b c)
[PROOF STEP]
apply(induct a b  rule: p_min.induct )
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. p_min (p_min Infty Infty) c = p_min Infty (p_min Infty c)
 2. \<And>e a. p_min (p_min Infty (LP e a)) c = p_min Infty (p_min (LP e a) c)
 3. \<And>e a. p_min (p_min (LP e a) Infty) c = p_min (LP e a) (p_min Infty c)
 4. \<And>e1 a e2 b. p_min (p_min (LP e1 a) (LP e2 b)) c = p_min (LP e1 a) (p_min (LP e2 b) c)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e1 a e2 b. p_min (LP (max e1 e2) (min a b)) c = p_min (LP e1 a) (p_min (LP e2 b) c)
[PROOF STEP]
apply (induct c)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>e1 a e2 b. p_min (LP (max e1 e2) (min a b)) Infty = p_min (LP e1 a) (p_min (LP e2 b) Infty)
 2. \<And>x1 x2 e1 a e2 b. p_min (LP (max e1 e2) (min a b)) (LP x1 x2) = p_min (LP e1 a) (p_min (LP e2 b) (LP x1 x2))
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x1 e1 e2. max (max e1 e2) x1 = max e1 (max e2 x1)
 2. \<And>x2 a b. min (min a b) x2 = min a (min b x2)
[PROOF STEP]
apply (metis max.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x2 a b. min (min a b) x2 = min a (min b x2)
[PROOF STEP]
apply (metis min.assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma graph_restrict_simps[simp]:
  "g_V (graph_restrict G R) = g_V G"
  "g_E (graph_restrict G R) = rel_restrict (g_E G) R"
  "g_V0 (graph_restrict G R) = g_V0 G - R"
  "graph_rec.more (graph_restrict G R) = graph_rec.more G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g_V (graph_restrict G R) = g_V G &&& g_E (graph_restrict G R) = rel_restrict (g_E G) R) &&& g_V0 (graph_restrict G R) = g_V0 G - R &&& graph_rec.more (graph_restrict G R) = graph_rec.more G
[PROOF STEP]
unfolding graph_restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g_V \<lparr>g_V = g_V G, g_E = rel_restrict (g_E G) R, g_V0 = g_V0 G - R, \<dots> = graph_rec.more G\<rparr> = g_V G &&& g_E \<lparr>g_V = g_V G, g_E = rel_restrict (g_E G) R, g_V0 = g_V0 G - R, \<dots> = graph_rec.more G\<rparr> = rel_restrict (g_E G) R) &&& g_V0 \<lparr>g_V = g_V G, g_E = rel_restrict (g_E G) R, g_V0 = g_V0 G - R, \<dots> = graph_rec.more G\<rparr> = g_V0 G - R &&& graph_rec.more \<lparr>g_V = g_V G, g_E = rel_restrict (g_E G) R, g_V0 = g_V0 G - R, \<dots> = graph_rec.more G\<rparr> = graph_rec.more G
[PROOF STEP]
by auto


[STATEMENT]
lemma (in gd_term) compute_trd_aux [code]:
  "trd_aux fs p r =
    (if is_zero p then
      r
    else
      case find_adds fs (lt p) of
        None   \<Rightarrow> trd_aux fs (tail p) (plus_monomial_less r (lc p) (lt p))
      | Some f \<Rightarrow> trd_aux fs (tail p - monom_mult (lc p / lc f) (lp p - lp f) (tail f)) r
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trd_aux fs p r = (if is_zero p then r else case find_adds fs (lt p) of None \<Rightarrow> trd_aux fs (tail p) (plus_monomial_less r (lc p) (lt p)) | Some f \<Rightarrow> trd_aux fs (tail p - monom_mult (lc p / lc f) (lp p - lp f) (tail f)) r)
[PROOF STEP]
by (simp only: trd_aux.simps[of fs p r] plus_monomial_less_def is_zero_def)


[STATEMENT]
lemma reverse_reverse: "reverse (reverse xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reverse (reverse xs) = xs
[PROOF STEP]
by (induct xs) (simp_all add: reverse_conc)


[STATEMENT]
lemma finite_ne_subset_induct [consumes 3, case_names singleton insert]:
  assumes "finite F"
      and "F \<noteq> {}"
      and "F \<subseteq> S"
      and singleton: "\<And>x . P {x}"
      and insert: "\<And>x F . finite F \<Longrightarrow> F \<noteq> {} \<Longrightarrow> F \<subseteq> S \<Longrightarrow> x \<in> S \<Longrightarrow> x \<notin> F \<Longrightarrow> P F \<Longrightarrow> P (insert x F)"
    shows "P F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P F
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
finite F
F \<noteq> {}
F \<subseteq> S

goal (1 subgoal):
 1. P F
[PROOF STEP]
apply (induct rule: finite_ne_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. {x} \<subseteq> S \<Longrightarrow> P {x}
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; F \<subseteq> S \<Longrightarrow> P F; insert x F \<subseteq> S\<rbrakk> \<Longrightarrow> P (insert x F)
[PROOF STEP]
apply (simp add: singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; F \<subseteq> S \<Longrightarrow> P F; insert x F \<subseteq> S\<rbrakk> \<Longrightarrow> P (insert x F)
[PROOF STEP]
by (simp add: insert)


[STATEMENT]
lemma Smith_1xn_two_matrices:
  fixes A :: "'a::comm_ring_1 mat"
  assumes A: "A \<in> carrier_mat 1 n"
  and PSQ: "(P,S,Q) = (Smith_1xn A)"
  and is_SNF: "is_SNF A (Smith_1xn A)"
shows "\<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, (Smith_1xn' A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)
[PROOF STEP]
let ?Q = "P$$(0,0) \<cdot>\<^sub>m Q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)
[PROOF STEP]
have P00_dvd_1: "P $$ (0, 0) dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P $$ (0, 0) dvd (1::'a)
[PROOF STEP]
by (metis (mono_tags, lifting) assms carrier_matD(1) determinant_one_element
        invertible_iff_is_unit_JNF is_SNF_def prod.simps(2))
[PROOF STATE]
proof (state)
this:
P $$ (0, 0) dvd (1::'a)

goal (1 subgoal):
 1. \<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)
[PROOF STEP]
have "is_SNF A (1\<^sub>m 1,S,?Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_SNF A (1\<^sub>m 1, S, P $$ (0, 0) \<cdot>\<^sub>m Q)
[PROOF STEP]
proof (rule is_SNF_intro)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. 1\<^sub>m 1 \<in> carrier_mat (dim_row A) (dim_row A)
 2. P $$ (0, 0) \<cdot>\<^sub>m Q \<in> carrier_mat (dim_col A) (dim_col A)
 3. invertible_mat (1\<^sub>m 1)
 4. invertible_mat (P $$ (0, 0) \<cdot>\<^sub>m Q)
 5. Smith_normal_form_mat S
 6. S = 1\<^sub>m 1 * A * (P $$ (0, 0) \<cdot>\<^sub>m Q)
[PROOF STEP]
show "invertible_mat (P $$ (0, 0) \<cdot>\<^sub>m Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (P $$ (0, 0) \<cdot>\<^sub>m Q)
[PROOF STEP]
by (rule invertible_mat_smult_mat, insert P00_dvd_1 assms, auto simp add: is_SNF_def)
[PROOF STATE]
proof (state)
this:
invertible_mat (P $$ (0, 0) \<cdot>\<^sub>m Q)

goal (5 subgoals):
 1. 1\<^sub>m 1 \<in> carrier_mat (dim_row A) (dim_row A)
 2. P $$ (0, 0) \<cdot>\<^sub>m Q \<in> carrier_mat (dim_col A) (dim_col A)
 3. invertible_mat (1\<^sub>m 1)
 4. Smith_normal_form_mat S
 5. S = 1\<^sub>m 1 * A * (P $$ (0, 0) \<cdot>\<^sub>m Q)
[PROOF STEP]
show "S = 1\<^sub>m 1 * A * (P $$ (0, 0) \<cdot>\<^sub>m Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = 1\<^sub>m 1 * A * (P $$ (0, 0) \<cdot>\<^sub>m Q)
[PROOF STEP]
by (smt A PSQ is_SNF carrier_matD(2) index_mult_mat(2) index_one_mat(2) left_mult_one_mat
          mult_smult_assoc_mat mult_smult_distrib smult_mat_mat_one_element is_SNF_def split_conv)
[PROOF STATE]
proof (state)
this:
S = 1\<^sub>m 1 * A * (P $$ (0, 0) \<cdot>\<^sub>m Q)

goal (4 subgoals):
 1. 1\<^sub>m 1 \<in> carrier_mat (dim_row A) (dim_row A)
 2. P $$ (0, 0) \<cdot>\<^sub>m Q \<in> carrier_mat (dim_col A) (dim_col A)
 3. invertible_mat (1\<^sub>m 1)
 4. Smith_normal_form_mat S
[PROOF STEP]
qed (insert assms, auto simp add: is_SNF_def)
[PROOF STATE]
proof (state)
this:
is_SNF A (1\<^sub>m 1, S, P $$ (0, 0) \<cdot>\<^sub>m Q)

goal (1 subgoal):
 1. \<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_SNF A (1\<^sub>m 1, S, P $$ (0, 0) \<cdot>\<^sub>m Q)

goal (1 subgoal):
 1. \<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>Smith_1xn'. is_SNF A (1\<^sub>m 1, Smith_1xn' A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma natLeq_on_Card_order: "Card_order (natLeq_on n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order (natLeq_on n)
[PROOF STEP]
proof(unfold card_order_on_def,
      auto simp add: natLeq_on_Well_order, simp add: Field_natLeq_on)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r'. well_order_on {x. x < n} r' \<Longrightarrow> natLeq_on n \<le>o r'
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r'. well_order_on {x. x < n} r' \<Longrightarrow> natLeq_on n \<le>o r'
[PROOF STEP]
assume "well_order_on {x. x < n} r"
[PROOF STATE]
proof (state)
this:
well_order_on {x. x < n} r

goal (1 subgoal):
 1. \<And>r'. well_order_on {x. x < n} r' \<Longrightarrow> natLeq_on n \<le>o r'
[PROOF STEP]
thus "natLeq_on n \<le>o r"
[PROOF STATE]
proof (prove)
using this:
well_order_on {x. x < n} r

goal (1 subgoal):
 1. natLeq_on n \<le>o r
[PROOF STEP]
using finite_atLeastLessThan natLeq_on_well_order_on
        finite_well_order_on_ordIso ordIso_iff_ordLeq
[PROOF STATE]
proof (prove)
using this:
well_order_on {x. x < n} r
finite {?l..<?u}
well_order_on {x. x < ?n} (natLeq_on ?n)
\<lbrakk>finite ?A; well_order_on ?A ?r; well_order_on ?A ?r'\<rbrakk> \<Longrightarrow> ?r =o ?r'
(?r =o ?r') = (?r \<le>o ?r' \<and> ?r' \<le>o ?r)

goal (1 subgoal):
 1. natLeq_on n \<le>o r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
natLeq_on n \<le>o r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_R1_intersection:
  assumes "A \<subseteq> carrier R"
  assumes "B \<subseteq> carrier R"
  shows "to_R1 ` (A \<inter> B) = to_R1` A \<inter> to_R1 ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. [a]) ` (A \<inter> B) = (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>a. [a]) ` (A \<inter> B) \<subseteq> (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B
 2. (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B \<subseteq> (\<lambda>a. [a]) ` (A \<inter> B)
[PROOF STEP]
show "(\<lambda>a. [a]) ` (A \<inter> B) \<subseteq> (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. [a]) ` (A \<inter> B) \<subseteq> (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>a. [a]) ` (A \<inter> B) \<subseteq> (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B

goal (1 subgoal):
 1. (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B \<subseteq> (\<lambda>a. [a]) ` (A \<inter> B)
[PROOF STEP]
show "(\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B \<subseteq> (\<lambda>a. [a]) ` (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B \<subseteq> (\<lambda>a. [a]) ` (A \<inter> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier R
B \<subseteq> carrier R

goal (1 subgoal):
 1. (\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B \<subseteq> (\<lambda>a. [a]) ` (A \<inter> B)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B \<subseteq> (\<lambda>a. [a]) ` (A \<inter> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma term_order_rel_trans:
  \<open>(a, aa) \<in> term_order_rel \<Longrightarrow>
       (aa, ab) \<in> term_order_rel \<Longrightarrow> (a, ab) \<in> term_order_rel\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, aa) \<in> term_order_rel; (aa, ab) \<in> term_order_rel\<rbrakk> \<Longrightarrow> (a, ab) \<in> term_order_rel
[PROOF STEP]
by (metis PAC_Checker_Relation.less_char_def p2rel_def string_list_trans var_order_rel_def)


[STATEMENT]
lemma poly_tuple_evalE:
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "as \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "j < m"
  shows "(poly_tuple_eval fs as)!j \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_tuple_eval fs as ! j \<in> carrier R
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_tuple_eval fs as ! j \<in> carrier R
[PROOF STEP]
have 0: "(poly_tuple_eval fs as)!j = (eval_at_poly R (fs!j) as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_tuple_eval fs as ! j = eval_at_point R as (fs ! j)
[PROOF STEP]
using poly_tuple_eval_def
[PROOF STATE]
proof (prove)
using this:
poly_tuple_eval ?fs ?as = map (eval_at_point R ?as) ?fs

goal (1 subgoal):
 1. poly_tuple_eval fs as ! j = eval_at_point R as (fs ! j)
[PROOF STEP]
by (metis assms(2) assms(4) nth_map)
[PROOF STATE]
proof (state)
this:
poly_tuple_eval fs as ! j = eval_at_point R as (fs ! j)

goal (1 subgoal):
 1. poly_tuple_eval fs as ! j \<in> carrier R
[PROOF STEP]
have 1: "(fs!j) \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fs ! j \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
using assms is_poly_tupleE
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
as \<in> carrier (R\<^bsup>n\<^esup>)
j < m
\<lbrakk>is_poly_tuple ?n ?fs; ?j < length ?fs\<rbrakk> \<Longrightarrow> ?fs ! ?j \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])

goal (1 subgoal):
 1. fs ! j \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fs ! j \<in> carrier (R [\<X>\<^bsub>n\<^esub>])

goal (1 subgoal):
 1. poly_tuple_eval fs as ! j \<in> carrier R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_tuple_eval fs as ! j \<in> carrier R
[PROOF STEP]
using assms 0 1 eval_at_point_closed
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
as \<in> carrier (R\<^bsup>n\<^esup>)
j < m
poly_tuple_eval fs as ! j = eval_at_point R as (fs ! j)
fs ! j \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
\<lbrakk>?a \<in> carrier (R\<^bsup>?n\<^esup>); ?p \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> eval_at_point R ?a ?p \<in> carrier R

goal (1 subgoal):
 1. poly_tuple_eval fs as ! j \<in> carrier R
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
poly_tuple_eval fs as ! j \<in> carrier R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding) indRelRT_iff_exists_source_target_relation:
  fixes Pred :: "(('procS, 'procT) Proc \<times> ('procS, 'procT) Proc) \<Rightarrow> bool"
  shows "(\<forall>TRel. (\<forall>(TP, TQ) \<in> TRel. Pred (TargetTerm TP, TargetTerm TQ))
          \<longleftrightarrow> (\<forall>(P, Q) \<in> indRelRT TRel. Pred (P, Q)))
         = (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> (\<forall>(P, Q) \<in> Rel. Pred (P, Q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>TRel. (\<forall>(TP, TQ)\<in>TRel. Pred (TargetTerm TP, TargetTerm TQ)) = (\<forall>(P, Q)\<in>indRelRT TRel. Pred (P, Q))) = (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> (\<forall>(P, Q)\<in>Rel. Pred (P, Q)))
[PROOF STEP]
using indRelR_iff_exists_source_target_relation[where Pred="Pred"]
            indRelR_modulo_pred_impl_indRelRT_modulo_pred[where Pred="Pred"]
[PROOF STATE]
proof (prove)
using this:
(\<forall>(P, Q)\<in>indRelR. Pred (P, Q)) = (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> (\<forall>(P, Q)\<in>Rel. Pred (P, Q)))
(\<forall>(P, Q)\<in>indRelR. Pred (P, Q)) = (\<forall>TRel. (\<forall>(TP, TQ)\<in>TRel. Pred (TargetTerm TP, TargetTerm TQ)) = (\<forall>(P, Q)\<in>indRelRT TRel. Pred (P, Q)))

goal (1 subgoal):
 1. (\<forall>TRel. (\<forall>(TP, TQ)\<in>TRel. Pred (TargetTerm TP, TargetTerm TQ)) = (\<forall>(P, Q)\<in>indRelRT TRel. Pred (P, Q))) = (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> (\<forall>(P, Q)\<in>Rel. Pred (P, Q)))
[PROOF STEP]
by simp


[STATEMENT]
lemma  vec_hom_zero_iff[simp]: "(map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
assume i: "i < n" "dim_vec x = n"
[PROOF STATE]
proof (state)
this:
i < n
dim_vec x = n

goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
hence "map_vec hom x $ i = 0 \<longleftrightarrow> x $ i = 0"
[PROOF STATE]
proof (prove)
using this:
i < n
dim_vec x = n

goal (1 subgoal):
 1. (map_vec hom x $ i = (0::'b)) = (x $ i = (0::'a))
[PROOF STEP]
using index_map_vec(1)[of i x]
[PROOF STATE]
proof (prove)
using this:
i < n
dim_vec x = n
i < dim_vec x \<Longrightarrow> map_vec ?f x $ i = ?f (x $ i)

goal (1 subgoal):
 1. (map_vec hom x $ i = (0::'b)) = (x $ i = (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(map_vec hom x $ i = (0::'b)) = (x $ i = (0::'a))

goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; dim_vec x = n\<rbrakk> \<Longrightarrow> (map_vec hom x $ ?i2 = (0::'b)) = (x $ ?i2 = (0::'a))

goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
note main = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; dim_vec x = n\<rbrakk> \<Longrightarrow> (map_vec hom x $ ?i2 = (0::'b)) = (x $ ?i2 = (0::'a))

goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim_vec (map_vec hom x) = dim_vec (0\<^sub>v n) \<and> (\<forall>i<dim_vec (0\<^sub>v n). map_vec hom x $ i = 0\<^sub>v n $ i)) = (dim_vec x = dim_vec (0\<^sub>v n) \<and> (\<forall>i<dim_vec (0\<^sub>v n). x $ i = 0\<^sub>v n $ i))
[PROOF STEP]
by (simp, insert main, auto)
[PROOF STATE]
proof (state)
this:
(map_vec hom x = 0\<^sub>v n) = (x = 0\<^sub>v n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma img_digit_of_nat:
\<open>n < 10 \<Longrightarrow> digit_of_nat n \<in> {CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'',
                              CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < 10 \<Longrightarrow> digit_of_nat n \<in> {CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'', CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}
[PROOF STEP]
by(simp add:nat_of_digit_def digit_of_nat_def)


[STATEMENT]
lemma int_of_real_1[simp]: "int_of_real (1::real) = (1::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_real 1 = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int_of_real 1 = 1
[PROOF STEP]
have 1: "(1::real) = real_of_int (1::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = real_of_int 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 = real_of_int 1

goal (1 subgoal):
 1. int_of_real 1 = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_real 1 = 1
[PROOF STEP]
by (simp only: 1 int_of_real_real)
[PROOF STATE]
proof (state)
this:
int_of_real 1 = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma composition_enum_length: "length (weak_integer_composition_enum i n) = n multichoose i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (weak_integer_composition_enum i n) = n multichoose i
[PROOF STEP]
unfolding multichoose_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (weak_integer_composition_enum i n) = n + i - 1 choose i
[PROOF STEP]
proof(induct i n rule: weak_integer_composition_enum.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i. length (weak_integer_composition_enum i 0) = 0 + i - 1 choose i
 2. \<And>i. length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i
 3. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
case (1 i)
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>i. length (weak_integer_composition_enum i 0) = 0 + i - 1 choose i
 2. \<And>i. length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i
 3. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (weak_integer_composition_enum i 0) = 0 + i - 1 choose i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (weak_integer_composition_enum i 0) = 0 + i - 1 choose i

goal (2 subgoals):
 1. \<And>i. length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i
 2. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i
 2. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
case (2 i)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i. length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i
 2. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (weak_integer_composition_enum i (Suc 0)) = Suc 0 + i - 1 choose i

goal (1 subgoal):
 1. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
case (3 i n)
[PROOF STATE]
proof (state)
this:
?x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc (Suc n) - 1)) = Suc (Suc n) - 1 + (i - ?x) - 1 choose (i - ?x)

goal (1 subgoal):
 1. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc (Suc n) - 1)) = Suc (Suc n) - 1 + (i - ?x) - 1 choose (i - ?x)
[PROOF STEP]
have "x \<in> set [0..< i] \<Longrightarrow>
    length (weak_integer_composition_enum (i - x) (Suc n)) = n + (i - x) choose (i - x)" for x
[PROOF STATE]
proof (prove)
using this:
?x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc (Suc n) - 1)) = Suc (Suc n) - 1 + (i - ?x) - 1 choose (i - ?x)

goal (1 subgoal):
 1. x \<in> set [0..<i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc n)) = n + (i - x) choose (i - x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x \<in> set [0..<i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc n)) = n + (i - ?x) choose (i - ?x)

goal (1 subgoal):
 1. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set [0..<i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc n)) = n + (i - ?x) choose (i - ?x)
[PROOF STEP]
have ev: "length [h#r . h \<leftarrow> [0..< i], r \<leftarrow> weak_integer_composition_enum (i-h) (Suc n)] =
     (\<Sum>x\<leftarrow>[0..< i]. n + (i - x) choose (i - x))"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set [0..<i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc n)) = n + (i - ?x) choose (i - ?x)

goal (1 subgoal):
 1. length (concat (map (\<lambda>h. map ((#) h) (weak_integer_composition_enum (i - h) (Suc n))) [0..<i])) = (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x))
[PROOF STEP]
using length_concat_map_function_sum_list [of
      "[0..< i]"
      "\<lambda>x. (weak_integer_composition_enum (i-x) (Suc n))"
      "\<lambda>x. n + (i-x) choose (i-x)"
      "\<lambda>h r. h#r"
      ]
[PROOF STATE]
proof (prove)
using this:
?x \<in> set [0..<i] \<Longrightarrow> length (weak_integer_composition_enum (i - ?x) (Suc n)) = n + (i - ?x) choose (i - ?x)
(\<And>x. x \<in> set [0..<i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc n)) = n + (i - x) choose (i - x)) \<Longrightarrow> length (concat (map (\<lambda>x. map ((#) x) (weak_integer_composition_enum (i - x) (Suc n))) [0..<i])) = (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x))

goal (1 subgoal):
 1. length (concat (map (\<lambda>h. map ((#) h) (weak_integer_composition_enum (i - h) (Suc n))) [0..<i])) = (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (concat (map (\<lambda>h. map ((#) h) (weak_integer_composition_enum (i - h) (Suc n))) [0..<i])) = (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x))

goal (1 subgoal):
 1. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
have "Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i
[PROOF STEP]
using a_choose_equivalence
[PROOF STATE]
proof (prove)
using this:
Suc (\<Sum>x\<leftarrow>[0..<?k]. ?n + (?k - x) choose (?k - x)) = Suc (?n + ?k) choose ?k

goal (1 subgoal):
 1. Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i

goal (1 subgoal):
 1. \<And>i va. (\<And>x. x \<in> set [0..<Suc i] \<Longrightarrow> length (weak_integer_composition_enum (i - x) (Suc (Suc va) - 1)) = Suc (Suc va) - 1 + (i - x) - 1 choose (i - x)) \<Longrightarrow> length (weak_integer_composition_enum i (Suc (Suc va))) = Suc (Suc va) + i - 1 choose i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i

goal (1 subgoal):
 1. length (weak_integer_composition_enum i (Suc (Suc n))) = Suc (Suc n) + i - 1 choose i
[PROOF STEP]
using weak_integer_composition_enum_zero ev
[PROOF STATE]
proof (prove)
using this:
Suc (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x)) = Suc (n + i) choose i
length (weak_integer_composition_enum 0 (Suc ?n)) = 1
length (concat (map (\<lambda>h. map ((#) h) (weak_integer_composition_enum (i - h) (Suc n))) [0..<i])) = (\<Sum>x\<leftarrow>[0..<i]. n + (i - x) choose (i - x))

goal (1 subgoal):
 1. length (weak_integer_composition_enum i (Suc (Suc n))) = Suc (Suc n) + i - 1 choose i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (weak_integer_composition_enum i (Suc (Suc n))) = Suc (Suc n) + i - 1 choose i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Bseq_add_iff: "Bseq (\<lambda>x. f x + c) \<longleftrightarrow> Bseq f"
  for f :: "nat \<Rightarrow> 'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c) = Bseq f
[PROOF STEP]
using Bseq_add[of f c] Bseq_add[of "\<lambda>x. f x + c" "-c"]
[PROOF STATE]
proof (prove)
using this:
Bseq f \<Longrightarrow> Bseq (\<lambda>x. f x + c)
Bseq (\<lambda>x. f x + c) \<Longrightarrow> Bseq (\<lambda>x. f x + c + - c)

goal (1 subgoal):
 1. Bseq (\<lambda>x. f x + c) = Bseq f
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_Inf_Sup: "\<Sqinter>(Sup ` A) \<le> \<Squnion>(Inf ` {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> (Sup ` A) \<le> \<Squnion> (Inf ` {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y})
[PROOF STEP]
proof (rule finite_induct [of A "\<lambda>A. \<Sqinter>(Sup ` A) \<le> \<Squnion>(Inf ` {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y})"], simp_all add: finite_UnionD)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
fix x::"'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
fix F
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
assume "x \<notin> F"
[PROOF STATE]
proof (state)
this:
x \<notin> F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
have [simp]: "{\<Squnion>x \<sqinter> b |b . b \<in> Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y} } = {\<Squnion>x \<sqinter> (Inf (f ` F)) |f  . (\<forall>Y\<in>F. f Y \<in> Y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<Squnion> x \<sqinter> b |b. b \<in> Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y}} = {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{\<Squnion> x \<sqinter> b |b. b \<in> Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y}} = {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
define fa where "fa = (\<lambda> (b::'a) f Y . (if Y = x then b else f Y))"
[PROOF STATE]
proof (state)
this:
fa = (\<lambda>b f Y. if Y = x then b else f Y)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
have "\<And>f b. \<forall>Y\<in>F. f Y \<in> Y \<Longrightarrow> b \<in> x \<Longrightarrow> insert b (f ` (F \<inter> {Y. Y \<noteq> x})) = insert (fa b f x) (fa b f ` F) \<and> fa b f x \<in> x \<and> (\<forall>Y\<in>F. fa b f Y \<in> Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> insert b (f ` (F \<inter> {Y. Y \<noteq> x})) = insert (fa b f x) (fa b f ` F) \<and> fa b f x \<in> x \<and> (\<forall>Y\<in>F. fa b f Y \<in> Y)
[PROOF STEP]
by (auto simp add: fa_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>Y\<in>F. ?f Y \<in> Y; ?b \<in> x\<rbrakk> \<Longrightarrow> insert ?b (?f ` (F \<inter> {Y. Y \<noteq> x})) = insert (fa ?b ?f x) (fa ?b ?f ` F) \<and> fa ?b ?f x \<in> x \<and> (\<forall>Y\<in>F. fa ?b ?f Y \<in> Y)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>Y\<in>F. ?f Y \<in> Y; ?b \<in> x\<rbrakk> \<Longrightarrow> insert ?b (?f ` (F \<inter> {Y. Y \<noteq> x})) = insert (fa ?b ?f x) (fa ?b ?f ` F) \<and> fa ?b ?f x \<in> x \<and> (\<forall>Y\<in>F. fa ?b ?f Y \<in> Y)
[PROOF STEP]
have B: "\<And>f b. \<forall>Y\<in>F. f Y \<in> Y \<Longrightarrow> b \<in> x \<Longrightarrow> fa b f ` ({x} \<union> F) \<in> {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>Y\<in>F. ?f Y \<in> Y; ?b \<in> x\<rbrakk> \<Longrightarrow> insert ?b (?f ` (F \<inter> {Y. Y \<noteq> x})) = insert (fa ?b ?f x) (fa ?b ?f ` F) \<and> fa ?b ?f x \<in> x \<and> (\<forall>Y\<in>F. fa ?b ?f Y \<in> Y)

goal (1 subgoal):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> fa b f ` ({x} \<union> F) \<in> {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>Y\<in>F. ?f Y \<in> Y; ?b \<in> x\<rbrakk> \<Longrightarrow> fa ?b ?f ` ({x} \<union> F) \<in> {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
have [simp]: "\<And>f b. \<forall>Y\<in>F. f Y \<in> Y \<Longrightarrow> b \<in> x \<Longrightarrow> b \<sqinter> (\<Sqinter>x\<in>F. f x)  \<le> \<Squnion>(Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> b \<sqinter> \<Sqinter> (f ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>Y\<in>F. ?f Y \<in> Y; ?b \<in> x\<rbrakk> \<Longrightarrow> fa ?b ?f ` ({x} \<union> F) \<in> {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)}

goal (1 subgoal):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> b \<sqinter> \<Sqinter> (f ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
apply (rule SUP_upper2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> \<forall>Y\<in>F. ?f1 f b Y \<in> Y
 2. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> ?b1 f b \<in> x
 3. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> b \<sqinter> \<Sqinter> (f ` F) \<le> \<Sqinter> (fa (?b1 f b) (?f1 f b) ` ({x} \<union> F))
[PROOF STEP]
using \<open>x \<notin> F\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> F

goal (3 subgoals):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> \<forall>Y\<in>F. ?f1 f b Y \<in> Y
 2. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> ?b1 f b \<in> x
 3. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> b \<sqinter> \<Sqinter> (f ` F) \<le> \<Sqinter> (fa (?b1 f b) (?f1 f b) ` ({x} \<union> F))
[PROOF STEP]
apply (simp_all add: fa_def Inf_union_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x; x \<notin> F\<rbrakk> \<Longrightarrow> b \<sqinter> \<Sqinter> (f ` F) \<le> b \<and> b \<sqinter> \<Sqinter> (f ` F) \<le> \<Sqinter> (f ` (F \<inter> {xa. xa \<noteq> x}))
[PROOF STEP]
apply (simp add: image_mono Inf_superset_mono inf.coboundedI2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>Y\<in>F. ?f Y \<in> Y; ?b \<in> x\<rbrakk> \<Longrightarrow> ?b \<sqinter> \<Sqinter> (?f ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
assume "\<Sqinter>(Sup ` F) \<le> \<Squnion>(Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})"
[PROOF STATE]
proof (state)
this:
\<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})
[PROOF STEP]
have "\<Squnion>x \<sqinter> \<Sqinter>(Sup ` F) \<le> \<Squnion>x \<sqinter> \<Squnion>(Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})"
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})

goal (1 subgoal):
 1. \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})
[PROOF STEP]
using inf.coboundedI2
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})
?b \<le> ?c \<Longrightarrow> ?a \<sqinter> ?b \<le> ?c

goal (1 subgoal):
 1. \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
have "... = Sup {\<Squnion>x \<sqinter> (Inf (f ` F)) |f  .  (\<forall>Y\<in>F. f Y \<in> Y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y}) = \<Squnion> {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y}
[PROOF STEP]
by (simp add: finite_inf_Sup)
[PROOF STATE]
proof (state)
this:
\<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y}) = \<Squnion> {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion> x \<sqinter> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y}) = \<Squnion> {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
have "... = Sup {Sup {Inf (f ` F) \<sqinter> b | b . b \<in> x} |f  .  (\<forall>Y\<in>F. f Y \<in> Y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y} = \<Squnion> {\<Squnion> {\<Sqinter> (f ` F) \<sqinter> b |b. b \<in> x} |f. \<forall>Y\<in>F. f Y \<in> Y}
[PROOF STEP]
by (subst inf_commute) (simp add: finite_inf_Sup)
[PROOF STATE]
proof (state)
this:
\<Squnion> {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y} = \<Squnion> {\<Squnion> {\<Sqinter> (f ` F) \<sqinter> b |b. b \<in> x} |f. \<forall>Y\<in>F. f Y \<in> Y}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion> {\<Squnion> x \<sqinter> \<Sqinter> (f ` F) |f. \<forall>Y\<in>F. f Y \<in> Y} = \<Squnion> {\<Squnion> {\<Sqinter> (f ` F) \<sqinter> b |b. b \<in> x} |f. \<forall>Y\<in>F. f Y \<in> Y}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
have "... \<le> \<Squnion>(Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {\<Squnion> {\<Sqinter> (f ` F) \<sqinter> b |b. b \<in> x} |f. \<forall>Y\<in>F. f Y \<in> Y} \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
apply (rule Sup_least, clarsimp)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f b. \<lbrakk>\<forall>Y\<in>F. f Y \<in> Y; b \<in> x\<rbrakk> \<Longrightarrow> \<Sqinter> (f ` F) \<sqinter> b \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
apply (subst inf_commute, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<Squnion> {\<Squnion> {\<Sqinter> (f ` F) \<sqinter> b |b. b \<in> x} |f. \<forall>Y\<in>F. f Y \<in> Y} \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>x \<notin> F; \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {f ` F |f. \<forall>Y\<in>F. f Y \<in> Y})\<rbrakk> \<Longrightarrow> \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
show "\<Squnion>x \<sqinter> \<Sqinter>(Sup ` F) \<le> \<Squnion>(Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})"
[PROOF STATE]
proof (prove)
using this:
\<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})

goal (1 subgoal):
 1. \<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Squnion> x \<sqinter> \<Sqinter> (Sup ` F) \<le> \<Squnion> (Inf ` {insert (f x) (f ` F) |f. f x \<in> x \<and> (\<forall>Y\<in>F. f Y \<in> Y)})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma defloat_float_zerosign_round_finite:
  assumes threshold: "\<bar>x\<bar> < threshold TYPE(('e, 'f)float)"
  shows "is_finite (zerosign s (round To_nearest x::('e, 'f)float))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_finite (zerosign s (IEEE.round To_nearest x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_finite (zerosign s (IEEE.round To_nearest x))
[PROOF STEP]
have "(round To_nearest x::('e, 'f)float) =
      (closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x
[PROOF STEP]
using threshold
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < threshold TYPE(('e, 'f) IEEE.float)

goal (1 subgoal):
 1. IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x
[PROOF STEP]
by (metis (full_types) abs_less_iff leD le_minus_iff round.simps(1))
[PROOF STATE]
proof (state)
this:
IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x

goal (1 subgoal):
 1. is_finite (zerosign s (IEEE.round To_nearest x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x
[PROOF STEP]
have "is_finite (round To_nearest x::('e, 'f)float)"
[PROOF STATE]
proof (prove)
using this:
IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x

goal (1 subgoal):
 1. is_finite (IEEE.round To_nearest x)
[PROOF STEP]
by (metis is_finite_closest)
[PROOF STATE]
proof (state)
this:
is_finite (IEEE.round To_nearest x)

goal (1 subgoal):
 1. is_finite (zerosign s (IEEE.round To_nearest x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_finite (IEEE.round To_nearest x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_finite (IEEE.round To_nearest x)

goal (1 subgoal):
 1. is_finite (zerosign s (IEEE.round To_nearest x))
[PROOF STEP]
using is_finite_zerosign
[PROOF STATE]
proof (prove)
using this:
is_finite (IEEE.round To_nearest x)
is_finite (zerosign ?s ?a) = is_finite ?a

goal (1 subgoal):
 1. is_finite (zerosign s (IEEE.round To_nearest x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_finite (zerosign s (IEEE.round To_nearest x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dgrad_set_closed_lcs:
  assumes "dickson_grading d" and "s \<in> dgrad_set d m" and "t \<in> dgrad_set d m"
  shows "lcs s t \<in> dgrad_set d m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcs s t \<in> dgrad_set d m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lcs s t \<in> dgrad_set d m
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
dickson_grading d
[PROOF STEP]
have "d (lcs s t) \<le> ord_class.max (d s) (d t)"
[PROOF STATE]
proof (prove)
using this:
dickson_grading d

goal (1 subgoal):
 1. d (lcs s t) \<le> max (d s) (d t)
[PROOF STEP]
by (rule dickson_grading_lcs)
[PROOF STATE]
proof (state)
this:
d (lcs s t) \<le> max (d s) (d t)

goal (1 subgoal):
 1. lcs s t \<in> dgrad_set d m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d (lcs s t) \<le> max (d s) (d t)

goal (1 subgoal):
 1. lcs s t \<in> dgrad_set d m
[PROOF STEP]
from assms(2, 3)
[PROOF STATE]
proof (chain)
picking this:
s \<in> dgrad_set d m
t \<in> dgrad_set d m
[PROOF STEP]
have "... \<le> m"
[PROOF STATE]
proof (prove)
using this:
s \<in> dgrad_set d m
t \<in> dgrad_set d m

goal (1 subgoal):
 1. max (d s) (d t) \<le> m
[PROOF STEP]
by (simp add: dgrad_set_def)
[PROOF STATE]
proof (state)
this:
max (d s) (d t) \<le> m

goal (1 subgoal):
 1. lcs s t \<in> dgrad_set d m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d (lcs s t) \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d (lcs s t) \<le> m

goal (1 subgoal):
 1. lcs s t \<in> dgrad_set d m
[PROOF STEP]
by (simp add: dgrad_set_def)
[PROOF STATE]
proof (state)
this:
lcs s t \<in> dgrad_set d m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma 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)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_concat_simple f (k + l) = (i, j + l)
[PROOF STEP]
using jl
[PROOF STATE]
proof (prove)
using this:
j + l < f i

goal (1 subgoal):
 1. inf_concat_simple f (k + l) = (i, j + l)
[PROOF STEP]
proof (induct l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j + 0 < f i \<Longrightarrow> inf_concat_simple f (k + 0) = (i, j + 0)
 2. \<And>l. \<lbrakk>j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l); j + Suc l < f i\<rbrakk> \<Longrightarrow> inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
j + 0 < f i

goal (2 subgoals):
 1. j + 0 < f i \<Longrightarrow> inf_concat_simple f (k + 0) = (i, j + 0)
 2. \<And>l. \<lbrakk>j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l); j + Suc l < f i\<rbrakk> \<Longrightarrow> inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
j + 0 < f i

goal (1 subgoal):
 1. inf_concat_simple f (k + 0) = (i, j + 0)
[PROOF STEP]
using ck
[PROOF STATE]
proof (prove)
using this:
j + 0 < f i
inf_concat_simple f k = (i, j)

goal (1 subgoal):
 1. inf_concat_simple f (k + 0) = (i, j + 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inf_concat_simple f (k + 0) = (i, j + 0)

goal (1 subgoal):
 1. \<And>l. \<lbrakk>j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l); j + Suc l < f i\<rbrakk> \<Longrightarrow> inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l); j + Suc l < f i\<rbrakk> \<Longrightarrow> inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
case (Suc l)
[PROOF STATE]
proof (state)
this:
j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l)
j + Suc l < f i

goal (1 subgoal):
 1. \<And>l. \<lbrakk>j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l); j + Suc l < f i\<rbrakk> \<Longrightarrow> inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
hence c: "inf_concat_simple f (k + l) = (i, j+ l)"
[PROOF STATE]
proof (prove)
using this:
j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l)
j + Suc l < f i

goal (1 subgoal):
 1. inf_concat_simple f (k + l) = (i, j + l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inf_concat_simple f (k + l) = (i, j + l)

goal (1 subgoal):
 1. \<And>l. \<lbrakk>j + l < f i \<Longrightarrow> inf_concat_simple f (k + l) = (i, j + l); j + Suc l < f i\<rbrakk> \<Longrightarrow> inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_concat_simple f (k + Suc l) = (i, j + Suc l)
[PROOF STEP]
by (simp add: c, insert Suc(2), auto)
[PROOF STATE]
proof (state)
this:
inf_concat_simple f (k + Suc l) = (i, j + Suc l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W_2_ln_2 [simp]: "Lambert_W (2 * ln 2) = ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
have "-1 \<le> (0 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<le> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- 1 \<le> 0

goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- 1 \<le> 0

goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
have "\<dots> \<le> ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> ln 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> ln 2

goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- 1 \<le> ln 2
[PROOF STEP]
have "-1 \<le> (ln 2 :: real)"
[PROOF STATE]
proof (prove)
using this:
- 1 \<le> ln 2

goal (1 subgoal):
 1. - 1 \<le> ln 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- 1 \<le> ln 2

goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- 1 \<le> ln 2

goal (1 subgoal):
 1. Lambert_W (2 * ln 2) = ln 2
[PROOF STEP]
by (intro Lambert_W_eqI) auto
[PROOF STATE]
proof (state)
this:
Lambert_W (2 * ln 2) = ln 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Limit_vifunion_vsubset_VsetI:
  assumes "Limit \<alpha>" and "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> A i \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "(\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i) \<subseteq>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<subseteq>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
proof(intro vsubsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
assume "x \<in>\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i)"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I)
[PROOF STEP]
obtain i where i: "i \<in>\<^sub>\<circ> I" and "x \<in>\<^sub>\<circ> A i"
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in>\<^sub>\<circ> I; x \<in>\<^sub>\<circ> A i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in>\<^sub>\<circ> I
x \<in>\<^sub>\<circ> A i

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I A `\<^sub>\<circ> I) \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
with assms(1) assms(2)[OF i]
[PROOF STATE]
proof (chain)
picking this:
Limit \<alpha>
A i \<in>\<^sub>\<circ> Vset \<alpha>
i \<in>\<^sub>\<circ> I
x \<in>\<^sub>\<circ> A i
[PROOF STEP]
show "x \<in>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
using this:
Limit \<alpha>
A i \<in>\<^sub>\<circ> Vset \<alpha>
i \<in>\<^sub>\<circ> I
x \<in>\<^sub>\<circ> A i

goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> Vset \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jumpF_polyR_smult_1:
  "jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
proof (cases "c=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
 2. c \<noteq> 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
 2. c \<noteq> 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = 0

goal (1 subgoal):
 1. jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x
[PROOF STEP]
unfolding jumpF_polyR_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_right x) = sgn c * jumpF (\<lambda>x. poly q x / poly p x) (at_right x)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
c \<noteq> 0

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_right x) = sgn c * jumpF (\<lambda>x. poly q x / poly p x) (at_right x)
[PROOF STEP]
apply (subst jumpF_times[of "\<lambda>_. c",symmetric])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>c \<noteq> 0; c \<noteq> 0\<rbrakk> \<Longrightarrow> ((\<lambda>_. c) \<longlongrightarrow> c) (at_right x)
 2. \<lbrakk>c \<noteq> 0; c \<noteq> 0\<rbrakk> \<Longrightarrow> c \<noteq> 0
 3. \<lbrakk>c \<noteq> 0; c \<noteq> 0\<rbrakk> \<Longrightarrow> at_right x \<noteq> bot
 4. \<lbrakk>c \<noteq> 0; c \<noteq> 0\<rbrakk> \<Longrightarrow> jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_right x) = jumpF (\<lambda>x. c * (poly q x / poly p x)) (at_right x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyR (smult c q) p x = sgn c * jumpF_polyR q p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rk_singleton : "\<forall>P. rk {P} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. rk {P} = 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. rk {P} = 1
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. rk {P} = 1
[PROOF STEP]
have f1:"rk {P} \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {P} \<le> 1
[PROOF STEP]
by (metis One_nat_def card.empty card_Suc_eq insert_absorb insert_not_empty matroid_ax_1b)
[PROOF STATE]
proof (state)
this:
rk {P} \<le> 1

goal (1 subgoal):
 1. \<And>P. rk {P} = 1
[PROOF STEP]
have f2:"rk {P} \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> rk {P}
[PROOF STEP]
using rk_ax_singleton
[PROOF STATE]
proof (prove)
using this:
1 \<le> rk {?P}

goal (1 subgoal):
 1. 1 \<le> rk {P}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> rk {P}

goal (1 subgoal):
 1. \<And>P. rk {P} = 1
[PROOF STEP]
from f1 and f2
[PROOF STATE]
proof (chain)
picking this:
rk {P} \<le> 1
1 \<le> rk {P}
[PROOF STEP]
show "rk {P} = 1"
[PROOF STATE]
proof (prove)
using this:
rk {P} \<le> 1
1 \<le> rk {P}

goal (1 subgoal):
 1. rk {P} = 1
[PROOF STEP]
using antisym
[PROOF STATE]
proof (prove)
using this:
rk {P} \<le> 1
1 \<le> rk {P}
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. rk {P} = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rk {P} = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_present_eq_key: "distinct (map fst al) \<Longrightarrow> (k, v) \<in> set al \<longleftrightarrow> lookup (\<lambda>x. x=k) al = Some v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst al) \<Longrightarrow> ((k, v) \<in> set al) = (lookup (\<lambda>x. x = k) al = Some v)
[PROOF STEP]
by (induction al) (auto simp add: rev_image_eqI split: if_splits)


[STATEMENT]
lemma truncate_up_nonneg_iff[simp]: "truncate_up p x \<ge> 0 \<longleftrightarrow> x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> truncate_up p x) = (0 \<le> x)
[PROOF STEP]
using truncate_up_less_zero_iff[of p x] truncate_up_nonneg[of x]
[PROOF STATE]
proof (prove)
using this:
(truncate_up p x < 0) = (x < 0)
0 \<le> x \<Longrightarrow> 0 \<le> truncate_up ?p x

goal (1 subgoal):
 1. (0 \<le> truncate_up p x) = (0 \<le> x)
[PROOF STEP]
by linarith


[STATEMENT]
lemma (in complete_lattice) SUP_set_fold:
  "\<Squnion>(f ` set xs) = fold (sup \<circ> f) xs bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (f ` set xs) = fold ((\<squnion>) \<circ> f) xs \<bottom>
[PROOF STEP]
using Sup_set_fold [of "map f xs"]
[PROOF STATE]
proof (prove)
using this:
\<Squnion> set (map f xs) = fold (\<squnion>) (map f xs) \<bottom>

goal (1 subgoal):
 1. \<Squnion> (f ` set xs) = fold ((\<squnion>) \<circ> f) xs \<bottom>
[PROOF STEP]
by (simp add: fold_map)


[STATEMENT]
lemma degree_drop_2n:
assumes "degree f < 2*n"
shows "degree (drop_deg n f) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (drop_deg n f) < n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree f < 2 * n

goal (1 subgoal):
 1. degree (drop_deg n f) < n
[PROOF STEP]
unfolding degree_drop_n
[PROOF STATE]
proof (prove)
using this:
degree f < 2 * n

goal (1 subgoal):
 1. degree f - n < n
[PROOF STEP]
by auto


[STATEMENT]
lemma Partial_order_restrict_rel:
  assumes "Partial_order R"
  shows "Partial_order (restrict_rel A R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partial_order (restrict_rel A R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Partial_order (restrict_rel A R)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Partial_order R
[PROOF STEP]
have "Refl R"
[PROOF STATE]
proof (prove)
using this:
Partial_order R

goal (1 subgoal):
 1. Refl R
[PROOF STEP]
by(simp add: order_on_defs)
[PROOF STATE]
proof (state)
this:
Refl R

goal (1 subgoal):
 1. Partial_order (restrict_rel A R)
[PROOF STEP]
from Field_restrict_rel[OF this, of A] assms
[PROOF STATE]
proof (chain)
picking this:
Field (restrict_rel A R) = A \<inter> Field R
Partial_order R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Field (restrict_rel A R) = A \<inter> Field R
Partial_order R

goal (1 subgoal):
 1. Partial_order (restrict_rel A R)
[PROOF STEP]
by(simp add: order_on_defs trans_def antisym_def)
      (auto intro: FieldI1 FieldI2 intro!: refl_onI simp add: in_restrict_rel_iff elim: refl_onD)
[PROOF STATE]
proof (state)
this:
Partial_order (restrict_rel A R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma psi_ubound_3_2: "psi n \<le> 3/2 * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
have "(551 / 256) * ln 2 \<le> (551 / 256) * (16/23 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 551 / 256 * ln 2 \<le> 551 / 256 * (16 / 23)
[PROOF STEP]
by (intro mult_left_mono ln_2_le') auto
[PROOF STATE]
proof (state)
this:
551 / 256 * ln 2 \<le> 551 / 256 * (16 / 23)

goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
551 / 256 * ln 2 \<le> 551 / 256 * (16 / 23)

goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
have "\<dots> \<le> 3 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 551 / 256 * (16 / 23) \<le> 3 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
551 / 256 * (16 / 23) \<le> 3 / 2

goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
551 / 256 * ln 2 \<le> 3 / 2
[PROOF STEP]
have "551 / 256 * ln 2 \<le> 3/(2::real)"
[PROOF STATE]
proof (prove)
using this:
551 / 256 * ln 2 \<le> 3 / 2

goal (1 subgoal):
 1. 551 / 256 * ln 2 \<le> 3 / 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
551 / 256 * ln 2 \<le> 3 / 2

goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
with of_nat_0_le_iff mult_right_mono
[PROOF STATE]
proof (chain)
picking this:
(0::?'a) \<le> of_nat ?n
\<lbrakk>?a \<le> ?b; (0::?'a) \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?c \<le> ?b * ?c
551 / 256 * ln 2 \<le> 3 / 2
[PROOF STEP]
have "551 / 256 * ln 2 * n \<le> 3/2 * n"
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<le> of_nat ?n
\<lbrakk>?a \<le> ?b; (0::?'a) \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?c \<le> ?b * ?c
551 / 256 * ln 2 \<le> 3 / 2

goal (1 subgoal):
 1. 551 / 256 * ln 2 * real n \<le> 3 / 2 * real n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
551 / 256 * ln 2 * real n \<le> 3 / 2 * real n

goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
with psi_ubound_log[of "n"]
[PROOF STATE]
proof (chain)
picking this:
psi n \<le> 551 / 256 * ln 2 * real n
551 / 256 * ln 2 * real n \<le> 3 / 2 * real n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
psi n \<le> 551 / 256 * ln 2 * real n
551 / 256 * ln 2 * real n \<le> 3 / 2 * real n

goal (1 subgoal):
 1. psi n \<le> 3 / 2 * real n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
psi n \<le> 3 / 2 * real n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cancel_times_right: "b * (a::'a N) = c * a \<Longrightarrow> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * a = c * a \<Longrightarrow> b = c
[PROOF STEP]
apply (simp add: times_N_def Abs_N_inverse Rep_N_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> b = c
[PROOF STEP]
apply (subgoal_tac "Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a); Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))\<rbrakk> \<Longrightarrow> b = c
 2. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))
[PROOF STEP]
apply (drule drop_assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a)); True\<rbrakk> \<Longrightarrow> b = c
 2. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))
[PROOF STEP]
apply (simp add: Abs_N_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_N b = Rep_N c \<Longrightarrow> b = c
 2. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))
[PROOF STEP]
apply (subgoal_tac "Abs_N (Rep_N b) = Abs_N (Rep_N c)")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Rep_N b = Rep_N c; Abs_N (Rep_N b) = Abs_N (Rep_N c)\<rbrakk> \<Longrightarrow> b = c
 2. Rep_N b = Rep_N c \<Longrightarrow> Abs_N (Rep_N b) = Abs_N (Rep_N c)
 3. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))
[PROOF STEP]
apply (drule drop_assumption)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Abs_N (Rep_N b) = Abs_N (Rep_N c); True\<rbrakk> \<Longrightarrow> b = c
 2. Rep_N b = Rep_N c \<Longrightarrow> Abs_N (Rep_N b) = Abs_N (Rep_N c)
 3. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))
[PROOF STEP]
apply (simp add: Rep_N_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_N b = Rep_N c \<Longrightarrow> Abs_N (Rep_N b) = Abs_N (Rep_N c)
 2. Abs_N (Rep_N b + Rep_N a) = Abs_N (Rep_N c + Rep_N a) \<Longrightarrow> Rep_N (Abs_N (Rep_N b + Rep_N a)) = Rep_N (Abs_N (Rep_N c + Rep_N a))
[PROOF STEP]
by simp_all


[STATEMENT]
lemma mset_contains_eq: "(m \<in># M) = ({#m#}+(M-{#m#})=M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<in># M) = ({#m#} + (M - {#m#}) = M)
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. add_mset m (M - {#m#}) = M \<Longrightarrow> m \<in># M
[PROOF STEP]
assume "add_mset m (M - {#m#}) = M"
[PROOF STATE]
proof (state)
this:
add_mset m (M - {#m#}) = M

goal (1 subgoal):
 1. add_mset m (M - {#m#}) = M \<Longrightarrow> m \<in># M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
add_mset m (M - {#m#}) = M

goal (1 subgoal):
 1. add_mset m (M - {#m#}) = M \<Longrightarrow> m \<in># M
[PROOF STEP]
have "m \<in># {#m#} + (M - {#m#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in># {#m#} + (M - {#m#})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m \<in># {#m#} + (M - {#m#})

goal (1 subgoal):
 1. add_mset m (M - {#m#}) = M \<Longrightarrow> m \<in># M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
add_mset m (M - {#m#}) = M
m \<in># {#m#} + (M - {#m#})
[PROOF STEP]
show "m \<in># M"
[PROOF STATE]
proof (prove)
using this:
add_mset m (M - {#m#}) = M
m \<in># {#m#} + (M - {#m#})

goal (1 subgoal):
 1. m \<in># M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m \<in># M

goal:
No subgoals!
[PROOF STEP]
qed