[STATEMENT]
lemma graeffe_recursion: assumes "graeffe_poly c as m = f"
  shows "graeffe_poly c as (Suc m) = smult ((-1)^(degree f)) (poly_square_subst (f * f \<circ>\<^sub>p [:0,-1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
let ?g = "graeffe_poly c as m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "f * f \<circ>\<^sub>p [:0,-1:] = ?g * ?g \<circ>\<^sub>p [:0,-1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = graeffe_poly c as m * graeffe_poly c as m \<circ>\<^sub>p [:0::'a, - (1::'a):]
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = graeffe_poly c as m * graeffe_poly c as m \<circ>\<^sub>p [:0::'a, - (1::'a):]

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = graeffe_poly c as m * graeffe_poly c as m \<circ>\<^sub>p [:0::'a, - (1::'a):]

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "?g \<circ>\<^sub>p [:0,-1:] = smult ((- 1) ^ length as) (smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graeffe_poly c as m \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
unfolding graeffe_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
proof (induct as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
case (Cons a as)
[PROOF STATE]
proof (state)
this:
Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
have "?case = ((smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1:] \<circ>\<^sub>p [:0, - 1:] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]) \<circ>\<^sub>p [:0, - 1:]) =
     smult (-1 * (- 1) ^ length as)
      (smult (c ^ 2 ^ m) ([: a ^ 2 ^ m, 1:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:])))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))
[PROOF STEP]
unfolding list.simps prod_list.Cons pcompose_smult pcompose_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])))) = (Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
have "smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1:] \<circ>\<^sub>p [:0, - 1:] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]) \<circ>\<^sub>p [:0, - 1:])
      = smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]) \<circ>\<^sub>p [:0, - 1:]) * [:- (a ^ 2 ^ m), 1:] \<circ>\<^sub>p [:0, - 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) * [:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):]
[PROOF STEP]
unfolding mult_smult_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] * [:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) * [:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):]

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polynomial.smult (c ^ 2 ^ m) ([:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) * [:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):]

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
have "smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]) \<circ>\<^sub>p [:0, - 1:]) =
      smult ((- 1) ^ length as) (smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
unfolding pcompose_smult[symmetric] Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polynomial.smult (c ^ 2 ^ m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):]) = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
have "[:- (a ^ 2 ^ m), 1:] \<circ>\<^sub>p [:0, - 1:] = smult (-1) [: a^2^m, 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[:- (a ^ 2 ^ m), 1::'a:] \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:]

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) * Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:] = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))
[PROOF STEP]
have id: "?case = (smult ((- 1) ^ length as) (smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:])) * smult (- 1) [:a ^ 2 ^ m, 1:] =
      smult (- 1 * (- 1) ^ length as) (smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:]))))"
[PROOF STATE]
proof (prove)
using this:
(Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) * Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:] = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))

goal (1 subgoal):
 1. (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) * Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:] = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))) = (Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) * Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:] = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))))

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
obtain c d where id': "(\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:]) = c" "[:a ^ 2 ^ m, 1:] = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c d. \<lbrakk>(\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = c; [:a ^ 2 ^ m, 1::'a:] = d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = c
[:a ^ 2 ^ m, 1::'a:] = d

goal (2 subgoals):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
 2. \<And>a as. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) \<Longrightarrow> Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) * Polynomial.smult (- (1::'a)) [:a ^ 2 ^ m, 1::'a:] = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])))
[PROOF STEP]
unfolding id'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) c) * Polynomial.smult (- (1::'a)) d = Polynomial.smult (- (1::'a) * (- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (d * c))
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length (a # as)) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]))

goal (1 subgoal):
 1. Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length []) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
graeffe_poly c as m \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = graeffe_poly c as m * Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
have "f * f \<circ>\<^sub>p [:0, - 1:] =
    smult ((- 1) ^ length as * (c ^ 2 ^ m * c ^ 2 ^ m))
    ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:]))"
[PROOF STATE]
proof (prove)
using this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = graeffe_poly c as m * Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (1 subgoal):
 1. f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * (c ^ 2 ^ m * c ^ 2 ^ m)) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
unfolding graeffe_poly_def
[PROOF STATE]
proof (prove)
using this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (1 subgoal):
 1. f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * (c ^ 2 ^ m * c ^ 2 ^ m)) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * (c ^ 2 ^ m * c ^ 2 ^ m)) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * (c ^ 2 ^ m * c ^ 2 ^ m)) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "c ^ 2 ^ m * c ^ 2 ^ m = c ^ 2 ^ (Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ^ 2 ^ m * c ^ 2 ^ m = c ^ 2 ^ Suc m
[PROOF STEP]
by (simp add: semiring_normalization_rules(36))
[PROOF STATE]
proof (state)
this:
c ^ 2 ^ m * c ^ 2 ^ m = c ^ 2 ^ Suc m

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c ^ 2 ^ m * c ^ 2 ^ m = c ^ 2 ^ Suc m

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "(\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1:]) =
    (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ (Suc m)), 1:]) \<circ>\<^sub>p monom 1 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
proof (induct as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
case (Cons a as)
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
have id: "(monom 1 2 :: 'a poly) = [:0,0,1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.monom (1::'a) 2 = [:0::'a, 0::'a, 1::'a:]
[PROOF STEP]
by (metis monom_altdef pCons_0_as_mult power2_eq_square smult_1_left)
[PROOF STATE]
proof (state)
this:
Polynomial.monom (1::'a) 2 = [:0::'a, 0::'a, 1::'a:]

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
have "(\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1:])
      = ([:- (a ^ 2 ^ m), 1:] * [: a ^ 2 ^ m, 1:]) * ((\<Prod>a\<leftarrow> as. [:- (a ^ 2 ^ m), 1:]) * (\<Prod>a\<leftarrow> as. [:a ^ 2 ^ m, 1:]))"
        (is "_ = ?a * ?b")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = [:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] * ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
unfolding list.simps prod_list.Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- (a ^ 2 ^ m), 1::'a:] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * ([:a ^ 2 ^ m, 1::'a:] * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:])) = [:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] * ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))
[PROOF STEP]
by (simp only: ac_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = [:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] * ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = [:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] * ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]))

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
have "?b = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1:]) \<circ>\<^sub>p monom 1 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
unfolding Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
have "?a = [: - (a ^ 2 ^ (Suc m)), 0 , 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] = [:- (a ^ 2 ^ Suc m), 0::'a, 1::'a:]
[PROOF STEP]
by (simp add: semiring_normalization_rules(36))
[PROOF STATE]
proof (state)
this:
[:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] = [:- (a ^ 2 ^ Suc m), 0::'a, 1::'a:]

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[:- (a ^ 2 ^ m), 1::'a:] * [:a ^ 2 ^ m, 1::'a:] = [:- (a ^ 2 ^ Suc m), 0::'a, 1::'a:]

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
have "\<dots> = [: - (a ^ 2 ^ (Suc m)), 1:] \<circ>\<^sub>p monom 1 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- (a ^ 2 ^ Suc m), 0::'a, 1::'a:] = [:- (a ^ 2 ^ Suc m), 1::'a:] \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
by (simp add: id)
[PROOF STATE]
proof (state)
this:
[:- (a ^ 2 ^ Suc m), 0::'a, 1::'a:] = [:- (a ^ 2 ^ Suc m), 1::'a:] \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[:- (a ^ 2 ^ Suc m), 0::'a, 1::'a:] = [:- (a ^ 2 ^ Suc m), 1::'a:] \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
have "[: - (a ^ 2 ^ (Suc m)), 1:] \<circ>\<^sub>p monom 1 2 * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1:]) \<circ>\<^sub>p monom 1 2 =
      (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1:]) \<circ>\<^sub>p monom 1 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- (a ^ 2 ^ Suc m), 1::'a:] \<circ>\<^sub>p Polynomial.monom (1::'a) 2 * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
unfolding pcompose_mult[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([:- (a ^ 2 ^ Suc m), 1::'a:] * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:])) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[:- (a ^ 2 ^ Suc m), 1::'a:] \<circ>\<^sub>p Polynomial.monom (1::'a) 2 * (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (2 subgoals):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
 2. \<And>a as. (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2 \<Longrightarrow> (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>a # as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>a # as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>[]. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>[]. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) * (\<Prod>a\<leftarrow>as. [:a ^ 2 ^ m, 1::'a:]) = (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * c ^ 2 ^ Suc m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2)
[PROOF STEP]
have "f * f \<circ>\<^sub>p [:0, - 1:] = (smult ((- 1) ^ length as) (graeffe_poly c as (Suc m)) \<circ>\<^sub>p monom 1 2)"
[PROOF STATE]
proof (prove)
using this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * c ^ 2 ^ Suc m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2)

goal (1 subgoal):
 1. f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (graeffe_poly c as (Suc m)) \<circ>\<^sub>p Polynomial.monom (1::'a) 2
[PROOF STEP]
unfolding graeffe_poly_def pcompose_smult
[PROOF STATE]
proof (prove)
using this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as * c ^ 2 ^ Suc m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2)

goal (1 subgoal):
 1. f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult (c ^ 2 ^ Suc m) ((\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ Suc m), 1::'a:]) \<circ>\<^sub>p Polynomial.monom (1::'a) 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f * f \<circ>\<^sub>p [:0::'a, - (1::'a):] = Polynomial.smult ((- (1::'a)) ^ length as) (graeffe_poly c as (Suc m)) \<circ>\<^sub>p Polynomial.monom (1::'a) 2

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
from arg_cong[OF this, of "\<lambda> f. smult ((- 1) ^ length as) (poly_square_subst f)", unfolded poly_square_subst]
[PROOF STATE]
proof (chain)
picking this:
Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult ((- (1::'a)) ^ length as) (graeffe_poly c as (Suc m)))
[PROOF STEP]
have "graeffe_poly c as (Suc m) = smult ((- 1) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0, - 1:]))"
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ length as) (Polynomial.smult ((- (1::'a)) ^ length as) (graeffe_poly c as (Suc m)))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "\<dots> = smult ((- 1) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0, - 1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
proof (cases "f = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
 2. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f = 0

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
 2. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f = 0

goal (1 subgoal):
 1. Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
by (auto simp: poly_square_subst_def)
[PROOF STATE]
proof (state)
this:
Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
graeffe_poly c as m = f
f \<noteq> 0
[PROOF STEP]
have c0: "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
graeffe_poly c as m = f
f \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> (0::'a)
[PROOF STEP]
unfolding graeffe_poly_def
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) = f
f \<noteq> 0

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

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
from arg_cong[OF assms, of degree]
[PROOF STATE]
proof (chain)
picking this:
degree (graeffe_poly c as m) = degree f
[PROOF STEP]
have "degree f = degree (smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:]))"
[PROOF STATE]
proof (prove)
using this:
degree (graeffe_poly c as m) = degree f

goal (1 subgoal):
 1. degree f = degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]))
[PROOF STEP]
unfolding graeffe_poly_def
[PROOF STATE]
proof (prove)
using this:
degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])) = degree f

goal (1 subgoal):
 1. degree f = degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree f = degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]))

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree f = degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]))

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "\<dots> = degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])) = degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])
[PROOF STEP]
unfolding degree_smult_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if c ^ 2 ^ m = (0::'a) then 0 else degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])) = degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])
[PROOF STEP]
using c0
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. (if c ^ 2 ^ m = (0::'a) then 0 else degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])) = degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])) = degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (Polynomial.smult (c ^ 2 ^ m) (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])) = degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:])

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
have "\<dots> = length as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) = length as
[PROOF STEP]
unfolding degree_linear_factors
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length as = length as
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (\<Prod>a\<leftarrow>as. [:- (a ^ 2 ^ m), 1::'a:]) = length as

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree f = length as
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree f = length as

goal (1 subgoal):
 1. Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Polynomial.smult ((- (1::'a)) ^ length as) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):])) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal (1 subgoal):
 1. graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
graeffe_poly c as (Suc m) = Polynomial.smult ((- (1::'a)) ^ degree f) (poly_square_subst (f * f \<circ>\<^sub>p [:0::'a, - (1::'a):]))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_mod_cancel_left:
  fixes m :: "'a::{euclidean_ring_cancel,semiring_gcd}"
  assumes "(n * a) mod m = (n * b) mod m" and "coprime m n"
  shows "a mod m = b mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod m = b mod m
[PROOF STEP]
by (metis assms mult.commute mult_mod_cancel_right)


[STATEMENT]
lemma fls_deriv_X_intpow:
  "fls_deriv (fls_X_intpow i) = of_int i * fls_X_intpow (i-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (fls_X_intpow i) = of_int i * fls_X_intpow (i - 1)
[PROOF STEP]
by (simp add: fls_deriv_shift)


[STATEMENT]
lemma (in Ring) nsClose:
  "\<And> n. \<lbrakk> x \<in> carrier R \<rbrakk>  \<Longrightarrow> nscal R x n \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. x \<in> carrier R \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<in> carrier R
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. x \<in> carrier R \<Longrightarrow>  0 \<times>\<^bsub>R\<^esub> x \<in> carrier R
 2. \<And>n na. \<lbrakk>x \<in> carrier R;  na \<times>\<^bsub>R\<^esub> x \<in> carrier R\<rbrakk> \<Longrightarrow>  Suc na \<times>\<^bsub>R\<^esub> x \<in> carrier R
[PROOF STEP]
apply (simp add:ring_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<lbrakk>x \<in> carrier R;  na \<times>\<^bsub>R\<^esub> x \<in> carrier R\<rbrakk> \<Longrightarrow>  Suc na \<times>\<^bsub>R\<^esub> x \<in> carrier R
[PROOF STEP]
apply (cut_tac ring_is_ag, simp add:aGroup.ag_pOp_closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sin_arccos_abs: "\<bar>y\<bar> \<le> 1 \<Longrightarrow> sin (arccos y) = sqrt (1 - y\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>y\<bar> \<le> 1 \<Longrightarrow> sin (arccos y) = sqrt (1 - y\<^sup>2)
[PROOF STEP]
by (simp add: sin_arccos abs_le_iff)


[STATEMENT]
lemma sf_mono: "x \<le> y \<Longrightarrow> sf x \<le> sf y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> sf x \<le> sf y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> sf x \<le> sf y
[PROOF STEP]
assume A1: "x \<le> y"
[PROOF STATE]
proof (state)
this:
x \<le> y

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> sf x \<le> sf y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> y
[PROOF STEP]
have "x+1 \<le> y+1"
[PROOF STATE]
proof (prove)
using this:
x \<le> y

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

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> sf x \<le> sf y
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
x \<le> y
x + 1 \<le> y + 1
[PROOF STEP]
have "x*(x+1) \<le> y*(y+1)"
[PROOF STATE]
proof (prove)
using this:
x \<le> y
x + 1 \<le> y + 1

goal (1 subgoal):
 1. x * (x + 1) \<le> y * (y + 1)
[PROOF STEP]
by (rule mult_le_mono)
[PROOF STATE]
proof (state)
this:
x * (x + 1) \<le> y * (y + 1)

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> sf x \<le> sf y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x * (x + 1) \<le> y * (y + 1)
[PROOF STEP]
have "x*(x+1) div 2 \<le> y*(y+1) div 2"
[PROOF STATE]
proof (prove)
using this:
x * (x + 1) \<le> y * (y + 1)

goal (1 subgoal):
 1. x * (x + 1) div 2 \<le> y * (y + 1) div 2
[PROOF STEP]
by (rule div_le_mono)
[PROOF STATE]
proof (state)
this:
x * (x + 1) div 2 \<le> y * (y + 1) div 2

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> sf x \<le> sf y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x * (x + 1) div 2 \<le> y * (y + 1) div 2

goal (1 subgoal):
 1. sf x \<le> sf y
[PROOF STEP]
by (simp add: sf_def)
[PROOF STATE]
proof (state)
this:
sf x \<le> sf y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mlex_fst_decrI:
  fixes a a' b b' N :: nat
  assumes "a<a'"
  assumes "b<N" "b'<N"
  shows "a*N + b < a'*N + b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
have "a*N + b + 1 \<le> a*N + N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * N + b + 1 \<le> a * N + N
[PROOF STEP]
using \<open>b<N\<close>
[PROOF STATE]
proof (prove)
using this:
b < N

goal (1 subgoal):
 1. a * N + b + 1 \<le> a * N + N
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
a * N + b + 1 \<le> a * N + N

goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * N + b + 1 \<le> a * N + N

goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
have "\<dots> \<le> a'*N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * N + N \<le> a' * N
[PROOF STEP]
using \<open>a<a'\<close>
[PROOF STATE]
proof (prove)
using this:
a < a'

goal (1 subgoal):
 1. a * N + N \<le> a' * N
[PROOF STEP]
by (metis Suc_leI ab_semigroup_add_class.add.commute
      ab_semigroup_mult_class.mult.commute mult_Suc_right mult_le_mono2)
[PROOF STATE]
proof (state)
this:
a * N + N \<le> a' * N

goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * N + N \<le> a' * N

goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
have "\<dots> \<le> a'*N + b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a' * N \<le> a' * N + b'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a' * N \<le> a' * N + b'

goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a * N + b + 1 \<le> a' * N + b'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a * N + b + 1 \<le> a' * N + b'

goal (1 subgoal):
 1. a * N + b < a' * N + b'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * N + b < a' * N + b'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arctan_approx_def': "arctan_approx n (1/x) =
  (\<Sum>k<n. inverse (real (2 * k + 1) * (- x\<^sup>2) ^ k)) / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan_approx n (1 / x) = (\<Sum>k<n. inverse (real (2 * k + 1) * (- x\<^sup>2) ^ k)) / x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. arctan_approx n (1 / x) = (\<Sum>k<n. inverse (real (2 * k + 1) * (- x\<^sup>2) ^ k)) / x
[PROOF STEP]
have "(-1)^k / b = 1 / ((-1)^k * b)" for k :: nat and b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ k / b = 1 / ((- 1) ^ k * b)
[PROOF STEP]
by (cases "even k") auto
[PROOF STATE]
proof (state)
this:
(- 1) ^ ?k / ?b = 1 / ((- 1) ^ ?k * ?b)

goal (1 subgoal):
 1. arctan_approx n (1 / x) = (\<Sum>k<n. inverse (real (2 * k + 1) * (- x\<^sup>2) ^ k)) / x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(- 1) ^ ?k / ?b = 1 / ((- 1) ^ ?k * ?b)

goal (1 subgoal):
 1. arctan_approx n (1 / x) = (\<Sum>k<n. inverse (real (2 * k + 1) * (- x\<^sup>2) ^ k)) / x
[PROOF STEP]
by (simp add: arctan_approx_def  field_simps power_minus')
[PROOF STATE]
proof (state)
this:
arctan_approx n (1 / x) = (\<Sum>k<n. inverse (real (2 * k + 1) * (- x\<^sup>2) ^ k)) / x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_contour_integral_reversepath:
  assumes "valid_path g" and f: "(f has_contour_integral i) g"
    shows "(f has_contour_integral (-i)) (reversepath g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
fix S x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
assume xs: "g C1_differentiable_on ({0..1} - S)" "x \<notin> (-) 1 ` S" "0 \<le> x" "x \<le> 1"
[PROOF STATE]
proof (state)
this:
g C1_differentiable_on {0..1} - S
x \<notin> (-) 1 ` S
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
have "vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) =
            - vector_derivative g (at (1 - x) within {0..1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
obtain f' where f': "(g has_vector_derivative f') (at (1 - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f'. (g has_vector_derivative f') (at (1 - x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
g C1_differentiable_on {0..1} - S
x \<notin> (-) 1 ` S
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. (\<And>f'. (g has_vector_derivative f') (at (1 - x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: has_vector_derivative_def C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
(g has_vector_derivative f') (at (1 - x))

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
have "(g \<circ> (\<lambda>x. 1 - x) has_vector_derivative -1 *\<^sub>R f') (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> (-) 1 has_vector_derivative - 1 *\<^sub>R f') (at x)
[PROOF STEP]
by (intro vector_diff_chain_within has_vector_derivative_at_within [OF f'] derivative_eq_intros | simp)+
[PROOF STATE]
proof (state)
this:
(g \<circ> (-) 1 has_vector_derivative - 1 *\<^sub>R f') (at x)

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g \<circ> (-) 1 has_vector_derivative - 1 *\<^sub>R f') (at x)
[PROOF STEP]
have mf': "((\<lambda>x. g (1 - x)) has_vector_derivative -f') (at x)"
[PROOF STATE]
proof (prove)
using this:
(g \<circ> (-) 1 has_vector_derivative - 1 *\<^sub>R f') (at x)

goal (1 subgoal):
 1. ((\<lambda>x. g (1 - x)) has_vector_derivative - f') (at x)
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. g (1 - x)) has_vector_derivative - f') (at x)

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
g C1_differentiable_on {0..1} - S
x \<notin> (-) 1 ` S
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})
[PROOF STEP]
by (auto simp: vector_derivative_at_within_ivl [OF mf'] vector_derivative_at_within_ivl [OF f'])
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) = - vector_derivative g (at (1 - x) within {0..1})

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>g C1_differentiable_on {0..1} - ?S2; ?x2 \<notin> (-) 1 ` ?S2; 0 \<le> ?x2; ?x2 \<le> 1\<rbrakk> \<Longrightarrow> vector_derivative (\<lambda>x. g (1 - x)) (at ?x2 within {0..1}) = - vector_derivative g (at (1 - ?x2) within {0..1})

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>g C1_differentiable_on {0..1} - ?S2; ?x2 \<notin> (-) 1 ` ?S2; 0 \<le> ?x2; ?x2 \<le> 1\<rbrakk> \<Longrightarrow> vector_derivative (\<lambda>x. g (1 - x)) (at ?x2 within {0..1}) = - vector_derivative g (at (1 - ?x2) within {0..1})

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
obtain S where S: "continuous_on {0..1} g" "finite S" "g C1_differentiable_on {0..1} - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>continuous_on {0..1} g; finite S; g C1_differentiable_on {0..1} - S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path g
(f has_contour_integral i) g

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>continuous_on {0..1} g; finite S; g C1_differentiable_on {0..1} - S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: valid_path_def piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} g
finite S
g C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
have "((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral -i)
       {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}
[PROOF STEP]
using has_integral_affinity01 [where m= "-1" and c=1, OF f [unfolded has_contour_integral_def]]
[PROOF STATE]
proof (prove)
using this:
- 1 \<noteq> 0 \<Longrightarrow> ((\<lambda>x. f (g (- 1 * x + 1)) * vector_derivative g (at (- 1 * x + 1) within {0..1})) has_integral (1 / \<bar>- 1\<bar>) *\<^sub>R i) ((\<lambda>x. x / - 1 - 1 / - 1) ` {0..1})

goal (1 subgoal):
 1. ((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}
[PROOF STEP]
by (simp add: has_integral_neg)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}
continuous_on {0..1} g
finite S
g C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. (f has_contour_integral - i) (reversepath g)
[PROOF STEP]
unfolding reversepath_def has_contour_integral_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral - i) {0..1}
continuous_on {0..1} g
finite S
g C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. ((\<lambda>x. f (g (1 - x)) * vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1})) has_integral - i) {0..1}
[PROOF STEP]
by (rule_tac S = "(\<lambda>x. 1 - x) ` S" in has_integral_spike_finite) (auto simp: *)
[PROOF STATE]
proof (state)
this:
(f has_contour_integral - i) (reversepath g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cardEx: assumes "finite A" and "finite B" and "card A > card B" shows "\<exists>x\<in>A. \<not> x\<in>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
 2. \<not> ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
assume "A \<subseteq> B"
[PROOF STATE]
proof (state)
this:
A \<subseteq> B

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
 2. \<not> ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
card B < card A
A \<subseteq> B
[PROOF STEP]
have "card A\<le>card B"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
card B < card A
A \<subseteq> B

goal (1 subgoal):
 1. card A \<le> card B
[PROOF STEP]
using card_mono
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
card B < card A
A \<subseteq> B
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B

goal (1 subgoal):
 1. card A \<le> card B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card A \<le> card B

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
 2. \<not> ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
card B < card A
card A \<le> card B
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
card B < card A
card A \<le> card B

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
 2. \<not> ?P \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>A. x \<notin> B

goal (1 subgoal):
 1. \<not> A \<subseteq> B \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> A \<subseteq> B \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
assume "\<not> A \<subseteq> B"
[PROOF STATE]
proof (state)
this:
\<not> A \<subseteq> B

goal (1 subgoal):
 1. \<not> A \<subseteq> B \<Longrightarrow> \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> A \<subseteq> B

goal (1 subgoal):
 1. \<exists>x\<in>A. x \<notin> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>A. x \<notin> B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_add_comm:
  assumes "set p1 \<subseteq> carrier R" "set p2 \<subseteq> carrier R"
  shows "poly_add p1 p2 = poly_add p2 p1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_add p1 p2 = poly_add p2 p1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_add p1 p2 = poly_add p2 p1
[PROOF STEP]
have "coeff (poly_add p1 p2) = coeff (poly_add p2 p1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (poly_add p1 p2) = local.coeff (poly_add p2 p1)
[PROOF STEP]
using poly_add_coeff[OF assms] poly_add_coeff[OF assms(2) assms(1)]
          coeff_in_carrier[OF assms(1)] coeff_in_carrier[OF assms(2)] add.m_comm
[PROOF STATE]
proof (prove)
using this:
local.coeff (poly_add p1 p2) = (\<lambda>i. local.coeff p1 i \<oplus> local.coeff p2 i)
local.coeff (poly_add p2 p1) = (\<lambda>i. local.coeff p2 i \<oplus> local.coeff p1 i)
local.coeff p1 ?i \<in> carrier R
local.coeff p2 ?i \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y = ?y \<oplus> ?x

goal (1 subgoal):
 1. local.coeff (poly_add p1 p2) = local.coeff (poly_add p2 p1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.coeff (poly_add p1 p2) = local.coeff (poly_add p2 p1)

goal (1 subgoal):
 1. poly_add p1 p2 = poly_add p2 p1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
local.coeff (poly_add p1 p2) = local.coeff (poly_add p2 p1)

goal (1 subgoal):
 1. poly_add p1 p2 = poly_add p2 p1
[PROOF STEP]
using coeff_iff_polynomial_cond[OF
          poly_add_is_polynomial[OF carrier_is_subring assms]
          poly_add_is_polynomial[OF carrier_is_subring assms(2,1)]]
[PROOF STATE]
proof (prove)
using this:
local.coeff (poly_add p1 p2) = local.coeff (poly_add p2 p1)
(poly_add p1 p2 = poly_add p2 p1) = (local.coeff (poly_add p1 p2) = local.coeff (poly_add p2 p1))

goal (1 subgoal):
 1. poly_add p1 p2 = poly_add p2 p1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_add p1 p2 = poly_add p2 p1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem tree_enum_correct: "set(tree_enum n) = trees n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (tree_enum n) = trees n
[PROOF STEP]
proof(standard)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (tree_enum n) \<subseteq> trees n
 2. trees n \<subseteq> set (tree_enum n)
[PROOF STEP]
show "set (tree_enum n) \<subseteq> trees n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (tree_enum n) \<subseteq> trees n
[PROOF STEP]
unfolding trees_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (tree_enum n) \<subseteq> {t. size t = n}
[PROOF STEP]
using tree_enum_correct1
[PROOF STATE]
proof (prove)
using this:
?t \<in> set (tree_enum ?n) \<Longrightarrow> size ?t = ?n

goal (1 subgoal):
 1. set (tree_enum n) \<subseteq> {t. size t = n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (tree_enum n) \<subseteq> trees n

goal (1 subgoal):
 1. trees n \<subseteq> set (tree_enum n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trees n \<subseteq> set (tree_enum n)
[PROOF STEP]
show "trees n \<subseteq> set (tree_enum n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trees n \<subseteq> set (tree_enum n)
[PROOF STEP]
unfolding trees_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. size t = n} \<subseteq> set (tree_enum n)
[PROOF STEP]
using tree_enum_correct2
[PROOF STATE]
proof (prove)
using this:
?n = size ?t \<Longrightarrow> ?t \<in> set (tree_enum ?n)

goal (1 subgoal):
 1. {t. size t = n} \<subseteq> set (tree_enum n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trees n \<subseteq> set (tree_enum n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_rep_index:
  fixes n m i:: nat
  assumes "n \<ge> 1" and "m < 2^n" and "i < n" and "m \<ge> 0"
  shows "bin_rep n m ! i = (m mod 2^(n-i)) div 2^(n-1-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_rep n m ! i = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bin_rep n m ! i = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i)
[PROOF STEP]
have "bin_rep n m ! i = bin_rep_aux n m ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_rep n m ! i = bin_rep_aux n m ! i
[PROOF STEP]
using bin_rep_def length_of_bin_rep nth_butlast assms(3)
[PROOF STATE]
proof (prove)
using this:
bin_rep ?n ?m = butlast (bin_rep_aux ?n ?m)
?m < 2 ^ ?n \<Longrightarrow> length (bin_rep ?n ?m) = ?n
?n < length (butlast ?xs) \<Longrightarrow> butlast ?xs ! ?n = ?xs ! ?n
i < n

goal (1 subgoal):
 1. bin_rep n m ! i = bin_rep_aux n m ! i
[PROOF STEP]
by (simp add: nth_butlast assms(2))
[PROOF STATE]
proof (state)
this:
bin_rep n m ! i = bin_rep_aux n m ! i

goal (1 subgoal):
 1. bin_rep n m ! i = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bin_rep n m ! i = bin_rep_aux n m ! i

goal (1 subgoal):
 1. bin_rep n m ! i = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i)
[PROOF STEP]
using assms bin_rep_aux_index
[PROOF STATE]
proof (prove)
using this:
bin_rep n m ! i = bin_rep_aux n m ! i
1 \<le> n
m < 2 ^ n
i < n
0 \<le> m
\<lbrakk>1 \<le> ?n; ?m < 2 ^ ?n; 0 \<le> ?m; ?i \<le> ?n\<rbrakk> \<Longrightarrow> bin_rep_aux ?n ?m ! ?i = ?m mod 2 ^ (?n - ?i) div 2 ^ (?n - 1 - ?i)

goal (1 subgoal):
 1. bin_rep n m ! i = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bin_rep n m ! i = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  unitary_hermitian_eigenvalues:
  fixes U::"complex Matrix.mat"
  assumes "unitary U"
  and "hermitian U"
  and "U \<in> carrier_mat n n"
  and "0 < n"
  and "k \<in> spectrum U"
shows "k \<in> {-1, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
have "cpx_sq_mat n n (carrier_mat n n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cpx_sq_mat n n (carrier_mat n n)
[PROOF STEP]
by (unfold_locales, (simp add: assms)+)
[PROOF STATE]
proof (state)
this:
cpx_sq_mat n n (carrier_mat n n)

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
have "eigenvalue U k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigenvalue U k
[PROOF STEP]
using spectrum_eigenvalues assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?k \<in> spectrum ?A\<rbrakk> \<Longrightarrow> eigenvalue ?A ?k
Complex_Matrix.unitary U
hermitian U
U \<in> carrier_mat n n
0 < n
k \<in> spectrum U

goal (1 subgoal):
 1. eigenvalue U k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eigenvalue U k

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
have "k \<in> Reals"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> \<real>
[PROOF STEP]
using assms \<open>cpx_sq_mat n n (carrier_mat n n)\<close>
      cpx_sq_mat.hermitian_spectrum_real
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.unitary U
hermitian U
U \<in> carrier_mat n n
0 < n
k \<in> spectrum U
cpx_sq_mat n n (carrier_mat n n)
\<lbrakk>cpx_sq_mat ?dimR ?dimC ?fc_mats; ?A \<in> ?fc_mats; hermitian ?A; ?a \<in> spectrum ?A\<rbrakk> \<Longrightarrow> ?a \<in> \<real>

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

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
hence "conjugate k = k"
[PROOF STATE]
proof (prove)
using this:
k \<in> \<real>

goal (1 subgoal):
 1. conjugate k = k
[PROOF STEP]
by (simp add: Reals_cnj_iff)
[PROOF STATE]
proof (state)
this:
conjugate k = k

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
hence "k\<^sup>2 = 1"
[PROOF STATE]
proof (prove)
using this:
conjugate k = k

goal (1 subgoal):
 1. k\<^sup>2 = 1
[PROOF STEP]
using unitary_eigenvalues_norm_square[of U n k] assms
[PROOF STATE]
proof (prove)
using this:
conjugate k = k
\<lbrakk>Complex_Matrix.unitary U; U \<in> carrier_mat n n; eigenvalue U k\<rbrakk> \<Longrightarrow> conjugate k * k = 1
Complex_Matrix.unitary U
hermitian U
U \<in> carrier_mat n n
0 < n
k \<in> spectrum U

goal (1 subgoal):
 1. k\<^sup>2 = 1
[PROOF STEP]
by (simp add: \<open>eigenvalue U k\<close> power2_eq_square)
[PROOF STATE]
proof (state)
this:
k\<^sup>2 = 1

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
k\<^sup>2 = 1

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
using power2_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
k\<^sup>2 = 1
(?a\<^sup>2 = (1::?'a)) = (?a = (1::?'a) \<or> ?a = - (1::?'a))

goal (1 subgoal):
 1. k \<in> {- 1, 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<in> {- 1, 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_add_not: "x + NOT x = (-1::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + NOT x = - 1
[PROOF STEP]
by (simp add: not_int_def)


[STATEMENT]
lemma even_Bit1_int: "even (numeral (Num.Bit1 x) :: int) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (numeral (num.Bit1 x)) = False
[PROOF STEP]
by (simp only: odd_numeral)


[STATEMENT]
lemma continuous_tan:
  fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}"
  shows "continuous F f \<Longrightarrow> cos (f (Lim F (\<lambda>x. x))) \<noteq> 0 \<Longrightarrow> continuous F (\<lambda>x. tan (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; cos (f (Lim F (\<lambda>x. x))) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. tan (f x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F; cos (f (Lim F (\<lambda>x. x))) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. tan (f x)) \<longlongrightarrow> tan (f (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (rule tendsto_tan)


[STATEMENT]
lemma select_index_suc_even:
  fixes n k i:: nat
  assumes "k < 2^n" and "select_index n i k"
  shows "select_index (Suc n) i (2*k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
have "select_index n i k = select_index n i (2*k div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select_index n i k = select_index n i (2 * k div 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
select_index n i k = select_index n i (2 * k div 2)

goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
select_index n i k = select_index n i (2 * k div 2)

goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
have "\<dots> = select_index (Suc n) i (2*k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
[PROOF STEP]
have "i < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n
[PROOF STEP]
using assms(2) select_index_def
[PROOF STATE]
proof (prove)
using this:
select_index n i k
select_index ?n ?i ?j \<equiv> ?i \<le> ?n - 1 \<and> ?j \<le> 2 ^ ?n - 1 \<and> 2 ^ (?n - 1 - ?i) \<le> ?j mod 2 ^ (?n - ?i)

goal (1 subgoal):
 1. i < n
[PROOF STEP]
by (metis (no_types, opaque_lifting) Suc_eq_plus1 assms(1) calculation diff_diff_left diff_le_self
diff_self_eq_0 div_by_1 le_0_eq le_eq_less_or_eq less_imp_diff_less mod_div_trivial mult.left_neutral mult_eq_0_iff mult_le_mono1 not_less plus_1_eq_Suc power_0 semiring_normalization_rules(7))
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
[PROOF STEP]
using select_index_div_2 assms(1) select_index_def
[PROOF STATE]
proof (prove)
using this:
i < n
\<lbrakk>?i < 2 ^ (?n + 1); ?j < ?n\<rbrakk> \<Longrightarrow> select_index ?n ?j (?i div 2) = select_index (?n + 1) ?j ?i
k < 2 ^ n
select_index ?n ?i ?j \<equiv> ?i \<le> ?n - 1 \<and> ?j \<le> 2 ^ ?n - 1 \<and> 2 ^ (?n - 1 - ?i) \<le> ?j mod 2 ^ (?n - ?i)

goal (1 subgoal):
 1. select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
[PROOF STEP]
by(metis Suc_1 Suc_eq_plus1 Suc_mult_less_cancel1 power_Suc)
[PROOF STATE]
proof (state)
this:
select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)

goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
select_index n i k = select_index n i (2 * k div 2)
select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
[PROOF STEP]
show "select_index (Suc n) i (2*k)"
[PROOF STATE]
proof (prove)
using this:
select_index n i k = select_index n i (2 * k div 2)
select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)

goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
select_index n i k = select_index n i (2 * k div 2)
select_index n i (2 * k div 2) = select_index (Suc n) i (2 * k)
select_index n i k

goal (1 subgoal):
 1. select_index (Suc n) i (2 * k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
select_index (Suc n) i (2 * k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_Suc_iff: "summable (\<lambda>n. f (Suc n)) = summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (Suc n)) = summable f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. f (Suc n)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>n. f (Suc n))
[PROOF STEP]
assume "summable f"
[PROOF STATE]
proof (state)
this:
summable f

goal (2 subgoals):
 1. summable (\<lambda>n. f (Suc n)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>n. f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable f
[PROOF STEP]
have "f sums suminf f"
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. f sums suminf f
[PROOF STEP]
by (rule summable_sums)
[PROOF STATE]
proof (state)
this:
f sums suminf f

goal (2 subgoals):
 1. summable (\<lambda>n. f (Suc n)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>n. f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f sums suminf f
[PROOF STEP]
have "(\<lambda>n. f (Suc n)) sums (suminf f - f 0)"
[PROOF STATE]
proof (prove)
using this:
f sums suminf f

goal (1 subgoal):
 1. (\<lambda>n. f (Suc n)) sums (suminf f - f 0)
[PROOF STEP]
by (simp add: sums_Suc_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f (Suc n)) sums (suminf f - f 0)

goal (2 subgoals):
 1. summable (\<lambda>n. f (Suc n)) \<Longrightarrow> summable f
 2. summable f \<Longrightarrow> summable (\<lambda>n. f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. f (Suc n)) sums (suminf f - f 0)
[PROOF STEP]
show "summable (\<lambda>n. f (Suc n))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (Suc n)) sums (suminf f - f 0)

goal (1 subgoal):
 1. summable (\<lambda>n. f (Suc n))
[PROOF STEP]
unfolding summable_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (Suc n)) sums (suminf f - f 0)

goal (1 subgoal):
 1. Ex ((sums) (\<lambda>n. f (Suc n)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (Suc n))

goal (1 subgoal):
 1. summable (\<lambda>n. f (Suc n)) \<Longrightarrow> summable f
[PROOF STEP]
qed (auto simp: sums_Suc_iff summable_def)


[STATEMENT]
lemma (in group) nat_pow_inv:
  assumes "x \<in> carrier G" shows "(inv x) [^] (i :: nat) = inv (x [^] i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x [^] i = inv (x [^] i)
[PROOF STEP]
proof (induction i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inv x [^] 0 = inv (x [^] 0)
 2. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. inv x [^] 0 = inv (x [^] 0)
 2. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x [^] 0 = inv (x [^] 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inv x [^] 0 = inv (x [^] 0)

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
inv x [^] i = inv (x [^] i)

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
have "(inv x) [^] Suc i = ((inv x) [^] i) \<otimes> inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x [^] Suc i = inv x [^] i \<otimes> inv x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inv x [^] Suc i = inv x [^] i \<otimes> inv x

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv x [^] Suc i = inv x [^] i \<otimes> inv x

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
have " ... = (inv (x [^] i)) \<otimes> inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x [^] i \<otimes> inv x = inv (x [^] i) \<otimes> inv x
[PROOF STEP]
by (simp add: Suc.IH Suc.prems)
[PROOF STATE]
proof (state)
this:
inv x [^] i \<otimes> inv x = inv (x [^] i) \<otimes> inv x

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv x [^] i \<otimes> inv x = inv (x [^] i) \<otimes> inv x

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
have " ... = inv (x \<otimes> (x [^] i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (x [^] i) \<otimes> inv x = inv (x \<otimes> x [^] i)
[PROOF STEP]
by (simp add: assms inv_mult_group)
[PROOF STATE]
proof (state)
this:
inv (x [^] i) \<otimes> inv x = inv (x \<otimes> x [^] i)

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv (x [^] i) \<otimes> inv x = inv (x \<otimes> x [^] i)

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
have " ... = inv (x [^] (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (x \<otimes> x [^] i) = inv (x [^] Suc i)
[PROOF STEP]
using assms nat_pow_Suc2
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
?x \<in> carrier G \<Longrightarrow> ?x [^] Suc ?n = ?x \<otimes> ?x [^] ?n

goal (1 subgoal):
 1. inv (x \<otimes> x [^] i) = inv (x [^] Suc i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv (x \<otimes> x [^] i) = inv (x [^] Suc i)

goal (1 subgoal):
 1. \<And>i. inv x [^] i = inv (x [^] i) \<Longrightarrow> inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
inv x [^] Suc i = inv (x [^] Suc i)

goal (1 subgoal):
 1. inv x [^] Suc i = inv (x [^] Suc i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inv x [^] Suc i = inv (x [^] Suc i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VUnion_least:
  assumes "\<And>x. x \<in>\<^sub>\<circ> A \<Longrightarrow> x \<subseteq>\<^sub>\<circ> B"
  shows "\<Union>\<^sub>\<circ>A \<subseteq>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in>\<^sub>\<circ> A \<Longrightarrow> ?x \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
by (fact Sup_least)


[STATEMENT]
lemma homeomorphic_frontiers:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "S homeomorphic T" "closed S" "closed T"
          "interior S = {} \<longleftrightarrow> interior T = {}"
    shows "(frontier S) homeomorphic (frontier T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
proof (cases "interior T = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. interior T = {} \<Longrightarrow> frontier S homeomorphic frontier T
 2. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
interior T = {}

goal (2 subgoals):
 1. interior T = {} \<Longrightarrow> frontier S homeomorphic frontier T
 2. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interior T = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interior T = {}

goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
by (metis Diff_empty assms closure_eq frontier_def)
[PROOF STATE]
proof (state)
this:
frontier S homeomorphic frontier T

goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
interior T \<noteq> {}

goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
apply (rule homeomorphic_frontiers_same_dimension)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. S homeomorphic T
 2. closed S
 3. closed T
 4. DIM('a) = DIM('b)
[PROOF STEP]
apply (simp_all add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DIM('a) = DIM('b)
[PROOF STEP]
using False assms homeomorphic_interiors homeomorphic_open_imp_same_dimension
[PROOF STATE]
proof (prove)
using this:
interior T \<noteq> {}
S homeomorphic T
closed S
closed T
(interior S = {}) = (interior T = {})
\<lbrakk>?S homeomorphic ?T; (interior ?S = {}) = (interior ?T = {})\<rbrakk> \<Longrightarrow> interior ?S homeomorphic interior ?T
\<lbrakk>?S homeomorphic ?T; open ?S; ?S \<noteq> {}; open ?T; ?T \<noteq> {}\<rbrakk> \<Longrightarrow> DIM(?'a) = DIM(?'b)

goal (1 subgoal):
 1. DIM('a) = DIM('b)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
frontier S homeomorphic frontier T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_mset_OO:
  assumes AB: "rel_mset R A B" and BC: "rel_mset S B C"
  shows "rel_mset (R OO S) A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_mset (R OO S) A C
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_mset (R OO S) A C
[PROOF STEP]
from AB
[PROOF STATE]
proof (chain)
picking this:
rel_mset R A B
[PROOF STEP]
obtain as bs where A_as: "A = mset as" and B_bs: "B = mset bs" and as_bs: "list_all2 R as bs"
[PROOF STATE]
proof (prove)
using this:
rel_mset R A B

goal (1 subgoal):
 1. (\<And>as bs. \<lbrakk>A = mset as; B = mset bs; list_all2 R as bs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: rel_mset_def)
[PROOF STATE]
proof (state)
this:
A = mset as
B = mset bs
list_all2 R as bs

goal (1 subgoal):
 1. rel_mset (R OO S) A C
[PROOF STEP]
from rel_mset_free[OF BC] B_bs
[PROOF STATE]
proof (chain)
picking this:
mset ?xs = B \<Longrightarrow> \<exists>ys. mset ys = C \<and> list_all2 S ?xs ys
B = mset bs
[PROOF STEP]
obtain cs where C_cs: "C = mset cs" and bs_cs: "list_all2 S bs cs"
[PROOF STATE]
proof (prove)
using this:
mset ?xs = B \<Longrightarrow> \<exists>ys. mset ys = C \<and> list_all2 S ?xs ys
B = mset bs

goal (1 subgoal):
 1. (\<And>cs. \<lbrakk>C = mset cs; list_all2 S bs cs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C = mset cs
list_all2 S bs cs

goal (1 subgoal):
 1. rel_mset (R OO S) A C
[PROOF STEP]
from list_all2_trans[OF _ as_bs bs_cs, of "R OO S"] A_as C_cs
[PROOF STATE]
proof (chain)
picking this:
(\<And>a b c. \<lbrakk>R a b; S b c\<rbrakk> \<Longrightarrow> (R OO S) a c) \<Longrightarrow> list_all2 (R OO S) as cs
A = mset as
C = mset cs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>a b c. \<lbrakk>R a b; S b c\<rbrakk> \<Longrightarrow> (R OO S) a c) \<Longrightarrow> list_all2 (R OO S) as cs
A = mset as
C = mset cs

goal (1 subgoal):
 1. rel_mset (R OO S) A C
[PROOF STEP]
by (auto simp: rel_mset_def)
[PROOF STATE]
proof (state)
this:
rel_mset (R OO S) A C

goal:
No subgoals!
[PROOF STEP]
qed