[STATEMENT]
lemma iprev_eq: "
  \<lbrakk> iprev a I = iprev b I; \<exists>x\<in>I. x < a; \<exists>x\<in>I. x < b \<rbrakk> \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>iprev a I = iprev b I; \<exists>x\<in>I. x < a; \<exists>x\<in>I. x < b\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by (metis iprev_eq_if_neq_iMin not_less_iMin)


[STATEMENT]
lemma transpose_matrix_vector [simp]: "transpose A *v x = x v* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Cartesian_Product.transpose A *v x = x v* A
[PROOF STEP]
unfolding transpose_def vector_matrix_mult_def matrix_vector_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. \<Sum>j\<in>UNIV. (\<chi>i j. A $ j $ i) $ i $ j * x $ j) = (\<chi>j. \<Sum>i\<in>UNIV. A $ i $ j * x $ i)
[PROOF STEP]
by simp


[STATEMENT]
lemma stc_not_Infinitesimal: "stc(x) \<noteq> 0 \<Longrightarrow> x \<notin> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stc x \<noteq> 0 \<Longrightarrow> x \<notin> Infinitesimal
[PROOF STEP]
by (fast intro: stc_Infinitesimal)


[STATEMENT]
lemma Inf_inf_dual:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "Inf_dual f \<Longrightarrow> inf_dual f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_dual f \<Longrightarrow> inf_dual f
[PROOF STEP]
by (smt comp_eq_elim image_empty image_insert inf_Inf sup_Sup)


[STATEMENT]
lemma hyperpow_two: "\<And>r. (r::'a::monoid_mult star) pow (2::hypnat) = r * r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. r pow 2 = r * r
[PROOF STEP]
by transfer (rule power2_eq_square)


[STATEMENT]
lemma Gromov_hyperbolic_invariant_under_quasi_isometry_explicit':
  fixes f::"'a::geodesic_space \<Rightarrow> 'b::Gromov_hyperbolic_space"
  assumes "lambda C-quasi_isometry f"
  shows "Gromov_hyperbolic_subset (752 * lambda^3 * (C + deltaG(TYPE('b)))) (UNIV::('a set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV
[PROOF STEP]
interpret BS: Gromov_hyperbolic_space_geodesic "dist::('b Bonk_Schramm_extension \<Rightarrow> 'b Bonk_Schramm_extension \<Rightarrow> real)" "uniformity" "open" "(\<lambda>_. deltaG(TYPE('b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.Gromov_hyperbolic_space_geodesic dist uniformity open (\<lambda>_. deltaG TYPE('b))
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_hyperbolic_subset (deltaG TYPE('b)) UNIV
[PROOF STEP]
using Bonk_Schramm_extension_hyperbolic
[PROOF STATE]
proof (prove)
using this:
Gromov_hyperbolic_subset (deltaG TYPE(?'a)) UNIV

goal (1 subgoal):
 1. Gromov_hyperbolic_subset (deltaG TYPE('b)) UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV
[PROOF STEP]
have A: "(lambda * 1) (C * 1 + 0)-quasi_isometry_on UNIV (to_Bonk_Schramm_extension o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lambda * 1) (C * 1 + 0) -quasi_isometry (to_Bonk_Schramm_extension \<circ> f)
[PROOF STEP]
by (rule quasi_isometry_on_compose[OF assms, of _ _ UNIV])
       (auto simp add: isometry_quasi_isometry_on[OF to_Bonk_Schramm_extension_isometry])
[PROOF STATE]
proof (state)
this:
(lambda * 1) (C * 1 + 0) -quasi_isometry (to_Bonk_Schramm_extension \<circ> f)

goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV
[PROOF STEP]
have *: "deltaG(TYPE('b)) = deltaG(TYPE('b Bonk_Schramm_extension))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deltaG TYPE('b) = deltaG TYPE('b Bonk_Schramm_extension)
[PROOF STEP]
by (simp add: deltaG_Bonk_Schramm_extension_def)
[PROOF STATE]
proof (state)
this:
deltaG TYPE('b) = deltaG TYPE('b Bonk_Schramm_extension)

goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b Bonk_Schramm_extension))) UNIV
[PROOF STEP]
apply (rule Gromov_hyperbolic_invariant_under_quasi_isometry_explicit[of _ _ "to_Bonk_Schramm_extension o f"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda C -quasi_isometry (to_Bonk_Schramm_extension \<circ> f)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
(lambda * 1) (C * 1 + 0) -quasi_isometry (to_Bonk_Schramm_extension \<circ> f)

goal (1 subgoal):
 1. lambda C -quasi_isometry (to_Bonk_Schramm_extension \<circ> f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_not_div_choose:
  assumes "k < K" and "k \<le> n"
      and eeq: "\<And>j. \<lbrakk>0<j; j<K\<rbrakk> \<Longrightarrow> multiplicity p (n - k + (K - j)) = multiplicity p (K - j)" "prime p"
    shows "multiplicity p (n choose k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (n choose k) = 0
[PROOF STEP]
apply (rule p_not_div_choose_lemma [of K p "n-k" k, simplified assms nat_minus_add_max max_absorb1])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. Suc i < K \<Longrightarrow> multiplicity p (Suc i) = multiplicity p (Suc (n - k + i))
 2. True
 3. True
[PROOF STEP]
apply (metis add_Suc_right eeq diff_diff_cancel order_less_imp_le zero_less_Suc zero_less_diff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. True
 2. True
[PROOF STEP]
apply (rule TrueI)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem perron_frobenius_nonneg: fixes A :: "real Matrix.mat"
  assumes A: "A \<in> carrier_mat n n" and pos: "nonneg_mat A" and n: "n \<noteq> 0"
  shows "\<exists> sr ks f.
    sr \<ge> 0 \<and>
    0 \<notin> set ks \<and> ks \<noteq> [] \<and>
    char_poly A = prod_list (map (\<lambda> k. monom 1 k - [:sr ^ k:]) ks) * f \<and>
    (\<forall> x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
define p where "p = (\<lambda> sr k. monom 1 k - [: (sr :: real) ^ k:])"
[PROOF STATE]
proof (state)
this:
p = (\<lambda>sr k. monom 1 k - [:sr ^ k:])

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?small = "\<lambda> f sr. (\<forall> x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?wit = "\<lambda> A sr ks f. sr \<ge> 0 \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and>
    char_poly A = prod_list (map (p sr) ks) * f \<and> ?small f sr"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?c = "complex_of_real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
interpret c: field_hom ?c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field_hom complex_of_real
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
interpret p: map_poly_inj_idom_divide_hom ?c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_inj_idom_divide_hom complex_of_real
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have map_p: "map_poly ?c (p sr k) = (monom 1 k - [:?c sr^k:])" for sr k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real (p sr k) = monom 1 k - [:complex_of_real sr ^ k:]
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real (monom 1 k - [:sr ^ k:]) = monom 1 k - [:complex_of_real sr ^ k:]
[PROOF STEP]
by (simp add:  hom_distribs)
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real (p ?sr ?k) = monom 1 ?k - [:complex_of_real ?sr ^ ?k:]

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real (p ?sr ?k) = monom 1 ?k - [:complex_of_real ?sr ^ ?k:]

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
fix k x sr
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
assume 0: "poly (map_poly ?c (p sr k)) x = 0" and k: "k \<noteq> 0" and sr: "sr \<ge> 0"
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (p sr k)) x = 0
k \<noteq> 0
0 \<le> sr

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note 0
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (p sr k)) x = 0

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (p sr k)) x = 0

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note map_p
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real (p ?sr ?k) = monom 1 ?k - [:complex_of_real ?sr ^ ?k:]

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0
[PROOF STEP]
have "x^k = (?c sr)^k"
[PROOF STATE]
proof (prove)
using this:
poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0

goal (1 subgoal):
 1. x ^ k = complex_of_real sr ^ k
[PROOF STEP]
by (simp add: poly_monom)
[PROOF STATE]
proof (state)
this:
x ^ k = complex_of_real sr ^ k

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from arg_cong[OF this, of "\<lambda> c. root k (cmod c)", unfolded norm_power] k
[PROOF STATE]
proof (chain)
picking this:
root k (cmod x ^ k) = root k (cmod (complex_of_real sr) ^ k)
k \<noteq> 0
[PROOF STEP]
have "cmod x = cmod (?c sr)"
[PROOF STATE]
proof (prove)
using this:
root k (cmod x ^ k) = root k (cmod (complex_of_real sr) ^ k)
k \<noteq> 0

goal (1 subgoal):
 1. cmod x = cmod (complex_of_real sr)
[PROOF STEP]
using real_root_pos2
[PROOF STATE]
proof (prove)
using this:
root k (cmod x ^ k) = root k (cmod (complex_of_real sr) ^ k)
k \<noteq> 0
\<lbrakk>0 < ?n; 0 \<le> ?x\<rbrakk> \<Longrightarrow> root ?n (?x ^ ?n) = ?x

goal (1 subgoal):
 1. cmod x = cmod (complex_of_real sr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod x = cmod (complex_of_real sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod x = cmod (complex_of_real sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "\<dots> = sr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real sr) = sr
[PROOF STEP]
using sr
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr

goal (1 subgoal):
 1. cmod (complex_of_real sr) = sr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real sr) = sr

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod x = sr
[PROOF STEP]
have "cmod x = sr"
[PROOF STATE]
proof (prove)
using this:
cmod x = sr

goal (1 subgoal):
 1. cmod x = sr
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod x = sr

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>poly (map_poly complex_of_real (p ?sr2 ?k2)) ?x2 = 0; ?k2 \<noteq> 0; 0 \<le> ?sr2\<rbrakk> \<Longrightarrow> cmod ?x2 = ?sr2

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note p_conv = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>poly (map_poly complex_of_real (p ?sr2 ?k2)) ?x2 = 0; ?k2 \<noteq> 0; 0 \<le> ?sr2\<rbrakk> \<Longrightarrow> cmod ?x2 = ?sr2

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "\<exists> sr ks f. ?wit A sr ks f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
using A pos n
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
nonneg_mat A
n \<noteq> 0

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
proof (induct n arbitrary: A rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
case (less n A)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < n; ?A \<in> carrier_mat ?y ?y; nonneg_mat ?A; ?y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly ?A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
A \<in> carrier_mat n n
nonneg_mat A
n \<noteq> 0

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note pos = less(3)
[PROOF STATE]
proof (state)
this:
nonneg_mat A

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note A = less(2)
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note IH = less(1)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < n; ?A \<in> carrier_mat ?y ?y; nonneg_mat ?A; ?y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly ?A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
note n = less(4)
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
consider (1) "n = 1"
      | (irr) "irreducible_mat A"
      | (red) "\<not> irreducible_mat A" "n > 1"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>n = 1 \<Longrightarrow> thesis; irreducible_mat A \<Longrightarrow> thesis; \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = 1 \<Longrightarrow> ?thesis; irreducible_mat A \<Longrightarrow> ?thesis; \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>\<And>y A. \<lbrakk>y < x; A \<in> carrier_mat y y; nonneg_mat A; y \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr); A \<in> carrier_mat x x; nonneg_mat A; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
thus "\<exists> sr ks f. ?wit A sr ks f"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = 1 \<Longrightarrow> ?thesis; irreducible_mat A \<Longrightarrow> ?thesis; \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. irreducible_mat A \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
case irr
[PROOF STATE]
proof (state)
this:
irreducible_mat A

goal (3 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. irreducible_mat A \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from perron_frobenius_irreducible(3,6)[OF A n pos irr refl refl]
[PROOF STATE]
proof (chain)
picking this:
0 < Spectral_Radius.spectral_radius (of_real_hom.mat_hom A)
\<exists>k f. k \<noteq> 0 \<and> k \<le> n \<and> char_poly A = (monom 1 k - [:Spectral_Radius.spectral_radius (of_real_hom.mat_hom A) ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < Spectral_Radius.spectral_radius (of_real_hom.mat_hom A))
[PROOF STEP]
obtain sr k f where
        *: "sr > 0" "k \<noteq> 0" "char_poly A = p sr k * f" "?small f sr"
[PROOF STATE]
proof (prove)
using this:
0 < Spectral_Radius.spectral_radius (of_real_hom.mat_hom A)
\<exists>k f. k \<noteq> 0 \<and> k \<le> n \<and> char_poly A = (monom 1 k - [:Spectral_Radius.spectral_radius (of_real_hom.mat_hom A) ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < Spectral_Radius.spectral_radius (of_real_hom.mat_hom A))

goal (1 subgoal):
 1. (\<And>sr k f. \<lbrakk>0 < sr; k \<noteq> 0; char_poly A = p sr k * f; \<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
0 < Spectral_Radius.spectral_radius (of_real_hom.mat_hom A)
\<exists>k f. k \<noteq> 0 \<and> k \<le> n \<and> char_poly A = (monom 1 k - [:Spectral_Radius.spectral_radius (of_real_hom.mat_hom A) ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < Spectral_Radius.spectral_radius (of_real_hom.mat_hom A))

goal (1 subgoal):
 1. (\<And>sr k f. \<lbrakk>0 < sr; k \<noteq> 0; char_poly A = (monom 1 k - [:sr ^ k:]) * f; \<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < sr
k \<noteq> 0
char_poly A = p sr k * f
\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr

goal (3 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. irreducible_mat A \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
hence "?wit A sr [k] f"
[PROOF STATE]
proof (prove)
using this:
0 < sr
k \<noteq> 0
char_poly A = p sr k * f
\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr

goal (1 subgoal):
 1. 0 \<le> sr \<and> 0 \<notin> set [k] \<and> [k] \<noteq> [] \<and> char_poly A = prod_list (map (p sr) [k]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> sr \<and> 0 \<notin> set [k] \<and> [k] \<noteq> [] \<and> char_poly A = prod_list (map (p sr) [k]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (3 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. irreducible_mat A \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr \<and> 0 \<notin> set [k] \<and> [k] \<noteq> [] \<and> char_poly A = prod_list (map (p sr) [k]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
case red
[PROOF STATE]
proof (state)
this:
\<not> irreducible_mat A
1 < n

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from non_irreducible_nonneg_mat_split[OF A pos red]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n1 n2 A1 A2. char_poly A = char_poly A1 * char_poly A2 \<and> nonneg_mat A1 \<and> nonneg_mat A2 \<and> A1 \<in> carrier_mat n1 n1 \<and> A2 \<in> carrier_mat n2 n2 \<and> 0 < n1 \<and> n1 < n \<and> 0 < n2 \<and> n2 < n \<and> n1 + n2 = n
[PROOF STEP]
obtain n1 n2 A1 A2
        where char:  "char_poly A = char_poly A1 * char_poly A2"
          and pos: "nonneg_mat A1" "nonneg_mat A2"
          and A: "A1 \<in> carrier_mat n1 n1" "A2 \<in> carrier_mat n2 n2"
          and n: "n1 < n" "n2 < n"
          and n0: "n1 \<noteq> 0" "n2 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>n1 n2 A1 A2. char_poly A = char_poly A1 * char_poly A2 \<and> nonneg_mat A1 \<and> nonneg_mat A2 \<and> A1 \<in> carrier_mat n1 n1 \<and> A2 \<in> carrier_mat n2 n2 \<and> 0 < n1 \<and> n1 < n \<and> 0 < n2 \<and> n2 < n \<and> n1 + n2 = n

goal (1 subgoal):
 1. (\<And>A1 A2 n1 n2. \<lbrakk>char_poly A = char_poly A1 * char_poly A2; nonneg_mat A1; nonneg_mat A2; A1 \<in> carrier_mat n1 n1; A2 \<in> carrier_mat n2 n2; n1 < n; n2 < n; n1 \<noteq> 0; n2 \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_poly A = char_poly A1 * char_poly A2
nonneg_mat A1
nonneg_mat A2
A1 \<in> carrier_mat n1 n1
A2 \<in> carrier_mat n2 n2
n1 < n
n2 < n
n1 \<noteq> 0
n2 \<noteq> 0

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from IH[OF n(1) A(1) pos(1) n0(1)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
obtain sr1 ks1 f1 where 1: "?wit A1 sr1 ks1 f1"
[PROOF STATE]
proof (prove)
using this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. (\<And>sr1 ks1 f1. 0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from IH[OF n(2) A(2) pos(2) n0(2)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
obtain sr2 ks2 f2 where 2: "?wit A2 sr2 ks2 f2"
[PROOF STATE]
proof (prove)
using this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. (\<And>sr2 ks2 f2. 0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "\<exists> A1 A2 sr1 ks1 f1 sr2 ks2 f2. ?wit A1 sr1 ks1 f1 \<and> ?wit A2 sr2 ks2 f2 \<and>
         sr1 \<ge> sr2 \<and> char_poly A = char_poly A1 * char_poly A2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
proof (cases "sr1 \<ge> sr2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
 2. \<not> sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
sr2 \<le> sr1

goal (2 subgoals):
 1. sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
 2. \<not> sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
unfolding char
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A1a A2a sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1a = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2a = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A1 * char_poly A2 = char_poly A1a * char_poly A2a
[PROOF STEP]
by (intro exI, rule conjI[OF 1 conjI[OF 2]], insert True, auto)
[PROOF STATE]
proof (state)
this:
\<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2

goal (1 subgoal):
 1. \<not> sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> sr2 \<le> sr1

goal (1 subgoal):
 1. \<not> sr2 \<le> sr1 \<Longrightarrow> \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
unfolding char
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A1a A2a sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1a = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2a = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A1 * char_poly A2 = char_poly A1a * char_poly A2a
[PROOF STEP]
by (intro exI, rule conjI[OF 2 conjI[OF 1]], insert False, auto)
[PROOF STATE]
proof (state)
this:
\<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2
[PROOF STEP]
obtain A1 A2 sr1 ks1 f1 sr2 ks2 f2 where
        1: "?wit A1 sr1 ks1 f1" and 2: "?wit A2 sr2 ks2 f2" and
        sr: "sr1 \<ge> sr2" and char: "char_poly A = char_poly A1 * char_poly A2"
[PROOF STATE]
proof (prove)
using this:
\<exists>A1 A2 sr1 ks1 f1 sr2 ks2 f2. (0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)) \<and> (0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)) \<and> sr2 \<le> sr1 \<and> char_poly A = char_poly A1 * char_poly A2

goal (1 subgoal):
 1. (\<And>sr1 ks1 A1 f1 sr2 ks2 A2 f2. \<lbrakk>0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1); 0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2); sr2 \<le> sr1; char_poly A = char_poly A1 * char_poly A2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 = prod_list (map (p sr1) ks1) * f1 \<and> (\<forall>x. poly (map_poly complex_of_real f1) x = 0 \<longrightarrow> cmod x < sr1)
0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)
sr2 \<le> sr1
char_poly A = char_poly A1 * char_poly A2

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. \<lbrakk>\<not> irreducible_mat A; 1 < n\<rbrakk> \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
proof (cases "sr1 = sr2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sr1 = sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
sr1 = sr2

goal (2 subgoals):
 1. sr1 = sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "?wit A sr2 (ks1 @ ks2) (f1 * f2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sr2 \<and> 0 \<notin> set (ks1 @ ks2) \<and> ks1 @ ks2 \<noteq> [] \<and> char_poly A = prod_list (map (p sr2) (ks1 @ ks2)) * (f1 * f2) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2)) x = 0 \<longrightarrow> cmod x < sr2)
[PROOF STEP]
unfolding char
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sr2 \<and> 0 \<notin> set (ks1 @ ks2) \<and> ks1 @ ks2 \<noteq> [] \<and> char_poly A1 * char_poly A2 = prod_list (map (p sr2) (ks1 @ ks2)) * (f1 * f2) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2)) x = 0 \<longrightarrow> cmod x < sr2)
[PROOF STEP]
by (insert 1 2 True, auto simp: True p.hom_mult)
[PROOF STATE]
proof (state)
this:
0 \<le> sr2 \<and> 0 \<notin> set (ks1 @ ks2) \<and> ks1 @ ks2 \<noteq> [] \<and> char_poly A = prod_list (map (p sr2) (ks1 @ ks2)) * (f1 * f2) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2)) x = 0 \<longrightarrow> cmod x < sr2)

goal (2 subgoals):
 1. sr1 = sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr2 \<and> 0 \<notin> set (ks1 @ ks2) \<and> ks1 @ ks2 \<noteq> [] \<and> char_poly A = prod_list (map (p sr2) (ks1 @ ks2)) * (f1 * f2) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2)) x = 0 \<longrightarrow> cmod x < sr2)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
sr1 \<noteq> sr2

goal (1 subgoal):
 1. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
with sr
[PROOF STATE]
proof (chain)
picking this:
sr2 \<le> sr1
sr1 \<noteq> sr2
[PROOF STEP]
have sr1: "sr1 > sr2"
[PROOF STATE]
proof (prove)
using this:
sr2 \<le> sr1
sr1 \<noteq> sr2

goal (1 subgoal):
 1. sr2 < sr1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sr2 < sr1

goal (1 subgoal):
 1. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have lt: "poly (map_poly ?c (p sr2 k)) x = 0 \<Longrightarrow> k \<in> set ks2 \<Longrightarrow> cmod x < sr1" for k x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>poly (map_poly complex_of_real (p sr2 k)) x = 0; k \<in> set ks2\<rbrakk> \<Longrightarrow> cmod x < sr1
[PROOF STEP]
using sr1 p_conv[of sr2 k x] 2
[PROOF STATE]
proof (prove)
using this:
sr2 < sr1
\<lbrakk>poly (map_poly complex_of_real (p sr2 k)) x = 0; k \<noteq> 0; 0 \<le> sr2\<rbrakk> \<Longrightarrow> cmod x = sr2
0 \<le> sr2 \<and> 0 \<notin> set ks2 \<and> ks2 \<noteq> [] \<and> char_poly A2 = prod_list (map (p sr2) ks2) * f2 \<and> (\<forall>x. poly (map_poly complex_of_real f2) x = 0 \<longrightarrow> cmod x < sr2)

goal (1 subgoal):
 1. \<lbrakk>poly (map_poly complex_of_real (p sr2 k)) x = 0; k \<in> set ks2\<rbrakk> \<Longrightarrow> cmod x < sr1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>poly (map_poly complex_of_real (p sr2 ?k)) ?x = 0; ?k \<in> set ks2\<rbrakk> \<Longrightarrow> cmod ?x < sr1

goal (1 subgoal):
 1. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "?wit A sr1 ks1 (f1 * f2 * prod_list (map (p sr2) ks2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A = prod_list (map (p sr1) ks1) * (f1 * f2 * prod_list (map (p sr2) ks2)) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2 * prod_list (map (p sr2) ks2))) x = 0 \<longrightarrow> cmod x < sr1)
[PROOF STEP]
unfolding char
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A1 * char_poly A2 = prod_list (map (p sr1) ks1) * (f1 * f2 * prod_list (map (p sr2) ks2)) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2 * prod_list (map (p sr2) ks2))) x = 0 \<longrightarrow> cmod x < sr1)
[PROOF STEP]
by (insert 1 2 sr1 lt, auto simp: p.hom_mult p.hom_prod_list
          poly_prod_list prod_list_zero_iff)
[PROOF STATE]
proof (state)
this:
0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A = prod_list (map (p sr1) ks1) * (f1 * f2 * prod_list (map (p sr2) ks2)) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2 * prod_list (map (p sr2) ks2))) x = 0 \<longrightarrow> cmod x < sr1)

goal (1 subgoal):
 1. sr1 \<noteq> sr2 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr1 \<and> 0 \<notin> set ks1 \<and> ks1 \<noteq> [] \<and> char_poly A = prod_list (map (p sr1) ks1) * (f1 * f2 * prod_list (map (p sr2) ks2)) \<and> (\<forall>x. poly (map_poly complex_of_real (f1 * f2 * prod_list (map (p sr2) ks2))) x = 0 \<longrightarrow> cmod x < sr1)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
n = 1

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
define a where "a = A $$ (0,0)"
[PROOF STATE]
proof (state)
this:
a = A $$ (0, 0)

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have A: "A = Matrix.mat 1 1 (\<lambda> x. a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Matrix.mat 1 1 (\<lambda>x. a)
[PROOF STEP]
by (rule eq_matI, unfold a_def, insert A 1(1), auto)
[PROOF STATE]
proof (state)
this:
A = Matrix.mat 1 1 (\<lambda>x. a)

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have char: "char_poly A = [: - a, 1 :]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly A = [:- a, 1:]
[PROOF STEP]
unfolding A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly (Matrix.mat 1 1 (\<lambda>x. a)) = [:- a, 1:]
[PROOF STEP]
by (auto simp: Determinant.det_def char_poly_def char_poly_matrix_def)
[PROOF STATE]
proof (state)
this:
char_poly A = [:- a, 1:]

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from pos A
[PROOF STATE]
proof (chain)
picking this:
nonneg_mat A
A = Matrix.mat 1 1 (\<lambda>x. a)
[PROOF STEP]
have a: "a \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
nonneg_mat A
A = Matrix.mat 1 1 (\<lambda>x. a)

goal (1 subgoal):
 1. 0 \<le> a
[PROOF STEP]
unfolding nonneg_mat_def elements_mat
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>{A $$ (i, j) |i j. i < dim_row A \<and> j < dim_col A}. 0 \<le> a
A = Matrix.mat 1 1 (\<lambda>x. a)

goal (1 subgoal):
 1. 0 \<le> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> a

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "?wit A a [1] 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<and> 0 \<notin> set [1] \<and> [1] \<noteq> [] \<and> char_poly A = prod_list (map (p a) [1]) * 1 \<and> (\<forall>x. poly (map_poly complex_of_real 1) x = 0 \<longrightarrow> cmod x < a)
[PROOF STEP]
unfolding char
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<and> 0 \<notin> set [1] \<and> [1] \<noteq> [] \<and> [:- a, 1:] = prod_list (map (p a) [1]) * 1 \<and> (\<forall>x. poly (map_poly complex_of_real 1) x = 0 \<longrightarrow> cmod x < a)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
0 \<le> a

goal (1 subgoal):
 1. 0 \<le> a \<and> 0 \<notin> set [1] \<and> [1] \<noteq> [] \<and> [:- a, 1:] = prod_list (map (p a) [1]) * 1 \<and> (\<forall>x. poly (map_poly complex_of_real 1) x = 0 \<longrightarrow> cmod x < a)
[PROOF STEP]
by (auto simp: p_def monom_Suc)
[PROOF STATE]
proof (state)
this:
0 \<le> a \<and> 0 \<notin> set [1] \<and> [1] \<noteq> [] \<and> char_poly A = prod_list (map (p a) [1]) * 1 \<and> (\<forall>x. poly (map_poly complex_of_real 1) x = 0 \<longrightarrow> cmod x < a)

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> a \<and> 0 \<notin> set [1] \<and> [1] \<noteq> [] \<and> char_poly A = prod_list (map (p a) [1]) * 1 \<and> (\<forall>x. poly (map_poly complex_of_real 1) x = 0 \<longrightarrow> cmod x < a)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
obtain sr ks f where wit: "?wit A sr ks f"
[PROOF STATE]
proof (prove)
using this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. (\<And>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
using wit
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = prod_list (map (p sr) ks) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal (1 subgoal):
 1. \<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>sr ks f. 0 \<le> sr \<and> 0 \<notin> set ks \<and> ks \<noteq> [] \<and> char_poly A = (\<Prod>k\<leftarrow>ks. monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding) full_abstraction_wrt_preorders_impl_trans_source_target_relation:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  assumes fullAbs: "fully_abstract SRel TRel"
      and reflS:   "refl SRel"
      and transT:  "trans TRel"
  shows "\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel
                     \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel)
                \<and> SRel = {(S1, S2). (SourceTerm S1, SourceTerm S2) \<in> Rel}
                \<and> TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) \<in> Rel}
                \<and> trans Rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
have "\<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>)
        \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>) \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S
[PROOF STEP]
using indRelSTEQ.encR[where SRel="SRel" and TRel="TRel"]
            indRelSTEQ.encL[where SRel="SRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
SourceTerm ?S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>?S\<rbrakk>)
TargetTerm (\<lbrakk>?S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm ?S

goal (1 subgoal):
 1. \<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>) \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>) \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>) \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
have "SRel = {(S1, S2). SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SRel = _Collect (S1, S2) (SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2)
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> SRel \<Longrightarrow> SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b
 2. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
fix S1 S2
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> SRel \<Longrightarrow> SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b
 2. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
assume "(S1, S2) \<in> SRel"
[PROOF STATE]
proof (state)
this:
(S1, S2) \<in> SRel

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> SRel \<Longrightarrow> SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b
 2. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
thus "SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2"
[PROOF STATE]
proof (prove)
using this:
(S1, S2) \<in> SRel

goal (1 subgoal):
 1. SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2
[PROOF STEP]
by (rule indRelSTEQ.source[where SRel="SRel" and TRel="TRel"])
[PROOF STATE]
proof (state)
this:
SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2

goal (1 subgoal):
 1. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
fix S1 S2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
assume "SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2"
[PROOF STATE]
proof (state)
this:
SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2

goal (1 subgoal):
 1. \<And>a b. SourceTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm b \<Longrightarrow> (a, b) \<in> SRel
[PROOF STEP]
with fullAbs reflS transT
[PROOF STATE]
proof (chain)
picking this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
refl SRel
trans TRel
SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2
[PROOF STEP]
show "(S1, S2) \<in> SRel"
[PROOF STATE]
proof (prove)
using this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
refl SRel
trans TRel
SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2

goal (1 subgoal):
 1. (S1, S2) \<in> SRel
[PROOF STEP]
using full_abstraction_wrt_preorders_impl_indRelSTEQ_to_SRel_and_TRel(1)[where SRel="SRel"
                and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
refl SRel
trans TRel
SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2
(\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)) \<and> trans TRel \<and> refl SRel \<and> ?P \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?Q \<Longrightarrow> \<forall>SP SQ. SP \<in>S ?P \<and> SQ \<in>S ?Q \<longrightarrow> (SP, SQ) \<in> SRel

goal (1 subgoal):
 1. (S1, S2) \<in> SRel
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(S1, S2) \<in> SRel

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
SRel = _Collect (S1, S2) (SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
SRel = _Collect (S1, S2) (SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
have "TRel =  {(T1, T2). TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TRel = _Collect (T1, T2) (TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2)
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> TRel \<Longrightarrow> TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b
 2. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
fix T1 T2
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> TRel \<Longrightarrow> TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b
 2. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
assume "(T1, T2) \<in> TRel"
[PROOF STATE]
proof (state)
this:
(T1, T2) \<in> TRel

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> TRel \<Longrightarrow> TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b
 2. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
thus "TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2"
[PROOF STATE]
proof (prove)
using this:
(T1, T2) \<in> TRel

goal (1 subgoal):
 1. TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2
[PROOF STEP]
by (rule indRelSTEQ.target[where SRel="SRel" and TRel="TRel"])
[PROOF STATE]
proof (state)
this:
TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2

goal (1 subgoal):
 1. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
fix T1 T2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
assume "TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2"
[PROOF STATE]
proof (state)
this:
TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2

goal (1 subgoal):
 1. \<And>a b. TargetTerm a \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm b \<Longrightarrow> (a, b) \<in> TRel
[PROOF STEP]
with fullAbs reflS transT
[PROOF STATE]
proof (chain)
picking this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
refl SRel
trans TRel
TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2
[PROOF STEP]
show "(T1, T2) \<in> TRel"
[PROOF STATE]
proof (prove)
using this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
refl SRel
trans TRel
TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2

goal (1 subgoal):
 1. (T1, T2) \<in> TRel
[PROOF STEP]
using full_abstraction_wrt_preorders_impl_indRelSTEQ_to_SRel_and_TRel(5)[where SRel="SRel"
                and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
refl SRel
trans TRel
TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2
(\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)) \<and> trans TRel \<and> refl SRel \<and> ?P \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?Q \<Longrightarrow> \<forall>TP TQ. TP \<in>T ?P \<and> TQ \<in>T ?Q \<longrightarrow> (TP, TQ) \<in> TRel

goal (1 subgoal):
 1. (T1, T2) \<in> TRel
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(T1, T2) \<in> TRel

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
TRel = _Collect (T1, T2) (TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
TRel = _Collect (T1, T2) (TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
have "trans (indRelSTEQ SRel TRel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (indRelSTEQ SRel TRel)
[PROOF STEP]
using indRelSTEQ.trans[where SRel="SRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
?P \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?Q \<and> ?Q \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?R \<Longrightarrow> ?P \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?R

goal (1 subgoal):
 1. trans (indRelSTEQ SRel TRel)
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
?P \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?Q \<and> ?Q \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?R \<Longrightarrow> ?P \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> ?R

goal (1 subgoal):
 1. \<forall>x y z. x \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> y \<longrightarrow> y \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> z \<longrightarrow> x \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trans (indRelSTEQ SRel TRel)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>) \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S
SRel = _Collect (S1, S2) (SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2)
TRel = _Collect (T1, T2) (TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2)
trans (indRelSTEQ SRel TRel)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>S. SourceTerm S \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm (\<lbrakk>S\<rbrakk>) \<and> TargetTerm (\<lbrakk>S\<rbrakk>) \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S
SRel = _Collect (S1, S2) (SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2)
TRel = _Collect (T1, T2) (TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2)
trans (indRelSTEQ SRel TRel)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel \<and> (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> SRel = _Collect (S1, S2) ((SourceTerm S1, SourceTerm S2) \<in> Rel) \<and> TRel = _Collect (T1, T2) ((TargetTerm T1, TargetTerm T2) \<in> Rel) \<and> trans Rel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upsets_to_downsets: "(X \<in> upsets) = (\<partial> ` X \<in> downsets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<in> upsets) = (\<partial> ` X \<in> downsets)
[PROOF STEP]
by (simp add: downsets_upsets_dual image_comp)


[STATEMENT]
lemma sH_g_orbital: "\<^bold>{P\<^bold>} (x\<acute>= f & G on U S @ t\<^sub>0) \<^bold>{Q\<^bold>} =
  (\<forall>s. P s \<longrightarrow> (\<forall>X\<in>ivp_sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>{P\<^bold>}x\<acute>= f & G on U S @ t\<^sub>0\<^bold>{Q\<^bold>} = (\<forall>s. P s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)))
[PROOF STEP]
unfolding g_orbital_eq g_ode_def ndfun_kat_H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s s'. P s \<longrightarrow> s2p ((((\<lambda>s. {X t |t X. s2p (U s) t \<and> \<P> X (down (U s) t) \<subseteq> Collect G \<and> s2p (Sols f U S t\<^sub>0 s) X})\<^sup>\<bullet>)\<^sub>\<bullet>) s) s' \<longrightarrow> Q s') = (\<forall>s. P s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)))
[PROOF STEP]
by auto


[STATEMENT]
lemma nprv_ptrmE_uni0:
"\<sigma> \<in> ptrm n \<Longrightarrow> nprv F \<sigma> \<Longrightarrow> nprv F (subst \<sigma> t out) \<Longrightarrow>
 nprv (insert (eql (Var out) t) F) \<psi> \<Longrightarrow>
 F \<subseteq> fmla \<Longrightarrow> finite F \<Longrightarrow> \<psi> \<in> fmla \<Longrightarrow> t \<in> trm
 \<Longrightarrow> nprv F \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<sigma> \<in> ptrm n; nprv F \<sigma>; nprv F (subst \<sigma> t out); nprv (insert (eql (Var out) t) F) \<psi>; F \<subseteq> fmla; finite F; \<psi> \<in> fmla; t \<in> trm\<rbrakk> \<Longrightarrow> nprv F \<psi>
[PROOF STEP]
by (rule nprv_ptrmE_uni[of \<sigma> _ _ "Var out" t]) auto


[STATEMENT]
lemma bbw_ao_dist: "(x OR y) AND z = (x AND z) OR (y AND z)"
  for x y z :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x OR y) AND z = x AND z OR y AND z
[PROOF STEP]
by (auto simp add: bin_eq_iff bin_nth_ops)


[STATEMENT]
lemma tan_gt_zero: "0 < x \<Longrightarrow> x < pi/2 \<Longrightarrow> 0 < tan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x < pi / 2\<rbrakk> \<Longrightarrow> 0 < tan x
[PROOF STEP]
by (simp add: tan_def zero_less_divide_iff sin_gt_zero2 cos_gt_zero_pi)


[STATEMENT]
lemma winning_position_can_remain_winning_Odd:
  assumes "odd (length p)" "\<forall> m. position (p @ [m])" "winning_position_Odd p"
  shows "\<exists> m. winning_position_Odd (p @ [m])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. winning_position_Odd (p @ [m])
[PROOF STEP]
using assms winning_moves_remain_winning_Odd[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
odd (length p)
\<forall>m. position (p @ [m])
winning_position_Odd p
strategy_winning_by_Odd ?\<sigma> p \<Longrightarrow> strategy_winning_by_Odd ?\<sigma> (augment_list ?\<sigma> p)

goal (1 subgoal):
 1. \<exists>m. winning_position_Odd (p @ [m])
[PROOF STEP]
by auto


[STATEMENT]
lemma maddux1': "residuated f \<Longrightarrow> conjugate f(x \<sqinter> -f(y)) \<le> conjugate f(x) \<sqinter> -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> conjugate f (x \<sqinter> - f y) \<le> conjugate f x \<sqinter> - y
[PROOF STEP]
by (metis conj_involution conj_residuated maddux1)


[STATEMENT]
lemma closed_simple_path_image:
  fixes g :: "real \<Rightarrow> 'a::t2_space"
  shows "simple_path g \<Longrightarrow> closed(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_path g \<Longrightarrow> closed (path_image g)
[PROOF STEP]
by (metis closed_path_image simple_path_imp_path)


[STATEMENT]
lemma NR\<^sub>N_l_0:
  assumes "0 < n" "p \<in> {0<..<1}"
  shows "NR\<^sub>N n u 0 = (p * NR\<^sub>N (n - 1) u 0 +
                     q * (u + (\<Sum>k<n - 1. NR\<^sub>N (k + 1) u 0 * (pmf (binomial_pmf (n - 1) q) k))))
                     / (1 - (q ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NR\<^sub>N n u 0 = (ennreal p * NR\<^sub>N (n - 1) u 0 + ennreal q * (of_nat u + (\<Sum>k<n - 1. NR\<^sub>N (k + 1) u 0 * ennreal (pmf (binomial_pmf (n - 1) q) k)))) / ennreal (1 - q ^ n)
[PROOF STEP]
unfolding NR\<^sub>N_recurrence[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ennreal p * (of_nat 0 + NR\<^sub>N (n - 1) u 0) + ennreal q * (of_nat u + (\<Sum>k<n - 1. NR\<^sub>N (k + 1) u 0 * ennreal (pmf (binomial_pmf (n - 1) q) k)))) / ennreal (1 - q ^ n) = (ennreal p * NR\<^sub>N (n - 1) u 0 + ennreal q * (of_nat u + (\<Sum>k<n - 1. NR\<^sub>N (k + 1) u 0 * ennreal (pmf (binomial_pmf (n - 1) q) k)))) / ennreal (1 - q ^ n)
[PROOF STEP]
by (simp)


[STATEMENT]
lemma ennreal_enn2real_if: "ennreal (enn2real r) = (if r = top then 0 else r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (enn2real r) = (if r = top then 0 else r)
[PROOF STEP]
by(auto intro!: ennreal_enn2real simp add: less_top)


[STATEMENT]
lemma independentD: "independent s \<Longrightarrow> finite t \<Longrightarrow> t \<subseteq> s \<Longrightarrow> (\<Sum>v\<in>t. u v *s v) = 0 \<Longrightarrow> v \<in> t \<Longrightarrow> u v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>independent s; finite t; t \<subseteq> s; (\<Sum>v\<in>t. u v *s v) = (0::'b); v \<in> t\<rbrakk> \<Longrightarrow> u v = (0::'a)
[PROOF STEP]
by (simp add: independent_explicit_module)


[STATEMENT]
lemma keysFor_mono: "G\<subseteq>H ==> keysFor(G) \<subseteq> keysFor(H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<subseteq> H \<Longrightarrow> keysFor G \<subseteq> keysFor H
[PROOF STEP]
by (unfold keysFor_def, blast)