[STATEMENT]
lemma cf_array_ArrMap_vdomain[cat_cs_simps]:
  "\<D>\<^sub>\<circ> (cf_array \<BB> \<CC> \<DD> \<FF> \<GG>\<lparr>ArrMap\<rparr>) = (\<BB> \<times>\<^sub>C \<CC>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_array \<BB> \<CC> \<DD> \<FF> \<GG>\<lparr>ArrMap\<rparr>) = (\<BB> \<times>\<^sub>C \<CC>)\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding cf_array_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>f\<in>\<^sub>\<circ>(\<BB> \<times>\<^sub>C \<CC>)\<lparr>Arr\<rparr>. \<GG> (\<BB>\<lparr>Cod\<rparr>\<lparr>f\<lparr>[]\<^sub>\<circ>\<rparr>\<rparr>)\<lparr>ArrMap\<rparr>\<lparr>f\<lparr>1\<^sub>\<nat>\<rparr>\<rparr> \<circ>\<^sub>A\<^bsub>\<DD>\<^esub> \<FF> (\<CC>\<lparr>Dom\<rparr>\<lparr>f\<lparr>1\<^sub>\<nat>\<rparr>\<rparr>)\<lparr>ArrMap\<rparr>\<lparr>f\<lparr>[]\<^sub>\<circ>\<rparr>\<rparr>) = (\<BB> \<times>\<^sub>C \<CC>)\<lparr>Arr\<rparr>
[PROOF STEP]
by simp


[STATEMENT]
lemma to_fun_unit_eq':
  assumes "f \<in> carrier (SA n)"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f x = \<zero>"
  shows "to_fun_unit n f x = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun_unit n f x = \<one>
[PROOF STEP]
unfolding to_fun_unit_def fun_glue_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). if x \<in> {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>} then f x else \<one>\<^bsub>SA n\<^esub> x) x = \<one>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f x = \<zero>

goal (1 subgoal):
 1. (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). if x \<in> {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>} then f x else \<one>\<^bsub>SA n\<^esub> x) x = \<one>
[PROOF STEP]
by (simp add: SA_oneE)


[STATEMENT]
lemma (in Corps) n_val_n_pow:"\<lbrakk>valuation K v; x \<in> carrier (Vr K v); 0 \<le> n\<rbrakk> \<Longrightarrow>
         (n \<le> (n_val K v x)) = (x \<in> (vp K v) \<^bsup>(Vr K v)  n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier (Vr K v); 0 \<le> n\<rbrakk> \<Longrightarrow> (n \<le> n_val K v x) = (x \<in> vp K v\<^bsup> Vr K v n\<^esup>)
[PROOF STEP]
by (rule iffI, simp add:n_value_x_2, simp add:n_value_x_1)


[STATEMENT]
lemma galois_1: "x \<cdot> -y \<le> z \<longleftrightarrow> x \<le> y + z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<cdot> - y \<le> z) = (x \<le> y + z)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<cdot> - y \<le> z \<Longrightarrow> x \<le> y + z
 2. x \<le> y + z \<Longrightarrow> x \<cdot> - y \<le> z
[PROOF STEP]
apply (metis inf_le2 join_iso le_iff_sup le_supE join_isol aux4)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y + z \<Longrightarrow> x \<cdot> - y \<le> z
[PROOF STEP]
apply (metis meet_iso aux6 le_infE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_field_factorization_explicit:
  fixes f::"'a mod_ring poly"
  assumes sf_f: "square_free f"
    and us: "finite_field_factorization f = (c,us)"
  shows "f = smult c (prod_list us) \<and> (\<forall> u \<in> set us. monic u \<and> irreducible u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
proof (cases "degree f = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
degree f \<noteq> 0

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
note f = this
[PROOF STATE]
proof (state)
this:
degree f \<noteq> 0

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
define g where "g = smult (inverse c) f"
[PROOF STATE]
proof (state)
this:
g = Polynomial.smult (inverse c) f

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
obtain gs where dist: "(if use_distinct_degree_factorization then distinct_degree_factorization g else [(1,g)]) = gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>gs. (if use_distinct_degree_factorization then distinct_degree_factorization g else [(1, g)]) = gs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if use_distinct_degree_factorization then distinct_degree_factorization g else [(1, g)]) = gs

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
note us = us[unfolded finite_field_factorization_def Let_def]
[PROOF STATE]
proof (state)
this:
(if degree f = 0 then (lead_coeff f, []) else case List.partition (\<lambda>(i, f). degree f = i) (if use_distinct_degree_factorization then distinct_degree_factorization (Polynomial.smult (inverse (lead_coeff f)) f) else [(1, Polynomial.smult (inverse (lead_coeff f)) f)]) of (irr, hs) \<Rightarrow> (lead_coeff f, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from us f
[PROOF STATE]
proof (chain)
picking this:
(if degree f = 0 then (lead_coeff f, []) else case List.partition (\<lambda>(i, f). degree f = i) (if use_distinct_degree_factorization then distinct_degree_factorization (Polynomial.smult (inverse (lead_coeff f)) f) else [(1, Polynomial.smult (inverse (lead_coeff f)) f)]) of (irr, hs) \<Rightarrow> (lead_coeff f, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)
degree f \<noteq> 0
[PROOF STEP]
have c: "c = lead_coeff f"
[PROOF STATE]
proof (prove)
using this:
(if degree f = 0 then (lead_coeff f, []) else case List.partition (\<lambda>(i, f). degree f = i) (if use_distinct_degree_factorization then distinct_degree_factorization (Polynomial.smult (inverse (lead_coeff f)) f) else [(1, Polynomial.smult (inverse (lead_coeff f)) f)]) of (irr, hs) \<Rightarrow> (lead_coeff f, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)
degree f \<noteq> 0

goal (1 subgoal):
 1. c = lead_coeff f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = lead_coeff f

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
obtain irr hs where part: "List.partition (\<lambda> (i, f). degree f = i) gs = (irr,hs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>irr hs. List.partition (\<lambda>(i, f). degree f = i) gs = (irr, hs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
List.partition (\<lambda>(i, f). degree f = i) gs = (irr, hs)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from arg_cong[OF this, of fst]
[PROOF STATE]
proof (chain)
picking this:
fst (List.partition (\<lambda>(i, f). degree f = i) gs) = fst (irr, hs)
[PROOF STEP]
have irr: "irr = filter (\<lambda> (i, f). degree f = i) gs"
[PROOF STATE]
proof (prove)
using this:
fst (List.partition (\<lambda>(i, f). degree f = i) gs) = fst (irr, hs)

goal (1 subgoal):
 1. irr = filter (\<lambda>(i, f). degree f = i) gs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
irr = filter (\<lambda>(i, f). degree f = i) gs

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from us[folded c, folded g_def, unfolded dist part split] f
[PROOF STATE]
proof (chain)
picking this:
(if degree f = 0 then (c, []) else (c, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)
degree f \<noteq> 0
[PROOF STEP]
have us: "us = map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)"
[PROOF STATE]
proof (prove)
using this:
(if degree f = 0 then (c, []) else (c, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)
degree f \<noteq> 0

goal (1 subgoal):
 1. us = map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us = map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from f c
[PROOF STATE]
proof (chain)
picking this:
degree f \<noteq> 0
c = lead_coeff f
[PROOF STEP]
have c0: "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree f \<noteq> 0
c = lead_coeff f

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

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from False c0
[PROOF STATE]
proof (chain)
picking this:
degree f \<noteq> 0
c \<noteq> 0
[PROOF STEP]
have deg_g: "degree g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree f \<noteq> 0
c \<noteq> 0

goal (1 subgoal):
 1. degree g \<noteq> 0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
degree f \<noteq> 0
c \<noteq> 0

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

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
have mon_g: "monic g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic g
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (Polynomial.smult (inverse c) f)
[PROOF STEP]
by (metis c c0 field_class.field_inverse lead_coeff_smult)
[PROOF STATE]
proof (state)
this:
monic g

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from sf_f
[PROOF STATE]
proof (chain)
picking this:
square_free f
[PROOF STEP]
have sf_g: "square_free g"
[PROOF STATE]
proof (prove)
using this:
square_free f

goal (1 subgoal):
 1. square_free g
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
square_free f

goal (1 subgoal):
 1. square_free (Polynomial.smult (inverse c) f)
[PROOF STEP]
by (simp add: c0)
[PROOF STATE]
proof (state)
this:
square_free g

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from c0
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
have f: "f = smult c g"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. f = Polynomial.smult c g
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. f = Polynomial.smult c (Polynomial.smult (inverse c) f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = Polynomial.smult c g

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
have "g = prod_list (map snd gs) \<and> (\<forall> (i,f) \<in> set gs. degree f > 0 \<and> monic f \<and> (\<forall> h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
proof (cases use_distinct_degree_factorization)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
 2. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
use_distinct_degree_factorization

goal (2 subgoals):
 1. use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
 2. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
with dist
[PROOF STATE]
proof (chain)
picking this:
(if use_distinct_degree_factorization then distinct_degree_factorization g else [(1, g)]) = gs
use_distinct_degree_factorization
[PROOF STEP]
have "distinct_degree_factorization g = gs"
[PROOF STATE]
proof (prove)
using this:
(if use_distinct_degree_factorization then distinct_degree_factorization g else [(1, g)]) = gs
use_distinct_degree_factorization

goal (1 subgoal):
 1. distinct_degree_factorization g = gs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct_degree_factorization g = gs

goal (2 subgoals):
 1. use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
 2. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
note dist = distinct_degree_factorization[OF this sf_g mon_g]
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd gs) \<and> (\<forall>i f. (i, f) \<in> set gs \<longrightarrow> factors_of_same_degree i f)

goal (2 subgoals):
 1. use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
 2. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
from dist
[PROOF STATE]
proof (chain)
picking this:
g = prod_list (map snd gs) \<and> (\<forall>i f. (i, f) \<in> set gs \<longrightarrow> factors_of_same_degree i f)
[PROOF STEP]
have g: "g = prod_list (map snd gs)"
[PROOF STATE]
proof (prove)
using this:
g = prod_list (map snd gs) \<and> (\<forall>i f. (i, f) \<in> set gs \<longrightarrow> factors_of_same_degree i f)

goal (1 subgoal):
 1. g = prod_list (map snd gs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd gs)

goal (2 subgoals):
 1. use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
 2. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
proof (intro conjI[OF g] ballI, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set gs \<Longrightarrow> 0 < degree b \<and> monic b \<and> (\<forall>h. h dvd b \<longrightarrow> degree h = a \<longrightarrow> irreducible h)
[PROOF STEP]
fix i f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set gs \<Longrightarrow> 0 < degree b \<and> monic b \<and> (\<forall>h. h dvd b \<longrightarrow> degree h = a \<longrightarrow> irreducible h)
[PROOF STEP]
assume "(i,f) \<in> set gs"
[PROOF STATE]
proof (state)
this:
(i, f) \<in> set gs

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set gs \<Longrightarrow> 0 < degree b \<and> monic b \<and> (\<forall>h. h dvd b \<longrightarrow> degree h = a \<longrightarrow> irreducible h)
[PROOF STEP]
with dist
[PROOF STATE]
proof (chain)
picking this:
g = prod_list (map snd gs) \<and> (\<forall>i f. (i, f) \<in> set gs \<longrightarrow> factors_of_same_degree i f)
(i, f) \<in> set gs
[PROOF STEP]
have "factors_of_same_degree i f"
[PROOF STATE]
proof (prove)
using this:
g = prod_list (map snd gs) \<and> (\<forall>i f. (i, f) \<in> set gs \<longrightarrow> factors_of_same_degree i f)
(i, f) \<in> set gs

goal (1 subgoal):
 1. factors_of_same_degree i f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
factors_of_same_degree i f

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set gs \<Longrightarrow> 0 < degree b \<and> monic b \<and> (\<forall>h. h dvd b \<longrightarrow> degree h = a \<longrightarrow> irreducible h)
[PROOF STEP]
from factors_of_same_degreeD[OF this]
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> 0
degree f \<noteq> 0
monic f
?g dvd f \<Longrightarrow> irreducible ?g = (degree ?g = i)
[PROOF STEP]
show "degree f > 0 \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h)"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0
degree f \<noteq> 0
monic f
?g dvd f \<Longrightarrow> irreducible ?g = (degree ?g = i)

goal (1 subgoal):
 1. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))

goal (1 subgoal):
 1. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> use_distinct_degree_factorization

goal (1 subgoal):
 1. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
with dist
[PROOF STATE]
proof (chain)
picking this:
(if use_distinct_degree_factorization then distinct_degree_factorization g else [(1, g)]) = gs
\<not> use_distinct_degree_factorization
[PROOF STEP]
have gs: "gs = [(1,g)]"
[PROOF STATE]
proof (prove)
using this:
(if use_distinct_degree_factorization then distinct_degree_factorization g else [(1, g)]) = gs
\<not> use_distinct_degree_factorization

goal (1 subgoal):
 1. gs = [(1, g)]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gs = [(1, g)]

goal (1 subgoal):
 1. \<not> use_distinct_degree_factorization \<Longrightarrow> g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
unfolding gs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = prod_list (map snd [(1, g)]) \<and> (\<forall>(i, f)\<in>set [(1, g)]. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
using deg_g mon_g linear_irreducible\<^sub>d[where 'a = "'a mod_ring"]
[PROOF STATE]
proof (prove)
using this:
degree g \<noteq> 0
monic g
degree ?p = 1 \<Longrightarrow> irreducible\<^sub>d ?p

goal (1 subgoal):
 1. g = prod_list (map snd [(1, g)]) \<and> (\<forall>(i, f)\<in>set [(1, g)]. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
hence g_gs: "g = prod_list (map snd gs)"
    and mon_gs: "\<And> i f. (i, f) \<in> set gs \<Longrightarrow> monic f \<and> degree f > 0"
    and irrI: "\<And> i f h . (i, f) \<in> set gs \<Longrightarrow> h dvd f \<Longrightarrow> degree h = i \<Longrightarrow> irreducible h"
[PROOF STATE]
proof (prove)
using this:
g = prod_list (map snd gs) \<and> (\<forall>(i, f)\<in>set gs. 0 < degree f \<and> monic f \<and> (\<forall>h. h dvd f \<longrightarrow> degree h = i \<longrightarrow> irreducible h))

goal (1 subgoal):
 1. g = prod_list (map snd gs) &&& (\<And>i f. (i, f) \<in> set gs \<Longrightarrow> monic f \<and> 0 < degree f) &&& (\<And>i f h. \<lbrakk>(i, f) \<in> set gs; h dvd f; degree h = i\<rbrakk> \<Longrightarrow> irreducible h)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd gs)
(?i, ?f) \<in> set gs \<Longrightarrow> monic ?f \<and> 0 < degree ?f
\<lbrakk>(?i, ?f) \<in> set gs; ?h dvd ?f; degree ?h = ?i\<rbrakk> \<Longrightarrow> irreducible ?h

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
have g: "g = prod_list (map snd irr) * prod_list (map snd hs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = prod_list (map snd irr) * prod_list (map snd hs)
[PROOF STEP]
unfolding g_gs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map snd gs) = prod_list (map snd irr) * prod_list (map snd hs)
[PROOF STEP]
using prod_list_map_partition[OF part]
[PROOF STATE]
proof (prove)
using this:
prod_list (map ?g gs) = prod_list (map ?g irr) * prod_list (map ?g hs)

goal (1 subgoal):
 1. prod_list (map snd gs) = prod_list (map snd irr) * prod_list (map snd hs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd irr) * prod_list (map snd hs)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
g = prod_list (map snd irr) * prod_list (map snd hs)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
assume "f \<in> snd ` set irr"
[PROOF STATE]
proof (state)
this:
f \<in> snd ` set irr

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from this[unfolded irr]
[PROOF STATE]
proof (chain)
picking this:
f \<in> snd ` set (filter (\<lambda>(i, f). degree f = i) gs)
[PROOF STEP]
obtain i where *:  "(i,f) \<in> set gs" "degree f = i"
[PROOF STATE]
proof (prove)
using this:
f \<in> snd ` set (filter (\<lambda>(i, f). degree f = i) gs)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>(i, f) \<in> set gs; degree f = i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i, f) \<in> set gs
degree f = i

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
have "f dvd f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f dvd f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f dvd f

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
from irrI[OF *(1) this *(2)] mon_gs[OF *(1)]
[PROOF STATE]
proof (chain)
picking this:
irreducible f
monic f \<and> 0 < degree f
[PROOF STEP]
have "monic f" "irreducible f"
[PROOF STATE]
proof (prove)
using this:
irreducible f
monic f \<and> 0 < degree f

goal (1 subgoal):
 1. monic f &&& irreducible f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
monic f
irreducible f

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?fa2 \<in> snd ` set irr \<Longrightarrow> monic ?fa2
?fa2 \<in> snd ` set irr \<Longrightarrow> irreducible ?fa2

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
note irr = this
[PROOF STATE]
proof (state)
this:
?fa2 \<in> snd ` set irr \<Longrightarrow> monic ?fa2
?fa2 \<in> snd ` set irr \<Longrightarrow> irreducible ?fa2

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
let ?berl = "\<lambda> hs. concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
have "set hs \<subseteq> set gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set hs \<subseteq> set gs
[PROOF STEP]
using part
[PROOF STATE]
proof (prove)
using this:
List.partition (\<lambda>(i, f). degree f = i) gs = (irr, hs)

goal (1 subgoal):
 1. set hs \<subseteq> set gs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set hs \<subseteq> set gs

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
hence "prod_list (map snd hs) = prod_list (?berl hs)
    \<and> (\<forall> f \<in> set (?berl hs). monic f \<and> irreducible\<^sub>d f)"
[PROOF STATE]
proof (prove)
using this:
set hs \<subseteq> set gs

goal (1 subgoal):
 1. prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
proof (induct hs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
case (Cons ih hs)
[PROOF STATE]
proof (state)
this:
set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)). monic f \<and> irreducible\<^sub>d f)
set (ih # hs) \<subseteq> set gs

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
obtain i h where ih: "ih = (i,h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i h. ih = (i, h) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
ih = (i, h)

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
have "?berl (Cons ih hs) = berlekamp_monic_factorization i h @ ?berl hs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (ih # hs)) = berlekamp_monic_factorization i h @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)
[PROOF STEP]
unfolding ih
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) ((i, h) # hs)) = berlekamp_monic_factorization i h @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (ih # hs)) = berlekamp_monic_factorization i h @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
from Cons(2)[unfolded ih]
[PROOF STATE]
proof (chain)
picking this:
set ((i, h) # hs) \<subseteq> set gs
[PROOF STEP]
have mem: "(i,h) \<in> set gs" and sub: "set hs \<subseteq> set gs"
[PROOF STATE]
proof (prove)
using this:
set ((i, h) # hs) \<subseteq> set gs

goal (1 subgoal):
 1. (i, h) \<in> set gs &&& set hs \<subseteq> set gs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i, h) \<in> set gs
set hs \<subseteq> set gs

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
note IH = Cons(1)[OF sub]
[PROOF STATE]
proof (state)
this:
prod_list (map snd hs) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)). monic f \<and> irreducible\<^sub>d f)

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
from mem
[PROOF STATE]
proof (chain)
picking this:
(i, h) \<in> set gs
[PROOF STEP]
have "h \<in> set (map snd gs)"
[PROOF STATE]
proof (prove)
using this:
(i, h) \<in> set gs

goal (1 subgoal):
 1. h \<in> set (map snd gs)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
h \<in> set (map snd gs)

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
from square_free_factor[OF prod_list_dvd[OF this], folded g_gs, OF sf_g]
[PROOF STATE]
proof (chain)
picking this:
square_free h
[PROOF STEP]
have sf: "square_free h"
[PROOF STATE]
proof (prove)
using this:
square_free h

goal (1 subgoal):
 1. square_free h
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
square_free h

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
from mon_gs[OF mem] irrI[OF mem]
[PROOF STATE]
proof (chain)
picking this:
monic h \<and> 0 < degree h
\<lbrakk>?h dvd h; degree ?h = i\<rbrakk> \<Longrightarrow> irreducible ?h
[PROOF STEP]
have *: "degree h > 0" "monic h"
      "\<And> g. g dvd h \<Longrightarrow> degree g = i \<Longrightarrow> irreducible g"
[PROOF STATE]
proof (prove)
using this:
monic h \<and> 0 < degree h
\<lbrakk>?h dvd h; degree ?h = i\<rbrakk> \<Longrightarrow> irreducible ?h

goal (1 subgoal):
 1. 0 < degree h &&& monic h &&& (\<And>g. \<lbrakk>g dvd h; degree g = i\<rbrakk> \<Longrightarrow> irreducible g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < degree h
monic h
\<lbrakk>?g1 dvd h; degree ?g1 = i\<rbrakk> \<Longrightarrow> irreducible ?g1

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
from berlekamp_monic_factorization[OF sf refl *(3) *(1-2), of i]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>g. \<lbrakk>g dvd h; degree g = i\<rbrakk> \<Longrightarrow> g dvd h; \<And>g. \<lbrakk>g dvd h; degree g = i\<rbrakk> \<Longrightarrow> degree g = i\<rbrakk> \<Longrightarrow> h = prod_list (berlekamp_monic_factorization i h) \<and> (\<forall>u\<in>set (berlekamp_monic_factorization i h). monic u \<and> irreducible u)
[PROOF STEP]
have berl: "prod_list (berlekamp_monic_factorization i h) = h"
      and irr: "\<And> f. f \<in> set (berlekamp_monic_factorization i h) \<Longrightarrow> monic f \<and> irreducible f"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>g. \<lbrakk>g dvd h; degree g = i\<rbrakk> \<Longrightarrow> g dvd h; \<And>g. \<lbrakk>g dvd h; degree g = i\<rbrakk> \<Longrightarrow> degree g = i\<rbrakk> \<Longrightarrow> h = prod_list (berlekamp_monic_factorization i h) \<and> (\<forall>u\<in>set (berlekamp_monic_factorization i h). monic u \<and> irreducible u)

goal (1 subgoal):
 1. prod_list (berlekamp_monic_factorization i h) = h &&& (\<And>f. f \<in> set (berlekamp_monic_factorization i h) \<Longrightarrow> monic f \<and> irreducible f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list (berlekamp_monic_factorization i h) = h
?f1 \<in> set (berlekamp_monic_factorization i h) \<Longrightarrow> monic ?f1 \<and> irreducible ?f1

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
have "prod_list (map snd (Cons ih hs)) = h * prod_list (map snd hs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map snd (ih # hs)) = h * prod_list (map snd hs)
[PROOF STEP]
unfolding ih
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map snd ((i, h) # hs)) = h * prod_list (map snd hs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod_list (map snd (ih # hs)) = h * prod_list (map snd hs)

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod_list (map snd (ih # hs)) = h * prod_list (map snd hs)

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
have "prod_list (map snd hs) = prod_list (?berl hs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))
[PROOF STEP]
using IH
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd hs) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)). monic f \<and> irreducible\<^sub>d f)

goal (1 subgoal):
 1. prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod_list (map snd (ih # hs)) = h * prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))
[PROOF STEP]
have "prod_list (map snd (Cons ih hs)) = prod_list (?berl (Cons ih hs))"
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd (ih # hs)) = h * prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))

goal (1 subgoal):
 1. prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (ih # hs)))
[PROOF STEP]
unfolding ih
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd ((i, h) # hs)) = h * prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))

goal (1 subgoal):
 1. prod_list (map snd ((i, h) # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) ((i, h) # hs)))
[PROOF STEP]
using berl
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd ((i, h) # hs)) = h * prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))
prod_list (berlekamp_monic_factorization i h) = h

goal (1 subgoal):
 1. prod_list (map snd ((i, h) # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) ((i, h) # hs)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (ih # hs)))

goal (2 subgoals):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
 2. \<And>a hs. \<lbrakk>set hs \<subseteq> set gs \<Longrightarrow> prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f); set (a # hs) \<subseteq> set gs\<rbrakk> \<Longrightarrow> prod_list (map snd (a # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (a # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (ih # hs)))

goal (1 subgoal):
 1. prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) (ih # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) (ih # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
using IH irr
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) (ih # hs)))
prod_list (map snd hs) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)). monic f \<and> irreducible\<^sub>d f)
?f1 \<in> set (berlekamp_monic_factorization i h) \<Longrightarrow> monic ?f1 \<and> irreducible ?f1

goal (1 subgoal):
 1. prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) (ih # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) (ih # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
unfolding ih
[PROOF STATE]
proof (prove)
using this:
prod_list (map snd ((i, h) # hs)) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) ((i, h) # hs)))
prod_list (map snd hs) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) hs)). monic f \<and> irreducible\<^sub>d f)
?f1 \<in> set (berlekamp_monic_factorization i h) \<Longrightarrow> monic ?f1 \<and> irreducible ?f1

goal (1 subgoal):
 1. prod_list (map snd ((i, h) # hs)) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) ((i, h) # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) ((i, h) # hs))). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list (map snd (ih # hs)) = prod_list (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) (ih # hs))) \<and> (\<forall>f\<in>set (concat (map (\<lambda>a. case a of (a, b) \<Rightarrow> berlekamp_monic_factorization a b) (ih # hs))). monic f \<and> irreducible\<^sub>d f)

goal (1 subgoal):
 1. set [] \<subseteq> set gs \<Longrightarrow> prod_list (map snd []) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) [])). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
with g irr
[PROOF STATE]
proof (chain)
picking this:
g = prod_list (map snd irr) * prod_list (map snd hs)
?fa2 \<in> snd ` set irr \<Longrightarrow> monic ?fa2
?fa2 \<in> snd ` set irr \<Longrightarrow> irreducible ?fa2
prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f)
[PROOF STEP]
have main: "g = prod_list us \<and> (\<forall> u \<in> set us. monic u \<and> irreducible\<^sub>d u)"
[PROOF STATE]
proof (prove)
using this:
g = prod_list (map snd irr) * prod_list (map snd hs)
?fa2 \<in> snd ` set irr \<Longrightarrow> monic ?fa2
?fa2 \<in> snd ` set irr \<Longrightarrow> irreducible ?fa2
prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f)

goal (1 subgoal):
 1. g = prod_list us \<and> (\<forall>u\<in>set us. monic u \<and> irreducible\<^sub>d u)
[PROOF STEP]
unfolding us
[PROOF STATE]
proof (prove)
using this:
g = prod_list (map snd irr) * prod_list (map snd hs)
?fa2 \<in> snd ` set irr \<Longrightarrow> monic ?fa2
?fa2 \<in> snd ` set irr \<Longrightarrow> irreducible ?fa2
prod_list (map snd hs) = prod_list (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>f\<in>set (concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic f \<and> irreducible\<^sub>d f)

goal (1 subgoal):
 1. g = prod_list (map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)) \<and> (\<forall>u\<in>set (map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs)). monic u \<and> irreducible\<^sub>d u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g = prod_list us \<and> (\<forall>u\<in>set us. monic u \<and> irreducible\<^sub>d u)

goal (2 subgoals):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
 2. degree f \<noteq> 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
g = prod_list us \<and> (\<forall>u\<in>set us. monic u \<and> irreducible\<^sub>d u)

goal (1 subgoal):
 1. f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
using this:
g = prod_list us \<and> (\<forall>u\<in>set us. monic u \<and> irreducible\<^sub>d u)

goal (1 subgoal):
 1. Polynomial.smult c g = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
using sf_g
[PROOF STATE]
proof (prove)
using this:
g = prod_list us \<and> (\<forall>u\<in>set us. monic u \<and> irreducible\<^sub>d u)
square_free g

goal (1 subgoal):
 1. Polynomial.smult c g = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)

goal (1 subgoal):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree f = 0

goal (1 subgoal):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
with us[unfolded finite_field_factorization_def]
[PROOF STATE]
proof (chain)
picking this:
(if degree f = 0 then (lead_coeff f, []) else let a = lead_coeff f; u = Polynomial.smult (inverse a) f; gs = if use_distinct_degree_factorization then distinct_degree_factorization u else [(1, u)]; (irr, hs) = List.partition (\<lambda>(i, f). degree f = i) gs in (a, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)
degree f = 0
[PROOF STEP]
have "c = lead_coeff f" and us: "us = []"
[PROOF STATE]
proof (prove)
using this:
(if degree f = 0 then (lead_coeff f, []) else let a = lead_coeff f; u = Polynomial.smult (inverse a) f; gs = if use_distinct_degree_factorization then distinct_degree_factorization u else [(1, u)]; (irr, hs) = List.partition (\<lambda>(i, f). degree f = i) gs in (a, map snd irr @ concat (map (\<lambda>(x, y). berlekamp_monic_factorization x y) hs))) = (c, us)
degree f = 0

goal (1 subgoal):
 1. c = lead_coeff f &&& us = []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = lead_coeff f
us = []

goal (1 subgoal):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
with degree0_coeffs[OF True]
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. f = [:a:]
c = lead_coeff f
us = []
[PROOF STEP]
have f: "f = [:c:]"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. f = [:a:]
c = lead_coeff f
us = []

goal (1 subgoal):
 1. f = [:c:]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = [:c:]

goal (1 subgoal):
 1. degree f = 0 \<Longrightarrow> f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)
[PROOF STEP]
unfolding us f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:c:] = Polynomial.smult c (prod_list []) \<and> (\<forall>u\<in>set []. monic u \<and> irreducible u)
[PROOF STEP]
by (auto simp: normalize_poly_def)
[PROOF STATE]
proof (state)
this:
f = Polynomial.smult c (prod_list us) \<and> (\<forall>u\<in>set us. monic u \<and> irreducible u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pre_ex_unch:
  assumes h: "stutinv F"
  shows "\<exists>(v::'a::world \<Rightarrow> 'a). ( |~ F \<and> Unchanged v \<longrightarrow> \<circle>F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. (|~ F \<and> Unchanged v \<longrightarrow> \<circle>F)
[PROOF STEP]
using pre_id_unch[OF h]
[PROOF STATE]
proof (prove)
using this:
|~ F \<and> Unchanged id \<longrightarrow> \<circle>F

goal (1 subgoal):
 1. \<exists>v. (|~ F \<and> Unchanged v \<longrightarrow> \<circle>F)
[PROOF STEP]
by blast


[STATEMENT]
lemma complex_cos_eq:
  fixes w :: complex
  shows "cos w = cos z \<longleftrightarrow> (\<exists>n \<in> \<int>. w = z + of_real(2*n*pi) \<or> w = -z + of_real(2*n*pi))"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos w = cos z) = (\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cos w = cos z \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
cos w = cos z

goal (2 subgoals):
 1. cos w = cos z \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cos w = cos z
[PROOF STEP]
have "cos w - cos z = 0"
[PROOF STATE]
proof (prove)
using this:
cos w = cos z

goal (1 subgoal):
 1. cos w - cos z = 0
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
cos w - cos z = 0

goal (2 subgoals):
 1. cos w = cos z \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cos w - cos z = 0
[PROOF STEP]
have "sin ((w + z) / 2) * sin ((z - w) / 2) = 0"
[PROOF STATE]
proof (prove)
using this:
cos w - cos z = 0

goal (1 subgoal):
 1. sin ((w + z) / 2) * sin ((z - w) / 2) = 0
[PROOF STEP]
by (auto simp: cos_diff_cos)
[PROOF STATE]
proof (state)
this:
sin ((w + z) / 2) * sin ((z - w) / 2) = 0

goal (2 subgoals):
 1. cos w = cos z \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sin ((w + z) / 2) * sin ((z - w) / 2) = 0
[PROOF STEP]
consider "sin ((w + z) / 2) = 0" | "sin ((z - w) / 2) = 0"
[PROOF STATE]
proof (prove)
using this:
sin ((w + z) / 2) * sin ((z - w) / 2) = 0

goal (1 subgoal):
 1. \<lbrakk>sin ((w + z) / 2) = 0 \<Longrightarrow> thesis; sin ((z - w) / 2) = 0 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using mult_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
sin ((w + z) / 2) * sin ((z - w) / 2) = 0
(?a * ?b = (0::?'a)) = (?a = (0::?'a) \<or> ?b = (0::?'a))

goal (1 subgoal):
 1. \<lbrakk>sin ((w + z) / 2) = 0 \<Longrightarrow> thesis; sin ((z - w) / 2) = 0 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>sin ((w + z) / 2) = 0 \<Longrightarrow> ?thesis; sin ((z - w) / 2) = 0 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (2 subgoals):
 1. cos w = cos z \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>sin ((w + z) / 2) = 0 \<Longrightarrow> ?thesis; sin ((z - w) / 2) = 0 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sin ((w + z) / 2) = 0 \<Longrightarrow> ?thesis; sin ((z - w) / 2) = 0 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sin ((w + z) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
sin ((w + z) / 2) = 0

goal (2 subgoals):
 1. sin ((w + z) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sin ((w + z) / 2) = 0
[PROOF STEP]
obtain n where "w + z = of_int n * (complex_of_real pi * 2)"
[PROOF STATE]
proof (prove)
using this:
sin ((w + z) / 2) = 0

goal (1 subgoal):
 1. (\<And>n. w + z = of_int n * (complex_of_real pi * 2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: sin_eq_0 algebra_simps)
[PROOF STATE]
proof (state)
this:
w + z = of_int n * (complex_of_real pi * 2)

goal (2 subgoals):
 1. sin ((w + z) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w + z = of_int n * (complex_of_real pi * 2)
[PROOF STEP]
have "w = -z + of_real(2 * of_int n * pi)"
[PROOF STATE]
proof (prove)
using this:
w + z = of_int n * (complex_of_real pi * 2)

goal (1 subgoal):
 1. w = - z + complex_of_real (2 * real_of_int n * pi)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
w = - z + complex_of_real (2 * real_of_int n * pi)

goal (2 subgoals):
 1. sin ((w + z) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
 2. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w = - z + complex_of_real (2 * real_of_int n * pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w = - z + complex_of_real (2 * real_of_int n * pi)

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
using Ints_of_int
[PROOF STATE]
proof (prove)
using this:
w = - z + complex_of_real (2 * real_of_int n * pi)
of_int ?z \<in> \<int>

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)

goal (1 subgoal):
 1. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
sin ((z - w) / 2) = 0

goal (1 subgoal):
 1. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sin ((z - w) / 2) = 0
[PROOF STEP]
obtain n where "z = w + of_int n * (complex_of_real pi * 2)"
[PROOF STATE]
proof (prove)
using this:
sin ((z - w) / 2) = 0

goal (1 subgoal):
 1. (\<And>n. z = w + of_int n * (complex_of_real pi * 2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: sin_eq_0 algebra_simps)
[PROOF STATE]
proof (state)
this:
z = w + of_int n * (complex_of_real pi * 2)

goal (1 subgoal):
 1. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = w + of_int n * (complex_of_real pi * 2)
[PROOF STEP]
have "w = z + complex_of_real (2 * of_int(-n) * pi)"
[PROOF STATE]
proof (prove)
using this:
z = w + of_int n * (complex_of_real pi * 2)

goal (1 subgoal):
 1. w = z + complex_of_real (2 * real_of_int (- n) * pi)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
w = z + complex_of_real (2 * real_of_int (- n) * pi)

goal (1 subgoal):
 1. sin ((z - w) / 2) = 0 \<Longrightarrow> \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w = z + complex_of_real (2 * real_of_int (- n) * pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w = z + complex_of_real (2 * real_of_int (- n) * pi)

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
using Ints_of_int
[PROOF STATE]
proof (prove)
using this:
w = z + complex_of_real (2 * real_of_int (- n) * pi)
of_int ?z \<in> \<int>

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
[PROOF STEP]
obtain n::int where w: "w = z + of_real (2* of_int n*pi) \<or>
                               w = -z + of_real(2*n*pi)"
[PROOF STATE]
proof (prove)
using this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)

goal (1 subgoal):
 1. (\<And>n. w = z + complex_of_real (2 * real_of_int n * pi) \<or> w = - z + complex_of_real (real_of_int (2 * n) * pi) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Ints_cases
[PROOF STATE]
proof (prove)
using this:
\<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi)
\<lbrakk>?q \<in> \<int>; \<And>z. ?q = of_int z \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>n. w = z + complex_of_real (2 * real_of_int n * pi) \<or> w = - z + complex_of_real (real_of_int (2 * n) * pi) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis of_int_mult of_int_numeral)
[PROOF STATE]
proof (state)
this:
w = z + complex_of_real (2 * real_of_int n * pi) \<or> w = - z + complex_of_real (real_of_int (2 * n) * pi)

goal (1 subgoal):
 1. \<exists>n\<in>\<int>. w = z + complex_of_real (2 * n * pi) \<or> w = - z + complex_of_real (2 * n * pi) \<Longrightarrow> cos w = cos z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w = z + complex_of_real (2 * real_of_int n * pi) \<or> w = - z + complex_of_real (real_of_int (2 * n) * pi)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
w = z + complex_of_real (2 * real_of_int n * pi) \<or> w = - z + complex_of_real (real_of_int (2 * n) * pi)

goal (1 subgoal):
 1. cos w = cos z
[PROOF STEP]
using Periodic_Fun.cos.plus_of_int [of z n]
[PROOF STATE]
proof (prove)
using this:
w = z + complex_of_real (2 * real_of_int n * pi) \<or> w = - z + complex_of_real (real_of_int (2 * n) * pi)
cos (z + of_int n * (2 * complex_of_real pi)) = cos z

goal (1 subgoal):
 1. cos w = cos z
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w = z + of_int n * (complex_of_real pi * 2) \<or> w + z = of_int n * (complex_of_real pi * 2); cos (z + of_int n * (complex_of_real pi * 2)) = cos z\<rbrakk> \<Longrightarrow> cos w = cos z
[PROOF STEP]
by (metis cos.plus_of_int cos_minus minus_add_cancel mult.commute)
[PROOF STATE]
proof (state)
this:
cos w = cos z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphism_translation:
  fixes a :: "'a :: real_normed_vector"
  shows "homeomorphism ((+) a ` S) S ((+) (- a)) ((+) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism ((+) a ` S) S ((+) (- a)) ((+) a)
[PROOF STEP]
unfolding homeomorphism_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>(+) a ` S. a + (- a + x) = x) \<and> (+) (- a) ` (+) a ` S = S \<and> continuous_on ((+) a ` S) ((+) (- a)) \<and> (\<forall>y\<in>S. - a + (a + y) = y) \<and> (+) a ` S = (+) a ` S \<and> continuous_on S ((+) a)
[PROOF STEP]
by (auto simp: algebra_simps continuous_intros)


[STATEMENT]
lemma n_eq_1_imp: "s \<in> S \<Longrightarrow> cfg \<in> cfg_on s \<Longrightarrow> n s = 1 \<Longrightarrow> v cfg = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> S; cfg \<in> cfg_on s; n s = 1\<rbrakk> \<Longrightarrow> v cfg = 1
[PROOF STEP]
using n_le_v[of s cfg] v_le_1[of cfg]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>s \<in> S; cfg \<in> cfg_on s\<rbrakk> \<Longrightarrow> n s \<le> v cfg
cfg \<in> valid_cfg \<Longrightarrow> v cfg \<le> 1

goal (1 subgoal):
 1. \<lbrakk>s \<in> S; cfg \<in> cfg_on s; n s = 1\<rbrakk> \<Longrightarrow> v cfg = 1
[PROOF STEP]
by (auto intro: antisym valid_cfgI)


[STATEMENT]
lemma index_swaps_last_size: "distinct s \<Longrightarrow>
  size s \<le> index (swaps sws s) (last s) + length sws + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct s \<Longrightarrow> length s \<le> index (swaps sws s) (last s) + length sws + 1
[PROOF STEP]
apply(cases "s = []")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>distinct s; s = []\<rbrakk> \<Longrightarrow> length s \<le> index (swaps sws s) (last s) + length sws + 1
 2. \<lbrakk>distinct s; s \<noteq> []\<rbrakk> \<Longrightarrow> length s \<le> index (swaps sws s) (last s) + length sws + 1
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct s; s \<noteq> []\<rbrakk> \<Longrightarrow> length s \<le> index (swaps sws s) (last s) + length sws + 1
[PROOF STEP]
using index_swaps_size[of s "last s" sws]
[PROOF STATE]
proof (prove)
using this:
distinct s \<Longrightarrow> index s (last s) \<le> index (swaps sws s) (last s) + length sws

goal (1 subgoal):
 1. \<lbrakk>distinct s; s \<noteq> []\<rbrakk> \<Longrightarrow> length s \<le> index (swaps sws s) (last s) + length sws + 1
[PROOF STEP]
by simp


[STATEMENT]
lemma coplanar_ABCA'B'C'P :
  assumes "rk {A, A'} = 2" and "rk {A, B, C, A', B', C'} = 3" and "rk {A, A', P} = 2"
  shows "rk {A, B, C, A', B', C', P} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} = 3
[PROOF STEP]
have "rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}
[PROOF STEP]
using matroid_ax_3_alt[of "{A, A'}" "{A, B, C, A', B', C'}" "{A, A', P}"]
[PROOF STATE]
proof (prove)
using this:
{A, A'} \<subseteq> {A, B, C, A', B', C'} \<inter> {A, A', P} \<Longrightarrow> rk ({A, B, C, A', B', C'} \<union> {A, A', P}) + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}
[PROOF STEP]
have "rk {A, B, C, A', B', C', P} \<le> 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} \<le> 3
[PROOF STEP]
using assms(1) assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, A', B', C', P} + rk {A, A'} \<le> rk {A, B, C, A', B', C'} + rk {A, A', P}
rk {A, A'} = 2
rk {A, B, C, A', B', C'} = 3
rk {A, A', P} = 2

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} \<le> 3
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
rk {A, B, C, A', B', C', P} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, C, A', B', C', P} \<le> 3
[PROOF STEP]
show "rk {A, B, C, A', B', C', P} = 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, A', B', C', P} \<le> 3

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} = 3
[PROOF STEP]
using assms(2) matroid_ax_2
[PROOF STATE]
proof (prove)
using this:
rk {A, B, C, A', B', C', P} \<le> 3
rk {A, B, C, A', B', C'} = 3
?X \<subseteq> ?Y \<longrightarrow> rk ?X \<le> rk ?Y

goal (1 subgoal):
 1. rk {A, B, C, A', B', C', P} = 3
[PROOF STEP]
by (metis Un_insert_right Un_upper2 le_antisym sup_bot.right_neutral)
[PROOF STATE]
proof (state)
this:
rk {A, B, C, A', B', C', P} = 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subcocycle_avg_max:
  assumes "subcocycle u" "subcocycle v" "subcocycle_avg_ereal u > - \<infinity>" "subcocycle_avg_ereal v > - \<infinity>"
  shows "subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x)) > -\<infinity>"
        "subcocycle_avg (\<lambda>n x. max (u n x) (v n x)) \<ge> max (subcocycle_avg u) (subcocycle_avg v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x)) &&& max (subcocycle_avg u) (subcocycle_avg v) \<le> subcocycle_avg (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - \<infinity> < subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x))
 2. max (subcocycle_avg u) (subcocycle_avg v) \<le> subcocycle_avg (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
show *: "subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x)) > - \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
using assms(3) subcocycle_avg_ereal_max[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
- \<infinity> < subcocycle_avg_ereal u
max (subcocycle_avg_ereal u) (subcocycle_avg_ereal v) \<le> subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x))

goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- \<infinity> < subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x))

goal (1 subgoal):
 1. max (subcocycle_avg u) (subcocycle_avg v) \<le> subcocycle_avg (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
have "ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x))) \<ge> max (ereal(subcocycle_avg u)) (ereal(subcocycle_avg v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (ereal (subcocycle_avg u)) (ereal (subcocycle_avg v)) \<le> ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x)))
[PROOF STEP]
using subcocycle_avg_real_ereal[OF assms(3)] subcocycle_avg_real_ereal[OF assms(4)]
      subcocycle_avg_real_ereal[OF *] subcocycle_avg_ereal_max[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
subcocycle_avg_ereal u = ereal (subcocycle_avg u)
subcocycle_avg_ereal v = ereal (subcocycle_avg v)
subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x)) = ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x)))
max (subcocycle_avg_ereal u) (subcocycle_avg_ereal v) \<le> subcocycle_avg_ereal (\<lambda>n x. max (u n x) (v n x))

goal (1 subgoal):
 1. max (ereal (subcocycle_avg u)) (ereal (subcocycle_avg v)) \<le> ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max (ereal (subcocycle_avg u)) (ereal (subcocycle_avg v)) \<le> ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x)))

goal (1 subgoal):
 1. max (subcocycle_avg u) (subcocycle_avg v) \<le> subcocycle_avg (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
max (ereal (subcocycle_avg u)) (ereal (subcocycle_avg v)) \<le> ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x)))
[PROOF STEP]
show "subcocycle_avg (\<lambda>n x. max (u n x) (v n x)) \<ge> max (subcocycle_avg u) (subcocycle_avg v)"
[PROOF STATE]
proof (prove)
using this:
max (ereal (subcocycle_avg u)) (ereal (subcocycle_avg v)) \<le> ereal (subcocycle_avg (\<lambda>n x. max (u n x) (v n x)))

goal (1 subgoal):
 1. max (subcocycle_avg u) (subcocycle_avg v) \<le> subcocycle_avg (\<lambda>n x. max (u n x) (v n x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max (subcocycle_avg u) (subcocycle_avg v) \<le> subcocycle_avg (\<lambda>n x. max (u n x) (v n x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_approx_gt_zero: "0 < x \<Longrightarrow> x \<notin> Infinitesimal \<Longrightarrow> x \<approx> y \<Longrightarrow> 0 < y"
  for x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<notin> Infinitesimal; x \<approx> y\<rbrakk> \<Longrightarrow> 0 < y
[PROOF STEP]
by (blast dest: Ball_mem_monad_gt_zero approx_subset_monad)


[STATEMENT]
lemma xy_le_xx_yy [mono_intros]:
  "x * y \<le> x^2/2 + y^2/2" for x y::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y \<le> x\<^sup>2 / 2 + y\<^sup>2 / 2
[PROOF STEP]
using xy_le_uxx_vyy[of 1 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; 1 * 1 = 1\<rbrakk> \<Longrightarrow> ?x * ?y \<le> 1 * ?x\<^sup>2 / 2 + 1 * ?y\<^sup>2 / 2

goal (1 subgoal):
 1. x * y \<le> x\<^sup>2 / 2 + y\<^sup>2 / 2
[PROOF STEP]
by auto


[STATEMENT]
lemma part_circlepath_rotate_left:
  "part_circlepath c r (x + a) (x + b) = (\<lambda>z. c + cis x * (z - c)) \<circ> part_circlepath c r a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. part_circlepath c r (x + a) (x + b) = (\<lambda>z. c + cis x * (z - c)) \<circ> part_circlepath c r a b
[PROOF STEP]
by (simp add: part_circlepath_def exp_eq_polar fun_eq_iff
                linepath_translate_left linepath_translate_right cis_mult add_ac)


[STATEMENT]
lemma (in group) inj_on_f'':
    "\<lbrakk>H \<subseteq> carrier G;  a \<in> carrier G\<rbrakk> \<Longrightarrow> inj_on (\<lambda>y. inv a \<otimes> y) (a <# H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G\<rbrakk> \<Longrightarrow> inj_on ((\<otimes>) (inv a)) (a <# H)
[PROOF STEP]
apply (rule inj_onI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; inv a \<otimes> x = inv a \<otimes> y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (subgoal_tac "x \<in> carrier G & y \<in> carrier G")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; inv a \<otimes> x = inv a \<otimes> y; x \<in> carrier G \<and> y \<in> carrier G\<rbrakk> \<Longrightarrow> x = y
 2. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; inv a \<otimes> x = inv a \<otimes> y\<rbrakk> \<Longrightarrow> x \<in> carrier G \<and> y \<in> carrier G
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; inv a \<otimes> x = inv a \<otimes> y\<rbrakk> \<Longrightarrow> x \<in> carrier G \<and> y \<in> carrier G
 2. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; inv a \<otimes> x = inv a \<otimes> y; x \<in> carrier G \<and> y \<in> carrier G\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (blast intro: l_coset_subset_G [THEN subsetD])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; inv a \<otimes> x = inv a \<otimes> y; x \<in> carrier G \<and> y \<in> carrier G\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (simp add: subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma n_valid_Rmi_alt: "bdd_node_valid bdd na \<longleftrightarrow> (\<exists>b. (na, b) \<in> Rmi bdd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_node_valid bdd na = (\<exists>b. (na, b) \<in> Rmi bdd)
[PROOF STEP]
unfolding bdd_node_valid_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (na \<in> Domain (Rmi bdd)) = (\<exists>b. (na, b) \<in> Rmi bdd)
[PROOF STEP]
by auto


[STATEMENT]
lemma cont2cont_plus [simp, cont2cont]:
  assumes "cont (\<lambda>x. f x)" and "cont (\<lambda>x. g x)"
  shows "cont (\<lambda>x. f x + g x :: 'a::plus_cpo)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont (\<lambda>x. f x + g x)
[PROOF STEP]
apply (rule cont_apply [OF assms(1) cont_plus1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. cont (\<lambda>x. y + g x)
[PROOF STEP]
apply (rule cont_apply [OF assms(2) cont_plus2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y ya. cont (\<lambda>x. y + ya)
[PROOF STEP]
apply (rule cont_const)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma trail_Cons_iff:
  "trail u (e # es ) w \<longleftrightarrow> e \<in> arcs G \<and> u = tail G e \<and> e \<notin> set es \<and> trail (head G e) es w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trail u (e # es) w = (e \<in> arcs G \<and> u = tail G e \<and> e \<notin> set es \<and> trail (head G e) es w)
[PROOF STEP]
by (auto simp: trail_def awalk_Cons_iff)


[STATEMENT]
theorem Casorati_Weierstrass:
  assumes "open M" "z \<in> M" "f holomorphic_on (M - {z})"
      and "\<And>l. \<not> (f \<longlongrightarrow> l) (at z)" "\<And>l. \<not> ((inverse \<circ> f) \<longlongrightarrow> l) (at z)"
  shows "closure(f ` (M - {z})) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
obtain a where a: "- {a} \<subseteq> f ` (M - {z})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. - {a} \<subseteq> f ` (M - {z}) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using great_Picard_alt [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>a. - {a} \<subseteq> f ` (M - {z}) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a. - {a} \<subseteq> f ` (M - {z}) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- {a} \<subseteq> f ` (M - {z})

goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
have "UNIV = closure(- {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = closure (- {a})
[PROOF STEP]
by (simp add: closure_interior)
[PROOF STATE]
proof (state)
this:
UNIV = closure (- {a})

goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
UNIV = closure (- {a})

goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
have "... \<subseteq> closure(f ` (M - {z}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (- {a}) \<subseteq> closure (f ` (M - {z}))
[PROOF STEP]
by (simp add: a closure_mono)
[PROOF STATE]
proof (state)
this:
closure (- {a}) \<subseteq> closure (f ` (M - {z}))

goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
UNIV \<subseteq> closure (f ` (M - {z}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
UNIV \<subseteq> closure (f ` (M - {z}))

goal (1 subgoal):
 1. closure (f ` (M - {z})) = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closure (f ` (M - {z})) = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Interleaves_suffix_one_fst_1 [rule_format]:
 "P x [] \<Longrightarrow>
  xs \<cong> {ys, zs, \<lambda>w ws. P w (ws @ [x])} \<Longrightarrow> xs @ [x] \<cong> {ys @ [x], zs, P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P x []; xs \<cong> {ys, zs, \<lambda>w ws. P w (ws @ [x])}\<rbrakk> \<Longrightarrow> xs @ [x] \<cong> {ys @ [x], zs, P}
[PROOF STEP]
by (rule Interleaves_suffix_fst_1, simp)


[STATEMENT]
lemma section_map_compose:
   "\<lbrakk>section_map X Y f; section_map Y Z g\<rbrakk> \<Longrightarrow> section_map X Z (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>section_map X Y f; section_map Y Z g\<rbrakk> \<Longrightarrow> section_map X Z (g \<circ> f)
[PROOF STEP]
by (meson retraction_maps_compose section_map_def)


[STATEMENT]
lemma inc_above_dec_above_iff: "inc_above b i (dec_above b i x) = x \<longleftrightarrow> x < b \<or> b + i \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inc_above b i (dec_above b i x) = x) = (x < b \<or> b + i \<le> x)
[PROOF STEP]
by (auto simp: inc_above_def dec_above_def)


[STATEMENT]
lemma fps_exp_add_mult: "fps_exp (a + b) = fps_exp (a::'a::field_char_0) * fps_exp b" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_exp (a + b) = fps_exp a * fps_exp b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_exp (a + b) = fps_exp a * fps_exp b
[PROOF STEP]
have "fps_deriv ?r = fps_const (a + b) * ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_exp a * fps_exp b) = fps_const (a + b) * (fps_exp a * fps_exp b)
[PROOF STEP]
by (simp add: fps_const_add[symmetric] field_simps del: fps_const_add)
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_exp a * fps_exp b) = fps_const (a + b) * (fps_exp a * fps_exp b)

goal (1 subgoal):
 1. fps_exp (a + b) = fps_exp a * fps_exp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fps_deriv (fps_exp a * fps_exp b) = fps_const (a + b) * (fps_exp a * fps_exp b)
[PROOF STEP]
have "?r = ?l"
[PROOF STATE]
proof (prove)
using this:
fps_deriv (fps_exp a * fps_exp b) = fps_const (a + b) * (fps_exp a * fps_exp b)

goal (1 subgoal):
 1. fps_exp a * fps_exp b = fps_exp (a + b)
[PROOF STEP]
by (simp only: fps_exp_unique_ODE) (simp add: fps_mult_nth fps_exp_def)
[PROOF STATE]
proof (state)
this:
fps_exp a * fps_exp b = fps_exp (a + b)

goal (1 subgoal):
 1. fps_exp (a + b) = fps_exp a * fps_exp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fps_exp a * fps_exp b = fps_exp (a + b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_exp a * fps_exp b = fps_exp (a + b)

goal (1 subgoal):
 1. fps_exp (a + b) = fps_exp a * fps_exp b
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
fps_exp (a + b) = fps_exp a * fps_exp b

goal:
No subgoals!
[PROOF STEP]
qed