[STATEMENT]
lemma multiplicity_of_factor_of_gauss_poly:
  assumes "n > 0"
  assumes "monic_irreducible_poly R f"
  shows
    "pmult\<^bsub>R\<^esub> f (gauss_poly R (order R^n)) = of_bool (degree f dvd n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
proof (cases "degree f dvd n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree f dvd n

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
let ?g = "gauss_poly R (order R^n)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have f_carr: "f \<in> carrier P" "f \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier P &&& f \<noteq> []
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
m_i_p R f

goal (1 subgoal):
 1. f \<in> carrier P &&& f \<noteq> []
[PROOF STEP]
unfolding monic_irreducible_poly_def monic_poly_def
[PROOF STATE]
proof (prove)
using this:
(f \<noteq> [] \<and> lead_coeff f = \<one> \<and> f \<in> carrier P) \<and> pirreducible (carrier R) f

goal (1 subgoal):
 1. f \<in> carrier P &&& f \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> carrier P
f \<noteq> []

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have o2: "order R^n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < order R ^ n
[PROOF STEP]
using finite_field_min_order assms(1) one_less_power
[PROOF STATE]
proof (prove)
using this:
1 < order R
0 < n
\<lbrakk>(1::?'a) < ?a; 0 < ?n\<rbrakk> \<Longrightarrow> (1::?'a) < ?a ^ ?n

goal (1 subgoal):
 1. 1 < order R ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 < order R ^ n

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
hence o21: "order R^n > 0"
[PROOF STATE]
proof (prove)
using this:
1 < order R ^ n

goal (1 subgoal):
 1. 0 < order R ^ n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < order R ^ n

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
obtain d :: nat where order_dim: "order R = char R ^ d" "d > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>order R = char R ^ d; 0 < d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_field_order
[PROOF STATE]
proof (prove)
using this:
\<exists>n. order R = char R ^ n \<and> 0 < n

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>order R = char R ^ d; 0 < d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
order R = char R ^ d
0 < d

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have "d * n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d * n
[PROOF STEP]
using order_dim assms
[PROOF STATE]
proof (prove)
using this:
order R = char R ^ d
0 < d
0 < n
m_i_p R f

goal (1 subgoal):
 1. 0 < d * n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < d * n

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
hence char_dvd_order: "int (char R) dvd int (order R ^ n)"
[PROOF STATE]
proof (prove)
using this:
0 < d * n

goal (1 subgoal):
 1. int (char R) dvd int (order R ^ n)
[PROOF STEP]
unfolding order_dim
[PROOF STATE]
proof (prove)
using this:
0 < d * n

goal (1 subgoal):
 1. int (char R) dvd int ((char R ^ d) ^ n)
[PROOF STEP]
using finite_carr_imp_char_ge_0[OF finite_carrier]
[PROOF STATE]
proof (prove)
using this:
0 < d * n
0 < char R

goal (1 subgoal):
 1. int (char R) dvd int ((char R ^ d) ^ n)
[PROOF STEP]
by (simp add:power_mult[symmetric])
[PROOF STATE]
proof (state)
this:
int (char R) dvd int (order R ^ n)

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
interpret h: ring_hom_ring  "R" "P" "poly_of_const"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_hom_ring R P poly_of_const
[PROOF STEP]
using canonical_embedding_ring_hom
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring (R\<lparr>carrier := carrier R\<rparr>) P poly_of_const

goal (1 subgoal):
 1. ring_hom_ring R P poly_of_const
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have "f pdivides\<^bsub>R\<^esub> ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f pdivides gauss_poly R (order R ^ n)
[PROOF STEP]
using True div_gauss_poly_iff[OF assms]
[PROOF STATE]
proof (prove)
using this:
degree f dvd n
f pdivides gauss_poly R (order R ^ n) = (degree f dvd n)

goal (1 subgoal):
 1. f pdivides gauss_poly R (order R ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f pdivides gauss_poly R (order R ^ n)

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
hence "pmult\<^bsub>R\<^esub> f ?g \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
f pdivides gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. 1 \<le> pmult f (gauss_poly R (order R ^ n))
[PROOF STEP]
using multiplicity_ge_1_iff_pdivides[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
f pdivides gauss_poly R (order R ^ n)
?f \<in> carrier P - {\<zero>\<^bsub>P\<^esub>} \<Longrightarrow> (1 \<le> pmult f ?f) = f pdivides ?f

goal (1 subgoal):
 1. 1 \<le> pmult f (gauss_poly R (order R ^ n))
[PROOF STEP]
using gauss_poly_carr gauss_poly_not_zero[OF o2]
[PROOF STATE]
proof (prove)
using this:
f pdivides gauss_poly R (order R ^ n)
?f \<in> carrier P - {\<zero>\<^bsub>P\<^esub>} \<Longrightarrow> (1 \<le> pmult f ?f) = f pdivides ?f
gauss_poly R ?n \<in> carrier P
gauss_poly R (order R ^ n) \<noteq> \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. 1 \<le> pmult f (gauss_poly R (order R ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> pmult f (gauss_poly R (order R ^ n))

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 \<le> pmult f (gauss_poly R (order R ^ n))

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have "pmult\<^bsub>R\<^esub> f ?g < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) < 2
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> pmult\<^bsub>R\<^esub> f ?g < 2"
[PROOF STATE]
proof (state)
this:
\<not> pmult f (gauss_poly R (order R ^ n)) < 2

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
hence "pmult\<^bsub>R\<^esub> f ?g \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
\<not> pmult f (gauss_poly R (order R ^ n)) < 2

goal (1 subgoal):
 1. 2 \<le> pmult f (gauss_poly R (order R ^ n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 \<le> pmult f (gauss_poly R (order R ^ n))

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
hence "(f [^]\<^bsub>P\<^esub> (2::nat)) pdivides\<^bsub>R\<^esub> ?g"
[PROOF STATE]
proof (prove)
using this:
2 \<le> pmult f (gauss_poly R (order R ^ n))

goal (1 subgoal):
 1. f [^]\<^bsub>P\<^esub> 2 pdivides gauss_poly R (order R ^ n)
[PROOF STEP]
using gauss_poly_carr gauss_poly_not_zero[OF o2]
[PROOF STATE]
proof (prove)
using this:
2 \<le> pmult f (gauss_poly R (order R ^ n))
gauss_poly R ?n \<in> carrier P
gauss_poly R (order R ^ n) \<noteq> \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. f [^]\<^bsub>P\<^esub> 2 pdivides gauss_poly R (order R ^ n)
[PROOF STEP]
by (subst (asm) multiplicity_ge_iff[OF assms(2)]) simp_all
[PROOF STATE]
proof (state)
this:
f [^]\<^bsub>P\<^esub> 2 pdivides gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
hence "(f [^]\<^bsub>P\<^esub> (2::nat)) divides\<^bsub>mult_of P\<^esub> ?g"
[PROOF STATE]
proof (prove)
using this:
f [^]\<^bsub>P\<^esub> 2 pdivides gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)
[PROOF STEP]
unfolding pdivides_def
[PROOF STATE]
proof (prove)
using this:
f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>P\<^esub> gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)
[PROOF STEP]
using f_carr gauss_poly_not_zero o2 gauss_poly_carr
[PROOF STATE]
proof (prove)
using this:
f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>P\<^esub> gauss_poly R (order R ^ n)
f \<in> carrier P
f \<noteq> []
1 < ?n \<Longrightarrow> gauss_poly R ?n \<noteq> \<zero>\<^bsub>P\<^esub>
1 < order R ^ n
gauss_poly R ?n \<in> carrier P

goal (1 subgoal):
 1. f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)
[PROOF STEP]
by (intro p.divides_imp_divides_mult) simp_all
[PROOF STATE]
proof (state)
this:
f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)
[PROOF STEP]
obtain h where h_def:
      "h \<in> carrier (mult_of P)"
      "?g = f [^]\<^bsub>P\<^esub> (2::nat) \<otimes>\<^bsub>P\<^esub> h"
[PROOF STATE]
proof (prove)
using this:
f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> carrier (Ring_Divisibility.mult_of P); gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using dividesD
[PROOF STATE]
proof (prove)
using this:
f [^]\<^bsub>P\<^esub> 2 divides\<^bsub>Ring_Divisibility.mult_of P\<^esub> gauss_poly R (order R ^ n)
?a divides\<^bsub>?G\<^esub> ?b \<Longrightarrow> \<exists>c\<in>carrier ?G. ?b = ?a \<otimes>\<^bsub>?G\<^esub> c

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> carrier (Ring_Divisibility.mult_of P); gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> carrier (Ring_Divisibility.mult_of P)
gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = int_embed P (order R ^ n)
      \<otimes>\<^bsub>P\<^esub> (X\<^bsub>R\<^esub> [^]\<^bsub>P\<^esub> (order R ^ n-1)) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
using var_closed
[PROOF STATE]
proof (prove)
using this:
X \<in> carrier P
polynomial (carrier R) X

goal (1 subgoal):
 1. \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
apply (subst int_embed_consistent_with_poly_of_const)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> carrier P; polynomial (carrier R) X\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = poly_of_const (int_embed R (int (order R ^ n))) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
apply (subst iffD2[OF embed_char_eq_0_iff char_dvd_order])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> carrier P; polynomial (carrier R) X\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = poly_of_const \<zero> \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
by (simp add:a_minus_def)
[PROOF STATE]
proof (state)
this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = pderiv\<^bsub>R\<^esub> (X\<^bsub>R\<^esub> [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> X\<^bsub>R\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X
[PROOF STEP]
using pderiv_var
[PROOF STATE]
proof (prove)
using this:
pderiv X = \<one>\<^bsub>?K [X]\<^esub>

goal (1 subgoal):
 1. int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X
[PROOF STEP]
by (subst pderiv_var_pow[OF o21], simp)
[PROOF STATE]
proof (state)
this:
int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int_embed P (int (order R ^ n)) \<otimes>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (order R ^ n - 1) \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = pderiv\<^bsub>R\<^esub> ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X = pderiv (gauss_poly R (order R ^ n))
[PROOF STEP]
unfolding gauss_poly_def a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> pderiv X = pderiv (X [^]\<^bsub>P\<^esub> order R ^ n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> X)
[PROOF STEP]
using var_closed
[PROOF STATE]
proof (prove)
using this:
X \<in> carrier P
polynomial (carrier R) X

goal (1 subgoal):
 1. pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> pderiv X = pderiv (X [^]\<^bsub>P\<^esub> order R ^ n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> X)
[PROOF STEP]
by (subst pderiv_add, simp_all add:pderiv_inv)
[PROOF STATE]
proof (state)
this:
pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X = pderiv (gauss_poly R (order R ^ n))

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pderiv (X [^]\<^bsub>P\<^esub> order R ^ n) \<ominus>\<^bsub>P\<^esub> pderiv X = pderiv (gauss_poly R (order R ^ n))

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = pderiv\<^bsub>R\<^esub> (f [^]\<^bsub>P\<^esub> (2::nat) \<otimes>\<^bsub>P\<^esub> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (gauss_poly R (order R ^ n)) = pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h)
[PROOF STEP]
using h_def(2)
[PROOF STATE]
proof (prove)
using this:
gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h

goal (1 subgoal):
 1. pderiv (gauss_poly R (order R ^ n)) = pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pderiv (gauss_poly R (order R ^ n)) = pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pderiv (gauss_poly R (order R ^ n)) = pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = pderiv\<^bsub>R\<^esub> (f [^]\<^bsub>P\<^esub> (2::nat)) \<otimes>\<^bsub>P\<^esub> h
      \<oplus>\<^bsub>P\<^esub> (f [^]\<^bsub>P\<^esub> (2::nat)) \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h) = pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h
[PROOF STEP]
using f_carr h_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
f \<noteq> []
h \<in> carrier (Ring_Divisibility.mult_of P)
gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h

goal (1 subgoal):
 1. pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h) = pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h
[PROOF STEP]
by (intro pderiv_mult, simp_all)
[PROOF STATE]
proof (state)
this:
pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h) = pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pderiv (f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h) = pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = int_embed P 2 \<otimes>\<^bsub>P\<^esub> f  \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> f \<otimes>\<^bsub>P\<^esub> h
      \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h = int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h
[PROOF STEP]
using f_carr
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
f \<noteq> []

goal (1 subgoal):
 1. pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h = int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h
[PROOF STEP]
by (subst pderiv_pow, simp_all add:numeral_eq_Suc)
[PROOF STATE]
proof (state)
this:
pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h = int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pderiv (f [^]\<^bsub>P\<^esub> 2) \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> pderiv h = int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> f \<otimes>\<^bsub>P\<^esub> h)
      \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
using f_carr pderiv_carr h_def p.int_embed_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
f \<noteq> []
?f \<in> carrier P \<Longrightarrow> pderiv ?f \<in> carrier P
h \<in> carrier (Ring_Divisibility.mult_of P)
gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h
int_embed P ?k \<in> carrier P

goal (1 subgoal):
 1. int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
apply (intro arg_cong2[where f="(\<oplus>\<^bsub>P\<^esub>)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f \<in> carrier P; f \<noteq> []; \<And>f. f \<in> carrier P \<Longrightarrow> pderiv f \<in> carrier P; h \<in> carrier (Ring_Divisibility.mult_of P); gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h; \<And>k. int_embed P k \<in> carrier P\<rbrakk> \<Longrightarrow> int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h)
 2. \<lbrakk>f \<in> carrier P; f \<noteq> []; \<And>f. f \<in> carrier P \<Longrightarrow> pderiv f \<in> carrier P; h \<in> carrier (Ring_Divisibility.mult_of P); gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h; \<And>k. int_embed P k \<in> carrier P\<rbrakk> \<Longrightarrow> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h = f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
by (subst p.m_comm, simp_all add:p.m_assoc)
[PROOF STATE]
proof (state)
this:
int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int_embed P 2 \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = f \<otimes>\<^bsub>P\<^esub>
      (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h) = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
using f_carr pderiv_carr h_def p.int_embed_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
f \<noteq> []
?f \<in> carrier P \<Longrightarrow> pderiv ?f \<in> carrier P
h \<in> carrier (Ring_Divisibility.mult_of P)
gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h
int_embed P ?k \<in> carrier P

goal (1 subgoal):
 1. f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h) = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
by (subst p.r_distr, simp_all)
[PROOF STATE]
proof (state)
this:
f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h) \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> (f \<otimes>\<^bsub>P\<^esub> pderiv h) = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
have "\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub>
      (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv\<^bsub>R\<^esub> h)"
      (is "_ = f \<otimes>\<^bsub>P\<^esub> ?q")
[PROOF STATE]
proof (prove)
using this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
hence "f pdivides\<^bsub>R\<^esub> \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. f pdivides \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
[PROOF STEP]
unfolding factor_def pdivides_def
[PROOF STATE]
proof (prove)
using this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)

goal (1 subgoal):
 1. \<exists>c\<in>carrier P. \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> c
[PROOF STEP]
using f_carr pderiv_carr h_def p.int_embed_closed
[PROOF STATE]
proof (prove)
using this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> (int_embed P 2 \<otimes>\<^bsub>P\<^esub> pderiv f \<otimes>\<^bsub>P\<^esub> h \<oplus>\<^bsub>P\<^esub> f \<otimes>\<^bsub>P\<^esub> pderiv h)
f \<in> carrier P
f \<noteq> []
?f \<in> carrier P \<Longrightarrow> pderiv ?f \<in> carrier P
h \<in> carrier (Ring_Divisibility.mult_of P)
gauss_poly R (order R ^ n) = f [^]\<^bsub>P\<^esub> 2 \<otimes>\<^bsub>P\<^esub> h
int_embed P ?k \<in> carrier P

goal (1 subgoal):
 1. \<exists>c\<in>carrier P. \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> = f \<otimes>\<^bsub>P\<^esub> c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f pdivides \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f pdivides \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> \<zero>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f pdivides \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
have  "degree f \<le> degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
f pdivides \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. degree f \<le> degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
using f_carr
[PROOF STATE]
proof (prove)
using this:
f pdivides \<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>
\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub> \<noteq> \<zero>\<^bsub>P\<^esub>
f \<in> carrier P
f \<noteq> []

goal (1 subgoal):
 1. degree f \<le> degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)
[PROOF STEP]
by (intro pdivides_imp_degree_le, simp_all add:univ_poly_zero)
[PROOF STATE]
proof (state)
this:
degree f \<le> degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree f \<le> degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>)

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = 0
[PROOF STEP]
by (subst univ_poly_a_inv_degree, simp)
       (simp add:univ_poly_one)
[PROOF STATE]
proof (state)
this:
degree (\<ominus>\<^bsub>P\<^esub> \<one>\<^bsub>P\<^esub>) = 0

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree f \<le> 0
[PROOF STEP]
have "degree f = 0"
[PROOF STATE]
proof (prove)
using this:
degree f \<le> 0

goal (1 subgoal):
 1. degree f = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree f = 0

goal (1 subgoal):
 1. \<not> pmult f (gauss_poly R (order R ^ n)) < 2 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree f = 0
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
degree f = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using pirreducible_degree assms(2)
[PROOF STATE]
proof (prove)
using this:
degree f = 0
\<lbrakk>?p \<in> carrier P; pirreducible (carrier R) ?p\<rbrakk> \<Longrightarrow> 1 \<le> degree ?p
m_i_p R f

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding monic_irreducible_poly_def monic_poly_def
[PROOF STATE]
proof (prove)
using this:
degree f = 0
\<lbrakk>?p \<in> carrier P; pirreducible (carrier R) ?p\<rbrakk> \<Longrightarrow> 1 \<le> degree ?p
(f \<noteq> [] \<and> lead_coeff f = \<one> \<and> f \<in> carrier P) \<and> pirreducible (carrier R) f

goal (1 subgoal):
 1. False
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pmult f (gauss_poly R (order R ^ n)) < 2

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 \<le> pmult f (gauss_poly R (order R ^ n))
pmult f (gauss_poly R (order R ^ n)) < 2
[PROOF STEP]
have "pmult\<^bsub>R\<^esub> f ?g = 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> pmult f (gauss_poly R (order R ^ n))
pmult f (gauss_poly R (order R ^ n)) < 2

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pmult f (gauss_poly R (order R ^ n)) = 1

goal (2 subgoals):
 1. degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
 2. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pmult f (gauss_poly R (order R ^ n)) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pmult f (gauss_poly R (order R ^ n)) = 1

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
pmult f (gauss_poly R (order R ^ n)) = 1
degree f dvd n

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)

goal (1 subgoal):
 1. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> degree f dvd n

goal (1 subgoal):
 1. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have o2: "order R^n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < order R ^ n
[PROOF STEP]
using finite_field_min_order assms(1) one_less_power
[PROOF STATE]
proof (prove)
using this:
1 < order R
0 < n
\<lbrakk>(1::?'a) < ?a; 0 < ?n\<rbrakk> \<Longrightarrow> (1::?'a) < ?a ^ ?n

goal (1 subgoal):
 1. 1 < order R ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 < order R ^ n

goal (1 subgoal):
 1. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
have "\<not>(f pdivides\<^bsub>R\<^esub> gauss_poly R (order R^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f pdivides gauss_poly R (order R ^ n)
[PROOF STEP]
using div_gauss_poly_iff[OF assms] False
[PROOF STATE]
proof (prove)
using this:
f pdivides gauss_poly R (order R ^ n) = (degree f dvd n)
\<not> degree f dvd n

goal (1 subgoal):
 1. \<not> f pdivides gauss_poly R (order R ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> f pdivides gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
hence "pmult\<^bsub>R\<^esub> f (gauss_poly R (order R^n)) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> f pdivides gauss_poly R (order R ^ n)

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = 0
[PROOF STEP]
using multiplicity_ge_1_iff_pdivides[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<not> f pdivides gauss_poly R (order R ^ n)
?f \<in> carrier P - {\<zero>\<^bsub>P\<^esub>} \<Longrightarrow> (1 \<le> pmult f ?f) = f pdivides ?f

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = 0
[PROOF STEP]
using gauss_poly_carr gauss_poly_not_zero[OF o2] leI less_one
[PROOF STATE]
proof (prove)
using this:
\<not> f pdivides gauss_poly R (order R ^ n)
?f \<in> carrier P - {\<zero>\<^bsub>P\<^esub>} \<Longrightarrow> (1 \<le> pmult f ?f) = f pdivides ?f
gauss_poly R ?n \<in> carrier P
gauss_poly R (order R ^ n) \<noteq> \<zero>\<^bsub>P\<^esub>
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x
(?n < 1) = (?n = 0)

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pmult f (gauss_poly R (order R ^ n)) = 0

goal (1 subgoal):
 1. \<not> degree f dvd n \<Longrightarrow> pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pmult f (gauss_poly R (order R ^ n)) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pmult f (gauss_poly R (order R ^ n)) = 0

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
pmult f (gauss_poly R (order R ^ n)) = 0
\<not> degree f dvd n

goal (1 subgoal):
 1. pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pmult f (gauss_poly R (order R ^ n)) = of_bool (degree f dvd n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_lr_inverse_unique_divring:
  fixes   f g :: "'a ::division_ring fls"
  assumes fg: "f * g = 1"
  shows   "fls_left_inverse g (f $$ fls_subdegree f) = f"
  and     "fls_right_inverse f (g $$ fls_subdegree g) = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f &&& fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f
 2. fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
from fg
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
[PROOF STEP]
have "f \<noteq>0" "g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f * g = 1

goal (1 subgoal):
 1. f \<noteq> 0 &&& g \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<noteq> 0
g \<noteq> 0

goal (2 subgoals):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f
 2. fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
with fg
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
f \<noteq> 0
g \<noteq> 0
[PROOF STEP]
have "fls_subdegree f + fls_subdegree g = 0"
[PROOF STATE]
proof (prove)
using this:
f * g = 1
f \<noteq> 0
g \<noteq> 0

goal (1 subgoal):
 1. fls_subdegree f + fls_subdegree g = 0
[PROOF STEP]
using fls_subdegree_mult
[PROOF STATE]
proof (prove)
using this:
f * g = 1
f \<noteq> 0
g \<noteq> 0
\<lbrakk>?f \<noteq> 0; ?g \<noteq> 0\<rbrakk> \<Longrightarrow> fls_subdegree (?f * ?g) = fls_subdegree ?f + fls_subdegree ?g

goal (1 subgoal):
 1. fls_subdegree f + fls_subdegree g = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
fls_subdegree f + fls_subdegree g = 0

goal (2 subgoals):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f
 2. fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
with fg
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
fls_subdegree f + fls_subdegree g = 0
[PROOF STEP]
have "f $$ fls_subdegree f * g $$ fls_subdegree g = 1"
[PROOF STATE]
proof (prove)
using this:
f * g = 1
fls_subdegree f + fls_subdegree g = 0

goal (1 subgoal):
 1. f $$ fls_subdegree f * g $$ fls_subdegree g = (1::'a)
[PROOF STEP]
using fls_times_base[of f g]
[PROOF STATE]
proof (prove)
using this:
f * g = 1
fls_subdegree f + fls_subdegree g = 0
(f * g) $$ (fls_subdegree f + fls_subdegree g) = f $$ fls_subdegree f * g $$ fls_subdegree g

goal (1 subgoal):
 1. f $$ fls_subdegree f * g $$ fls_subdegree g = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f $$ fls_subdegree f * g $$ fls_subdegree g = (1::'a)

goal (2 subgoals):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f
 2. fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
hence "g $$ fls_subdegree g * f $$ fls_subdegree f = 1"
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * g $$ fls_subdegree g = (1::'a)

goal (1 subgoal):
 1. g $$ fls_subdegree g * f $$ fls_subdegree f = (1::'a)
[PROOF STEP]
using inverse_unique[of "f $$ fls_subdegree f"] left_inverse[of "f $$ fls_subdegree f"]
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * g $$ fls_subdegree g = (1::'a)
f $$ fls_subdegree f * ?b = (1::'a) \<Longrightarrow> inverse (f $$ fls_subdegree f) = ?b
f $$ fls_subdegree f \<noteq> (0::'a) \<Longrightarrow> inverse (f $$ fls_subdegree f) * f $$ fls_subdegree f = (1::'a)

goal (1 subgoal):
 1. g $$ fls_subdegree g * f $$ fls_subdegree f = (1::'a)
[PROOF STEP]
by    force
[PROOF STATE]
proof (state)
this:
g $$ fls_subdegree g * f $$ fls_subdegree f = (1::'a)

goal (2 subgoals):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f
 2. fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
thus
    "fls_left_inverse g (f $$ fls_subdegree f) = f"
    "fls_right_inverse f (g $$ fls_subdegree g) = g"
[PROOF STATE]
proof (prove)
using this:
g $$ fls_subdegree g * f $$ fls_subdegree f = (1::'a)

goal (1 subgoal):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f &&& fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
using fg fls_lr_inverse_unique_ring1
[PROOF STATE]
proof (prove)
using this:
g $$ fls_subdegree g * f $$ fls_subdegree f = (1::'a)
f * g = 1
\<lbrakk>?f * ?g = 1; ?g $$ fls_subdegree ?g * ?f $$ fls_subdegree ?f = (1::?'a)\<rbrakk> \<Longrightarrow> fls_left_inverse ?g (?f $$ fls_subdegree ?f) = ?f
\<lbrakk>?f * ?g = 1; ?g $$ fls_subdegree ?g * ?f $$ fls_subdegree ?f = (1::?'a)\<rbrakk> \<Longrightarrow> fls_right_inverse ?f (?g $$ fls_subdegree ?g) = ?g

goal (1 subgoal):
 1. fls_left_inverse g (f $$ fls_subdegree f) = f &&& fls_right_inverse f (g $$ fls_subdegree g) = g
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
fls_left_inverse g (f $$ fls_subdegree f) = f
fls_right_inverse f (g $$ fls_subdegree g) = g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dist_fs_infinite1:
  shows "dist_fs (of_complex z1) \<infinity>\<^sub>h = 2 / sqrt (1+(cmod z1)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist_fs (of_complex z1) \<infinity>\<^sub>h = 2 / sqrt (1 + (cmod z1)\<^sup>2)
[PROOF STEP]
by (transfer, transfer) (subst cmod_square, simp add: real_sqrt_divide)


[STATEMENT]
lemma (in Corps) vp_gen_nonzero:"\<lbrakk>valuation K v; vp K v = (Vr K v) \<diamondsuit>\<^sub>p t\<rbrakk> \<Longrightarrow>
                 t \<noteq> \<zero>\<^bsub>Vr K v\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; vp K v = Vr K v \<diamondsuit>\<^sub>p t\<rbrakk> \<Longrightarrow> t \<noteq> \<zero>\<^bsub>Vr K v\<^esub>
[PROOF STEP]
apply (rule contrapos_pp, simp+,
       cut_tac Ring.Rxa_zero[of "Vr K v"], drule sym, simp,
       simp add:vp_nonzero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; vp K v = Vr K v \<diamondsuit>\<^sub>p \<zero>\<^bsub>Vr K v\<^esub>; t = \<zero>\<^bsub>Vr K v\<^esub>\<rbrakk> \<Longrightarrow> Ring (Vr K v)
[PROOF STEP]
apply (simp add:Vr_ring)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma radical_sqrt_simultaneous_linear_equation:
  assumes a: "a \<in> radical_sqrt"
  and b: "b \<in> radical_sqrt"
  and c: "c \<in> radical_sqrt"
  and d: "d \<in> radical_sqrt"
  and e: "e \<in> radical_sqrt"
  and f: "f \<in> radical_sqrt"
  and NotNull: "\<not> (a*e - b*d =0 & a*f - c*d = 0 & e*c = b*f)"
  and eq0: "a*x + b*y = c"
  and eq1: "d*x + e*y = f"
  shows "x \<in> radical_sqrt & y \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
proof (cases "a*e - b*d =0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a * e - b * d \<noteq> 0

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
hence "(a*e-b*d) * x = (e*c-b*f)"
[PROOF STATE]
proof (prove)
using this:
a * e - b * d \<noteq> 0

goal (1 subgoal):
 1. (a * e - b * d) * x = e * c - b * f
[PROOF STEP]
using eq0 eq1
[PROOF STATE]
proof (prove)
using this:
a * e - b * d \<noteq> 0
a * x + b * y = c
d * x + e * y = f

goal (1 subgoal):
 1. (a * e - b * d) * x = e * c - b * f
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(a * e - b * d) * x = e * c - b * f

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
hence x: "x = (e*c-b*f) / (a*e-b*d)"
[PROOF STATE]
proof (prove)
using this:
(a * e - b * d) * x = e * c - b * f

goal (1 subgoal):
 1. x = (e * c - b * f) / (a * e - b * d)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
(a * e - b * d) * x = e * c - b * f
a * e - b * d \<noteq> 0

goal (1 subgoal):
 1. x = (e * c - b * f) / (a * e - b * d)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x = (e * c - b * f) / (a * e - b * d)

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
hence "(a*e-b*d) * y = (a*f - d*c)"
[PROOF STATE]
proof (prove)
using this:
x = (e * c - b * f) / (a * e - b * d)

goal (1 subgoal):
 1. (a * e - b * d) * y = a * f - d * c
[PROOF STEP]
using eq0 eq1
[PROOF STATE]
proof (prove)
using this:
x = (e * c - b * f) / (a * e - b * d)
a * x + b * y = c
d * x + e * y = f

goal (1 subgoal):
 1. (a * e - b * d) * y = a * f - d * c
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(a * e - b * d) * y = a * f - d * c

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
hence y: "y = (a*f-d*c)/(a*e-b*d)"
[PROOF STATE]
proof (prove)
using this:
(a * e - b * d) * y = a * f - d * c

goal (1 subgoal):
 1. y = (a * f - d * c) / (a * e - b * d)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
(a * e - b * d) * y = a * f - d * c
a * e - b * d \<noteq> 0

goal (1 subgoal):
 1. y = (a * f - d * c) / (a * e - b * d)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
y = (a * f - d * c) / (a * e - b * d)

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
have ae_rad: "(a*e -b*d) \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * e - b * d \<in> radical_sqrt
[PROOF STEP]
using a e b d radical_sqrt.simps
[PROOF STATE]
proof (prove)
using this:
a \<in> radical_sqrt
e \<in> radical_sqrt
b \<in> radical_sqrt
d \<in> radical_sqrt
(?a \<in> radical_sqrt) = ((\<exists>x. ?a = x \<and> x \<in> \<rat>) \<or> (\<exists>x. ?a = - x \<and> x \<in> radical_sqrt) \<or> (\<exists>x. ?a = 1 / x \<and> x \<in> radical_sqrt \<and> x \<noteq> 0) \<or> (\<exists>x y. ?a = x + y \<and> x \<in> radical_sqrt \<and> y \<in> radical_sqrt) \<or> (\<exists>x y. ?a = x * y \<and> x \<in> radical_sqrt \<and> y \<in> radical_sqrt) \<or> (\<exists>x. ?a = sqrt x \<and> x \<in> radical_sqrt \<and> 0 \<le> x))

goal (1 subgoal):
 1. a * e - b * d \<in> radical_sqrt
[PROOF STEP]
by (metis radical_sqrt.intros(5) radical_sqrt_rule_subtraction)
[PROOF STATE]
proof (state)
this:
a * e - b * d \<in> radical_sqrt

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
hence "((e*c-b*f) / (a*e-b*d)) \<in> radical_sqrt"  "((a*f-d*c) / (a*e-b*d)) \<in> radical_sqrt"
[PROOF STATE]
proof (prove)
using this:
a * e - b * d \<in> radical_sqrt

goal (1 subgoal):
 1. (e * c - b * f) / (a * e - b * d) \<in> radical_sqrt &&& (a * f - d * c) / (a * e - b * d) \<in> radical_sqrt
[PROOF STEP]
using False a b c d e f
[PROOF STATE]
proof (prove)
using this:
a * e - b * d \<in> radical_sqrt
a * e - b * d \<noteq> 0
a \<in> radical_sqrt
b \<in> radical_sqrt
c \<in> radical_sqrt
d \<in> radical_sqrt
e \<in> radical_sqrt
f \<in> radical_sqrt

goal (1 subgoal):
 1. (e * c - b * f) / (a * e - b * d) \<in> radical_sqrt &&& (a * f - d * c) / (a * e - b * d) \<in> radical_sqrt
[PROOF STEP]
by (auto intro!: radical_sqrt.intros(5) radical_sqrt_rule_division radical_sqrt_rule_subtraction)
[PROOF STATE]
proof (state)
this:
(e * c - b * f) / (a * e - b * d) \<in> radical_sqrt
(a * f - d * c) / (a * e - b * d) \<in> radical_sqrt

goal (2 subgoals):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
 2. a * e - b * d \<noteq> 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(e * c - b * f) / (a * e - b * d) \<in> radical_sqrt
(a * f - d * c) / (a * e - b * d) \<in> radical_sqrt

goal (1 subgoal):
 1. x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
by (simp add: x y)
[PROOF STATE]
proof (state)
this:
x \<in> radical_sqrt \<and> y \<in> radical_sqrt

goal (1 subgoal):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a * e - b * d = 0

goal (1 subgoal):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
hence "(a*e-b*d) * x = (e*c-b*f)" "(a*e-b*d) * y = (a*f - d*c)"
[PROOF STATE]
proof (prove)
using this:
a * e - b * d = 0

goal (1 subgoal):
 1. (a * e - b * d) * x = e * c - b * f &&& (a * e - b * d) * y = a * f - d * c
[PROOF STEP]
using eq0 eq1
[PROOF STATE]
proof (prove)
using this:
a * e - b * d = 0
a * x + b * y = c
d * x + e * y = f

goal (1 subgoal):
 1. (a * e - b * d) * x = e * c - b * f &&& (a * e - b * d) * y = a * f - d * c
[PROOF STEP]
by algebra+
[PROOF STATE]
proof (state)
this:
(a * e - b * d) * x = e * c - b * f
(a * e - b * d) * y = a * f - d * c

goal (1 subgoal):
 1. a * e - b * d = 0 \<Longrightarrow> x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(a * e - b * d) * x = e * c - b * f
(a * e - b * d) * y = a * f - d * c

goal (1 subgoal):
 1. x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
using NotNull True
[PROOF STATE]
proof (prove)
using this:
(a * e - b * d) * x = e * c - b * f
(a * e - b * d) * y = a * f - d * c
\<not> (a * e - b * d = 0 \<and> a * f - c * d = 0 \<and> e * c = b * f)
a * e - b * d = 0

goal (1 subgoal):
 1. x \<in> radical_sqrt \<and> y \<in> radical_sqrt
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> radical_sqrt \<and> y \<in> radical_sqrt

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_base:
 "foldl (+) (k + m) ns = foldl (+) m ns + (k :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (+) (k + m) ns = foldl (+) m ns + k
[PROOF STEP]
by (induction ns arbitrary: m, simp_all, subst add.assoc, simp)


[STATEMENT]
lemma succ_ne_self [simp]: "i \<noteq> succ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> ZFC_in_HOL.succ i
[PROOF STEP]
by (metis elts_succ insertI1 mem_not_refl)


[STATEMENT]
theorem I_qe_dlo: "DLO.I (qe_dlo \<phi>) xs = DLO.I \<phi> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DLO.I (qe_dlo \<phi>) xs = DLO.I \<phi> xs
[PROOF STEP]
unfolding qe_dlo_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DLO.I (DLO\<^sub>e.lift_dnfeq_qe qe_dlo\<^sub>1 \<phi>) xs = DLO.I \<phi> xs
[PROOF STEP]
by(fastforce intro!: I_qe_dlo\<^sub>1 qfree_qe_dlo\<^sub>1 DLO\<^sub>e.I_lift_dnfeq_qe
        simp: is_Less_iff not_is_Eq_iff split:atom.splits cong:conj_cong)


[STATEMENT]
lemma "\<Gamma>\<turnstile>\<^sub>t \<lbrace>\<acute>I \<le> 3\<rbrace>
     WHILE \<acute>I < 10 INV \<lbrace>\<acute>I\<le> 10\<rbrace> VAR MEASURE 10 - \<acute>I
     DO
       \<acute>I :== \<acute>I + 1
     OD
  \<lbrace>\<acute>I = 10\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile>\<^sub>t \<lbrace>\<acute>I \<le> 3\<rbrace> WHILE \<acute>I < 10 INV \<lbrace>\<acute>I \<le> 10\<rbrace> VAR MEASURE 10 - \<acute>I DO \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>I = 10\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>I. I \<le> 3 \<Longrightarrow> I \<le> 10
 2. \<And>I. \<lbrakk>I \<le> 10; I < 10\<rbrakk> \<Longrightarrow> 10 - (I + 1) < 10 - I \<and> I + 1 \<le> 10
 3. \<And>I. \<lbrakk>I \<le> 10; \<not> I < 10\<rbrakk> \<Longrightarrow> I = 10
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma range_binaryset_eq: "range(binaryset A B) = {A,B,{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (binaryset A B) = {A, B, {}}
[PROOF STEP]
apply (simp add: binaryset_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert A (insert B ((\<lambda>x. {}) ` ({x. x \<noteq> Suc 0} \<inter> Collect ((<) 0)))) = {A, B, {}}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x \<in> insert A (insert B ((\<lambda>x. {}) ` ({x. x \<noteq> Suc 0} \<inter> Collect ((<) 0))))) = (x \<in> {A, B, {}})
[PROOF STEP]
apply (auto simp add: image_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Ring) ideal_prod_mono2:"\<lbrakk>ideal R A; ideal R B; ideal R C;
                A \<subseteq> B \<rbrakk> \<Longrightarrow> C \<diamondsuit>\<^sub>r A \<subseteq> C \<diamondsuit>\<^sub>r B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; ideal R B; ideal R C; A \<subseteq> B\<rbrakk> \<Longrightarrow> C \<diamondsuit>\<^sub>r A \<subseteq> C \<diamondsuit>\<^sub>r B
[PROOF STEP]
apply (frule ideal_prod_mono1[of "A" "B" "C"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; ideal R B; ideal R C; A \<subseteq> B; A \<diamondsuit>\<^sub>r C \<subseteq> B \<diamondsuit>\<^sub>r C\<rbrakk> \<Longrightarrow> C \<diamondsuit>\<^sub>r A \<subseteq> C \<diamondsuit>\<^sub>r B
[PROOF STEP]
apply (simp add:ideal_prod_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma B_authenticates_A_bis:
     "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> \<in> set evs;
        Gets B (Cert2) \<in> set evs;
         B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B);
         evs \<in> srb \<rbrakk>
      \<Longrightarrow> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, Key K, Cert2\<rbrace> \<in> set evs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> \<in> set evs; Gets B Cert2 \<in> set evs; B \<noteq> Spy; \<not> illegalUse (Card A); \<not> illegalUse (Card B); evs \<in> srb\<rbrakk> \<Longrightarrow> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Cert2\<rbrace> \<in> set evs
[PROOF STEP]
apply (blast dest: Outpts_B_Card_form_7 B_authenticates_A)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iexp_approx1: "cmod (iexp x - (\<Sum>k \<le> n. (\<i> * x)^k / fact k)) \<le> \<bar>x\<bar>^(Suc n) / fact (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
have "iexp x - (\<Sum>k \<le> n. (\<i> * x)^k / fact k) =
      ((\<i> ^ (Suc n)) / (fact n)) * (CLBINT s=0..x. (x - s)^n * (iexp s))" (is "?t1 = ?t2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k) = \<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)
[PROOF STEP]
by (subst iexp_eq1 [of _ n], simp add: field_simps)
[PROOF STATE]
proof (state)
this:
iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k) = \<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k) = \<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)
[PROOF STEP]
have "cmod (?t1) = cmod (?t2)"
[PROOF STATE]
proof (prove)
using this:
iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k) = \<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) = cmod (\<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) = cmod (\<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s))

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) = cmod (\<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s))

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
have "\<dots> =  (1 / of_nat (fact n)) * cmod (CLBINT s=0..x. (x - s)^n * (iexp s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (\<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)) = 1 / real (fact n) * cmod (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)
[PROOF STEP]
by (simp add: norm_mult norm_divide norm_power)
[PROOF STATE]
proof (state)
this:
cmod (\<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)) = 1 / real (fact n) * cmod (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (\<i> ^ Suc n / fact n * (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)) = 1 / real (fact n) * cmod (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s)

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
have "\<dots> \<le> (1 / of_nat (fact n)) * \<bar>LBINT s=0..x. cmod ((x - s)^n * (iexp s))\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real (fact n) * cmod (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s) \<le> 1 / real (fact n) * \<bar>LBINT s=0..ereal x. cmod (complex_of_real ((x - s) ^ n) * iexp s)\<bar>
[PROOF STEP]
by (intro mult_left_mono interval_integral_norm2)
       (auto simp: zero_ereal_def intro: interval_integrable_isCont)
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * cmod (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s) \<le> 1 / real (fact n) * \<bar>LBINT s=0..ereal x. cmod (complex_of_real ((x - s) ^ n) * iexp s)\<bar>

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * cmod (CLBINT s=0..ereal x. complex_of_real ((x - s) ^ n) * iexp s) \<le> 1 / real (fact n) * \<bar>LBINT s=0..ereal x. cmod (complex_of_real ((x - s) ^ n) * iexp s)\<bar>

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
have "\<dots> \<le> (1 / of_nat (fact n)) * \<bar>LBINT s=0..x. \<bar>(x - s)^n\<bar>\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real (fact n) * \<bar>LBINT s=0..ereal x. cmod (complex_of_real ((x - s) ^ n) * iexp s)\<bar> \<le> 1 / real (fact n) * \<bar>LBINT s=0..ereal x. \<bar>(x - s) ^ n\<bar>\<bar>
[PROOF STEP]
by (simp add: norm_mult del: of_real_diff of_real_power)
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * \<bar>LBINT s=0..ereal x. cmod (complex_of_real ((x - s) ^ n) * iexp s)\<bar> \<le> 1 / real (fact n) * \<bar>LBINT s=0..ereal x. \<bar>(x - s) ^ n\<bar>\<bar>

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * \<bar>LBINT s=0..ereal x. cmod (complex_of_real ((x - s) ^ n) * iexp s)\<bar> \<le> 1 / real (fact n) * \<bar>LBINT s=0..ereal x. \<bar>(x - s) ^ n\<bar>\<bar>

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
have "\<dots> \<le> (1 / of_nat (fact n)) * \<bar>x ^ (Suc n) / (Suc n)\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real (fact n) * \<bar>LBINT s=0..ereal x. \<bar>(x - s) ^ n\<bar>\<bar> \<le> 1 / real (fact n) * \<bar>x ^ Suc n / real (Suc n)\<bar>
[PROOF STEP]
by (simp add: abs_LBINT_I0c_abs_power_diff)
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * \<bar>LBINT s=0..ereal x. \<bar>(x - s) ^ n\<bar>\<bar> \<le> 1 / real (fact n) * \<bar>x ^ Suc n / real (Suc n)\<bar>

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * \<bar>LBINT s=0..ereal x. \<bar>(x - s) ^ n\<bar>\<bar> \<le> 1 / real (fact n) * \<bar>x ^ Suc n / real (Suc n)\<bar>

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
have "1 / real_of_nat (fact n::nat) * \<bar>x ^ Suc n / real (Suc n)\<bar> =
      \<bar>x\<bar> ^ Suc n / fact (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real (fact n) * \<bar>x ^ Suc n / real (Suc n)\<bar> = \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
by (simp add: abs_mult power_abs)
[PROOF STATE]
proof (state)
this:
1 / real (fact n) * \<bar>x ^ Suc n / real (Suc n)\<bar> = \<bar>x\<bar> ^ Suc n / fact (Suc n)

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)

goal (1 subgoal):
 1. cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (iexp x - (\<Sum>k\<le>n. (\<i> * complex_of_real x) ^ k / fact k)) \<le> \<bar>x\<bar> ^ Suc n / fact (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adjuster_carrier[simp]:
  assumes w: "(w :: 'a vec) : carrier_vec n"
    and us: "set (us :: 'a vec list) \<subseteq> carrier_vec n"
    and dist: "distinct us"
  shows "adjuster n w us : carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w us \<in> carrier_vec n
[PROOF STEP]
using adjuster_in_span span_closed assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> carrier_vec n; set ?us \<subseteq> carrier_vec n; distinct ?us\<rbrakk> \<Longrightarrow> adjuster n ?w ?us \<in> local.span (set ?us)
\<lbrakk>?U \<subseteq> carrier_vec n; ?v \<in> local.span ?U\<rbrakk> \<Longrightarrow> ?v \<in> carrier_vec n
w \<in> carrier_vec n
set us \<subseteq> carrier_vec n
distinct us

goal (1 subgoal):
 1. adjuster n w us \<in> carrier_vec n
[PROOF STEP]
by auto