[STATEMENT]
lemma maximal_eigen_value_roots_of_unity_rotation:
  assumes M: "M = {ev :: complex. eigen_value cA ev \<and> cmod ev = sr}"
   and kM: "k = card M"
 shows "k \<noteq> 0"
    "k \<le> CARD('n)"
    "\<exists> f. charpoly A = (monom 1 k - [:sr^k:]) * f
       \<and> (\<forall> x. poly (map_poly c f) x = 0 \<longrightarrow> cmod x < sr)"
    "M = (*) (c sr) ` (\<lambda> i. (cis (of_nat i * 2 * pi / k))) ` {0 ..< k}"
    "M = (*) (c sr) ` { x :: complex. x ^ k = 1}"
    "(*) (cis (2 * pi / k)) ` Spectrum cA = Spectrum cA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k \<noteq> 0 &&& k \<le> CARD('n) &&& \<exists>f. charpoly A = (monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)) &&& M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real k)) ` {0..<k} &&& M = (*) (complex_of_real sr) ` {x. x ^ k = 1} &&& (*) (cis (2 * pi / real k)) ` Spectrum cA = Spectrum cA
[PROOF STEP]
unfolding kM
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card M \<noteq> 0 &&& card M \<le> CARD('n) &&& \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)) &&& M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M} &&& M = (*) (complex_of_real sr) ` {x. x ^ card M = 1} &&& (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?M = "card M"
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note fin = finite_spectrum[of cA]
[PROOF STATE]
proof (state)
this:
finite (Collect (eigen_value cA))

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note char = degree_monic_charpoly[of cA]
[PROOF STATE]
proof (state)
this:
degree (charpoly cA) = CARD('n) \<and> monic (charpoly cA)

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "?M \<le> card (Collect (eigen_value cA))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card M \<le> card (Collect (eigen_value cA))
[PROOF STEP]
by (rule card_mono[OF fin], unfold M, auto)
[PROOF STATE]
proof (state)
this:
card M \<le> card (Collect (eigen_value cA))

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card M \<le> card (Collect (eigen_value cA))

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "Collect (eigen_value cA) = {x. poly (charpoly cA) x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Collect (eigen_value cA) = {x. poly (charpoly cA) x = 0}
[PROOF STEP]
unfolding eigen_value_root_charpoly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k. poly (charpoly cA) k = 0} = {x. poly (charpoly cA) x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Collect (eigen_value cA) = {x. poly (charpoly cA) x = 0}

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Collect (eigen_value cA) = {x. poly (charpoly cA) x = 0}

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "card \<dots> \<le> degree (charpoly cA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. poly (charpoly cA) x = 0} \<le> degree (charpoly cA)
[PROOF STEP]
by (rule poly_roots_degree, insert char, auto)
[PROOF STATE]
proof (state)
this:
card {x. poly (charpoly cA) x = 0} \<le> degree (charpoly cA)

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {x. poly (charpoly cA) x = 0} \<le> degree (charpoly cA)

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> = CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (charpoly cA) = CARD('n)
[PROOF STEP]
using char
[PROOF STATE]
proof (prove)
using this:
degree (charpoly cA) = CARD('n) \<and> monic (charpoly cA)

goal (1 subgoal):
 1. degree (charpoly cA) = CARD('n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (charpoly cA) = CARD('n)

goal (6 subgoals):
 1. card M \<noteq> 0
 2. card M \<le> CARD('n)
 3. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 4. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 5. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 6. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card M \<le> CARD('n)
[PROOF STEP]
show "?M \<le> CARD ('n)"
[PROOF STATE]
proof (prove)
using this:
card M \<le> CARD('n)

goal (1 subgoal):
 1. card M \<le> CARD('n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card M \<le> CARD('n)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from finite_subset[OF _ fin, of M]
[PROOF STATE]
proof (chain)
picking this:
M \<subseteq> Collect (eigen_value cA) \<Longrightarrow> finite M
[PROOF STEP]
have finM: "finite M"
[PROOF STATE]
proof (prove)
using this:
M \<subseteq> Collect (eigen_value cA) \<Longrightarrow> finite M

goal (1 subgoal):
 1. finite M
[PROOF STEP]
unfolding M
[PROOF STATE]
proof (prove)
using this:
{ev. eigen_value cA ev \<and> cmod ev = sr} \<subseteq> Collect (eigen_value cA) \<Longrightarrow> finite {ev. eigen_value cA ev \<and> cmod ev = sr}

goal (1 subgoal):
 1. finite {ev. eigen_value cA ev \<and> cmod ev = sr}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from finite_distinct_list[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs. set xs = M \<and> distinct xs
[PROOF STEP]
obtain m where Mm: "M = set m" and dist: "distinct m"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = M \<and> distinct xs

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>M = set m; distinct m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = set m
distinct m

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from Mm dist
[PROOF STATE]
proof (chain)
picking this:
M = set m
distinct m
[PROOF STEP]
have card: "?M = length m"
[PROOF STATE]
proof (prove)
using this:
M = set m
distinct m

goal (1 subgoal):
 1. card M = length m
[PROOF STEP]
by (auto simp: distinct_card)
[PROOF STATE]
proof (state)
this:
card M = length m

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have sr: "sr \<in> set m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real sr \<in> set m
[PROOF STEP]
using eigen_value_sr_c sr_pos
[PROOF STATE]
proof (prove)
using this:
eigen_value cA (complex_of_real sr)
0 < sr

goal (1 subgoal):
 1. complex_of_real sr \<in> set m
[PROOF STEP]
unfolding Mm[symmetric] M
[PROOF STATE]
proof (prove)
using this:
eigen_value cA (complex_of_real sr)
0 < sr

goal (1 subgoal):
 1. complex_of_real sr \<in> {ev. eigen_value cA ev \<and> cmod ev = sr}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
complex_of_real sr \<in> set m

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
define s where "s = sort_key Arg m"
[PROOF STATE]
proof (state)
this:
s = sort_key Arg m

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
define a where "a = map Arg s"
[PROOF STATE]
proof (state)
this:
a = map Arg s

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?k = "length a"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from dist Mm card sr
[PROOF STATE]
proof (chain)
picking this:
distinct m
M = set m
card M = length m
complex_of_real sr \<in> set m
[PROOF STEP]
have s: "M = set s" "distinct s"  "sr \<in> set s"
    and card: "?M = ?k"
    and sorted: "sorted a"
[PROOF STATE]
proof (prove)
using this:
distinct m
M = set m
card M = length m
complex_of_real sr \<in> set m

goal (1 subgoal):
 1. (M = set s &&& distinct s &&& complex_of_real sr \<in> set s) &&& card M = length a &&& sorted a
[PROOF STEP]
unfolding s_def a_def
[PROOF STATE]
proof (prove)
using this:
distinct m
M = set m
card M = length m
complex_of_real sr \<in> set m

goal (1 subgoal):
 1. (M = set (sort_key Arg m) &&& distinct (sort_key Arg m) &&& complex_of_real sr \<in> set (sort_key Arg m)) &&& card M = length (map Arg (sort_key Arg m)) &&& sorted (map Arg (sort_key Arg m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = set s
distinct s
complex_of_real sr \<in> set s
card M = length a
sorted a

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have map_s: "map ((*) (c sr)) (map cis a) = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((*) (complex_of_real sr)) (map cis a) = s
[PROOF STEP]
unfolding map_map o_def a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>x. complex_of_real sr * cis (Arg x)) s = s
[PROOF STEP]
proof (rule map_idI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set s \<Longrightarrow> complex_of_real sr * cis (Arg x) = x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set s \<Longrightarrow> complex_of_real sr * cis (Arg x) = x
[PROOF STEP]
assume "x \<in> set s"
[PROOF STATE]
proof (state)
this:
x \<in> set s

goal (1 subgoal):
 1. \<And>x. x \<in> set s \<Longrightarrow> complex_of_real sr * cis (Arg x) = x
[PROOF STEP]
from this[folded s(1), unfolded M]
[PROOF STATE]
proof (chain)
picking this:
x \<in> {ev. eigen_value cA ev \<and> cmod ev = sr}
[PROOF STEP]
have id: "cmod x = sr"
[PROOF STATE]
proof (prove)
using this:
x \<in> {ev. eigen_value cA ev \<and> cmod ev = sr}

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

goal (1 subgoal):
 1. \<And>x. x \<in> set s \<Longrightarrow> complex_of_real sr * cis (Arg x) = x
[PROOF STEP]
show "sr * cis (Arg x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real sr * cis (Arg x) = x
[PROOF STEP]
by (subst (5) rcis_cmod_Arg[symmetric], unfold id[symmetric] rcis_def, simp)
[PROOF STATE]
proof (state)
this:
complex_of_real sr * cis (Arg x) = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map ((*) (complex_of_real sr)) (map cis a) = s

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from s(2)[folded map_s, unfolded distinct_map]
[PROOF STATE]
proof (chain)
picking this:
(distinct a \<and> inj_on cis (set a)) \<and> inj_on ((*) (complex_of_real sr)) (set (map cis a))
[PROOF STEP]
have a: "distinct a" "inj_on cis (set a)"
[PROOF STATE]
proof (prove)
using this:
(distinct a \<and> inj_on cis (set a)) \<and> inj_on ((*) (complex_of_real sr)) (set (map cis a))

goal (1 subgoal):
 1. distinct a &&& inj_on cis (set a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct a
inj_on cis (set a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from s(3)
[PROOF STATE]
proof (chain)
picking this:
complex_of_real sr \<in> set s
[PROOF STEP]
obtain aa a' where a_split: "a = aa # a'"
[PROOF STATE]
proof (prove)
using this:
complex_of_real sr \<in> set s

goal (1 subgoal):
 1. (\<And>aa a'. a = aa # a' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
complex_of_real sr \<in> set s

goal (1 subgoal):
 1. (\<And>aa a'. map Arg s = aa # a' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases s, auto)
[PROOF STATE]
proof (state)
this:
a = aa # a'

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from Arg_bounded
[PROOF STATE]
proof (chain)
picking this:
- pi < Arg ?z \<and> Arg ?z \<le> pi
[PROOF STEP]
have bounded: "x \<in> set a \<Longrightarrow> - pi < x \<and> x \<le> pi" for x
[PROOF STATE]
proof (prove)
using this:
- pi < Arg ?z \<and> Arg ?z \<le> pi

goal (1 subgoal):
 1. x \<in> set a \<Longrightarrow> - pi < x \<and> x \<le> pi
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
- pi < Arg ?z \<and> Arg ?z \<le> pi

goal (1 subgoal):
 1. x \<in> set (map Arg s) \<Longrightarrow> - pi < x \<and> x \<le> pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> set a \<Longrightarrow> - pi < ?x \<and> ?x \<le> pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from bounded[of aa, unfolded a_split]
[PROOF STATE]
proof (chain)
picking this:
aa \<in> set (aa # a') \<Longrightarrow> - pi < aa \<and> aa \<le> pi
[PROOF STEP]
have aa: "- pi < aa \<and> aa \<le> pi"
[PROOF STATE]
proof (prove)
using this:
aa \<in> set (aa # a') \<Longrightarrow> - pi < aa \<and> aa \<le> pi

goal (1 subgoal):
 1. - pi < aa \<and> aa \<le> pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < aa \<and> aa \<le> pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?aa = "aa + 2 * pi"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
define args where "args = a @ [?aa]"
[PROOF STATE]
proof (state)
this:
args = a @ [aa + 2 * pi]

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?diff = "\<lambda> i. args ! Suc i - args ! i"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have bnd: "x \<in> set a \<Longrightarrow> x < ?aa" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set a \<Longrightarrow> x < aa + 2 * pi
[PROOF STEP]
using aa bounded[of x]
[PROOF STATE]
proof (prove)
using this:
- pi < aa \<and> aa \<le> pi
x \<in> set a \<Longrightarrow> - pi < x \<and> x \<le> pi

goal (1 subgoal):
 1. x \<in> set a \<Longrightarrow> x < aa + 2 * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> set a \<Longrightarrow> ?x < aa + 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence aa_a: "?aa \<notin> set a"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set a \<Longrightarrow> ?x < aa + 2 * pi

goal (1 subgoal):
 1. aa + 2 * pi \<notin> set a
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
aa + 2 * pi \<notin> set a

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have sorted: "sorted args"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted args
[PROOF STEP]
unfolding args_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (a @ [aa + 2 * pi])
[PROOF STEP]
using sorted
[PROOF STATE]
proof (prove)
using this:
sorted a

goal (1 subgoal):
 1. sorted (a @ [aa + 2 * pi])
[PROOF STEP]
unfolding sorted_append
[PROOF STATE]
proof (prove)
using this:
sorted a

goal (1 subgoal):
 1. sorted a \<and> sorted [aa + 2 * pi] \<and> (\<forall>x\<in>set a. Ball (set [aa + 2 * pi]) ((\<le>) x))
[PROOF STEP]
by (insert bnd, auto simp: order.strict_iff_order)
[PROOF STATE]
proof (state)
this:
sorted args

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have dist: "distinct args"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct args
[PROOF STEP]
using a aa_a
[PROOF STATE]
proof (prove)
using this:
distinct a
inj_on cis (set a)
aa + 2 * pi \<notin> set a

goal (1 subgoal):
 1. distinct args
[PROOF STEP]
unfolding args_def distinct_append
[PROOF STATE]
proof (prove)
using this:
distinct a
inj_on cis (set a)
aa + 2 * pi \<notin> set a

goal (1 subgoal):
 1. distinct a \<and> distinct [aa + 2 * pi] \<and> set a \<inter> set [aa + 2 * pi] = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct args

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have sum: "(\<Sum> i < ?k. ?diff i) = 2 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length a. args ! Suc i - args ! i) = 2 * pi
[PROOF STEP]
unfolding sum_lessThan_telescope args_def a_split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((aa # a') @ [aa + 2 * pi]) ! length (aa # a') - ((aa # a') @ [aa + 2 * pi]) ! 0 = 2 * pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length a. args ! Suc i - args ! i) = 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have k: "?k \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length a \<noteq> 0
[PROOF STEP]
unfolding a_split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (aa # a') \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length a \<noteq> 0

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?A = "?diff ` {..< ?k}"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?Min = "Min ?A"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
define Min where "Min = ?Min"
[PROOF STATE]
proof (state)
this:
Min = (MIN i\<in>{..<length a}. args ! Suc i - args ! i)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "?Min = (?k * ?Min) / ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MIN i\<in>{..<length a}. args ! Suc i - args ! i) = real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a)
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
length a \<noteq> 0

goal (1 subgoal):
 1. (MIN i\<in>{..<length a}. args ! Suc i - args ! i) = real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(MIN i\<in>{..<length a}. args ! Suc i - args ! i) = real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(MIN i\<in>{..<length a}. args ! Suc i - args ! i) = real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "?k * ?Min = (\<Sum> i < ?k. ?Min)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) = (\<Sum>i<length a. MIN i\<in>{..<length a}. args ! Suc i - args ! i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) = (\<Sum>i<length a. MIN i\<in>{..<length a}. args ! Suc i - args ! i)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (length a) * (MIN i\<in>{..<length a}. args ! Suc i - args ! i) = (\<Sum>i<length a. MIN i\<in>{..<length a}. args ! Suc i - args ! i)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> / ?k \<le> (\<Sum> i < ?k. ?diff i) / ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length a. MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a) \<le> (\<Sum>i<length a. args ! Suc i - args ! i) / real (length a)
[PROOF STEP]
by (rule divide_right_mono[OF sum_mono[OF Min_le]], auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length a. MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a) \<le> (\<Sum>i<length a. args ! Suc i - args ! i) / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length a. MIN i\<in>{..<length a}. args ! Suc i - args ! i) / real (length a) \<le> (\<Sum>i<length a. args ! Suc i - args ! i) / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> = 2 * pi / ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length a. args ! Suc i - args ! i) / real (length a) = 2 * pi / real (length a)
[PROOF STEP]
unfolding sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * pi / real (length a) = 2 * pi / real (length a)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length a. args ! Suc i - args ! i) / real (length a) = 2 * pi / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(MIN i\<in>{..<length a}. args ! Suc i - args ! i) \<le> 2 * pi / real (length a)
[PROOF STEP]
have Min: "Min \<le> 2 * pi / ?k"
[PROOF STATE]
proof (prove)
using this:
(MIN i\<in>{..<length a}. args ! Suc i - args ! i) \<le> 2 * pi / real (length a)

goal (1 subgoal):
 1. Min \<le> 2 * pi / real (length a)
[PROOF STEP]
unfolding Min_def
[PROOF STATE]
proof (prove)
using this:
(MIN i\<in>{..<length a}. args ! Suc i - args ! i) \<le> 2 * pi / real (length a)

goal (1 subgoal):
 1. (MIN i\<in>{..<length a}. args ! Suc i - args ! i) \<le> 2 * pi / real (length a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min \<le> 2 * pi / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have lt: "i < ?k \<Longrightarrow> args ! i < args ! (Suc i)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length a \<Longrightarrow> args ! i < args ! Suc i
[PROOF STEP]
using sorted[unfolded sorted_iff_nth_mono, rule_format, of i "Suc i"]
    dist[unfolded distinct_conv_nth, rule_format, of "Suc i" i]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i \<le> Suc i; Suc i < length args\<rbrakk> \<Longrightarrow> args ! i \<le> args ! Suc i
\<lbrakk>Suc i < length args; i < length args; Suc i \<noteq> i\<rbrakk> \<Longrightarrow> args ! Suc i \<noteq> args ! i

goal (1 subgoal):
 1. i < length a \<Longrightarrow> args ! i < args ! Suc i
[PROOF STEP]
by (auto simp: args_def)
[PROOF STATE]
proof (state)
this:
?i < length a \<Longrightarrow> args ! ?i < args ! Suc ?i

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?c = "\<lambda> i. rcis sr (args ! i)"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have hda[simp]: "hd a = aa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd a = aa
[PROOF STEP]
unfolding a_split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (aa # a') = aa
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hd a = aa

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have Min0: "Min > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Min
[PROOF STEP]
using lt
[PROOF STATE]
proof (prove)
using this:
?i < length a \<Longrightarrow> args ! ?i < args ! Suc ?i

goal (1 subgoal):
 1. 0 < Min
[PROOF STEP]
unfolding Min_def
[PROOF STATE]
proof (prove)
using this:
?i < length a \<Longrightarrow> args ! ?i < args ! Suc ?i

goal (1 subgoal):
 1. 0 < (MIN i\<in>{..<length a}. args ! Suc i - args ! i)
[PROOF STEP]
by (subst Min_gr_iff, insert k, auto)
[PROOF STATE]
proof (state)
this:
0 < Min

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have Min_A: "Min \<in> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min \<in> (\<lambda>i. args ! Suc i - args ! i) ` {..<length a}
[PROOF STEP]
unfolding Min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MIN i\<in>{..<length a}. args ! Suc i - args ! i) \<in> (\<lambda>i. args ! Suc i - args ! i) ` {..<length a}
[PROOF STEP]
by (rule Min_in, insert k, auto)
[PROOF STATE]
proof (state)
this:
Min \<in> (\<lambda>i. args ! Suc i - args ! i) ` {..<length a}

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Min \<in> (\<lambda>i. args ! Suc i - args ! i) ` {..<length a}

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
assume i: "i < length args"
[PROOF STATE]
proof (state)
this:
i < length args

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence "?c i = rcis sr ((a @ [hd a]) ! i)"
[PROOF STATE]
proof (prove)
using this:
i < length args

goal (1 subgoal):
 1. rcis sr (args ! i) = rcis sr ((a @ [hd a]) ! i)
[PROOF STEP]
by (cases "i = ?k", auto simp: args_def nth_append rcis_def)
[PROOF STATE]
proof (state)
this:
rcis sr (args ! i) = rcis sr ((a @ [hd a]) ! i)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rcis sr (args ! i) = rcis sr ((a @ [hd a]) ! i)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> \<in> set (map (rcis sr) (a @ [hd a]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis sr ((a @ [hd a]) ! i) \<in> set (map (rcis sr) (a @ [hd a]))
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < length args

goal (1 subgoal):
 1. rcis sr ((a @ [hd a]) ! i) \<in> set (map (rcis sr) (a @ [hd a]))
[PROOF STEP]
unfolding args_def set_map
[PROOF STATE]
proof (prove)
using this:
i < length (a @ [aa + 2 * pi])

goal (1 subgoal):
 1. rcis sr ((a @ [hd a]) ! i) \<in> rcis sr ` set (a @ [hd a])
[PROOF STEP]
unfolding set_conv_nth
[PROOF STATE]
proof (prove)
using this:
i < length (a @ [aa + 2 * pi])

goal (1 subgoal):
 1. rcis sr ((a @ [hd a]) ! i) \<in> rcis sr ` {(a @ [hd a]) ! i |i. i < length (a @ [hd a])}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rcis sr ((a @ [hd a]) ! i) \<in> set (map (rcis sr) (a @ [hd a]))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rcis sr ((a @ [hd a]) ! i) \<in> set (map (rcis sr) (a @ [hd a]))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> = rcis sr ` set a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (rcis sr) (a @ [hd a])) = rcis sr ` set a
[PROOF STEP]
unfolding a_split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (rcis sr) ((aa # a') @ [hd (aa # a')])) = rcis sr ` set (aa # a')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map (rcis sr) (a @ [hd a])) = rcis sr ` set a

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set (map (rcis sr) (a @ [hd a])) = rcis sr ` set a

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis sr ` set a = M
[PROOF STEP]
unfolding s(1) map_s[symmetric] set_map image_image
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis sr ` set a = (\<lambda>x. complex_of_real sr * cis x) ` set a
[PROOF STEP]
by (rule image_cong[OF refl], auto simp: rcis_def)
[PROOF STATE]
proof (state)
this:
rcis sr ` set a = M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rcis sr (args ! i) \<in> M
[PROOF STEP]
have "?c i \<in> M"
[PROOF STATE]
proof (prove)
using this:
rcis sr (args ! i) \<in> M

goal (1 subgoal):
 1. rcis sr (args ! i) \<in> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rcis sr (args ! i) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < length args \<Longrightarrow> rcis sr (args ! ?i2) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note ciM = this
[PROOF STATE]
proof (state)
this:
?i2 < length args \<Longrightarrow> rcis sr (args ! ?i2) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?i2 < length args \<Longrightarrow> rcis sr (args ! ?i2) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
assume i: "i < ?k"
[PROOF STATE]
proof (state)
this:
i < length a

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence "i < length args" "Suc i < length args"
[PROOF STATE]
proof (prove)
using this:
i < length a

goal (1 subgoal):
 1. i < length args &&& Suc i < length args
[PROOF STEP]
unfolding args_def
[PROOF STATE]
proof (prove)
using this:
i < length a

goal (1 subgoal):
 1. i < length (a @ [aa + 2 * pi]) &&& Suc i < length (a @ [aa + 2 * pi])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length args
Suc i < length args

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from maximal_eigen_values_group[OF M ciM[OF this(2)] ciM[OF this(1)]]
[PROOF STATE]
proof (chain)
picking this:
rcis sr (args ! Suc i + args ! i) \<in> M
rcis sr (args ! Suc i - args ! i) \<in> M
rcis sr 0 \<in> M
[PROOF STEP]
have "rcis sr (?diff i) \<in> M"
[PROOF STATE]
proof (prove)
using this:
rcis sr (args ! Suc i + args ! i) \<in> M
rcis sr (args ! Suc i - args ! i) \<in> M
rcis sr 0 \<in> M

goal (1 subgoal):
 1. rcis sr (args ! Suc i - args ! i) \<in> M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rcis sr (args ! Suc i - args ! i) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < length a \<Longrightarrow> rcis sr (args ! Suc ?i2 - args ! ?i2) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence Min_M: "rcis sr Min \<in> M"
[PROOF STATE]
proof (prove)
using this:
?i2 < length a \<Longrightarrow> rcis sr (args ! Suc ?i2 - args ! ?i2) \<in> M

goal (1 subgoal):
 1. rcis sr Min \<in> M
[PROOF STEP]
using Min_A
[PROOF STATE]
proof (prove)
using this:
?i2 < length a \<Longrightarrow> rcis sr (args ! Suc ?i2 - args ! ?i2) \<in> M
Min \<in> (\<lambda>i. args ! Suc i - args ! i) ` {..<length a}

goal (1 subgoal):
 1. rcis sr Min \<in> M
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
rcis sr Min \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have rcisM: "rcis sr (of_nat n * Min) \<in> M" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis sr (real n * Min) \<in> M
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rcis sr (real 0 * Min) \<in> M
 2. \<And>n. rcis sr (real n * Min) \<in> M \<Longrightarrow> rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. rcis sr (real 0 * Min) \<in> M
 2. \<And>n. rcis sr (real n * Min) \<in> M \<Longrightarrow> rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis sr (real 0 * Min) \<in> M
[PROOF STEP]
using sr Mm
[PROOF STATE]
proof (prove)
using this:
complex_of_real sr \<in> set m
M = set m

goal (1 subgoal):
 1. rcis sr (real 0 * Min) \<in> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rcis sr (real 0 * Min) \<in> M

goal (1 subgoal):
 1. \<And>n. rcis sr (real n * Min) \<in> M \<Longrightarrow> rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. rcis sr (real n * Min) \<in> M \<Longrightarrow> rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
rcis sr (real n * Min) \<in> M

goal (1 subgoal):
 1. \<And>n. rcis sr (real n * Min) \<in> M \<Longrightarrow> rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
have *: "rcis sr (of_nat (Suc n) * Min) = rcis sr (of_nat n * Min) * cis Min"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis sr (real (Suc n) * Min) = rcis sr (real n * Min) * cis Min
[PROOF STEP]
by (simp add: rcis_mult ring_distribs add.commute)
[PROOF STATE]
proof (state)
this:
rcis sr (real (Suc n) * Min) = rcis sr (real n * Min) * cis Min

goal (1 subgoal):
 1. \<And>n. rcis sr (real n * Min) \<in> M \<Longrightarrow> rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
from maximal_eigen_values_group(1)[OF M Suc Min_M]
[PROOF STATE]
proof (chain)
picking this:
rcis sr (real n * Min + Min) \<in> M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
rcis sr (real n * Min + Min) \<in> M

goal (1 subgoal):
 1. rcis sr (real (Suc n) * Min) \<in> M
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
rcis sr (real n * Min + Min) \<in> M

goal (1 subgoal):
 1. rcis sr (real n * Min) * cis Min \<in> M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rcis sr (real (Suc n) * Min) \<in> M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rcis sr (real ?n * Min) \<in> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?list = "map (rcis sr) (map (\<lambda> i. of_nat i * Min) [0 ..< ?k])"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
define list where "list = ?list"
[PROOF STATE]
proof (state)
this:
list = map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have len: "length ?list = ?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = card M
[PROOF STEP]
unfolding card
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = length a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = card M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from sr_pos
[PROOF STATE]
proof (chain)
picking this:
0 < sr
[PROOF STEP]
have sr0: "sr \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < sr

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

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
sr \<noteq> 0

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
assume i: "i < ?k"
[PROOF STATE]
proof (state)
this:
i < length a

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence *: "0 \<le> real i * Min"
[PROOF STATE]
proof (prove)
using this:
i < length a

goal (1 subgoal):
 1. 0 \<le> real i * Min
[PROOF STEP]
using Min0
[PROOF STATE]
proof (prove)
using this:
i < length a
0 < Min

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

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from i
[PROOF STATE]
proof (chain)
picking this:
i < length a
[PROOF STEP]
have "real i < real ?k"
[PROOF STATE]
proof (prove)
using this:
i < length a

goal (1 subgoal):
 1. real i < real (length a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real i < real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from mult_strict_right_mono[OF this Min0]
[PROOF STATE]
proof (chain)
picking this:
real i * Min < real (length a) * Min
[PROOF STEP]
have "real i * Min < real ?k * Min"
[PROOF STATE]
proof (prove)
using this:
real i * Min < real (length a) * Min

goal (1 subgoal):
 1. real i * Min < real (length a) * Min
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real i * Min < real (length a) * Min

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real i * Min < real (length a) * Min

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> \<le> real ?k * (2 * pi / real ?k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (length a) * Min \<le> real (length a) * (2 * pi / real (length a))
[PROOF STEP]
by (rule mult_left_mono[OF Min], auto)
[PROOF STATE]
proof (state)
this:
real (length a) * Min \<le> real (length a) * (2 * pi / real (length a))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (length a) * Min \<le> real (length a) * (2 * pi / real (length a))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> = 2 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (length a) * (2 * pi / real (length a)) = 2 * pi
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
length a \<noteq> 0

goal (1 subgoal):
 1. real (length a) * (2 * pi / real (length a)) = 2 * pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (length a) * (2 * pi / real (length a)) = 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real i * Min < 2 * pi
[PROOF STEP]
have "real i * Min < 2 * pi"
[PROOF STATE]
proof (prove)
using this:
real i * Min < 2 * pi

goal (1 subgoal):
 1. real i * Min < 2 * pi
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real i * Min < 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note * this
[PROOF STATE]
proof (state)
this:
0 \<le> real i * Min
real i * Min < 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < length a \<Longrightarrow> 0 \<le> real ?i2 * Min
?i2 < length a \<Longrightarrow> real ?i2 * Min < 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note prod_pi = this
[PROOF STATE]
proof (state)
this:
?i2 < length a \<Longrightarrow> 0 \<le> real ?i2 * Min
?i2 < length a \<Longrightarrow> real ?i2 * Min < 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have dist: "distinct ?list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
unfolding distinct_map[of "rcis sr"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map (\<lambda>i. real i * Min) [0..<length a]) \<and> inj_on (rcis sr) (set (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
proof (rule conjI[OF _ inj_on_subset[OF rcis_inj_on[OF sr0]]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct (map (\<lambda>i. real i * Min) [0..<length a])
 2. set (map (\<lambda>i. real i * Min) [0..<length a]) \<subseteq> {0..<2 * pi}
[PROOF STEP]
show "distinct (map (\<lambda> i. of_nat i * Min) [0 ..< ?k])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map (\<lambda>i. real i * Min) [0..<length a])
[PROOF STEP]
using Min0
[PROOF STATE]
proof (prove)
using this:
0 < Min

goal (1 subgoal):
 1. distinct (map (\<lambda>i. real i * Min) [0..<length a])
[PROOF STEP]
by (auto simp: distinct_map inj_on_def)
[PROOF STATE]
proof (state)
this:
distinct (map (\<lambda>i. real i * Min) [0..<length a])

goal (1 subgoal):
 1. set (map (\<lambda>i. real i * Min) [0..<length a]) \<subseteq> {0..<2 * pi}
[PROOF STEP]
show "set (map (\<lambda>i. real i * Min) [0..<?k]) \<subseteq> {0..<2 * pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. real i * Min) [0..<length a]) \<subseteq> {0..<2 * pi}
[PROOF STEP]
using prod_pi
[PROOF STATE]
proof (prove)
using this:
?i2 < length a \<Longrightarrow> 0 \<le> real ?i2 * Min
?i2 < length a \<Longrightarrow> real ?i2 * Min < 2 * pi

goal (1 subgoal):
 1. set (map (\<lambda>i. real i * Min) [0..<length a]) \<subseteq> {0..<2 * pi}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map (\<lambda>i. real i * Min) [0..<length a]) \<subseteq> {0..<2 * pi}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distinct (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
with len
[PROOF STATE]
proof (chain)
picking this:
length (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = card M
distinct (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
have card': "card (set ?list) = ?M"
[PROOF STATE]
proof (prove)
using this:
length (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = card M
distinct (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (1 subgoal):
 1. card (set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))) = card M
[PROOF STEP]
using distinct_card
[PROOF STATE]
proof (prove)
using this:
length (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = card M
distinct (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs

goal (1 subgoal):
 1. card (set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))) = card M
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card (set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))) = card M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have listM: "set ?list \<subseteq> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) \<subseteq> M
[PROOF STEP]
using rcisM
[PROOF STATE]
proof (prove)
using this:
rcis sr (real ?n * Min) \<in> M

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) \<subseteq> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) \<subseteq> M

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from card_subset_eq[OF finM listM card']
[PROOF STATE]
proof (chain)
picking this:
set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = M
[PROOF STEP]
have M_list: "M = set ?list"
[PROOF STATE]
proof (prove)
using this:
set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = M

goal (1 subgoal):
 1. M = set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
M = set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?piM = "2 * pi / ?M"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
assume "Min \<noteq> ?piM"
[PROOF STATE]
proof (state)
this:
Min \<noteq> 2 * pi / real (card M)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
with Min
[PROOF STATE]
proof (chain)
picking this:
Min \<le> 2 * pi / real (length a)
Min \<noteq> 2 * pi / real (card M)
[PROOF STEP]
have lt: "Min < 2 * pi / ?k"
[PROOF STATE]
proof (prove)
using this:
Min \<le> 2 * pi / real (length a)
Min \<noteq> 2 * pi / real (card M)

goal (1 subgoal):
 1. Min < 2 * pi / real (length a)
[PROOF STEP]
unfolding card
[PROOF STATE]
proof (prove)
using this:
Min \<le> 2 * pi / real (length a)
Min \<noteq> 2 * pi / real (length a)

goal (1 subgoal):
 1. Min < 2 * pi / real (length a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Min < 2 * pi / real (length a)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from k
[PROOF STATE]
proof (chain)
picking this:
length a \<noteq> 0
[PROOF STEP]
have "0 < real ?k"
[PROOF STATE]
proof (prove)
using this:
length a \<noteq> 0

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

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from mult_strict_left_mono[OF lt this] k Min0
[PROOF STATE]
proof (chain)
picking this:
real (length a) * Min < real (length a) * (2 * pi / real (length a))
length a \<noteq> 0
0 < Min
[PROOF STEP]
have k: "0 \<le> ?k * Min" "?k * Min < 2 * pi"
[PROOF STATE]
proof (prove)
using this:
real (length a) * Min < real (length a) * (2 * pi / real (length a))
length a \<noteq> 0
0 < Min

goal (1 subgoal):
 1. 0 \<le> real (length a) * Min &&& real (length a) * Min < 2 * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> real (length a) * Min
real (length a) * Min < 2 * pi

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from rcisM[of ?k, unfolded M_list]
[PROOF STATE]
proof (chain)
picking this:
rcis sr (real (length a) * Min) \<in> set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
have "rcis sr (?k * Min) \<in> set ?list"
[PROOF STATE]
proof (prove)
using this:
rcis sr (real (length a) * Min) \<in> set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (1 subgoal):
 1. rcis sr (real (length a) * Min) \<in> set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rcis sr (real (length a) * Min) \<in> set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rcis sr (real (length a) * Min) \<in> set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))
[PROOF STEP]
obtain i where i: "i < ?k" and id: "rcis sr (?k * Min) = rcis sr (i * Min)"
[PROOF STATE]
proof (prove)
using this:
rcis sr (real (length a) * Min) \<in> set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < length a; rcis sr (real (length a) * Min) = rcis sr (real i * Min)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length a
rcis sr (real (length a) * Min) = rcis sr (real i * Min)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from inj_onD[OF inj_on_subset[OF rcis_inj_on[OF sr0], of "{?k * Min, i * Min}"] id]
      prod_pi[OF i] k
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>{real (length a) * Min, real i * Min} \<subseteq> {0..<2 * pi}; real (length a) * Min \<in> {real (length a) * Min, real i * Min}; real i * Min \<in> {real (length a) * Min, real i * Min}\<rbrakk> \<Longrightarrow> real (length a) * Min = real i * Min
0 \<le> real i * Min
real i * Min < 2 * pi
0 \<le> real (length a) * Min
real (length a) * Min < 2 * pi
[PROOF STEP]
have "?k * Min = i * Min"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{real (length a) * Min, real i * Min} \<subseteq> {0..<2 * pi}; real (length a) * Min \<in> {real (length a) * Min, real i * Min}; real i * Min \<in> {real (length a) * Min, real i * Min}\<rbrakk> \<Longrightarrow> real (length a) * Min = real i * Min
0 \<le> real i * Min
real i * Min < 2 * pi
0 \<le> real (length a) * Min
real (length a) * Min < 2 * pi

goal (1 subgoal):
 1. real (length a) * Min = real i * Min
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (length a) * Min = real i * Min

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
with Min0 i
[PROOF STATE]
proof (chain)
picking this:
0 < Min
i < length a
real (length a) * Min = real i * Min
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
0 < Min
i < length a
real (length a) * Min = real i * Min

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

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Min \<noteq> 2 * pi / real (card M) \<Longrightarrow> False

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence Min: "Min = ?piM"
[PROOF STATE]
proof (prove)
using this:
Min \<noteq> 2 * pi / real (card M) \<Longrightarrow> False

goal (1 subgoal):
 1. Min = 2 * pi / real (card M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min = 2 * pi / real (card M)

goal (5 subgoals):
 1. card M \<noteq> 0
 2. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 3. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 4. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 5. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
show cM: "?M \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card M \<noteq> 0
[PROOF STEP]
unfolding card
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length a \<noteq> 0
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
length a \<noteq> 0

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

goal (4 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 3. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 4. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?f = "(\<lambda> i. cis (of_nat i * 2 * pi / ?M))"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 3. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 4. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note M_list
[PROOF STATE]
proof (state)
this:
M = set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (4 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 3. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 4. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M = set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a]))

goal (4 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 3. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 4. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "set ?list = (*) (c sr) ` (\<lambda> i. cis (of_nat i * Min)) ` {0 ..< ?k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * Min)) ` {0..<length a}
[PROOF STEP]
unfolding set_map image_image
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. rcis sr (real x * Min)) ` set [0..<length a] = (\<lambda>x. complex_of_real sr * cis (real x * Min)) ` {0..<length a}
[PROOF STEP]
by (rule image_cong, insert sr_pos, auto simp: rcis_mult rcis_def)
[PROOF STATE]
proof (state)
this:
set (map (rcis sr) (map (\<lambda>i. real i * Min) [0..<length a])) = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * Min)) ` {0..<length a}

goal (4 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
 3. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 4. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * Min)) ` {0..<length a}
[PROOF STEP]
show M_cis: "M = (*) (c sr) ` ?f ` {0 ..< ?M}"
[PROOF STATE]
proof (prove)
using this:
M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * Min)) ` {0..<length a}

goal (1 subgoal):
 1. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
[PROOF STEP]
unfolding card Min
[PROOF STATE]
proof (prove)
using this:
M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * (2 * pi / real (length a)))) ` {0..<length a}

goal (1 subgoal):
 1. M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (length a))) ` {0..<length a}
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}

goal (3 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
 3. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
thus M_pow: "M = (*) (c sr) ` { x :: complex. x ^ ?M = 1}"
[PROOF STATE]
proof (prove)
using this:
M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}

goal (1 subgoal):
 1. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
[PROOF STEP]
using roots_of_unity[OF cM]
[PROOF STATE]
proof (prove)
using this:
M = (*) (complex_of_real sr) ` (\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M}
(\<lambda>i. cis (real i * 2 * pi / real (card M))) ` {0..<card M} = {x. x ^ card M = 1}
{x. poly (root_unity (card M)) x = 0} = {x. x ^ card M = 1}
card {x. x ^ card M = 1} = card M

goal (1 subgoal):
 1. M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M = (*) (complex_of_real sr) ` {x. x ^ card M = 1}

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?rphi = "rcis sr (2 * pi / ?M)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
let ?phi = "cis (2 * pi / ?M)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from Min_M[unfolded Min]
[PROOF STATE]
proof (chain)
picking this:
rcis sr (2 * pi / real (card M)) \<in> M
[PROOF STEP]
have ev: "eigen_value cA ?rphi"
[PROOF STATE]
proof (prove)
using this:
rcis sr (2 * pi / real (card M)) \<in> M

goal (1 subgoal):
 1. eigen_value cA (rcis sr (2 * pi / real (card M)))
[PROOF STEP]
unfolding M
[PROOF STATE]
proof (prove)
using this:
rcis sr (2 * pi / real (card {ev. eigen_value cA ev \<and> cmod ev = sr})) \<in> {ev. eigen_value cA ev \<and> cmod ev = sr}

goal (1 subgoal):
 1. eigen_value cA (rcis sr (2 * pi / real (card {ev. eigen_value cA ev \<and> cmod ev = sr})))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigen_value cA (rcis sr (2 * pi / real (card M)))

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have cm: "cmod ?rphi = sr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (rcis sr (2 * pi / real (card M))) = sr
[PROOF STEP]
using sr_pos
[PROOF STATE]
proof (prove)
using this:
0 < sr

goal (1 subgoal):
 1. cmod (rcis sr (2 * pi / real (card M))) = sr
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (rcis sr (2 * pi / real (card M))) = sr

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have id: "cis (Arg ?rphi) = cis (Arg ?phi) * cmod ?phi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (Arg (cis (2 * pi / real (card M)))) * complex_of_real (cmod (cis (2 * pi / real (card M))))
[PROOF STEP]
unfolding arg_rcis_cis[OF sr_pos]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (Arg (cis (2 * pi / real (card M)))) = cis (Arg (cis (2 * pi / real (card M)))) * complex_of_real (cmod (cis (2 * pi / real (card M))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (Arg (cis (2 * pi / real (card M)))) * complex_of_real (cmod (cis (2 * pi / real (card M))))

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (Arg (cis (2 * pi / real (card M)))) * complex_of_real (cmod (cis (2 * pi / real (card M))))

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "\<dots> = ?phi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (Arg (cis (2 * pi / real (card M)))) * complex_of_real (cmod (cis (2 * pi / real (card M)))) = cis (2 * pi / real (card M))
[PROOF STEP]
unfolding cis_mult_cmod_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (2 * pi / real (card M)) = cis (2 * pi / real (card M))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
cis (Arg (cis (2 * pi / real (card M)))) * complex_of_real (cmod (cis (2 * pi / real (card M)))) = cis (2 * pi / real (card M))

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (2 * pi / real (card M))
[PROOF STEP]
have id: "cis (Arg ?rphi) = ?phi"
[PROOF STATE]
proof (prove)
using this:
cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (2 * pi / real (card M))

goal (1 subgoal):
 1. cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (2 * pi / real (card M))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cis (Arg (rcis sr (2 * pi / real (card M)))) = cis (2 * pi / real (card M))

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
define phi where "phi = ?phi"
[PROOF STATE]
proof (state)
this:
phi = cis (2 * pi / real (card M))

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have phi: "phi \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phi \<noteq> 0
[PROOF STEP]
unfolding phi_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (2 * pi / real (card M)) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
phi \<noteq> 0

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
note max = maximal_eigen_value_rotation[OF ev cm, unfolded id phi_def[symmetric]]
[PROOF STATE]
proof (state)
this:
eigen_value cA (?x * phi) = eigen_value cA ?x
eigen_value cA (?x / phi) = eigen_value cA ?x

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
have "((*) phi) ` Spectrum cA = Spectrum cA" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
have *: "x \<in> ?L \<Longrightarrow> x \<in> ?R" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (*) phi ` Spectrum cA \<Longrightarrow> x \<in> Spectrum cA
[PROOF STEP]
using max(2)[of x] phi
[PROOF STATE]
proof (prove)
using this:
eigen_value cA (x / phi) = eigen_value cA x
phi \<noteq> 0

goal (1 subgoal):
 1. x \<in> (*) phi ` Spectrum cA \<Longrightarrow> x \<in> Spectrum cA
[PROOF STEP]
unfolding Spectrum_def
[PROOF STATE]
proof (prove)
using this:
eigen_value cA (x / phi) = eigen_value cA x
phi \<noteq> 0

goal (1 subgoal):
 1. x \<in> (*) phi ` Collect (eigen_value cA) \<Longrightarrow> x \<in> Collect (eigen_value cA)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> (*) phi ` Spectrum cA \<Longrightarrow> ?x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> (*) phi ` Spectrum cA \<Longrightarrow> ?x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x \<in> (*) phi ` Spectrum cA \<Longrightarrow> ?x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
assume "x \<in> ?R"
[PROOF STATE]
proof (state)
this:
x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
hence "eigen_value cA x"
[PROOF STATE]
proof (prove)
using this:
x \<in> Spectrum cA

goal (1 subgoal):
 1. eigen_value cA x
[PROOF STEP]
unfolding Spectrum_def
[PROOF STATE]
proof (prove)
using this:
x \<in> Collect (eigen_value cA)

goal (1 subgoal):
 1. eigen_value cA x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigen_value cA x

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
from this[folded max(2)[of x]]
[PROOF STATE]
proof (chain)
picking this:
eigen_value cA (x / phi)
[PROOF STEP]
have "x / phi \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
eigen_value cA (x / phi)

goal (1 subgoal):
 1. x / phi \<in> Spectrum cA
[PROOF STEP]
unfolding Spectrum_def
[PROOF STATE]
proof (prove)
using this:
eigen_value cA (x / phi)

goal (1 subgoal):
 1. x / phi \<in> Collect (eigen_value cA)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x / phi \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
from imageI[OF this, of "(*) phi"]
[PROOF STATE]
proof (chain)
picking this:
phi * (x / phi) \<in> (*) phi ` Spectrum cA
[PROOF STEP]
have "x \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
phi * (x / phi) \<in> (*) phi ` Spectrum cA

goal (1 subgoal):
 1. x \<in> (*) phi ` Spectrum cA
[PROOF STEP]
using phi
[PROOF STATE]
proof (prove)
using this:
phi * (x / phi) \<in> (*) phi ` Spectrum cA
phi \<noteq> 0

goal (1 subgoal):
 1. x \<in> (*) phi ` Spectrum cA
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> (*) phi ` Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x \<in> Spectrum cA \<Longrightarrow> x \<in> (*) phi ` Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
note this *
[PROOF STATE]
proof (state)
this:
x \<in> Spectrum cA \<Longrightarrow> x \<in> (*) phi ` Spectrum cA
?x \<in> (*) phi ` Spectrum cA \<Longrightarrow> ?x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x3 \<in> Spectrum cA \<Longrightarrow> ?x3 \<in> (*) phi ` Spectrum cA
?x \<in> (*) phi ` Spectrum cA \<Longrightarrow> ?x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x3 \<in> Spectrum cA \<Longrightarrow> ?x3 \<in> (*) phi ` Spectrum cA
?x \<in> (*) phi ` Spectrum cA \<Longrightarrow> ?x \<in> Spectrum cA

goal (1 subgoal):
 1. (*) phi ` Spectrum cA = Spectrum cA
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(*) phi ` Spectrum cA = Spectrum cA

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(*) phi ` Spectrum cA = Spectrum cA

goal (2 subgoals):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
 2. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
from this[unfolded phi_def]
[PROOF STATE]
proof (chain)
picking this:
(*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
show "(*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA"
[PROOF STATE]
proof (prove)
using this:
(*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA

goal (1 subgoal):
 1. (*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(*) (cis (2 * pi / real (card M))) ` Spectrum cA = Spectrum cA

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?p = "monom 1 k - [:sr^k:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?cp = "monom 1 k - [:(c sr)^k:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?one = "1 :: complex"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?list = "map (rcis sr) (map (\<lambda> i. of_nat i * ?piM) [0 ..< card M])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
interpret c: field_hom c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field_hom complex_of_real
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
interpret p: map_poly_inj_idom_divide_hom c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_inj_idom_divide_hom complex_of_real
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have cp: "?cp = map_poly c ?p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom 1 k - [:complex_of_real sr ^ k:] = map_poly complex_of_real (monom 1 k - [:sr ^ k:])
[PROOF STEP]
by (simp add: hom_distribs)
[PROOF STATE]
proof (state)
this:
monom 1 k - [:complex_of_real sr ^ k:] = map_poly complex_of_real (monom 1 k - [:sr ^ k:])

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have M_list: "M = set ?list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))
[PROOF STEP]
using M_list[unfolded Min card[symmetric]]
[PROOF STATE]
proof (prove)
using this:
M = set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))

goal (1 subgoal):
 1. M = set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
M = set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have dist: "distinct ?list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))
[PROOF STEP]
using dist[unfolded Min card[symmetric]]
[PROOF STATE]
proof (prove)
using this:
distinct (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))

goal (1 subgoal):
 1. distinct (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
distinct (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have k0: "k \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> 0
[PROOF STEP]
using k[folded card] assms
[PROOF STATE]
proof (prove)
using this:
card M \<noteq> 0
M = {ev. eigen_value cA ev \<and> cmod ev = sr}
k = card M

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

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "?cp = (monom 1 k + (- [:(c sr)^k:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom 1 k - [:complex_of_real sr ^ k:] = monom 1 k + - [:complex_of_real sr ^ k:]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monom 1 k - [:complex_of_real sr ^ k:] = monom 1 k + - [:complex_of_real sr ^ k:]

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
monom 1 k - [:complex_of_real sr ^ k:] = monom 1 k + - [:complex_of_real sr ^ k:]

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "degree \<dots> = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (monom 1 k + - [:complex_of_real sr ^ k:]) = k
[PROOF STEP]
by (subst degree_add_eq_left, insert k0, auto simp: degree_monom_eq)
[PROOF STATE]
proof (state)
this:
degree (monom 1 k + - [:complex_of_real sr ^ k:]) = k

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree (monom 1 k - [:complex_of_real sr ^ k:]) = k
[PROOF STEP]
have deg: "degree ?cp = k"
[PROOF STATE]
proof (prove)
using this:
degree (monom 1 k - [:complex_of_real sr ^ k:]) = k

goal (1 subgoal):
 1. degree (monom 1 k - [:complex_of_real sr ^ k:]) = k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree (monom 1 k - [:complex_of_real sr ^ k:]) = k

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from deg k0
[PROOF STATE]
proof (chain)
picking this:
degree (monom 1 k - [:complex_of_real sr ^ k:]) = k
k \<noteq> 0
[PROOF STEP]
have cp0: "?cp \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree (monom 1 k - [:complex_of_real sr ^ k:]) = k
k \<noteq> 0

goal (1 subgoal):
 1. monom 1 k - [:complex_of_real sr ^ k:] \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
monom 1 k - [:complex_of_real sr ^ k:] \<noteq> 0

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "{x. poly ?cp x = 0} = {x. x^k = (c sr)^k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} = {x. x ^ k = complex_of_real sr ^ k}
[PROOF STEP]
unfolding poly_diff poly_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. 1 * x ^ k - poly [:complex_of_real sr ^ k:] x = 0} = {x. x ^ k = complex_of_real sr ^ k}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} = {x. x ^ k = complex_of_real sr ^ k}

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} = {x. x ^ k = complex_of_real sr ^ k}

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "\<dots> \<subseteq> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
assume id: "x^k = (c sr)^k"
[PROOF STATE]
proof (state)
this:
x ^ k = complex_of_real sr ^ k

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
from sr_pos k0
[PROOF STATE]
proof (chain)
picking this:
0 < sr
k \<noteq> 0
[PROOF STEP]
have "(c sr)^k \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < sr
k \<noteq> 0

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

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
with arg_cong[OF id, of "\<lambda> x. x / (c sr)^k"]
[PROOF STATE]
proof (chain)
picking this:
x ^ k / complex_of_real sr ^ k = complex_of_real sr ^ k / complex_of_real sr ^ k
complex_of_real sr ^ k \<noteq> 0
[PROOF STEP]
have "(x / c sr)^k = 1"
[PROOF STATE]
proof (prove)
using this:
x ^ k / complex_of_real sr ^ k = complex_of_real sr ^ k / complex_of_real sr ^ k
complex_of_real sr ^ k \<noteq> 0

goal (1 subgoal):
 1. (x / complex_of_real sr) ^ k = 1
[PROOF STEP]
unfolding power_divide
[PROOF STATE]
proof (prove)
using this:
x ^ k / complex_of_real sr ^ k = complex_of_real sr ^ k / complex_of_real sr ^ k
complex_of_real sr ^ k \<noteq> 0

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

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
hence "c sr * (x / c sr) \<in> M"
[PROOF STATE]
proof (prove)
using this:
(x / complex_of_real sr) ^ k = 1

goal (1 subgoal):
 1. complex_of_real sr * (x / complex_of_real sr) \<in> M
[PROOF STEP]
by (subst M_pow, unfold kM[symmetric], blast)
[PROOF STATE]
proof (state)
this:
complex_of_real sr * (x / complex_of_real sr) \<in> M

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real sr * (x / complex_of_real sr) \<in> M

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
have "c sr * (x / c sr) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real sr * (x / complex_of_real sr) = x
[PROOF STEP]
using sr_pos
[PROOF STATE]
proof (prove)
using this:
0 < sr

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

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> M
[PROOF STEP]
have "x \<in> M"
[PROOF STATE]
proof (prove)
using this:
x \<in> M

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

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 ^ k = complex_of_real sr ^ k \<Longrightarrow> ?x2 \<in> M

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x2 ^ k = complex_of_real sr ^ k \<Longrightarrow> ?x2 \<in> M

goal (1 subgoal):
 1. {x. x ^ k = complex_of_real sr ^ k} \<subseteq> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. x ^ k = complex_of_real sr ^ k} \<subseteq> M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x. x ^ k = complex_of_real sr ^ k} \<subseteq> M

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M
[PROOF STEP]
have cp_M: "{x. poly ?cp x = 0} \<subseteq> M"
[PROOF STATE]
proof (prove)
using this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M

goal (1 subgoal):
 1. {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "k = card (set ?list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = card (set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])))
[PROOF STEP]
unfolding distinct_card[OF dist]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = length (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))
[PROOF STEP]
by (simp add: kM)
[PROOF STATE]
proof (state)
this:
k = card (set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])))

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k = card (set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])))

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have "\<dots> \<le> card {x. poly ?cp x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))) \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
proof (rule card_mono[OF poly_roots_finite[OF cp0]])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
assume "x \<in> set ?list"
[PROOF STATE]
proof (state)
this:
x \<in> set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))
[PROOF STEP]
obtain i where x: "x = rcis sr (real i * ?piM)"
[PROOF STATE]
proof (prove)
using this:
x \<in> set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))

goal (1 subgoal):
 1. (\<And>i. x = rcis sr (real i * (2 * pi / real (card M))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = rcis sr (real i * (2 * pi / real (card M)))

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
have "x^k = (c sr)^k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ k = complex_of_real sr ^ k
[PROOF STEP]
unfolding x DeMoivre2 kM
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis (sr ^ card M) (real (card M) * (real i * (2 * pi / real (card M)))) = complex_of_real sr ^ card M
[PROOF STEP]
by simp (metis mult.assoc of_real_power rcis_times_2pi)
[PROOF STATE]
proof (state)
this:
x ^ k = complex_of_real sr ^ k

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
hence "poly ?cp x = 0"
[PROOF STATE]
proof (prove)
using this:
x ^ k = complex_of_real sr ^ k

goal (1 subgoal):
 1. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0
[PROOF STEP]
unfolding poly_diff poly_monom
[PROOF STATE]
proof (prove)
using this:
x ^ k = complex_of_real sr ^ k

goal (1 subgoal):
 1. 1 * x ^ k - poly [:complex_of_real sr ^ k:] x = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<Longrightarrow> poly (monom 1 k - [:complex_of_real sr ^ k:]) ?x2 = 0

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
thus "set ?list \<subseteq> {x. poly ?cp x = 0}"
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<Longrightarrow> poly (monom 1 k - [:complex_of_real sr ^ k:]) ?x2 = 0

goal (1 subgoal):
 1. set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M])) \<subseteq> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (set (map (rcis sr) (map (\<lambda>i. real i * (2 * pi / real (card M))) [0..<card M]))) \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
have k_card: "k \<le> card {x. poly ?cp x = 0}"
[PROOF STATE]
proof (prove)
using this:
k \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}

goal (1 subgoal):
 1. k \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from k_card cp_M finM
[PROOF STATE]
proof (chain)
picking this:
k \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M
finite M
[PROOF STEP]
have M_id: "M = {x. poly ?cp x = 0}"
[PROOF STATE]
proof (prove)
using this:
k \<le> card {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M
finite M

goal (1 subgoal):
 1. M = {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}
[PROOF STEP]
unfolding kM
[PROOF STATE]
proof (prove)
using this:
card M \<le> card {x. poly (monom 1 (card M) - [:complex_of_real sr ^ card M:]) x = 0}
{x. poly (monom 1 (card M) - [:complex_of_real sr ^ card M:]) x = 0} \<subseteq> M
finite M

goal (1 subgoal):
 1. M = {x. poly (monom 1 (card M) - [:complex_of_real sr ^ card M:]) x = 0}
[PROOF STEP]
by (metis card_seteq)
[PROOF STATE]
proof (state)
this:
M = {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have dvdc: "?cp dvd charpoly cA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom 1 k - [:complex_of_real sr ^ k:] dvd charpoly cA
[PROOF STEP]
proof (rule poly_roots_dvd[OF cp0 deg k_card])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> {x. poly (charpoly cA) x = 0}
[PROOF STEP]
from cp_M
[PROOF STATE]
proof (chain)
picking this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M
[PROOF STEP]
show "{x. poly ?cp x = 0} \<subseteq> {x. poly (charpoly cA) x = 0}"
[PROOF STATE]
proof (prove)
using this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> M

goal (1 subgoal):
 1. {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> {x. poly (charpoly cA) x = 0}
[PROOF STEP]
unfolding M eigen_value_root_charpoly
[PROOF STATE]
proof (prove)
using this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> {ev. poly (charpoly cA) ev = 0 \<and> cmod ev = sr}

goal (1 subgoal):
 1. {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> {x. poly (charpoly cA) x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0} \<subseteq> {x. poly (charpoly cA) x = 0}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
monom 1 k - [:complex_of_real sr ^ k:] dvd charpoly cA

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from this[unfolded charpoly_of_real cp p.hom_dvd_iff]
[PROOF STATE]
proof (chain)
picking this:
monom 1 k - [:sr ^ k:] dvd charpoly A
[PROOF STEP]
have dvd: "?p dvd charpoly A"
[PROOF STATE]
proof (prove)
using this:
monom 1 k - [:sr ^ k:] dvd charpoly A

goal (1 subgoal):
 1. monom 1 k - [:sr ^ k:] dvd charpoly A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
monom 1 k - [:sr ^ k:] dvd charpoly A

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
from this[unfolded dvd_def]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ka. charpoly A = (monom 1 k - [:sr ^ k:]) * ka
[PROOF STEP]
obtain f where
    decomp: "charpoly A = ?p * f"
[PROOF STATE]
proof (prove)
using this:
\<exists>ka. charpoly A = (monom 1 k - [:sr ^ k:]) * ka

goal (1 subgoal):
 1. (\<And>f. charpoly A = (monom 1 k - [:sr ^ k:]) * f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
charpoly A = (monom 1 k - [:sr ^ k:]) * f

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
let ?f = "map_poly c f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
have decompc: "charpoly cA = ?cp * ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. charpoly cA = (monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f
[PROOF STEP]
unfolding charpoly_of_real decomp p.hom_mult cp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real (monom 1 k - [:sr ^ k:]) * map_poly complex_of_real f = map_poly complex_of_real (monom 1 k - [:sr ^ k:]) * map_poly complex_of_real f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
charpoly cA = (monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f

goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
show "\<exists> f. charpoly A = (monom 1 ?M - [:sr^?M:]) * f \<and> (\<forall> x. poly (map_poly c f) x = 0 \<longrightarrow> cmod x < sr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
unfolding kM[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. charpoly A = (monom 1 k - [:sr ^ k:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)
[PROOF STEP]
proof (intro exI conjI allI impI, rule decomp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
assume f: "poly ?f x = 0"
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real f) x = 0

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
hence ev: "eigen_value cA x"
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real f) x = 0

goal (1 subgoal):
 1. eigen_value cA x
[PROOF STEP]
unfolding decompc p.hom_mult eigen_value_root_charpoly
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real f) x = 0

goal (1 subgoal):
 1. poly ((monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f) x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigen_value cA x

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
hence le: "cmod x \<le> sr"
[PROOF STATE]
proof (prove)
using this:
eigen_value cA x

goal (1 subgoal):
 1. cmod x \<le> sr
[PROOF STEP]
using eigen_value_norm_sr
[PROOF STATE]
proof (prove)
using this:
eigen_value cA x
eigen_value cA ?\<alpha> \<Longrightarrow> cmod ?\<alpha> \<le> sr

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

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
cmod x \<le> sr

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
assume max: "cmod x = sr"
[PROOF STATE]
proof (state)
this:
cmod x = sr

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
hence "x \<in> M"
[PROOF STATE]
proof (prove)
using this:
cmod x = sr

goal (1 subgoal):
 1. x \<in> M
[PROOF STEP]
unfolding M
[PROOF STATE]
proof (prove)
using this:
cmod x = sr

goal (1 subgoal):
 1. x \<in> {ev. eigen_value cA ev \<and> cmod ev = sr}
[PROOF STEP]
using ev
[PROOF STATE]
proof (prove)
using this:
cmod x = sr
eigen_value cA x

goal (1 subgoal):
 1. x \<in> {ev. eigen_value cA ev \<and> cmod ev = sr}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> M

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
hence "poly ?cp x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> M

goal (1 subgoal):
 1. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0
[PROOF STEP]
unfolding M_id
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0}

goal (1 subgoal):
 1. poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
hence dvd1: "[: -x, 1 :] dvd ?cp"
[PROOF STATE]
proof (prove)
using this:
poly (monom 1 k - [:complex_of_real sr ^ k:]) x = 0

goal (1 subgoal):
 1. [:- x, 1:] dvd monom 1 k - [:complex_of_real sr ^ k:]
[PROOF STEP]
unfolding poly_eq_0_iff_dvd
[PROOF STATE]
proof (prove)
using this:
[:- x, 1:] dvd monom 1 k - [:complex_of_real sr ^ k:]

goal (1 subgoal):
 1. [:- x, 1:] dvd monom 1 k - [:complex_of_real sr ^ k:]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[:- x, 1:] dvd monom 1 k - [:complex_of_real sr ^ k:]

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
from f[unfolded poly_eq_0_iff_dvd]
[PROOF STATE]
proof (chain)
picking this:
[:- x, 1:] dvd map_poly complex_of_real f
[PROOF STEP]
have dvd2: "[: -x, 1 :] dvd ?f"
[PROOF STATE]
proof (prove)
using this:
[:- x, 1:] dvd map_poly complex_of_real f

goal (1 subgoal):
 1. [:- x, 1:] dvd map_poly complex_of_real f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[:- x, 1:] dvd map_poly complex_of_real f

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
from char
[PROOF STATE]
proof (chain)
picking this:
degree (charpoly cA) = CARD('n) \<and> monic (charpoly cA)
[PROOF STEP]
have 0: "charpoly cA \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree (charpoly cA) = CARD('n) \<and> monic (charpoly cA)

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

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
from mult_dvd_mono[OF dvd1 dvd2]
[PROOF STATE]
proof (chain)
picking this:
[:- x, 1:] * [:- x, 1:] dvd (monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f
[PROOF STEP]
have "[: -x, 1 :]^2 dvd (charpoly cA)"
[PROOF STATE]
proof (prove)
using this:
[:- x, 1:] * [:- x, 1:] dvd (monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f

goal (1 subgoal):
 1. [:- x, 1:]\<^sup>2 dvd charpoly cA
[PROOF STEP]
unfolding decompc power2_eq_square
[PROOF STATE]
proof (prove)
using this:
[:- x, 1:] * [:- x, 1:] dvd (monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f

goal (1 subgoal):
 1. [:- x, 1:] * [:- x, 1:] dvd (monom 1 k - [:complex_of_real sr ^ k:]) * map_poly complex_of_real f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
[:- x, 1:]\<^sup>2 dvd charpoly cA

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
from order_max[OF this 0] maximal_eigen_value_order_1[OF ev max]
[PROOF STATE]
proof (chain)
picking this:
2 \<le> order x (charpoly cA)
order x (charpoly cA) = 1
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
2 \<le> order x (charpoly cA)
order x (charpoly cA) = 1

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

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
cmod x = sr \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real f) x = 0 \<Longrightarrow> cmod x < sr
[PROOF STEP]
with le
[PROOF STATE]
proof (chain)
picking this:
cmod x \<le> sr
cmod x = sr \<Longrightarrow> False
[PROOF STEP]
show "cmod x < sr"
[PROOF STATE]
proof (prove)
using this:
cmod x \<le> sr
cmod x = sr \<Longrightarrow> False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f. charpoly A = (monom 1 (card M) - [:sr ^ card M:]) * f \<and> (\<forall>x. poly (map_poly complex_of_real f) x = 0 \<longrightarrow> cmod x < sr)

goal:
No subgoals!
[PROOF STEP]
qed