[STATEMENT]
lemma (in RModule) RModHom_idhom : "RModuleHom R smult M smult (id\<down>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RModuleHom R (\<cdot>) M (\<cdot>) (id \<down> M)
[PROOF STEP]
using RModule_axioms GroupHom_idhom
[PROOF STATE]
proof (prove)
using this:
RModule R (\<cdot>) M
GroupHom M (id \<down> M)

goal (1 subgoal):
 1. RModuleHom R (\<cdot>) M (\<cdot>) (id \<down> M)
[PROOF STEP]
proof (rule RModuleHom.intro)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. RModuleHom_axioms R (\<cdot>) M (\<cdot>) (id \<down> M)
[PROOF STEP]
show "RModuleHom_axioms R (\<cdot>) M (\<cdot>) (id \<down> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RModuleHom_axioms R (\<cdot>) M (\<cdot>) (id \<down> M)
[PROOF STEP]
using smult_closed
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> ?r \<cdot> ?m \<in> M

goal (1 subgoal):
 1. RModuleHom_axioms R (\<cdot>) M (\<cdot>) (id \<down> M)
[PROOF STEP]
by unfold_locales simp
[PROOF STATE]
proof (state)
this:
RModuleHom_axioms R (\<cdot>) M (\<cdot>) (id \<down> M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_imp_solovay_strassen_witness:
  assumes "prime p" "odd p" "a \<in> {2..<p}"
  shows   "solovay_strassen_witness p a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solovay_strassen_witness p a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. solovay_strassen_witness p a
[PROOF STEP]
have eq: "Jacobi a p = Legendre a p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Jacobi (int a) (int p) = Legendre (int a) (int p)
[PROOF STEP]
using prime_p_Jacobi_eq_Legendre assms
[PROOF STATE]
proof (prove)
using this:
prime ?p \<Longrightarrow> Jacobi ?a ?p = Legendre ?a ?p
prime p
odd p
a \<in> {2..<p}

goal (1 subgoal):
 1. Jacobi (int a) (int p) = Legendre (int a) (int p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Jacobi (int a) (int p) = Legendre (int a) (int p)

goal (1 subgoal):
 1. solovay_strassen_witness p a
[PROOF STEP]
from \<open>prime p\<close>
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
have "coprime p a"
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. coprime p a
[PROOF STEP]
by (rule prime_imp_coprime) (use assms in auto)
[PROOF STATE]
proof (state)
this:
coprime p a

goal (1 subgoal):
 1. solovay_strassen_witness p a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solovay_strassen_witness p a
[PROOF STEP]
unfolding solovay_strassen_witness_def Let_def eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Legendre (int a) (int p) \<noteq> 0 \<and> [Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Legendre (int a) (int p) \<noteq> 0
 2. [Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
from \<open>coprime p a\<close> and \<open>prime p\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime p a
prime p
[PROOF STEP]
show "Legendre (int a) (int p) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
coprime p a
prime p

goal (1 subgoal):
 1. Legendre (int a) (int p) \<noteq> 0
[PROOF STEP]
by (auto simp: coprime_commute)
[PROOF STATE]
proof (state)
this:
Legendre (int a) (int p) \<noteq> 0

goal (1 subgoal):
 1. [Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
show "[Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
odd p
a \<in> {2..<p}

goal (1 subgoal):
 1. [Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
by (intro euler_criterion) auto
[PROOF STATE]
proof (state)
this:
[Legendre (int a) (int p) = int a ^ ((p - 1) div 2)] (mod int p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
solovay_strassen_witness p a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring) Span_eq_eval_img:
  assumes "subfield K R" "x \<in> carrier R"
  shows "Span K (exp_base x n) = (\<lambda>p. eval p x) ` { p \<in> carrier (K[X]). length p \<le> n }"
    (is "?Span = ?eval_img")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Span K (exp_base x n) = (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Span K (exp_base x n) \<subseteq> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
 2. (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<subseteq> Span K (exp_base x n)
[PROOF STEP]
show "?Span \<subseteq> ?eval_img"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Span K (exp_base x n) \<subseteq> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
assume "u \<in> Span K (exp_base x n)"
[PROOF STATE]
proof (state)
this:
u \<in> Span K (exp_base x n)

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> Span K (exp_base x n)
[PROOF STEP]
obtain Ks where Ks: "set Ks \<subseteq> K" "length Ks = n" "u = combine Ks (exp_base x n)"
[PROOF STATE]
proof (prove)
using this:
u \<in> Span K (exp_base x n)

goal (1 subgoal):
 1. (\<And>Ks. \<lbrakk>set Ks \<subseteq> K; length Ks = n; u = combine Ks (exp_base x n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Span_eq_combine_set_length_version[OF assms(1) exp_base_closed[OF assms(2)]]
[PROOF STATE]
proof (prove)
using this:
u \<in> Span K (exp_base x n)
Span K (exp_base x ?n1) = {combine Ks (exp_base x ?n1) |Ks. length Ks = length (exp_base x ?n1) \<and> set Ks \<subseteq> K}

goal (1 subgoal):
 1. (\<And>Ks. \<lbrakk>set Ks \<subseteq> K; length Ks = n; u = combine Ks (exp_base x n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: exp_base_def)
[PROOF STATE]
proof (state)
this:
set Ks \<subseteq> K
length Ks = n
u = combine Ks (exp_base x n)

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
hence "u = eval (normalize Ks) x"
[PROOF STATE]
proof (prove)
using this:
set Ks \<subseteq> K
length Ks = n
u = combine Ks (exp_base x n)

goal (1 subgoal):
 1. u = local.eval (local.normalize Ks) x
[PROOF STEP]
using combine_eq_eval eval_normalize[OF _ assms(2)] subfieldE(3)[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
set Ks \<subseteq> K
length Ks = n
u = combine Ks (exp_base x n)
combine ?Ks (exp_base ?x (length ?Ks)) = local.eval ?Ks ?x
set ?p \<subseteq> carrier R \<Longrightarrow> local.eval (local.normalize ?p) x = local.eval ?p x
K \<subseteq> carrier R

goal (1 subgoal):
 1. u = local.eval (local.normalize Ks) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = local.eval (local.normalize Ks) x

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
u = local.eval (local.normalize Ks) x

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
have "normalize Ks \<in> carrier (K[X])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.normalize Ks \<in> carrier (K [X])
[PROOF STEP]
using normalize_gives_polynomial[OF Ks(1)]
[PROOF STATE]
proof (prove)
using this:
polynomial K (local.normalize Ks)

goal (1 subgoal):
 1. local.normalize Ks \<in> carrier (K [X])
[PROOF STEP]
unfolding univ_poly_def
[PROOF STATE]
proof (prove)
using this:
polynomial K (local.normalize Ks)

goal (1 subgoal):
 1. local.normalize Ks \<in> carrier \<lparr>carrier = Collect (polynomial K), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.normalize Ks \<in> carrier (K [X])

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.normalize Ks \<in> carrier (K [X])

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
have "length (normalize Ks) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (local.normalize Ks) \<le> n
[PROOF STEP]
using normalize_length_le[of Ks] Ks(2)
[PROOF STATE]
proof (prove)
using this:
length (local.normalize Ks) \<le> length Ks
length Ks = n

goal (1 subgoal):
 1. length (local.normalize Ks) \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (local.normalize Ks) \<le> n

goal (1 subgoal):
 1. \<And>xa. xa \<in> Span K (exp_base x n) \<Longrightarrow> xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
u = local.eval (local.normalize Ks) x
local.normalize Ks \<in> carrier (K [X])
length (local.normalize Ks) \<le> n
[PROOF STEP]
show "u \<in> ?eval_img"
[PROOF STATE]
proof (prove)
using this:
u = local.eval (local.normalize Ks) x
local.normalize Ks \<in> carrier (K [X])
length (local.normalize Ks) \<le> n

goal (1 subgoal):
 1. u \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Span K (exp_base x n) \<subseteq> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}

goal (1 subgoal):
 1. (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<subseteq> Span K (exp_base x n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<subseteq> Span K (exp_base x n)
[PROOF STEP]
show "?eval_img \<subseteq> ?Span"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<subseteq> Span K (exp_base x n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
assume "u \<in> ?eval_img"
[PROOF STATE]
proof (state)
this:
u \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}
[PROOF STEP]
obtain p where p: "p \<in> carrier (K[X])" "length p \<le> n" "u = eval p x"
[PROOF STATE]
proof (prove)
using this:
u \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n}

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> carrier (K [X]); length p \<le> n; u = local.eval p x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<in> carrier (K [X])
length p \<le> n
u = local.eval p x

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
hence "combine p (exp_base x (length p)) = u"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X])
length p \<le> n
u = local.eval p x

goal (1 subgoal):
 1. combine p (exp_base x (length p)) = u
[PROOF STEP]
using combine_eq_eval
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X])
length p \<le> n
u = local.eval p x
combine ?Ks (exp_base ?x (length ?Ks)) = local.eval ?Ks ?x

goal (1 subgoal):
 1. combine p (exp_base x (length p)) = u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
combine p (exp_base x (length p)) = u

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
combine p (exp_base x (length p)) = u

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
have set_p: "set p \<subseteq> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set p \<subseteq> K
[PROOF STEP]
using polynomial_incl[of K p] p(1)
[PROOF STATE]
proof (prove)
using this:
polynomial K p \<Longrightarrow> set p \<subseteq> K
p \<in> carrier (K [X])

goal (1 subgoal):
 1. set p \<subseteq> K
[PROOF STEP]
unfolding univ_poly_carrier
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X]) \<Longrightarrow> set p \<subseteq> K
p \<in> carrier (K [X])

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

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
hence "set p \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> K

goal (1 subgoal):
 1. set p \<subseteq> carrier R
[PROOF STEP]
using subfieldE(3)[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> K
K \<subseteq> carrier R

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

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set p \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
have "drop (n - length p) (exp_base x n) = exp_base x (length p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop (n - length p) (exp_base x n) = exp_base x (length p)
[PROOF STEP]
using p(2) drop_exp_base
[PROOF STATE]
proof (prove)
using this:
length p \<le> n
drop ?n (exp_base ?x ?m) = exp_base ?x (?m - ?n)

goal (1 subgoal):
 1. drop (n - length p) (exp_base x n) = exp_base x (length p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
drop (n - length p) (exp_base x n) = exp_base x (length p)

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
combine p (exp_base x (length p)) = u
set p \<subseteq> carrier R
drop (n - length p) (exp_base x n) = exp_base x (length p)
[PROOF STEP]
have "combine ((replicate (n - length p) \<zero>) @ p) (exp_base x n) = u"
[PROOF STATE]
proof (prove)
using this:
combine p (exp_base x (length p)) = u
set p \<subseteq> carrier R
drop (n - length p) (exp_base x n) = exp_base x (length p)

goal (1 subgoal):
 1. combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u
[PROOF STEP]
using combine_prepend_replicate[OF _ exp_base_closed[OF assms(2), of n]]
[PROOF STATE]
proof (prove)
using this:
combine p (exp_base x (length p)) = u
set p \<subseteq> carrier R
drop (n - length p) (exp_base x n) = exp_base x (length p)
set ?Ks \<subseteq> carrier R \<Longrightarrow> combine (replicate ?n \<zero> @ ?Ks) (exp_base x n) = combine ?Ks (drop ?n (exp_base x n))

goal (1 subgoal):
 1. combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
have "set ((replicate (n - length p) \<zero>) @ p) \<subseteq> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (replicate (n - length p) \<zero> @ p) \<subseteq> K
[PROOF STEP]
using subringE(2)[OF subfieldE(1)[OF assms(1)]] set_p
[PROOF STATE]
proof (prove)
using this:
\<zero> \<in> K
set p \<subseteq> K

goal (1 subgoal):
 1. set (replicate (n - length p) \<zero> @ p) \<subseteq> K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (replicate (n - length p) \<zero> @ p) \<subseteq> K

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<Longrightarrow> xa \<in> Span K (exp_base x n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u
set (replicate (n - length p) \<zero> @ p) \<subseteq> K
[PROOF STEP]
show "u \<in> ?Span"
[PROOF STATE]
proof (prove)
using this:
combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u
set (replicate (n - length p) \<zero> @ p) \<subseteq> K

goal (1 subgoal):
 1. u \<in> Span K (exp_base x n)
[PROOF STEP]
using Span_eq_combine_set[OF assms(1) exp_base_closed[OF assms(2), of n]]
[PROOF STATE]
proof (prove)
using this:
combine (replicate (n - length p) \<zero> @ p) (exp_base x n) = u
set (replicate (n - length p) \<zero> @ p) \<subseteq> K
Span K (exp_base x n) = {combine Ks (exp_base x n) |Ks. set Ks \<subseteq> K}

goal (1 subgoal):
 1. u \<in> Span K (exp_base x n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u \<in> Span K (exp_base x n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>p. local.eval p x) ` {p \<in> carrier (K [X]). length p \<le> n} \<subseteq> Span K (exp_base x n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eheight_Node:
  "l \<noteq> Leaf \<or> r \<noteq> Leaf \<Longrightarrow> eheight (Node l x r) = 2 * max (eheight l) (eheight r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> \<langle>\<rangle> \<or> r \<noteq> \<langle>\<rangle> \<Longrightarrow> eheight \<langle>l, x, r\<rangle> = 2 * max (eheight l) (eheight r)
[PROOF STEP]
by (cases l; cases r) (simp_all add: eheight_def max_power_distrib_right)


[STATEMENT]
lemma Carmichael_dvd_totient: "Carmichael n dvd totient n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Carmichael n dvd totient n
[PROOF STEP]
unfolding Carmichael_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm (ord n ` totatives n) dvd totient n
[PROOF STEP]
proof (intro Lcm_least, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b x. x \<in> totatives n \<Longrightarrow> ord n x dvd totient n
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b x. x \<in> totatives n \<Longrightarrow> ord n x dvd totient n
[PROOF STEP]
assume "a \<in> totatives n"
[PROOF STATE]
proof (state)
this:
a \<in> totatives n

goal (1 subgoal):
 1. \<And>b x. x \<in> totatives n \<Longrightarrow> ord n x dvd totient n
[PROOF STEP]
hence "[a ^ totient n = 1] (mod n)"
[PROOF STATE]
proof (prove)
using this:
a \<in> totatives n

goal (1 subgoal):
 1. [a ^ totient n = 1] (mod n)
[PROOF STEP]
by (intro euler_theorem) (auto simp: totatives_def)
[PROOF STATE]
proof (state)
this:
[a ^ totient n = 1] (mod n)

goal (1 subgoal):
 1. \<And>b x. x \<in> totatives n \<Longrightarrow> ord n x dvd totient n
[PROOF STEP]
thus "ord n a dvd totient n"
[PROOF STATE]
proof (prove)
using this:
[a ^ totient n = 1] (mod n)

goal (1 subgoal):
 1. ord n a dvd totient n
[PROOF STEP]
using ord_divides
[PROOF STATE]
proof (prove)
using this:
[a ^ totient n = 1] (mod n)
[?a ^ ?d = 1] (mod ?n) = (ord ?n ?a dvd ?d)

goal (1 subgoal):
 1. ord n a dvd totient n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ord n a dvd totient n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_mod_elements_in:
  assumes "x \<in> elements_mat M"
  shows "x mod m \<in> elements_mat (mat_mod M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod m \<in> elements_mat (local.mat_mod M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x mod m \<in> elements_mat (local.mat_mod M)
[PROOF STEP]
obtain i j where "M $$ (i, j) = x" and ilt: "i < dim_row M" and jlt: "j < dim_col M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>M $$ (i, j) = x; i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> elements_mat M

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>M $$ (i, j) = x; i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M $$ (i, j) = x
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. x mod m \<in> elements_mat (local.mat_mod M)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M $$ (i, j) = x
i < dim_row M
j < dim_col M
[PROOF STEP]
have "mat_mod M $$ (i, j) = x mod m"
[PROOF STATE]
proof (prove)
using this:
M $$ (i, j) = x
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. local.mat_mod M $$ (i, j) = x mod m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.mat_mod M $$ (i, j) = x mod m

goal (1 subgoal):
 1. x mod m \<in> elements_mat (local.mat_mod M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
local.mat_mod M $$ (i, j) = x mod m

goal (1 subgoal):
 1. x mod m \<in> elements_mat (local.mat_mod M)
[PROOF STEP]
using ilt jlt
[PROOF STATE]
proof (prove)
using this:
local.mat_mod M $$ (i, j) = x mod m
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. x mod m \<in> elements_mat (local.mat_mod M)
[PROOF STEP]
by (metis elements_matI2 mat_mod_dim(1) mat_mod_dim(2))
[PROOF STATE]
proof (state)
this:
x mod m \<in> elements_mat (local.mat_mod M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma moebius_inv_translation_translation [simp]:
  shows "moebius_pt (moebius_translation (-v)) (moebius_pt (moebius_translation v) z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_translation (- v)) (moebius_pt (moebius_translation v) z) = z
[PROOF STEP]
using moebius_translation_inv[symmetric, of v]
[PROOF STATE]
proof (prove)
using this:
moebius_translation (- v) = moebius_inv (moebius_translation v)

goal (1 subgoal):
 1. moebius_pt (moebius_translation (- v)) (moebius_pt (moebius_translation v) z) = z
[PROOF STEP]
by (simp del: moebius_translation_inv)


[STATEMENT]
lemma (in comm_semiring_0) padd_assoc: "(a +++ b) +++ c = a +++ (b +++ c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a +++ b +++ c = a +++ (b +++ c)
[PROOF STEP]
proof (induct a arbitrary: b c)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b c. [] +++ b +++ c = [] +++ (b +++ c)
 2. \<And>a1 a2 b c. (\<And>b c. a2 +++ b +++ c = a2 +++ (b +++ c)) \<Longrightarrow> a1 # a2 +++ b +++ c = a1 # a2 +++ (b +++ c)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>b c. [] +++ b +++ c = [] +++ (b +++ c)
 2. \<And>a1 a2 b c. (\<And>b c. a2 +++ b +++ c = a2 +++ (b +++ c)) \<Longrightarrow> a1 # a2 +++ b +++ c = a1 # a2 +++ (b +++ c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [] +++ b +++ c = [] +++ (b +++ c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[] +++ b +++ c = [] +++ (b +++ c)

goal (1 subgoal):
 1. \<And>a1 a2 b c. (\<And>b c. a2 +++ b +++ c = a2 +++ (b +++ c)) \<Longrightarrow> a1 # a2 +++ b +++ c = a1 # a2 +++ (b +++ c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a1 a2 b c. (\<And>b c. a2 +++ b +++ c = a2 +++ (b +++ c)) \<Longrightarrow> a1 # a2 +++ b +++ c = a1 # a2 +++ (b +++ c)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
a2_ +++ ?b1 +++ ?c1 = a2_ +++ (?b1 +++ ?c1)

goal (1 subgoal):
 1. \<And>a1 a2 b c. (\<And>b c. a2 +++ b +++ c = a2 +++ (b +++ c)) \<Longrightarrow> a1 # a2 +++ b +++ c = a1 # a2 +++ (b +++ c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a2_ +++ ?b1 +++ ?c1 = a2_ +++ (?b1 +++ ?c1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a2_ +++ ?b1 +++ ?c1 = a2_ +++ (?b1 +++ ?c1)

goal (1 subgoal):
 1. a1_ # a2_ +++ b +++ c = a1_ # a2_ +++ (b +++ c)
[PROOF STEP]
by (cases b) (simp_all add: ac_simps)
[PROOF STATE]
proof (state)
this:
a1_ # a2_ +++ b +++ c = a1_ # a2_ +++ (b +++ c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Osum_Total:
assumes FLD: "Field r Int Field r' = {}" and
        TOT: "Total r" and TOT': "Total r'"
shows "Total (r Osum r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Total (r \<union>o r')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Field r \<inter> Field r' = {}
Total r
Total r'

goal (1 subgoal):
 1. Total (r \<union>o r')
[PROOF STEP]
unfolding total_on_def  Field_Osum
[PROOF STATE]
proof (prove)
using this:
Field r \<inter> Field r' = {}
\<forall>x\<in>Field r. \<forall>y\<in>Field r. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r
\<forall>x\<in>Field r'. \<forall>y\<in>Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r' \<or> (y, x) \<in> r'

goal (1 subgoal):
 1. \<forall>x\<in>Field r \<union> Field r'. \<forall>y\<in>Field r \<union> Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<union>o r' \<or> (y, x) \<in> r \<union>o r'
[PROOF STEP]
unfolding Osum_def
[PROOF STATE]
proof (prove)
using this:
Field r \<inter> Field r' = {}
\<forall>x\<in>Field r. \<forall>y\<in>Field r. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r
\<forall>x\<in>Field r'. \<forall>y\<in>Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r' \<or> (y, x) \<in> r'

goal (1 subgoal):
 1. \<forall>x\<in>Field r \<union> Field r'. \<forall>y\<in>Field r \<union> Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<union> r' \<union> {(a, a'). a \<in> Field r \<and> a' \<in> Field r'} \<or> (y, x) \<in> r \<union> r' \<union> {(a, a'). a \<in> Field r \<and> a' \<in> Field r'}
[PROOF STEP]
by blast


[STATEMENT]
lemma bin_rep_eq:
  fixes n m:: nat
  assumes "n \<ge> 1" and "m \<ge> 0" and "m < 2^n" and "m \<ge> 0"
  shows "m = (\<Sum>i<n. bin_rep n m ! i * 2^(n-1-i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
fix i:: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
assume "i < n"
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "bin_rep n m ! i * 2^(n-1-i) = (m mod 2^(n-i)) div 2^(n-1-i) * 2^(n-1-i)"
[PROOF STATE]
proof (prove)
using this:
i < n

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

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

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bin_rep n m ! i * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i)

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = m mod 2^(n-i) - m mod 2^(n-i) mod 2^(n-1-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)
[PROOF STEP]
by (simp add: minus_mod_eq_div_mult)
[PROOF STATE]
proof (state)
this:
m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = int(m mod 2^(n-i)) - m mod 2^(n-i) mod 2^(n-1-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i))
[PROOF STEP]
using mod_less_eq_dividend of_nat_diff
[PROOF STATE]
proof (prove)
using this:
?m mod ?n \<le> ?m
?n \<le> ?m \<Longrightarrow> of_nat (?m - ?n) = of_nat ?m - of_nat ?n

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

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i))

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = int(m mod 2^(n-i)) - m mod 2^(n-1-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))
[PROOF STEP]
using mod_mod_power_cancel[of "n-1-i" "n-i"]
[PROOF STATE]
proof (prove)
using this:
n - 1 - i \<le> n - i \<Longrightarrow> ?p mod 2 ^ (n - i) mod 2 ^ (n - 1 - i) = ?p mod 2 ^ (n - 1 - i)

goal (1 subgoal):
 1. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))
[PROOF STEP]
by (simp add: dvd_power_le mod_mod_cancel)
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bin_rep n m ! i * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i)
m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)
int (m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i))
int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))
[PROOF STEP]
have "bin_rep n m ! i * 2^(n-1-i) = int (m mod 2^(n-i)) - m mod 2^(n-1-i)"
[PROOF STATE]
proof (prove)
using this:
bin_rep n m ! i * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i)
m mod 2 ^ (n - i) div 2 ^ (n - 1 - i) * 2 ^ (n - 1 - i) = m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)
int (m mod 2 ^ (n - i) - m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i))
int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - i) mod 2 ^ (n - 1 - i)) = int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))

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

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < n \<Longrightarrow> int (bin_rep n m ! ?i2 * 2 ^ (n - 1 - ?i2)) = int (m mod 2 ^ (n - ?i2)) - int (m mod 2 ^ (n - 1 - ?i2))

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 < n \<Longrightarrow> int (bin_rep n m ! ?i2 * 2 ^ (n - 1 - ?i2)) = int (m mod 2 ^ (n - ?i2)) - int (m mod 2 ^ (n - 1 - ?i2))
[PROOF STEP]
have f0:"(\<Sum>i<n. bin_rep n m ! i * 2^(n-1-i)) = (\<Sum>i<n. int (m mod 2^(n-i)) - m mod 2^(n-1-i))"
[PROOF STATE]
proof (prove)
using this:
?i2 < n \<Longrightarrow> int (bin_rep n m ! ?i2 * 2 ^ (n - 1 - ?i2)) = int (m mod 2 ^ (n - ?i2)) - int (m mod 2 ^ (n - 1 - ?i2))

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i)))

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i)))

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "(\<Sum>i<n. int ((m::nat) mod 2^(n - i)) - (m mod 2^(n - 1 - i))) =
          (\<Sum>i<n. ( m mod 2^(n - i))) -  (\<Sum>i<n. int (m mod 2^(n - 1 - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))
[PROOF STEP]
using sum_subtractf[of "(\<lambda>i. (m mod 2^(n-i)))::nat\<Rightarrow>nat" "(\<lambda>i. (m mod 2^(n-1-i)))::nat\<Rightarrow>nat" "{..<(n::nat)}"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x<n. int (m mod 2 ^ (n - x)) - int (m mod 2 ^ (n - 1 - x))) = (\<Sum>x<n. int (m mod 2 ^ (n - x))) - (\<Sum>x<n. int (m mod 2 ^ (n - 1 - x)))

goal (1 subgoal):
 1. (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = m mod 2^n + (\<Sum>i\<in>{1..<n}. (m mod 2^(n-i))) - (\<Sum>i<n-1. int (m mod 2^(n-1-i)))- m mod 2^0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
[PROOF STEP]
using sum.atLeast_Suc_atMost sum.lessThan_Suc assms(1)
[PROOF STATE]
proof (prove)
using this:
?m \<le> ?n \<Longrightarrow> sum ?g {?m..?n} = ?g ?m + sum ?g {Suc ?m..?n}
sum ?g {..<Suc ?n} = sum ?g {..<?n} + ?g ?n
1 \<le> n

goal (1 subgoal):
 1. int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
[PROOF STEP]
by (smt One_nat_def Suc_le_eq diff_self_eq_0 le_add_diff_inverse lessThan_atLeast0 minus_nat.diff_0
          plus_1_eq_Suc sum.atLeast_Suc_lessThan)
[PROOF STATE]
proof (state)
this:
int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = m mod 2^n + (\<Sum>i<n-1. m mod 2^(n-i-1)) - (\<Sum>i<n-1. int ( m mod 2^(n-1-i))) - m mod 2^0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
[PROOF STEP]
apply (auto simp add: sum_of_index_diff[of "\<lambda>i. m mod 2 ^ (n - 1 - i)" "1" "n-1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x = Suc 0..<n. int (m mod 2 ^ (n - x))) = (\<Sum>i<n - Suc 0. int (m mod 2 ^ (n - Suc i)))
[PROOF STEP]
by (smt One_nat_def assms(1) le_add_diff_inverse lessThan_atLeast0 plus_1_eq_Suc sum.cong sum.shift_bounds_Suc_ivl)
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = m mod 2^n - m mod 2^0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n - m mod 2 ^ 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n - m mod 2 ^ 0)

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n - m mod 2 ^ 0)

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
have "\<dots> = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (m mod 2 ^ n - m mod 2 ^ 0) = int m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
0 \<le> m
m < 2 ^ n
0 \<le> m

goal (1 subgoal):
 1. int (m mod 2 ^ n - m mod 2 ^ 0) = int m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (m mod 2 ^ n - m mod 2 ^ 0) = int m

goal (1 subgoal):
 1. int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) \<Longrightarrow> m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))
int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n - m mod 2 ^ 0)
int (m mod 2 ^ n - m mod 2 ^ 0) = int m
[PROOF STEP]
show "m = (\<Sum>i<n. bin_rep n m ! i * 2^(n-1-i))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))
int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n - m mod 2 ^ 0)
int (m mod 2 ^ n - m mod 2 ^ 0) = int m

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
using assms f0
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i))) = int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i)))
int (\<Sum>i<n. m mod 2 ^ (n - i)) - (\<Sum>i<n. int (m mod 2 ^ (n - 1 - i))) = int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
int (m mod 2 ^ n + (\<Sum>i = 1..<n. m mod 2 ^ (n - i))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0)
int (m mod 2 ^ n + (\<Sum>i<n - 1. m mod 2 ^ (n - i - 1))) - (\<Sum>i<n - 1. int (m mod 2 ^ (n - 1 - i))) - int (m mod 2 ^ 0) = int (m mod 2 ^ n - m mod 2 ^ 0)
int (m mod 2 ^ n - m mod 2 ^ 0) = int m
1 \<le> n
0 \<le> m
m < 2 ^ n
0 \<le> m
int (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i)) = (\<Sum>i<n. int (m mod 2 ^ (n - i)) - int (m mod 2 ^ (n - 1 - i)))

goal (1 subgoal):
 1. m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m = (\<Sum>i<n. bin_rep n m ! i * 2 ^ (n - 1 - i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring_1) of_int_code_if:
  "of_int k = (if k = 0 then 0
     else if k < 0 then - of_int (- k)
     else let
       l = 2 * of_int (k div 2);
       j = k mod 2
     in if j = 0 then l else l + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int k = (if k = 0 then 0::'a else if k < 0 then - of_int (- k) else let l = (2::'a) * of_int (k div 2); j = k mod 2 in if j = 0 then l else l + (1::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_int k = (if k = 0 then 0::'a else if k < 0 then - of_int (- k) else let l = (2::'a) * of_int (k div 2); j = k mod 2 in if j = 0 then l else l + (1::'a))
[PROOF STEP]
from div_mult_mod_eq
[PROOF STATE]
proof (chain)
picking this:
?a div ?b * ?b + ?a mod ?b = ?a
[PROOF STEP]
have *: "of_int k = of_int (k div 2 * 2 + k mod 2)"
[PROOF STATE]
proof (prove)
using this:
?a div ?b * ?b + ?a mod ?b = ?a

goal (1 subgoal):
 1. of_int k = of_int (k div 2 * 2 + k mod 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int k = of_int (k div 2 * 2 + k mod 2)

goal (1 subgoal):
 1. of_int k = (if k = 0 then 0::'a else if k < 0 then - of_int (- k) else let l = (2::'a) * of_int (k div 2); j = k mod 2 in if j = 0 then l else l + (1::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int k = (if k = 0 then 0::'a else if k < 0 then - of_int (- k) else let l = (2::'a) * of_int (k div 2); j = k mod 2 in if j = 0 then l else l + (1::'a))
[PROOF STEP]
by (simp add: Let_def of_int_add [symmetric]) (simp add: * mult.commute)
[PROOF STATE]
proof (state)
this:
of_int k = (if k = 0 then 0::'a else if k < 0 then - of_int (- k) else let l = (2::'a) * of_int (k div 2); j = k mod 2 in if j = 0 then l else l + (1::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_shift_cfs:
  assumes "f \<in> carrier P"
  shows "poly_shift f n = f (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_shift f n = f (Suc n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_shift f n = f (Suc n)
[PROOF STEP]
have "(f \<ominus>\<^bsub>P\<^esub> ctrm f) (Suc n) = (X \<otimes>\<^bsub>P\<^esub> (poly_shift f)) (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)
[PROOF STEP]
using assms poly_shift_id
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
?f \<in> carrier P \<Longrightarrow> ?f \<ominus>\<^bsub>P\<^esub> monom P (?f 0) 0 = X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift ?f

goal (1 subgoal):
 1. (f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)

goal (1 subgoal):
 1. poly_shift f n = f (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (X_poly R \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)

goal (1 subgoal):
 1. poly_shift f n = f (Suc n)
[PROOF STEP]
unfolding X_poly_def
[PROOF STATE]
proof (prove)
using this:
(f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (monom (UP R) \<one> 1 \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)

goal (1 subgoal):
 1. poly_shift f n = f (Suc n)
[PROOF STEP]
using poly_shift_closed assms
[PROOF STATE]
proof (prove)
using this:
(f \<ominus>\<^bsub>P\<^esub> monom P (f 0) 0) (Suc n) = (monom (UP R) \<one> 1 \<otimes>\<^bsub>P\<^esub> poly_shift f) (Suc n)
?f \<in> carrier P \<Longrightarrow> poly_shift ?f \<in> carrier P
f \<in> carrier P

goal (1 subgoal):
 1. poly_shift f n = f (Suc n)
[PROOF STEP]
by (metis (no_types, lifting) ctrm_degree ctrm_is_poly
        P.add.m_comm P.minus_closed coeff_of_sum_diff_degree0 poly_shift_id poly_shift_eq cfs_times_X zero_less_Suc)
[PROOF STATE]
proof (state)
this:
poly_shift f n = f (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_inv_axiom1:
  assumes "G s \<longrightarrow> I s" and "diff_invariant I (\<lambda>t. f) (\<lambda>s. {t. t \<ge> 0}) UNIV 0 G"
  shows "s \<in> (fb\<^sub>\<F> (x\<acute>= f & G) {s. I s})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s2p (fb\<^sub>\<F> x\<acute>=\<lambda>t. f & G on \<lambda>s. {t. 0 \<le> t} UNIV @ 0 {s. I s}) s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
G s \<longrightarrow> I s
diff_invariant I (\<lambda>t. f) (\<lambda>s. {t. 0 \<le> t}) UNIV 0 G

goal (1 subgoal):
 1. s2p (fb\<^sub>\<F> x\<acute>=\<lambda>t. f & G on \<lambda>s. {t. 0 \<le> t} UNIV @ 0 {s. I s}) s
[PROOF STEP]
unfolding ffb_g_orbital diff_invariant_eq
[PROOF STATE]
proof (prove)
using this:
G s \<longrightarrow> I s
\<forall>s. I s \<longrightarrow> (\<forall>X\<in>Sols (\<lambda>t. f) (\<lambda>s. Collect ((\<le>) 0)) UNIV 0 s. \<forall>t\<in>Collect ((\<le>) 0). (\<forall>\<tau>\<in>down (Collect ((\<le>) 0)) t. G (X \<tau>)) \<longrightarrow> I (X t))

goal (1 subgoal):
 1. s2p {s. \<forall>X\<in>Sols (\<lambda>t. f) (\<lambda>s. Collect ((\<le>) 0)) UNIV 0 s. \<forall>t\<in>Collect ((\<le>) 0). (\<forall>\<tau>\<in>down (Collect ((\<le>) 0)) t. G (X \<tau>)) \<longrightarrow> s2p (Collect I) (X t)} s
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X t. \<lbrakk>G s \<longrightarrow> I s; \<forall>s. I s \<longrightarrow> (\<forall>X\<in>Sols (\<lambda>t. f) (\<lambda>s. Collect ((\<le>) 0)) UNIV 0 s. \<forall>t\<ge>0. (\<forall>\<tau>. 0 \<le> \<tau> \<and> \<tau> \<le> t \<longrightarrow> G (X \<tau>)) \<longrightarrow> I (X t)); s2p (Sols (\<lambda>t. f) (\<lambda>s. Collect ((\<le>) 0)) UNIV 0 s) X; 0 \<le> t; \<forall>\<tau>. 0 \<le> \<tau> \<and> \<tau> \<le> t \<longrightarrow> G (X \<tau>)\<rbrakk> \<Longrightarrow> I (X t)
[PROOF STEP]
by (erule_tac x=s in allE, frule ivp_solsD(2), clarsimp)


[STATEMENT]
lemma vec_of_basis_enum_1: "vec_of_basis_enum (1 :: 'a::one_dim) = vec_of_list [1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (1::'a) = vec_of_list [1]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_of_basis_enum (1::'a) = vec_of_list [1]
[PROOF STEP]
have [simp]: \<open>crepresentation {1} x 1 = one_dim_iso x\<close> for x :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crepresentation {1::'a} x (1::'a) = one_dim_iso x
[PROOF STEP]
apply (subst one_dim_scaleC_1[where x=x, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crepresentation {1::'a} (one_dim_iso x *\<^sub>C (1::'a)) (1::'a) = one_dim_iso x
[PROOF STEP]
apply (subst complex_vector.representation_scale)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. cindependent {1::'a}
 2. (1::'a) \<in> cspan {1::'a}
 3. one_dim_iso x * crepresentation {1::'a} (1::'a) (1::'a) = one_dim_iso x
[PROOF STEP]
by (auto simp add: complex_vector.span_base complex_vector.representation_basis)
[PROOF STATE]
proof (state)
this:
crepresentation {1::'a} ?x (1::'a) = one_dim_iso ?x

goal (1 subgoal):
 1. vec_of_basis_enum (1::'a) = vec_of_list [1]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (1::'a) = vec_of_list [1]
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (vec_of_list [1]) \<Longrightarrow> vec_of_basis_enum (1::'a) $ i = vec_of_list [1] $ i
 2. dim_vec (vec_of_basis_enum (1::'a)) = dim_vec (vec_of_list [1])
[PROOF STEP]
by (auto simp: vec_of_basis_enum_def)
[PROOF STATE]
proof (state)
this:
vec_of_basis_enum (1::'a) = vec_of_list [1]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_le_sumset:
  assumes A: "finite A" "a \<in> A" "a \<in> G"
    and   B: "finite B" "B \<subseteq> G"
  shows "card B \<le> card (sumset A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B \<le> card (sumset A B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card B \<le> card (sumset A B)
[PROOF STEP]
have "B \<subseteq> (\<oplus>) (inverse a) ` sumset A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> (\<oplus>) (local.inverse a) ` sumset A B
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
finite A
a \<in> A
a \<in> G
finite B
B \<subseteq> G

goal (1 subgoal):
 1. B \<subseteq> (\<oplus>) (local.inverse a) ` sumset A B
[PROOF STEP]
apply (clarsimp simp: sumset image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>finite A; a \<in> A; a \<in> G; finite B; B \<subseteq> G; x \<in> B\<rbrakk> \<Longrightarrow> \<exists>y\<in>A \<inter> G. \<exists>ya\<in>B \<inter> G. x = local.inverse a \<oplus> (y \<oplus> ya)
[PROOF STEP]
by (metis Int_absorb2 Int_iff invertible invertible_left_inverse2)
[PROOF STATE]
proof (state)
this:
B \<subseteq> (\<oplus>) (local.inverse a) ` sumset A B

goal (1 subgoal):
 1. card B \<le> card (sumset A B)
[PROOF STEP]
with A B
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<in> A
a \<in> G
finite B
B \<subseteq> G
B \<subseteq> (\<oplus>) (local.inverse a) ` sumset A B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
a \<in> A
a \<in> G
finite B
B \<subseteq> G
B \<subseteq> (\<oplus>) (local.inverse a) ` sumset A B

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma oriented_subsegment_scale:
  assumes "x1 \<in> {a<--<b}"
  assumes "x2 \<in> {x1<--<b}"
  obtains e where "e > 0" "b-a = e *\<^sub>R (x2-x1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
x1 \<in> {a<--<b}
[PROOF STEP]
obtain u where u : "u > 0" "u < 1" "x1 = (1 - u) *\<^sub>R a + u *\<^sub>R b"
[PROOF STATE]
proof (prove)
using this:
x1 \<in> {a<--<b}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 < u; u < 1; x1 = (1 - u) *\<^sub>R a + u *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding in_segment
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b \<and> (\<exists>u>0. u < 1 \<and> x1 = (1 - u) *\<^sub>R a + u *\<^sub>R b)

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 < u; u < 1; x1 = (1 - u) *\<^sub>R a + u *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < u
u < 1
x1 = (1 - u) *\<^sub>R a + u *\<^sub>R b

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
x2 \<in> {x1<--<b}
[PROOF STEP]
obtain v where v: "v > 0" "v < 1" "x2 = (1 - v) *\<^sub>R x1 + v *\<^sub>R b"
[PROOF STATE]
proof (prove)
using this:
x2 \<in> {x1<--<b}

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>0 < v; v < 1; x2 = (1 - v) *\<^sub>R x1 + v *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding in_segment
[PROOF STATE]
proof (prove)
using this:
x1 \<noteq> b \<and> (\<exists>u>0. u < 1 \<and> x2 = (1 - u) *\<^sub>R x1 + u *\<^sub>R b)

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>0 < v; v < 1; x2 = (1 - v) *\<^sub>R x1 + v *\<^sub>R b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < v
v < 1
x2 = (1 - v) *\<^sub>R x1 + v *\<^sub>R b

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "x2-x1 = -v *\<^sub>R x1 + v *\<^sub>R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 - x1 = - v *\<^sub>R x1 + v *\<^sub>R b
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
0 < v
v < 1
x2 = (1 - v) *\<^sub>R x1 + v *\<^sub>R b

goal (1 subgoal):
 1. x2 - x1 = - v *\<^sub>R x1 + v *\<^sub>R b
[PROOF STEP]
by (metis add.commute add_diff_cancel_right diff_minus_eq_add scaleR_collapse scaleR_left.minus)
[PROOF STATE]
proof (state)
this:
x2 - x1 = - v *\<^sub>R x1 + v *\<^sub>R b

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x2 - x1 = - v *\<^sub>R x1 + v *\<^sub>R b

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "... = (-v) *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b)  + v *\<^sub>R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - v *\<^sub>R x1 + v *\<^sub>R b = - v *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b) + v *\<^sub>R b
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
0 < u
u < 1
x1 = (1 - u) *\<^sub>R a + u *\<^sub>R b

goal (1 subgoal):
 1. - v *\<^sub>R x1 + v *\<^sub>R b = - v *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b) + v *\<^sub>R b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- v *\<^sub>R x1 + v *\<^sub>R b = - v *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b) + v *\<^sub>R b

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- v *\<^sub>R x1 + v *\<^sub>R b = - v *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b) + v *\<^sub>R b

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "... = v *\<^sub>R ((1-u)*\<^sub>R b - (1-u)*\<^sub>R a )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - v *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b) + v *\<^sub>R b = v *\<^sub>R ((1 - u) *\<^sub>R b - (1 - u) *\<^sub>R a)
[PROOF STEP]
by (smt add_diff_cancel diff_diff_add diff_minus_eq_add minus_diff_eq scaleR_collapse scale_minus_left scale_right_diff_distrib)
[PROOF STATE]
proof (state)
this:
- v *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b) + v *\<^sub>R b = v *\<^sub>R ((1 - u) *\<^sub>R b - (1 - u) *\<^sub>R a)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x2 - x1 = v *\<^sub>R ((1 - u) *\<^sub>R b - (1 - u) *\<^sub>R a)
[PROOF STEP]
have x2x1:"x2-x1 = (v *(1-u)) *\<^sub>R (b - a)"
[PROOF STATE]
proof (prove)
using this:
x2 - x1 = v *\<^sub>R ((1 - u) *\<^sub>R b - (1 - u) *\<^sub>R a)

goal (1 subgoal):
 1. x2 - x1 = (v * (1 - u)) *\<^sub>R (b - a)
[PROOF STEP]
by (metis scaleR_scaleR scale_right_diff_distrib)
[PROOF STATE]
proof (state)
this:
x2 - x1 = (v * (1 - u)) *\<^sub>R (b - a)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "v * (1-u) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < v * (1 - u)
[PROOF STEP]
using u(2) v(1)
[PROOF STATE]
proof (prove)
using this:
u < 1
0 < v

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

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < v * (1 - u)
[PROOF STEP]
have "(x2-x1)/\<^sub>R (v * (1-u)) = (b-a)"
[PROOF STATE]
proof (prove)
using this:
0 < v * (1 - u)

goal (1 subgoal):
 1. (x2 - x1) /\<^sub>R (v * (1 - u)) = b - a
[PROOF STEP]
unfolding x2x1
[PROOF STATE]
proof (prove)
using this:
0 < v * (1 - u)

goal (1 subgoal):
 1. (v * (1 - u)) *\<^sub>R (b - a) /\<^sub>R (v * (1 - u)) = b - a
[PROOF STEP]
by (smt field_class.field_inverse scaleR_one scaleR_scaleR)
[PROOF STATE]
proof (state)
this:
(x2 - x1) /\<^sub>R (v * (1 - u)) = b - a

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; b - a = e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x2 - x1) /\<^sub>R (v * (1 - u)) = b - a

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using \<open>0 < v * (1 - u)\<close> positive_imp_inverse_positive that
[PROOF STATE]
proof (prove)
using this:
(x2 - x1) /\<^sub>R (v * (1 - u)) = b - a
0 < v * (1 - u)
(0::?'a) < ?a \<Longrightarrow> (0::?'a) < inverse ?a
\<lbrakk>0 < ?e; b - a = ?e *\<^sub>R (x2 - x1)\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_vec_left_diff_distrib: "(p - q) ** r = p ** r - q ** r"
  for p::"_ \<Rightarrow>\<^sub>0 'b::ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p - q) ** r = p ** r - q ** r
[PROOF STEP]
using mult_vec_distrib_right [of p "- q" r]
[PROOF STATE]
proof (prove)
using this:
(p + - q) ** r = p ** r + - q ** r

goal (1 subgoal):
 1. (p - q) ** r = p ** r - q ** r
[PROOF STEP]
by (simp add: mult_vec_minus_mult_left)


[STATEMENT]
lemma rel_comp_empty_trancl_simp: "R O R = {} \<Longrightarrow> R\<^sup>+ = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R O R = {} \<Longrightarrow> R\<^sup>+ = R
[PROOF STEP]
by (metis O_assoc relcomp_empty2 sup_bot_right trancl_unfold trancl_unfold_right)


[STATEMENT]
lemma inj_tensor_ell2_left: \<open>inj (\<lambda>a::'a::finite ell2. a \<otimes>\<^sub>s b)\<close> if \<open>b \<noteq> 0\<close> for b :: \<open>'b::finite ell2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>a. a \<otimes>\<^sub>s b)
[PROOF STEP]
proof (rule injI, rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix x y :: \<open>'a ell2\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume eq: \<open>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b\<close>
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume neq: \<open>x \<noteq> y\<close>
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
define a where \<open>a = x - y\<close>
[PROOF STATE]
proof (state)
this:
a = x - y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from neq a_def
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
a = x - y
[PROOF STEP]
have neq0: \<open>a \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
a = x - y

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

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> 0
a \<noteq> 0
[PROOF STEP]
have \<open>a \<otimes>\<^sub>s b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0
a \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>s b \<noteq> 0
[PROOF STEP]
by (simp add: tensor_ell2_nonzero)
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^sub>s b \<noteq> 0

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes>\<^sub>s b \<noteq> 0
[PROOF STEP]
have \<open>x \<otimes>\<^sub>s b \<noteq> y \<otimes>\<^sub>s b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^sub>s b \<noteq> 0

goal (1 subgoal):
 1. x \<otimes>\<^sub>s b \<noteq> y \<otimes>\<^sub>s b
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
(x - y) \<otimes>\<^sub>s b \<noteq> 0

goal (1 subgoal):
 1. x \<otimes>\<^sub>s b \<noteq> y \<otimes>\<^sub>s b
[PROOF STEP]
by (metis add_cancel_left_left diff_add_cancel tensor_ell2_add1)
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^sub>s b \<noteq> y \<otimes>\<^sub>s b

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b
x \<otimes>\<^sub>s b \<noteq> y \<otimes>\<^sub>s b
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<otimes>\<^sub>s b = y \<otimes>\<^sub>s b
x \<otimes>\<^sub>s b \<noteq> y \<otimes>\<^sub>s b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_V_est_E: "card V \<le> 2 * card E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
have "card V \<le> card (fst`E) + card (snd`E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card V \<le> card (fst ` E) + card (snd ` E)
[PROOF STEP]
by (auto simp: card_Un_le V_alt)
[PROOF STATE]
proof (state)
this:
card V \<le> card (fst ` E) + card (snd ` E)

goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card V \<le> card (fst ` E) + card (snd ` E)

goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
note card_image_le[OF finite_E]
[PROOF STATE]
proof (state)
this:
card (?f ` E) \<le> card E

goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (?f ` E) \<le> card E

goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
note card_image_le[OF finite_E]
[PROOF STATE]
proof (state)
this:
card (?f ` E) \<le> card E

goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> card (fst ` E) + x \<le> card (fst ` E) + y; \<And>x y. x \<le> y \<Longrightarrow> x + card E \<le> y + card E\<rbrakk> \<Longrightarrow> card V \<le> card E + card E
[PROOF STEP]
show "card V \<le> 2 * card E"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> card (fst ` E) + x \<le> card (fst ` E) + y; \<And>x y. x \<le> y \<Longrightarrow> x + card E \<le> y + card E\<rbrakk> \<Longrightarrow> card V \<le> card E + card E

goal (1 subgoal):
 1. card V \<le> 2 * card E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card V \<le> 2 * card E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma canon_ang_unique:
  assumes "canon_ang_P \<alpha> \<alpha>\<^sub>1" and "canon_ang_P \<alpha> \<alpha>\<^sub>2"
  shows "\<alpha>\<^sub>1 = \<alpha>\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
obtain k1::int where "\<alpha> - \<alpha>\<^sub>1 = 2*k1*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1. \<alpha> - \<alpha>\<^sub>1 = real_of_int (2 * k1) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
canon_ang_P \<alpha> \<alpha>\<^sub>1

goal (1 subgoal):
 1. (\<And>k1. \<alpha> - \<alpha>\<^sub>1 = real_of_int (2 * k1) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> - \<alpha>\<^sub>1 = real_of_int (2 * k1) * pi

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
obtain k2::int where "\<alpha> - \<alpha>\<^sub>2 = 2*k2*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k2. \<alpha> - \<alpha>\<^sub>2 = real_of_int (2 * k2) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
canon_ang_P \<alpha> \<alpha>\<^sub>2

goal (1 subgoal):
 1. (\<And>k2. \<alpha> - \<alpha>\<^sub>2 = real_of_int (2 * k2) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> - \<alpha>\<^sub>2 = real_of_int (2 * k2) * pi

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
hence *: "-\<alpha>\<^sub>1 + \<alpha>\<^sub>2 = 2*(k1 - k2)*pi"
[PROOF STATE]
proof (prove)
using this:
\<alpha> - \<alpha>\<^sub>2 = real_of_int (2 * k2) * pi

goal (1 subgoal):
 1. - \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi
[PROOF STEP]
using \<open>\<alpha> - \<alpha>\<^sub>1 = 2*k1*pi\<close>
[PROOF STATE]
proof (prove)
using this:
\<alpha> - \<alpha>\<^sub>2 = real_of_int (2 * k2) * pi
\<alpha> - \<alpha>\<^sub>1 = real_of_int (2 * k1) * pi

goal (1 subgoal):
 1. - \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi
[PROOF STEP]
by (simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
have "-\<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi" "-\<alpha>\<^sub>1 + \<alpha>\<^sub>2 > -2*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi &&& - 2 * pi < - \<alpha>\<^sub>1 + \<alpha>\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
canon_ang_P \<alpha> \<alpha>\<^sub>1
canon_ang_P \<alpha> \<alpha>\<^sub>2

goal (1 subgoal):
 1. - \<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi &&& - 2 * pi < - \<alpha>\<^sub>1 + \<alpha>\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi
- 2 * pi < - \<alpha>\<^sub>1 + \<alpha>\<^sub>2

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi
- 2 * pi < - \<alpha>\<^sub>1 + \<alpha>\<^sub>2
[PROOF STEP]
have "-\<alpha>\<^sub>1 + \<alpha>\<^sub>2 = 0"
[PROOF STATE]
proof (prove)
using this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi
- 2 * pi < - \<alpha>\<^sub>1 + \<alpha>\<^sub>2

goal (1 subgoal):
 1. - \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = 0
[PROOF STEP]
using mult_less_cancel_right[of "-2" pi "real_of_int(2 * (k1 - k2))"]
[PROOF STATE]
proof (prove)
using this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = real_of_int (2 * (k1 - k2)) * pi
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 < 2 * pi
- 2 * pi < - \<alpha>\<^sub>1 + \<alpha>\<^sub>2
(- 2 * pi < real_of_int (2 * (k1 - k2)) * pi) = ((0 \<le> pi \<longrightarrow> - 2 < real_of_int (2 * (k1 - k2))) \<and> (pi \<le> 0 \<longrightarrow> real_of_int (2 * (k1 - k2)) < - 2))

goal (1 subgoal):
 1. - \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = 0

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- \<alpha>\<^sub>1 + \<alpha>\<^sub>2 = 0

goal (1 subgoal):
 1. \<alpha>\<^sub>1 = \<alpha>\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha>\<^sub>1 = \<alpha>\<^sub>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cpx_sq_mat) eigen_projector_carrier:
  assumes "A\<in> fc_mats"
  and "a\<in> spectrum A"
  and "hermitian A"
shows "eigen_projector A a \<in> fc_mats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_projector A a \<in> fc_mats
[PROOF STEP]
unfolding eigen_projector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. meas_outcome_prj (proj_meas_outcomes (make_pm A) (spectrum_to_pm_idx A a)) \<in> fc_mats
[PROOF STEP]
using meas_outcome_prj_carrier[of A "spectrum_to_pm_idx A a"]
    spectrum_to_pm_idx_lt_card[of A a] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>hermitian A; A \<in> fc_mats; spectrum_to_pm_idx A a < card (spectrum A)\<rbrakk> \<Longrightarrow> meas_outcome_prj (proj_meas_outcomes (make_pm A) (spectrum_to_pm_idx A a)) \<in> fc_mats
\<lbrakk>A \<in> fc_mats; hermitian A; a \<in> spectrum A\<rbrakk> \<Longrightarrow> spectrum_to_pm_idx A a < card (spectrum A)
A \<in> fc_mats
a \<in> spectrum A
hermitian A

goal (1 subgoal):
 1. meas_outcome_prj (proj_meas_outcomes (make_pm A) (spectrum_to_pm_idx A a)) \<in> fc_mats
[PROOF STEP]
by simp


[STATEMENT]
lemma amin_amult_pos:"0 < z \<Longrightarrow>
         amin ((ant z) * x) ((ant z) * y) = (ant z) * amin x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < z \<Longrightarrow> amin (ant z * x) (ant z * y) = ant z * amin x y
[PROOF STEP]
by (simp add:asprod_amult[THEN sym], simp add:amin_mult_pos)


[STATEMENT]
lemma cong_le_nat: "y \<le> x \<Longrightarrow> [x = y] (mod n) \<longleftrightarrow> (\<exists>q. x = q * n + y)"
  for x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x \<Longrightarrow> [x = y] (mod n) = (\<exists>q. x = q * n + y)
[PROOF STEP]
by (auto simp add: cong_altdef_nat le_imp_diff_is_add)


[STATEMENT]
lemma bigo_const [simp]: "(\<lambda>_. c) \<in> O[F](\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>_. c) \<in> O[F](\<lambda>_. 1::'b)
[PROOF STEP]
by (rule bigoI[of _ "norm c"]) simp


[STATEMENT]
lemma part_circlepath_cnj: "cnj (part_circlepath c r a b x) = part_circlepath (cnj c) r (-a) (-b) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (part_circlepath c r a b x) = part_circlepath (cnj c) r (- a) (- b) x
[PROOF STEP]
by (simp add: part_circlepath_def exp_cnj linepath_def algebra_simps)


[STATEMENT]
lemma integrable_count_space_finite_support:
  fixes f :: "'a \<Rightarrow> 'b::{banach,second_countable_topology}"
  shows "finite {x\<in>X. f x \<noteq> 0} \<Longrightarrow> integrable (count_space X) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x \<in> X. f x \<noteq> (0::'b)} \<Longrightarrow> integrable (count_space X) f
[PROOF STEP]
by (auto simp: nn_integral_count_space integrable_iff_bounded)


[STATEMENT]
lemma cf_cn_cov_rcomp_ObjMap_vrange:
  assumes "category \<alpha> \<BB>"
    and "\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "\<SS> : op_cat \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
"
  shows "\<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Obj\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<SS> : op_cat \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_cn_cov_rcomp_def
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<SS> : op_cat \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_bcomp \<SS> (dghm_id \<BB>) \<GG>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Obj\<rparr>
[PROOF STEP]
by (intro cf_cn_cov_bcomp_ObjMap_vrange)
    (cs_concl cs_intro: cat_cs_intros)+


[STATEMENT]
lemma iadd_Suc_right: "(m::eint) + (n + 1) = (m + n) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m + (n + 1) = m + n + 1
[PROOF STEP]
using add.assoc[of m n 1]
[PROOF STATE]
proof (prove)
using this:
m + n + 1 = m + (n + 1)

goal (1 subgoal):
 1. m + (n + 1) = m + n + 1
[PROOF STEP]
by auto


[STATEMENT]
lemma is_hashmap_prec: "precise is_hashmap"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. precise is_hashmap
[PROOF STEP]
unfolding is_hashmap_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. precise (\<lambda>m ht. \<exists>\<^sub>Al. is_hashmap' m l ht)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a a' h p F F'. h \<Turnstile> (\<exists>\<^sub>Al. is_hashmap' a l p) * F \<and>\<^sub>A (\<exists>\<^sub>Al. is_hashmap' a' l p) * F' \<Longrightarrow> a = a'
[PROOF STEP]
by (auto simp add: is_hashmap'_prec)


[STATEMENT]
lemma interval_image_affinity_interval:
  "\<exists>u v. (\<lambda>x. m *\<^sub>R (x::'a::euclidean_space) + c) ` cbox a b = cbox u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v. (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = cbox u v
[PROOF STEP]
unfolding image_affinity_cbox
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v. (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c)) = cbox u v
[PROOF STEP]
by auto


[STATEMENT]
lemma less_nrows: "(m < nrows A) = (\<exists>j i. m <= j & (Rep_matrix A j i) \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m < nrows A) = (\<exists>j i. m \<le> j \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (m < nrows A) = (\<exists>j i. m \<le> j \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
have a: "!! (a::nat) b. (a < b) = (~(b <= a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. (a < b) = (\<not> b \<le> a)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(?a < ?b) = (\<not> ?b \<le> ?a)

goal (1 subgoal):
 1. (m < nrows A) = (\<exists>j i. m \<le> j \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m < nrows A) = (\<exists>j i. m \<le> j \<and> Rep_matrix A j i \<noteq> (0::'a))
[PROOF STEP]
by (simp add: a nrows_le)
[PROOF STATE]
proof (state)
this:
(m < nrows A) = (\<exists>j i. m \<le> j \<and> Rep_matrix A j i \<noteq> (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma associativitySym:
  fixes \<Psi>   :: 'b
  and   \<Psi>'  :: 'b
  and   \<Psi>'' :: 'b

  shows "(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
have "(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> (\<Psi>' \<otimes> \<Psi>'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>''
[PROOF STEP]
by(rule Associativity)
[PROOF STATE]
proof (state)
this:
(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>''

goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>''

goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
have "\<Psi> \<otimes> (\<Psi>' \<otimes> \<Psi>'') \<simeq> \<Psi> \<otimes> (\<Psi>'' \<otimes> \<Psi>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>'
[PROOF STEP]
by(rule compositionSym[OF Commutativity])
[PROOF STATE]
proof (state)
this:
\<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>'

goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>'

goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
have "\<Psi> \<otimes> (\<Psi>'' \<otimes> \<Psi>') \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
by(rule AssertionStatEqSym[OF Associativity])
[PROOF STATE]
proof (state)
this:
\<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'

goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>''
\<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>'
\<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>''
\<Psi> \<otimes> \<Psi>' \<otimes> \<Psi>'' \<simeq> \<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>'
\<Psi> \<otimes> \<Psi>'' \<otimes> \<Psi>' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'

goal (1 subgoal):
 1. (\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'
[PROOF STEP]
by(blast dest: AssertionStatEqTrans)
[PROOF STATE]
proof (state)
this:
(\<Psi> \<otimes> \<Psi>') \<otimes> \<Psi>'' \<simeq> (\<Psi> \<otimes> \<Psi>'') \<otimes> \<Psi>'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_sccs_verts_dv: "card sccs_verts = Suc (card H.sccs_verts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card sccs_verts = Suc (card H.sccs_verts)
[PROOF STEP]
unfolding sccs_verts_dv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card sccs_verts = Suc (card (sccs_verts - {{u}}))
[PROOF STEP]
by (rule card.remove) (auto simp: isolated_verts_in_sccs u_in_isolated_verts finite_sccs_verts)


[STATEMENT]
lemma copyp_distrib: "k \<otimes> (x \<squnion> y) = (k \<otimes> x) \<squnion> (k \<otimes> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<otimes> (x \<squnion> y) = k \<otimes> x \<squnion> k \<otimes> y
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<otimes> (x \<squnion> y) = 0 \<otimes> x \<squnion> 0 \<otimes> y
 2. \<And>k. k \<otimes> (x \<squnion> y) = k \<otimes> x \<squnion> k \<otimes> y \<Longrightarrow> Suc k \<otimes> (x \<squnion> y) = Suc k \<otimes> x \<squnion> Suc k \<otimes> y
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. 0 \<otimes> (x \<squnion> y) = 0 \<otimes> x \<squnion> 0 \<otimes> y
 2. \<And>k. k \<otimes> (x \<squnion> y) = k \<otimes> x \<squnion> k \<otimes> y \<Longrightarrow> Suc k \<otimes> (x \<squnion> y) = Suc k \<otimes> x \<squnion> Suc k \<otimes> y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<otimes> (x \<squnion> y) = 0 \<otimes> x \<squnion> 0 \<otimes> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<otimes> (x \<squnion> y) = 0 \<otimes> x \<squnion> 0 \<otimes> y

goal (1 subgoal):
 1. \<And>k. k \<otimes> (x \<squnion> y) = k \<otimes> x \<squnion> k \<otimes> y \<Longrightarrow> Suc k \<otimes> (x \<squnion> y) = Suc k \<otimes> x \<squnion> Suc k \<otimes> y
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
k_ \<otimes> (x \<squnion> y) = k_ \<otimes> x \<squnion> k_ \<otimes> y

goal (1 subgoal):
 1. \<And>k. k \<otimes> (x \<squnion> y) = k \<otimes> x \<squnion> k \<otimes> y \<Longrightarrow> Suc k \<otimes> (x \<squnion> y) = Suc k \<otimes> x \<squnion> Suc k \<otimes> y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
k_ \<otimes> (x \<squnion> y) = k_ \<otimes> x \<squnion> k_ \<otimes> y

goal (1 subgoal):
 1. Suc k_ \<otimes> (x \<squnion> y) = Suc k_ \<otimes> x \<squnion> Suc k_ \<otimes> y
[PROOF STEP]
by (simp, metis sup_assoc sup_comm)
[PROOF STATE]
proof (state)
this:
Suc k_ \<otimes> (x \<squnion> y) = Suc k_ \<otimes> x \<squnion> Suc k_ \<otimes> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vrange_vunion: "\<R>\<^sub>\<circ> (r \<union>\<^sub>\<circ> s) = \<R>\<^sub>\<circ> r \<union>\<^sub>\<circ> \<R>\<^sub>\<circ> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (r \<union>\<^sub>\<circ> s) = \<R>\<^sub>\<circ> r \<union>\<^sub>\<circ> \<R>\<^sub>\<circ> s
[PROOF STEP]
by (auto intro!: vsubset_antisym)


[STATEMENT]
lemma bigo_mult3: "f \<in> O(h) \<Longrightarrow> g \<in> O(j) \<Longrightarrow> f * g \<in> O(h * j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); g \<in> O(j)\<rbrakk> \<Longrightarrow> f * g \<in> O(h * j)
[PROOF STEP]
apply (rule subsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f \<in> O(h); g \<in> O(j)\<rbrakk> \<Longrightarrow> ?A \<subseteq> O(h * j)
 2. \<lbrakk>f \<in> O(h); g \<in> O(j)\<rbrakk> \<Longrightarrow> f * g \<in> ?A
[PROOF STEP]
apply (rule bigo_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); g \<in> O(j)\<rbrakk> \<Longrightarrow> f * g \<in> O(h) * O(j)
[PROOF STEP]
apply (erule set_times_intro, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ereal_abs_add:
  fixes a b::ereal
  shows "abs(a+b) \<le> abs a + abs b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a + b\<bar> \<le> \<bar>a\<bar> + \<bar>b\<bar>
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) (auto)


[STATEMENT]
lemma Sretr_sym:
assumes "sym theta"
shows "sym (Sretr theta)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (Sretr theta)
[PROOF STEP]
unfolding sym_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> Sretr theta \<longrightarrow> (y, x) \<in> Sretr theta
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> Sretr theta \<Longrightarrow> (y, x) \<in> Sretr theta
[PROOF STEP]
fix c d
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> Sretr theta \<Longrightarrow> (y, x) \<in> Sretr theta
[PROOF STEP]
assume "(c, d) \<in> Sretr theta"
[PROOF STATE]
proof (state)
this:
(c, d) \<in> Sretr theta

goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> Sretr theta \<Longrightarrow> (y, x) \<in> Sretr theta
[PROOF STEP]
hence "(d, c) \<in> Sretr (theta ^-1)"
[PROOF STATE]
proof (prove)
using this:
(c, d) \<in> Sretr theta

goal (1 subgoal):
 1. (d, c) \<in> Sretr (theta\<inverse>)
[PROOF STEP]
unfolding Sretr_def
[PROOF STATE]
proof (prove)
using this:
(c, d) \<in> {(c, d). matchC_C theta c d}

goal (1 subgoal):
 1. (d, c) \<in> {(c, d). matchC_C (theta\<inverse>) c d}
[PROOF STEP]
using matchC_C_sym
[PROOF STATE]
proof (prove)
using this:
(c, d) \<in> {(c, d). matchC_C theta c d}
matchC_C ?theta ?c ?d \<Longrightarrow> matchC_C (?theta\<inverse>) ?d ?c

goal (1 subgoal):
 1. (d, c) \<in> {(c, d). matchC_C (theta\<inverse>) c d}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(d, c) \<in> Sretr (theta\<inverse>)

goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> Sretr theta \<Longrightarrow> (y, x) \<in> Sretr theta
[PROOF STEP]
thus "(d, c) \<in> Sretr theta"
[PROOF STATE]
proof (prove)
using this:
(d, c) \<in> Sretr (theta\<inverse>)

goal (1 subgoal):
 1. (d, c) \<in> Sretr theta
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(d, c) \<in> Sretr (theta\<inverse>)
sym theta

goal (1 subgoal):
 1. (d, c) \<in> Sretr theta
[PROOF STEP]
by (metis sym_conv_converse_eq)
[PROOF STATE]
proof (state)
this:
(d, c) \<in> Sretr theta

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_ring_one: "one (image_ring f R) = f \<one>\<^bsub>R\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>image_ring f R\<^esub> = f \<one>\<^bsub>R\<^esub>
[PROOF STEP]
unfolding image_ring_def image_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>monoid.extend \<lparr>carrier = f ` carrier R, mult = \<lambda>a b. f (inv_into (carrier R) f a \<otimes>\<^bsub>R\<^esub> inv_into (carrier R) f b), one = f \<one>\<^bsub>R\<^esub>\<rparr> \<lparr>zero = f \<zero>\<^bsub>R\<^esub>, add = \<lambda>a b. f (inv_into (carrier R) f a \<oplus>\<^bsub>R\<^esub> inv_into (carrier R) f b)\<rparr>\<^esub> = f \<one>\<^bsub>R\<^esub>
[PROOF STEP]
by (simp add: monoid.defs)


[STATEMENT]
lemma inext_nth_mono2_infin: "
  infinite I \<Longrightarrow> (I \<rightarrow> a < I \<rightarrow> b) = (a < b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite I \<Longrightarrow> (I \<rightarrow> a < I \<rightarrow> b) = (a < b)
[PROOF STEP]
apply (drule infinite_nat_iff_unbounded[THEN iffD1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. \<exists>n>m. n \<in> I \<Longrightarrow> (I \<rightarrow> a < I \<rightarrow> b) = (a < b)
[PROOF STEP]
apply (rule inext_nth_mono2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. \<exists>n>m. n \<in> I \<Longrightarrow> \<exists>x\<in>I. I \<rightarrow> a < x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iT_Plus_iprev_nth: "\<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> n = (I \<leftarrow> n) + k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> n = (I \<leftarrow> n) + k
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> 0 = (I \<leftarrow> 0) + k
 2. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> n = (I \<leftarrow> n) + k; finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> Suc n = (I \<leftarrow> Suc n) + k
[PROOF STEP]
apply (simp add: iT_Plus_Max)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> n = (I \<leftarrow> n) + k; finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<oplus> k) \<leftarrow> Suc n = (I \<leftarrow> Suc n) + k
[PROOF STEP]
apply (simp add: iT_Plus_iprev)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nths_nths: "nths (nths xs A) B = nths xs {i \<in> A. \<exists>j \<in> B. card {i' \<in> A. i' < i} = j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths (nths xs A) B = nths xs {i \<in> A. \<exists>j\<in>B. card {i' \<in> A. i' < i} = j}
[PROOF STEP]
by (induction xs arbitrary: A B) (auto simp add: nths_Cons card_less_Suc card_less_Suc2)


[STATEMENT]
lemma perpendicular_sym:
  shows "perpendicular H1 H2 \<longleftrightarrow> perpendicular H2 H1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular H1 H2 = perpendicular H2 H1
[PROOF STEP]
unfolding perpendicular_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos_angle (of_circline H1) (of_circline H2) = 0) = (cos_angle (of_circline H2) (of_circline H1) = 0)
[PROOF STEP]
by (transfer, transfer, auto simp add: field_simps)


[STATEMENT]
lemma Re_Ln [simp]: "z \<noteq> 0 \<Longrightarrow> Re(Ln z) = ln(norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> Re (Ln z) = ln (cmod z)
[PROOF STEP]
by (metis exp_Ln ln_exp norm_exp_eq_Re)


[STATEMENT]
lemma map_of_zip_map:
  "map_of (zip xs (map f xs)) = (\<lambda>x. if x \<in> set xs then Some (f x) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (zip xs (map f xs)) = (\<lambda>x. if x \<in> set xs then Some (f x) else None)
[PROOF STEP]
by (induct xs) (simp_all add: fun_eq_iff)


[STATEMENT]
lemma finite_dimensional_vector_space_euclidean:
  "finite_dimensional_vector_space (*\<^sub>R) Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_dimensional_vector_space (*\<^sub>R) Basis
[PROOF STEP]
proof unfold_locales
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite Basis
 2. real_vector.independent Basis
 3. module.span (*\<^sub>R) Basis = UNIV
[PROOF STEP]
show "finite (Basis::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Basis
[PROOF STEP]
by (metis finite_Basis)
[PROOF STATE]
proof (state)
this:
finite Basis

goal (2 subgoals):
 1. real_vector.independent Basis
 2. module.span (*\<^sub>R) Basis = UNIV
[PROOF STEP]
show "real_vector.independent (Basis::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_vector.independent Basis
[PROOF STEP]
unfolding dependent_def dependent_raw_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>a\<in>Basis. a \<in> span (Basis - {a}))
[PROOF STEP]
apply (subst span_finite)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. finite (Basis - {a})
 2. \<not> (\<exists>a\<in>Basis. a \<in> range (\<lambda>u. \<Sum>v\<in>Basis - {a}. u v *\<^sub>R v))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>a\<in>Basis. a \<in> range (\<lambda>u. \<Sum>v\<in>Basis - {a}. u v *\<^sub>R v))
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a u. \<lbrakk>a \<in> Basis; a = (\<Sum>v\<in>Basis - {a}. u v *\<^sub>R v); u \<in> UNIV\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule_tac f="inner a" in arg_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a u. \<lbrakk>a \<in> Basis; u \<in> UNIV; inner a a = inner a (\<Sum>v\<in>Basis - {a}. u v *\<^sub>R v)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: inner_Basis inner_sum_right eq_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real_vector.independent Basis

goal (1 subgoal):
 1. module.span (*\<^sub>R) Basis = UNIV
[PROOF STEP]
show "module.span (*\<^sub>R) Basis = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module.span (*\<^sub>R) Basis = UNIV
[PROOF STEP]
unfolding span_finite [OF finite_Basis] span_raw_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj (\<lambda>u. \<Sum>v\<in>Basis. u v *\<^sub>R v)
[PROOF STEP]
by (auto intro!: euclidean_representation[symmetric])
[PROOF STATE]
proof (state)
this:
module.span (*\<^sub>R) Basis = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smooth_on_compose:
  fixes g::"_\<Rightarrow>_::euclidean_space"
  assumes "k-smooth_on T f" "k-smooth_on S g" "open S" "open T" "g ` S \<subseteq> T"
  shows "k-smooth_on S (f o g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on S (f \<circ> g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k-smooth_on T f
k-smooth_on S g
open S
open T
g ` S \<subseteq> T

goal (1 subgoal):
 1. k-smooth_on S (f \<circ> g)
[PROOF STEP]
by (rule smooth_on_compose2) auto


[STATEMENT]
lemma vector_compl: "is_vector x \<Longrightarrow> is_vector (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_vector x \<Longrightarrow> is_vector (- x)
[PROOF STEP]
by (metis one_compl is_vector_def)


[STATEMENT]
lemma gauss_cnj_sum [simp]: "gauss_cnj (sum f A) = (\<Sum>x\<in>A. gauss_cnj (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_cnj (sum f A) = (\<Sum>x\<in>A. gauss_cnj (f x))
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma inter_empty2:"\<emptyset> \<sqinter> (i::nat_int) = \<emptyset>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bot \<sqinter> i = bot
[PROOF STEP]
by (metis inf_commute nat_int.inter_empty1)


[STATEMENT]
lemma iMin_Int_ge2: "(A \<inter> B) \<noteq> {} \<Longrightarrow> iMin B \<le> iMin (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B \<noteq> {} \<Longrightarrow> iMin B \<le> iMin (A \<inter> B)
[PROOF STEP]
by (rule iMin_subset[OF _ Int_lower2])