[STATEMENT]
lemma continuous_on_eq_continuous_at: "open s \<Longrightarrow> continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. isCont f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open s \<Longrightarrow> continuous_on s f = (\<forall>x\<in>s. isCont f x)
[PROOF STEP]
by (simp add: continuous_on_def continuous_at at_within_open[of _ s])


[STATEMENT]
lemma unit_disc_fix_conjugate_comp_moebius [simp]:
  assumes "unit_disc_fix M"
  shows "unit_disc_fix_f (conjugate \<circ> moebius_pt M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix_f (conjugate \<circ> moebius_pt M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. unit_disc_fix_f (conjugate \<circ> moebius_pt M)
[PROOF STEP]
apply (subst conjugate_moebius)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix M \<Longrightarrow> unit_disc_fix_f (moebius_pt (conjugate_moebius M) \<circ> conjugate)
[PROOF STEP]
apply (simp add: unit_disc_fix_f_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix M \<Longrightarrow> \<exists>Ma. unit_disc_fix Ma \<and> (moebius_pt (conjugate_moebius M) \<circ> conjugate = moebius_pt Ma \<or> moebius_pt (conjugate_moebius M) \<circ> conjugate = moebius_pt Ma \<circ> conjugate)
[PROOF STEP]
apply (rule_tac x="conjugate_moebius M" in exI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma twice_field_differentiable_at_polyn [simp, intro]:
  fixes coef :: "nat \<Rightarrow> 'a :: {real_normed_field}"
    and n :: nat
  shows "(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x
 2. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x
 2. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<0. coef i * x ^ i) twice_field_differentiable_at x

goal (1 subgoal):
 1. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
case hyp: (Suc n)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x

goal (1 subgoal):
 1. \<And>n. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x \<Longrightarrow> (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
proof (simp, rule twice_field_differentiable_at_add)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x
 2. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
show "(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x
[PROOF STEP]
by (rule hyp)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<n. coef i * x ^ i) twice_field_differentiable_at x

goal (1 subgoal):
 1. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
show "(\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
using twice_field_differentiable_at_compose[of "\<lambda>x. x ^ n" x "(*) (coef n)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>x. x ^ n) twice_field_differentiable_at x; (*) (coef n) twice_field_differentiable_at x ^ n\<rbrakk> \<Longrightarrow> (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x

goal (1 subgoal):
 1. (\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. coef n * x ^ n) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i<Suc n. coef i * x ^ i) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_Pair2:
  assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" and x: "x \<in> space M1"
  shows "(\<lambda>y. f (x, y)) \<in> measurable M2 M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. f (x, y)) \<in> M2 \<rightarrow>\<^sub>M M
[PROOF STEP]
using measurable_comp[OF measurable_Pair1' f, OF x]
[PROOF STATE]
proof (prove)
using this:
f \<circ> Pair x \<in> M2 \<rightarrow>\<^sub>M M

goal (1 subgoal):
 1. (\<lambda>y. f (x, y)) \<in> M2 \<rightarrow>\<^sub>M M
[PROOF STEP]
by (simp add: comp_def)


[STATEMENT]
theorem weak_Nullstellensatz:
  assumes "finite X" and "F \<subseteq> P[X]" and "\<V> F = ({}::(_ \<Rightarrow> _::alg_closed_field) set)"
  shows "ideal F = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
from assms(1, 2)
[PROOF STATE]
proof (chain)
picking this:
finite X
F \<subseteq> P[X]
[PROOF STEP]
have "\<I> (\<V> F) = \<surd>ideal F"
[PROOF STATE]
proof (prove)
using this:
finite X
F \<subseteq> P[X]

goal (1 subgoal):
 1. \<I> (\<V> F) = \<surd>ideal F
[PROOF STEP]
by (rule strong_Nullstellensatz)
[PROOF STATE]
proof (state)
this:
\<I> (\<V> F) = \<surd>ideal F

goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<I> (\<V> F) = \<surd>ideal F

goal (1 subgoal):
 1. ideal F = UNIV
[PROOF STEP]
by (simp add: assms(3) flip: radical_ideal_eq_UNIV_iff)
[PROOF STATE]
proof (state)
this:
ideal F = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sym : "setinterleaving(s, X, t)= setinterleaving(t, X, s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setinterleaving (s, X, t) = setinterleaving (t, X, s)
[PROOF STEP]
by (rule setinterleaving.induct[of "\<lambda>(s,X,t). setinterleaving (s, X, t)
  = setinterleaving (t, X, s)" "(s, X, t)", simplified], auto)


[STATEMENT]
lemma homeomorphic_ENR_iff_ENR:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "S homeomorphic T"
    shows "ENR S \<longleftrightarrow> ENR T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENR S = ENR T
[PROOF STEP]
by (meson ENR_homeomorphic_ENR assms homeomorphic_sym)


[STATEMENT]
lemma card_sumset_0_iff': "card (sumset A B) = 0 \<longleftrightarrow> card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
proof (cases "infinite (A \<inter> G) \<or> infinite (B \<inter> G)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. infinite (A \<inter> G) \<or> infinite (B \<inter> G) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
 2. \<not> (infinite (A \<inter> G) \<or> infinite (B \<inter> G)) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
infinite (A \<inter> G) \<or> infinite (B \<inter> G)

goal (2 subgoals):
 1. infinite (A \<inter> G) \<or> infinite (B \<inter> G) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
 2. \<not> (infinite (A \<inter> G) \<or> infinite (B \<inter> G)) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite (A \<inter> G) \<or> infinite (B \<inter> G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (A \<inter> G) \<or> infinite (B \<inter> G)

goal (1 subgoal):
 1. (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
by (metis card_eq_0_iff infinite_sumset_iff sumset_empty')
[PROOF STATE]
proof (state)
this:
(card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)

goal (1 subgoal):
 1. \<not> (infinite (A \<inter> G) \<or> infinite (B \<inter> G)) \<Longrightarrow> (card (sumset A B) = 0) = (card (A \<inter> G) = 0 \<or> card (B \<inter> G) = 0)
[PROOF STEP]
qed (auto simp: sumset_eq)


[STATEMENT]
lemma max_of_list_append [simp]:
  "max_of_list (xs @ ys) = max (max_of_list xs) (max_of_list ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_of_list (xs @ ys) = max (max_of_list xs) (max_of_list ys)
[PROOF STEP]
apply (simp add: max_of_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr max xs (foldr max ys 0) = max (foldr max xs 0) (foldr max ys 0)
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. foldr max [] (foldr max ys 0) = max (foldr max [] 0) (foldr max ys 0)
 2. \<And>a xs. foldr max xs (foldr max ys 0) = max (foldr max xs 0) (foldr max ys 0) \<Longrightarrow> foldr max (a # xs) (foldr max ys 0) = max (foldr max (a # xs) 0) (foldr max ys 0)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma matrix_to_blinfun_scaleR:
  "matrix_to_blinfun (c *\<^sub>R (f :: real^_^_)) = c *\<^sub>R matrix_to_blinfun f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_blinfun (c *\<^sub>R f) = c *\<^sub>R matrix_to_blinfun f
[PROOF STEP]
by (auto intro!: blinfun_eqI simp: matrix_to_blinfun_mult blinfun.scaleR_left
      matrix_vector_mult_add_rdistrib scaleR_matrix_vector_assoc[symmetric])


[STATEMENT]
lemma nlistToTree_inv:
  "\<forall> x \<in> set nl. is_measured_node x \<Longrightarrow> is_measured_ftree (nlistToTree nl)"
  "\<forall> x \<in> set nl. is_leveln_node n x \<Longrightarrow> is_leveln_ftree n (nlistToTree nl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set nl. is_measured_node x \<Longrightarrow> is_measured_ftree (nlistToTree nl)) &&& (\<forall>x\<in>set nl. is_leveln_node n x \<Longrightarrow> is_leveln_ftree n (nlistToTree nl))
[PROOF STEP]
by (unfold nlistToTree_def, induct nl, auto simp add: nlcons_invmeas)
     (induct nl, auto simp add: nlcons_invlevel)


[STATEMENT]
lemma append_one_genPrefix:
     "[| (xs,ys) \<in> genPrefix r;  length xs < length ys;  refl r |]
      ==> (xs @ [ys ! length xs], ys) \<in> genPrefix r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(xs, ys) \<in> genPrefix r; length xs < length ys; refl r\<rbrakk> \<Longrightarrow> (xs @ [ys ! length xs], ys) \<in> genPrefix r
[PROOF STEP]
by (blast intro: aolemma [THEN mp])


[STATEMENT]
lemma dg_prod_ArrE:
  assumes "f \<in>\<^sub>\<circ> (\<Prod>\<^sub>D\<^sub>Gi\<in>\<^sub>\<circ>I. \<AA> i)\<lparr>Arr\<rparr>"
  obtains "vsv f" and "\<D>\<^sub>\<circ> f = I" and "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>vsv f; \<D>\<^sub>\<circ> f = I; \<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in>\<^sub>\<circ> dg_prod I \<AA>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<lbrakk>vsv f; \<D>\<^sub>\<circ> f = I; \<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest: dg_prod_ArrD)


[STATEMENT]
lemma not_prime_imp_ex_prod_nat:
  assumes "m > 1" "\<not> prime (m::nat)"
  shows   "\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
[PROOF STEP]
have "\<not>Factorial_Ring.irreducible m"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m

goal (1 subgoal):
 1. \<not> comm_semiring_1_class.irreducible m
[PROOF STEP]
by (simp flip: prime_elem_iff_irreducible)
[PROOF STATE]
proof (state)
this:
\<not> comm_semiring_1_class.irreducible m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
\<not> comm_semiring_1_class.irreducible m
[PROOF STEP]
obtain n k where nk: "m = n * k" "n \<noteq> 1" "k \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
\<not> comm_semiring_1_class.irreducible m

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>m = n * k; n \<noteq> 1; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: Factorial_Ring.irreducible_def)
[PROOF STATE]
proof (state)
this:
m = n * k
n \<noteq> 1
k \<noteq> 1

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m = n * k
n \<noteq> 1
k \<noteq> 1

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from this assms
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < m
\<not> prime m
[PROOF STEP]
have "n > 0" "k > 0"
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < m
\<not> prime m

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with nk
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
0 < n
0 < k
[PROOF STEP]
have "n > 1" "k > 1"
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
0 < n
0 < k

goal (1 subgoal):
 1. 1 < n &&& 1 < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < n
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < n
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
1 < n
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from assms nk
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
m = n * k
n \<noteq> 1
k \<noteq> 1
[PROOF STEP]
have "n dvd m" "k dvd m"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
m = n * k
n \<noteq> 1
k \<noteq> 1

goal (1 subgoal):
 1. n dvd m &&& k dvd m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n dvd m
k dvd m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
n dvd m
k dvd m
[PROOF STEP]
have "n \<le> m" "k \<le> m"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
n dvd m
k dvd m

goal (1 subgoal):
 1. n \<le> m &&& k \<le> m
[PROOF STEP]
by (auto intro!: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
n \<le> m
k \<le> m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<le> m
k \<le> m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk \<open>n > 1\<close> \<open>k > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k
[PROOF STEP]
have "n \<noteq> m" "k \<noteq> m"
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
k \<le> m
n \<noteq> m
k \<noteq> m
[PROOF STEP]
have "n < m" "k < m"
[PROOF STATE]
proof (prove)
using this:
n \<le> m
k \<le> m
n \<noteq> m
k \<noteq> m

goal (1 subgoal):
 1. n < m &&& k < m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k
n < m
k < m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m = n * k
n \<noteq> 1
k \<noteq> 1
1 < n
1 < k
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_mult_vec_mat[simp]: "j < dim_col A \<Longrightarrow> (v \<^sub>v* A) $ j = v \<bullet> col A j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < dim_col A \<Longrightarrow> (v \<^sub>v* A) $ j = v \<bullet> col A j
[PROOF STEP]
by (auto simp: mult_vec_mat_def)


[STATEMENT]
lemma nat_card_le_Max: "card (A::nat set) \<le> Suc (Max A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A \<le> Suc (Max A)
[PROOF STEP]
apply (case_tac "finite A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite A \<Longrightarrow> card A \<le> Suc (Max A)
 2. infinite A \<Longrightarrow> card A \<le> Suc (Max A)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. infinite A \<Longrightarrow> card A \<le> Suc (Max A)
 2. finite A \<Longrightarrow> card A \<le> Suc (Max A)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> card A \<le> Suc (Max A)
[PROOF STEP]
apply (cut_tac card_mono[OF finite_atMost, of A "Max A"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; card A \<le> card {..Max A}\<rbrakk> \<Longrightarrow> card A \<le> Suc (Max A)
 2. finite A \<Longrightarrow> A \<subseteq> {..Max A}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> A \<subseteq> {..Max A}
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_unifier_alt:
  assumes "finite AA"
  shows "is_unifier \<sigma> AA \<longleftrightarrow> (\<forall>A \<in> AA. \<forall>B \<in> AA. A \<cdot>a \<sigma> = B \<cdot>a \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unifier \<sigma> AA = (\<forall>A\<in>AA. \<forall>B\<in>AA. A \<cdot>a \<sigma> = B \<cdot>a \<sigma>)
[PROOF STEP]
unfolding is_unifier_def subst_atms_def card_le_one_alt[OF finite_imageI[OF assms(1)]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>A. A \<cdot>a \<sigma>) ` AA = {} \<or> (\<exists>x. (\<lambda>A. A \<cdot>a \<sigma>) ` AA = {x})) = (\<forall>A\<in>AA. \<forall>B\<in>AA. A \<cdot>a \<sigma> = B \<cdot>a \<sigma>)
[PROOF STEP]
by (rule iffI, metis empty_iff insert_iff insert_image, blast)


[STATEMENT]
lemma token_run_merge:
  "\<lbrakk>x \<le> n; y \<le> n; token_run x n = token_run y n\<rbrakk> \<Longrightarrow> token_run x (n + m) = token_run y (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> n; y \<le> n; token_run x n = token_run y n\<rbrakk> \<Longrightarrow> token_run x (n + m) = token_run y (n + m)
[PROOF STEP]
using token_run_merge_Suc[of x _ y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<le> ?n; y \<le> ?n; token_run x ?n = token_run y ?n\<rbrakk> \<Longrightarrow> token_run x (Suc ?n) = token_run y (Suc ?n)

goal (1 subgoal):
 1. \<lbrakk>x \<le> n; y \<le> n; token_run x n = token_run y n\<rbrakk> \<Longrightarrow> token_run x (n + m) = token_run y (n + m)
[PROOF STEP]
by (induction m) auto


[STATEMENT]
lemma gkernTr2:"\<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> gker\<^bsub>F,G\<^esub> f; y \<in> gker\<^bsub>F,G\<^esub> f\<rbrakk>
   \<Longrightarrow> (x \<cdot>\<^bsub>F\<^esub> y) \<in> gker\<^bsub>F,G\<^esub> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> gker\<^bsub>F,G\<^esub> f; y \<in> gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> x \<cdot>\<^bsub>F\<^esub> y \<in> gker\<^bsub>F,G\<^esub> f
[PROOF STEP]
apply (simp add:gkernel_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F \<and> f x = \<one>\<^bsub>G\<^esub>; y \<in> carrier F \<and> f y = \<one>\<^bsub>G\<^esub>\<rbrakk> \<Longrightarrow> x \<cdot>\<^bsub>F\<^esub> y \<in> carrier F \<and> f (x \<cdot>\<^bsub>F\<^esub> y) = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (simp add:gHom, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; f x = \<one>\<^bsub>G\<^esub>; y \<in> carrier F; f y = \<one>\<^bsub>G\<^esub>\<rbrakk> \<Longrightarrow> x \<cdot>\<^bsub>F\<^esub> y \<in> carrier F \<and> \<one>\<^bsub>G\<^esub> \<cdot>\<^bsub>G\<^esub> \<one>\<^bsub>G\<^esub> = \<one>\<^bsub>G\<^esub>
[PROOF STEP]
apply (simp add:Group.mult_closed,
       frule Group.unit_closed[of "G"],
       simp add:Group.l_unit[of "G"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arb_finite_subset: "finite Y \<Longrightarrow> \<exists>X :: 'a set. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
assume fin: "finite Y"
[PROOF STATE]
proof (state)
this:
finite Y

goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite Y
[PROOF STEP]
obtain X where "X \<subseteq> UNIV - Y" "finite X" "n \<le> card X"
[PROOF STATE]
proof (prove)
using this:
finite Y

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>X \<subseteq> UNIV - Y; finite X; n \<le> card X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using infinite_UNIV
[PROOF STATE]
proof (prove)
using this:
finite Y
infinite UNIV

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>X \<subseteq> UNIV - Y; finite X; n \<le> card X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Compl_eq_Diff_UNIV finite_compl infinite_arbitrarily_large order_refl)
[PROOF STATE]
proof (state)
this:
X \<subseteq> UNIV - Y
finite X
n \<le> card X

goal (1 subgoal):
 1. finite Y \<Longrightarrow> \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> UNIV - Y
finite X
n \<le> card X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> UNIV - Y
finite X
n \<le> card X

goal (1 subgoal):
 1. \<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>X. Y \<inter> X = {} \<and> finite X \<and> n \<le> card X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_ge_right: assumes x: "x \<in> carrier R" and y: "y \<in> carrier R" shows "Max x y \<succeq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max x y \<succeq> y
[PROOF STEP]
by (unfold max_comm[OF x y], rule max_ge[OF y x])


[STATEMENT]
lemma HNatInfinite_FreeUltrafilterNat_iff:
  "(star_n X \<in> HNatInfinite) = (\<forall>u. eventually (\<lambda>n. u < X n) \<U>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X \<in> HNatInfinite) = (\<forall>u. \<forall>\<^sub>F n in \<U>. u < X n)
[PROOF STEP]
by (rule iffI [OF HNatInfinite_FreeUltrafilterNat FreeUltrafilterNat_HNatInfinite])


[STATEMENT]
lemma sum_pos: "finite M \<Longrightarrow> \<forall>x\<in>M. 0 \<le> f x \<Longrightarrow> y \<in> M \<Longrightarrow> 0 < (f y::_::ordered_comm_monoid_add) \<Longrightarrow> 0 < (\<Sum>x\<in>M. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite M; \<forall>x\<in>M. (0::'b) \<le> f x; y \<in> M; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f M
[PROOF STEP]
proof (induct M rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>x\<in>{}. (0::'b) \<le> f x; y \<in> {}; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{}. (0::'b) \<le> f x
y \<in> {}
(0::'b) < f y

goal (2 subgoals):
 1. \<lbrakk>\<forall>x\<in>{}. (0::'b) \<le> f x; y \<in> {}; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{}. (0::'b) \<le> f x
y \<in> {}
(0::'b) < f y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{}. (0::'b) \<le> f x
y \<in> {}
(0::'b) < f y

goal (1 subgoal):
 1. (0::'b) < sum f {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'b) < sum f {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F
\<forall>x\<in>insert x F. (0::'b) \<le> f x
y \<in> insert x F
(0::'b) < f y

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F; \<forall>x\<in>insert x F. (0::'b) \<le> f x; y \<in> insert x F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F
\<forall>x\<in>insert x F. (0::'b) \<le> f x
y \<in> insert x F
(0::'b) < f y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<forall>x\<in>F. (0::'b) \<le> f x; y \<in> F; (0::'b) < f y\<rbrakk> \<Longrightarrow> (0::'b) < sum f F
\<forall>x\<in>insert x F. (0::'b) \<le> f x
y \<in> insert x F
(0::'b) < f y

goal (1 subgoal):
 1. (0::'b) < sum f (insert x F)
[PROOF STEP]
by (cases "0 < f x") (auto intro: sum_nonneg add_pos_nonneg add_nonneg_pos)
[PROOF STATE]
proof (state)
this:
(0::'b) < sum f (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma consistent_prv_eql_tms_times_rev:
assumes "consistent" "prv (eql (tms (Num m) (Num n)) (Num k))"
shows "k = m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = m * n
[PROOF STEP]
by (metis Num assms consistent_def eql not_times_prv_neg_eql_tms num tms prv_neg_fls subsetCE)


[STATEMENT]
lemma exp_less_mono:
  fixes x y :: real
  assumes "x < y"
  shows "exp x < exp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
from \<open>x < y\<close>
[PROOF STATE]
proof (chain)
picking this:
x < y
[PROOF STEP]
have "0 < y - x"
[PROOF STATE]
proof (prove)
using this:
x < y

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

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < y - x
[PROOF STEP]
have "1 < exp (y - x)"
[PROOF STATE]
proof (prove)
using this:
0 < y - x

goal (1 subgoal):
 1. 1 < exp (y - x)
[PROOF STEP]
by (rule exp_gt_one)
[PROOF STATE]
proof (state)
this:
1 < exp (y - x)

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < exp (y - x)
[PROOF STEP]
have "1 < exp y / exp x"
[PROOF STATE]
proof (prove)
using this:
1 < exp (y - x)

goal (1 subgoal):
 1. 1 < exp y / exp x
[PROOF STEP]
by (simp only: exp_diff)
[PROOF STATE]
proof (state)
this:
1 < exp y / exp x

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < exp y / exp x
[PROOF STEP]
show "exp x < exp y"
[PROOF STATE]
proof (prove)
using this:
1 < exp y / exp x

goal (1 subgoal):
 1. exp x < exp y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp x < exp y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma flow0_path_connected_time:
  assumes "ts \<subseteq> existence_ivl0 x" "path_connected ts"
  shows "path_connected (flow0 x ` ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
have "continuous_on ts (flow0 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ts (flow0 x)
[PROOF STEP]
by (meson assms continuous_on_sequentially flow_continuous_on subsetD)
[PROOF STATE]
proof (state)
this:
continuous_on ts (flow0 x)

goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
from path_connected_continuous_image[OF this assms(2)]
[PROOF STATE]
proof (chain)
picking this:
path_connected (flow0 x ` ts)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path_connected (flow0 x ` ts)

goal (1 subgoal):
 1. path_connected (flow0 x ` ts)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_connected (flow0 x ` ts)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prodinf_finite:
  assumes N: "finite N"
    and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 1"
  shows "prodinf f = (\<Prod>n\<in>N. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prodinf f = prod f N
[PROOF STEP]
using has_prod_finite[OF assms, THEN has_prod_unique]
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<notin> N \<Longrightarrow> ?n2 n \<notin> N) \<Longrightarrow> (\<Prod>n\<in>N. f (?n2 n)) = (\<Prod>n. f (?n2 n))

goal (1 subgoal):
 1. prodinf f = prod f N
[PROOF STEP]
by simp


[STATEMENT]
lemma fin_dim[simp]: "fin_dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_dim
[PROOF STEP]
unfolding fin_dim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. finite A \<and> A \<subseteq> carrier_vec n \<and> local.span A = carrier_vec n
[PROOF STEP]
apply (intro eqTrueI exI conjI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite ?A
 2. ?A \<subseteq> carrier_vec n
 3. local.span ?A = carrier_vec n
[PROOF STEP]
using span_unit_vecs_is_carrier unit_vecs_carrier
[PROOF STATE]
proof (prove)
using this:
local.span (set (unit_vecs n)) = carrier_vec n
set (unit_vecs ?n) \<subseteq> carrier_vec ?n

goal (3 subgoals):
 1. finite ?A
 2. ?A \<subseteq> carrier_vec n
 3. local.span ?A = carrier_vec n
[PROOF STEP]
by auto


[STATEMENT]
lemma splitDigit_inv:
  "\<lbrakk>
  \<And>(a::'a) (b::'a). p a \<Longrightarrow> p (a + b);
  \<not> p i;
  is_measured_digit d;
  is_leveln_digit n d;
  p (i + gmd (d ::('e,'a::monoid_add) Digit));
  splitDigit p i d = (l, nd, r)
  \<rbrakk> \<Longrightarrow>
  \<not> p (i + (gmnl l))
  \<and>
  p (i + (gmnl l) + (gmn nd))
  \<and>
  (\<forall> x \<in> set l. (is_measured_node x \<and> is_leveln_node n x))
  \<and>
  (\<forall> x \<in> set r. (is_measured_node x \<and> is_leveln_node n x))
  \<and>
  (is_measured_node nd \<and> is_leveln_node n nd )
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
fix p i d n l nd r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
assume assms: "\<And>a b. p a \<Longrightarrow> p (a + b)" "\<not> p i" "is_measured_digit d"
    "p (i + gmd d)" "splitDigit p i d = (l, nd, r)"
    "is_leveln_digit n d"
[PROOF STATE]
proof (state)
this:
p ?a \<Longrightarrow> p (?a + ?b)
\<not> p i
is_measured_digit d
p (i + gmd d)
splitDigit p i d = (l, nd, r)
is_leveln_digit n d

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
from assms(3, 4)
[PROOF STATE]
proof (chain)
picking this:
is_measured_digit d
p (i + gmd d)
[PROOF STEP]
have v1: "p (i + gmnl (digitToNlist d))"
[PROOF STATE]
proof (prove)
using this:
is_measured_digit d
p (i + gmd d)

goal (1 subgoal):
 1. p (i + gmnl (digitToNlist d))
[PROOF STEP]
by (simp add: gmnl_gmd)
[PROOF STATE]
proof (state)
this:
p (i + gmnl (digitToNlist d))

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
note snc = splitNlist_correct [of p i "digitToNlist d" l nd r]
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; p (i + gmnl (digitToNlist d)); splitNlist p i (digitToNlist d) = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
from assms(5)
[PROOF STATE]
proof (chain)
picking this:
splitDigit p i d = (l, nd, r)
[PROOF STEP]
have v2: "splitNlist p i (digitToNlist d) = (l, nd, r)"
[PROOF STATE]
proof (prove)
using this:
splitDigit p i d = (l, nd, r)

goal (1 subgoal):
 1. splitNlist p i (digitToNlist d) = (l, nd, r)
[PROOF STEP]
by (simp add: splitDigit_def)
[PROOF STATE]
proof (state)
this:
splitNlist p i (digitToNlist d) = (l, nd, r)

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
note snc1 = snc[OF assms(1) assms(2) v1 v2]
[PROOF STATE]
proof (state)
this:
(\<And>a b. p a \<Longrightarrow> p a) \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
hence v3: "\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and>
             digitToNlist d = l @ nd # r"
[PROOF STATE]
proof (prove)
using this:
(\<And>a b. p a \<Longrightarrow> p a) \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
from assms(3,6)
[PROOF STATE]
proof (chain)
picking this:
is_measured_digit d
is_leveln_digit n d
[PROOF STEP]
have
    v4:" \<forall> x \<in> set (digitToNlist d). is_measured_node x"
    " \<forall> x \<in> set (digitToNlist d). is_leveln_node n x"
[PROOF STATE]
proof (prove)
using this:
is_measured_digit d
is_leveln_digit n d

goal (1 subgoal):
 1. \<forall>x\<in>set (digitToNlist d). is_measured_node x &&& \<forall>x\<in>set (digitToNlist d). is_leveln_node n x
[PROOF STEP]
by(auto simp add: digitToNlist_inv)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set (digitToNlist d). is_measured_node x
\<forall>x\<in>set (digitToNlist d). is_leveln_node n x

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
with v3
[PROOF STATE]
proof (chain)
picking this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set (digitToNlist d). is_measured_node x
\<forall>x\<in>set (digitToNlist d). is_leveln_node n x
[PROOF STEP]
have v5: "\<forall> x \<in> set l. (is_measured_node x \<and> is_leveln_node n x)"
    "\<forall> x \<in> set r. (is_measured_node x \<and> is_leveln_node n x)"
    "is_measured_node nd \<and> is_leveln_node n nd"
[PROOF STATE]
proof (prove)
using this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set (digitToNlist d). is_measured_node x
\<forall>x\<in>set (digitToNlist d). is_leveln_node n x

goal (1 subgoal):
 1. \<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x &&& \<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x &&& is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd

goal (1 subgoal):
 1. \<lbrakk>\<And>a b. p a \<Longrightarrow> p (a + b); \<not> p i; is_measured_digit d; is_leveln_digit n d; p (i + gmd d); splitDigit p i d = (l, nd, r)\<rbrakk> \<Longrightarrow> \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
with v3 v5
[PROOF STATE]
proof (chain)
picking this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
show
    "\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and>
    (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and>
    (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and>
    is_measured_node nd \<and> is_leveln_node n nd"
[PROOF STATE]
proof (prove)
using this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> digitToNlist d = l @ nd # r
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd
\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x
\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x
is_measured_node nd \<and> is_leveln_node n nd

goal (1 subgoal):
 1. \<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> p (i + gmnl l) \<and> p (i + gmnl l + gmn nd) \<and> (\<forall>x\<in>set l. is_measured_node x \<and> is_leveln_node n x) \<and> (\<forall>x\<in>set r. is_measured_node x \<and> is_leveln_node n x) \<and> is_measured_node nd \<and> is_leveln_node n nd

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma atoms_pltl_AND [simp]:
  assumes fin: "finite (\<Phi>::'a pltl set)"
  shows "atoms_pltl (AND \<Phi>) = (\<Union>\<phi>\<in>\<Phi>. atoms_pltl \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
fix \<psi>::"'a pltl"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
assume "fold_graph And_ltlp True_ltlp \<Phi> \<psi>"
[PROOF STATE]
proof (state)
this:
fold_graph And_ltlp true\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
hence "atoms_pltl \<psi> = (\<Union>\<phi>\<in>\<Phi>. atoms_pltl \<phi>)"
[PROOF STATE]
proof (prove)
using this:
fold_graph And_ltlp true\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. atoms_pltl \<psi> = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
by (rule fold_graph.induct) auto
[PROOF STATE]
proof (state)
this:
atoms_pltl \<psi> = \<Union> (atoms_pltl ` \<Phi>)

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> atoms_pltl ?\<psi>2 = \<Union> (atoms_pltl ` \<Phi>)

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
with fold_graph_AND[OF fin]
[PROOF STATE]
proof (chain)
picking this:
fold_graph And_ltlp true\<^sub>p \<Phi> (AND \<Phi>)
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> atoms_pltl ?\<psi>2 = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fold_graph And_ltlp true\<^sub>p \<Phi> (AND \<Phi>)
fold_graph And_ltlp true\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> atoms_pltl ?\<psi>2 = \<Union> (atoms_pltl ` \<Phi>)

goal (1 subgoal):
 1. atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
atoms_pltl (AND \<Phi>) = \<Union> (atoms_pltl ` \<Phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_in_hom [intro, simp]:
    assumes "obj a"
    shows "\<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>" and "\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright> &&& \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
 2. \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
show "\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
using assms unit_in_vhom
[PROOF STATE]
proof (prove)
using this:
obj a
obj ?a \<Longrightarrow> \<guillemotleft>\<i>[?a] : ?a \<star> ?a \<Rightarrow> ?a\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
[PROOF STEP]
thus "\<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<i>[a] : a \<star> a \<Rightarrow> a\<guillemotright>
obj a

goal (1 subgoal):
 1. \<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>
[PROOF STEP]
by (metis arrI in_hhom_def obj_simps(2-3) vconn_implies_hpar(1-4))
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<i>[a] : a \<rightarrow> a\<guillemotright>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integer_division:
  "PRE (\<lambda>s::nat store. x \<ge> 0)
    (''q'' ::= (\<lambda>s. 0));
    (''r'' ::= (\<lambda>s. x));
    (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0)
     DO
      (''q'' ::= (\<lambda>s. s ''q'' + 1));
      (''r'' ::= (\<lambda>s. s ''r'' - y))
      OD)
   POST (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0 \<and> s ''r'' < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rdom \<lceil>\<lambda>s. zero_class.zero \<le> x\<rceil> \<subseteq> wp ((''q'' ::= (\<lambda>s. zero_class.zero)) ; (''r'' ::= (\<lambda>s. x)) ; (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> zero_class.zero \<le> s ''r'') DO (''q'' ::= (\<lambda>s. s ''q'' + 1)) ; (''r'' ::= (\<lambda>s. s ''r'' - y)) OD)) \<lceil>\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> zero_class.zero \<le> s ''r'' \<and> s ''r'' < y\<rceil>
[PROOF STEP]
by (rule ppath_aka.fbox_whilei_break, auto)


[STATEMENT]
lemma "First (autodiff logistic x) = exp (- x) / (1 + exp (- x)) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. First (autodiff logistic x) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
(* Move to hyperdual variant: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. First (autodiff logistic x) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
apply (simp only: autodiff.simps hyperdual_to_derivs.simps derivs.sel hypext_logistic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eps1 (hyp_logistic (\<beta> x)) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
(* Unfold extensions of functions that have a hyperdual variant (all except exp): *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eps1 (hyp_logistic (\<beta> x)) = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
apply (simp only: hyp_logistic_def inverse_hyperdual.code hyperdual.sel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Eps1 (1 + (*h* exp) (- \<beta> x)) / (Base (1 + (*h* exp) (- \<beta> x)))\<^sup>2 = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
(* Finish by expanding the extension of exp and hyperdual computations: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Eps1 (1 + (*h* exp) (- \<beta> x)) / (Base (1 + (*h* exp) (- \<beta> x)))\<^sup>2 = exp (- x) / (1 + exp (- x))\<^sup>2
[PROOF STEP]
apply (simp add: hyperdualx_def hypext_exp_Hyperdual hyperdual_bases)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma exists_k_mod:
  fixes c::"'a::unique_euclidean_ring"
  shows "\<exists>k. a mod c = a + k * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. a mod c = a + k * c
[PROOF STEP]
by (metis add.commute diff_add_cancel diff_minus_eq_add
      mult_div_mod_eq mult.commute mult_minus_left)


[STATEMENT]
lemma flatten_sigma_2_sf_subset:
  "sf (\<phi>[M]\<^sub>\<Sigma>\<^sub>2) \<subseteq> (\<Union>\<psi>\<in>sf \<phi>. sf (\<psi>[M]\<^sub>\<Sigma>\<^sub>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sf \<phi>[M]\<^sub>\<Sigma>\<^sub>2 \<subseteq> (\<Union>\<psi>\<in>sf \<phi>. sf \<psi>[M]\<^sub>\<Sigma>\<^sub>2)
[PROOF STEP]
by (induction \<phi>) auto


[STATEMENT]
theorem (in Group) FinGroupRepresentation_FG :
  defines FG: "FG \<equiv> group_ring :: ('f::field, 'g) aezfun set"
  assumes good_char: "of_nat (card G) \<noteq> (0::'f)"
  shows   "FinGroupRepresentation G (*) FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FinGroupRepresentation G (*) FG
[PROOF STEP]
proof (rule FinGroupRepresentation.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. FGModule G (*) FG
 2. FinGroupRepresentation_axioms G (*) FG
[PROOF STEP]
from FG
[PROOF STATE]
proof (chain)
picking this:
FG \<equiv> group_ring
[PROOF STEP]
show "FGModule G (*) FG"
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring

goal (1 subgoal):
 1. FGModule G (*) FG
[PROOF STEP]
using FGModule_FG
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
FGModule G (*) group_ring

goal (1 subgoal):
 1. FGModule G (*) FG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
FGModule G (*) FG

goal (1 subgoal):
 1. FinGroupRepresentation_axioms G (*) FG
[PROOF STEP]
show "FinGroupRepresentation_axioms G (*) FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FinGroupRepresentation_axioms G (*) FG
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
from FG good_char
[PROOF STATE]
proof (chain)
picking this:
FG \<equiv> group_ring
of_nat (card G) \<noteq> (0::'f)
[PROOF STEP]
obtain gs
      where gs: "set gs = G"
                "\<forall>f\<in> FG. \<exists>bs. length bs = length gs
                      \<and> f = (\<Sum>(b,g)\<leftarrow>zip bs gs. (b \<delta>\<delta> 0) * (1 \<delta>\<delta> g))"
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
of_nat (card G) \<noteq> (0::'f)

goal (1 subgoal):
 1. (\<And>gs. \<lbrakk>set gs = G; \<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using good_card_imp_finite FinGroupI FinGroup.group_ring_spanning_set
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
of_nat (card G) \<noteq> (0::'f)
of_nat (card ?A) \<noteq> (0::?'a) \<Longrightarrow> finite ?A
finite G \<Longrightarrow> FinGroup G
FinGroup ?G \<Longrightarrow> \<exists>gs. distinct gs \<and> set gs = ?G \<and> (\<forall>f\<in>aezfun_setspan ?G. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::?'g) * ((1::?'b) \<delta>\<delta> g)) bs gs))

goal (1 subgoal):
 1. (\<And>gs. \<lbrakk>set gs = G; \<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
set gs = G
\<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
define xs where "xs = map ((\<delta>\<delta>) (1::'f)) gs"
[PROOF STATE]
proof (state)
this:
xs = map ((\<delta>\<delta>) (1::'f)) gs

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
with FG gs(1)
[PROOF STATE]
proof (chain)
picking this:
FG \<equiv> group_ring
set gs = G
xs = map ((\<delta>\<delta>) (1::'f)) gs
[PROOF STEP]
have 1: "set xs \<subseteq> FG"
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
set gs = G
xs = map ((\<delta>\<delta>) (1::'f)) gs

goal (1 subgoal):
 1. set xs \<subseteq> FG
[PROOF STEP]
using RG_aezdeltafun_closed
[PROOF STATE]
proof (prove)
using this:
FG \<equiv> group_ring
set gs = G
xs = map ((\<delta>\<delta>) (1::'f)) gs
?g \<in> G \<Longrightarrow> ?r \<delta>\<delta> ?g \<in> group_ring

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

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> FG

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
have "aezfun_scalar_mult.fSpan (*) xs = FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG
 2. FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
from 1 FG
[PROOF STATE]
proof (chain)
picking this:
set xs \<subseteq> FG
FG \<equiv> group_ring
[PROOF STEP]
show "aezfun_scalar_mult.fSpan (*) xs \<subseteq> FG"
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> FG
FG \<equiv> group_ring

goal (1 subgoal):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG
[PROOF STEP]
using FGModule_FG FGModule.fSpan_closed
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> FG
FG \<equiv> group_ring
FGModule G (*) group_ring
\<lbrakk>FGModule ?G ?smult ?V; set ?ms \<subseteq> ?V\<rbrakk> \<Longrightarrow> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult ?smult) ?ms \<subseteq> ?V

goal (1 subgoal):
 1. R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs \<subseteq> FG

goal (1 subgoal):
 1. FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
show "aezfun_scalar_mult.fSpan (*) xs \<supseteq> FG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
assume "x \<in> FG"
[PROOF STATE]
proof (state)
this:
x \<in> FG

goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
from this gs(2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> FG
\<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
[PROOF STEP]
obtain bs
          where bs: "length bs = length gs"
                    "x = (\<Sum>(b,g)\<leftarrow>zip bs gs. (b \<delta>\<delta> 0) * (1 \<delta>\<delta> g))"
[PROOF STATE]
proof (prove)
using this:
x \<in> FG
\<forall>f\<in>FG. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)

goal (1 subgoal):
 1. (\<And>bs. \<lbrakk>length bs = length gs; x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
length bs = length gs
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)

goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
from bs(2) xs_def
[PROOF STATE]
proof (chain)
picking this:
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
xs = map ((\<delta>\<delta>) (1::'f)) gs
[PROOF STEP]
have "x = (\<Sum>(b,a)\<leftarrow>zip bs xs. (b \<delta>\<delta> 0) * a)"
[PROOF STATE]
proof (prove)
using this:
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
xs = map ((\<delta>\<delta>) (1::'f)) gs

goal (1 subgoal):
 1. x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
[PROOF STEP]
using sum_list_prod_map2[THEN sym]
[PROOF STATE]
proof (prove)
using this:
x = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'f) \<delta>\<delta> g)) bs gs)
xs = map ((\<delta>\<delta>) (1::'f)) gs
sum_list (map2 (\<lambda>a b. ?g1 a (?f1 b)) ?as1 ?bs1) = sum_list (map2 ?g1 ?as1 (map ?f1 ?bs1))

goal (1 subgoal):
 1. x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)

goal (1 subgoal):
 1. \<And>x. x \<in> FG \<Longrightarrow> x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
with bs(1) xs_def
[PROOF STATE]
proof (chain)
picking this:
length bs = length gs
xs = map ((\<delta>\<delta>) (1::'f)) gs
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
[PROOF STEP]
show "x \<in> aezfun_scalar_mult.fSpan (*) xs"
[PROOF STATE]
proof (prove)
using this:
length bs = length gs
xs = map ((\<delta>\<delta>) (1::'f)) gs
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)

goal (1 subgoal):
 1. x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
using aezfun_scalar_mult.fsmultD[of "(*)", THEN sym]
                sum_list_prod_cong[
                  of "zip bs xs" "\<lambda>b a. (b \<delta>\<delta> 0) * a"
                     "\<lambda>b a. aezfun_scalar_mult.fsmult (*) b a"
                ]
                scalar_mult.lincomb_def[of "aezfun_scalar_mult.fsmult (*)" bs xs]
                scalar_mult.SpanD_lincomb[of "aezfun_scalar_mult.fsmult (*)"]
[PROOF STATE]
proof (prove)
using this:
length bs = length gs
xs = map ((\<delta>\<delta>) (1::'f)) gs
x = sum_list (map2 (\<lambda>b. (*) (b \<delta>\<delta> (0::'g))) bs xs)
?a1 \<delta>\<delta> (0::?'b3) * ?v1 = aezfun_scalar_mult.fsmult (*) ?a1 ?v1
\<forall>(x, y)\<in>set (zip bs xs). x \<delta>\<delta> (0::'g) * y = aezfun_scalar_mult.fsmult (*) x y \<Longrightarrow> sum_list (map2 (\<lambda>x. (*) (x \<delta>\<delta> (0::'g))) bs xs) = sum_list (map2 (aezfun_scalar_mult.fsmult (*)) bs xs)
scalar_mult.lincomb (aezfun_scalar_mult.fsmult (*)) bs xs = sum_list (map2 (aezfun_scalar_mult.fsmult (*)) bs xs)
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ?ms = {scalar_mult.lincomb (aezfun_scalar_mult.fsmult (*)) rs ?ms |rs. set rs \<subseteq> UNIV \<and> length rs = length ?ms}

goal (1 subgoal):
 1. x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs
[PROOF STEP]
by    force
[PROOF STATE]
proof (state)
this:
x \<in> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
FG \<subseteq> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG

goal (2 subgoals):
 1. of_nat (card G) \<noteq> (0::'f)
 2. \<exists>ms. set ms \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) ms = FG
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set xs \<subseteq> FG
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG
[PROOF STEP]
show "\<exists>xs. set xs \<subseteq> FG \<and> aezfun_scalar_mult.fSpan (*) xs = FG"
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> FG
R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG

goal (1 subgoal):
 1. \<exists>xs. set xs \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>xs. set xs \<subseteq> FG \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult (*)) xs = FG

goal (1 subgoal):
 1. of_nat (card G) \<noteq> (0::'f)
[PROOF STEP]
qed (rule good_char)
[PROOF STATE]
proof (state)
this:
FinGroupRepresentation_axioms G (*) FG

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group_hom) iso_iff: "h \<in> iso G H \<longleftrightarrow> carrier H \<subseteq> h ` carrier G \<and> (\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<in> Group.iso G H) = (carrier H \<subseteq> h ` carrier G \<and> (\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>))
[PROOF STEP]
by (auto simp: iso_def bij_betw_def inj_on_one_iff)


[STATEMENT]
lemma index_col_mat_of_cols_list [simp]:
  assumes "i < n" and "j < length l"
  shows "Matrix.col (mat_of_cols_list n l) j $ i = l ! j ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list n l) j $ i = l ! j ! i
[PROOF STEP]
apply (auto simp: Matrix.col_def mat_of_cols_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.vec n (\<lambda>i. Matrix.mat n (length l) (\<lambda>(i, j). l ! j ! i) $$ (i, j)) $ i = l ! j ! i
[PROOF STEP]
using assms less_le_trans
[PROOF STATE]
proof (prove)
using this:
i < n
j < length l
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. Matrix.vec n (\<lambda>i. Matrix.mat n (length l) (\<lambda>(i, j). l ! j ! i) $$ (i, j)) $ i = l ! j ! i
[PROOF STEP]
by fastforce


[STATEMENT]
lemma all_ns_ns_mul_ext:
  assumes "length as = length bs"
    and "\<forall>i. i < length bs \<longrightarrow> (as ! i, bs ! i) \<in> ns"
  shows "(mset as, mset bs) \<in> ns_mul_ext ns s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mset as, mset bs) \<in> ns_mul_ext ns s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length as = length bs
\<forall>i<length bs. (as ! i, bs ! i) \<in> ns

goal (1 subgoal):
 1. (mset as, mset bs) \<in> ns_mul_ext ns s
[PROOF STEP]
by (auto intro!: ns_mul_extI[of _ _ "{#}" _ _ "{#}"] multpw_listI)


[STATEMENT]
lemma lin_poly_to_vec_coeff_access:
  assumes "x < dim_poly y"
  shows "(lpoly_to_vec y) $ x = coeff y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
have "x < dim_vec (lpoly_to_vec y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < dim_vec (lpoly_to_vec y)
[PROOF STEP]
using dim_poly_dim_vec_equiv[of y] assms
[PROOF STATE]
proof (prove)
using this:
dim_vec (lpoly_to_vec y) = dim_poly y
x < dim_poly y

goal (1 subgoal):
 1. x < dim_vec (lpoly_to_vec y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < dim_vec (lpoly_to_vec y)

goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < dim_vec (lpoly_to_vec y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < dim_vec (lpoly_to_vec y)

goal (1 subgoal):
 1. lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x
[PROOF STEP]
by (simp add: coeff_def)
[PROOF STATE]
proof (state)
this:
lpoly_to_vec y $ x = Abstract_Linear_Poly.coeff y x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_step_mono_r:
  assumes "\<bar>s\<bar> \<ge> \<bar>r\<bar>" "L \<ge> 0" "B \<ge> 0" "t1 \<ge> t 0" "0 < p" "t j \<le> t1"
  shows "max_stepsize j \<le>
    root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
from max_step \<open>t j \<le> t1\<close>
[PROOF STATE]
proof (chain)
picking this:
t ?j \<le> t1 \<Longrightarrow> max_stepsize ?j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
t j \<le> t1
[PROOF STEP]
have "max_stepsize j \<le>
    root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
using this:
t ?j \<le> t1 \<Longrightarrow> max_stepsize ?j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
t j \<le> t1

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
max_stepsize j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
max_stepsize j \<le> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
have "... \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>r\<bar> \<le> \<bar>s\<bar>
0 \<le> L
0 \<le> B
t 0 \<le> t1
0 < p
t j \<le> t1

goal (1 subgoal):
 1. root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
apply (cases "B = 0", force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>r\<bar> \<le> \<bar>s\<bar>; 0 \<le> L; 0 \<le> B; t 0 \<le> t1; 0 < p; t j \<le> t1; B \<noteq> 0\<rbrakk> \<Longrightarrow> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
apply (cases "L = 0", force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>r\<bar> \<le> \<bar>s\<bar>; 0 \<le> L; 0 \<le> B; t 0 \<le> t1; 0 < p; t j \<le> t1; B \<noteq> 0; L \<noteq> 0\<rbrakk> \<Longrightarrow> root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
by (auto simp add: mult_le_cancel_left1
             intro!: divide_right_mono add_increasing mult_left_mono)
[PROOF STATE]
proof (state)
this:
root p (\<bar>r\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1)) \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
show "max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))"
[PROOF STATE]
proof (prove)
using this:
max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal (1 subgoal):
 1. max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
max_stepsize j \<le> root p (\<bar>s\<bar> * L / B / (exp (L * (t1 - t 0) + 1) - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_Atleast_Atmost_nat[simp]: "finite {f x |x. x \<in> (UNIV::'a::finite set)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f x |x. x \<in> UNIV}
[PROOF STEP]
using finite finite_image_set
[PROOF STATE]
proof (prove)
using this:
finite ?A
finite {x. ?P x} \<Longrightarrow> finite {?f x |x. ?P x}

goal (1 subgoal):
 1. finite {f x |x. x \<in> UNIV}
[PROOF STEP]
by blast


[STATEMENT]
lemma inv_integer_mod_group[simp]:
  "x \<in> carrier (integer_mod_group n) \<Longrightarrow> m_inv(integer_mod_group n) x = (-x) mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (integer_mod_group n) \<Longrightarrow> inv\<^bsub>integer_mod_group n\<^esub> x = - x mod int n
[PROOF STEP]
by (rule group.inv_equality [OF group_integer_mod_group]) (auto simp: integer_mod_group_def add.commute mod_add_right_eq)


[STATEMENT]
lemma of_int_complex: "of_int z = Complex (of_int z) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int z = Complex (real_of_int z) 0
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma linear_imp_has_derivative:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  shows "linear f \<Longrightarrow> (f has_derivative f) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f \<Longrightarrow> (f has_derivative f) net
[PROOF STEP]
by (simp add: bounded_linear_imp_has_derivative linear_conv_bounded_linear)


[STATEMENT]
lemma union:
  "F (A \<union> B) = F A \<^bold>* F B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (A \<union> B) = F A \<^bold>* F B
[PROOF STEP]
by (induct A rule: infinite_finite_induct)
    (simp_all add: ac_simps)


[STATEMENT]
lemma factor_minus: "x * a - x = x * (a - 1)"
  for x a::"'a::comm_semiring_1_cancel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * a - x = x * (a - (1::'a))
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma homom2img1:"\<lbrakk>Group F; Group G; f \<in> gHom F G; X \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f)\<rbrakk>
 \<Longrightarrow> (f\<dieresis>\<^bsub>F,(Img\<^bsub>F,G\<^esub> f)\<^esub>) X = (f\<dieresis>\<^bsub>F,G\<^esub>) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; X \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f)\<rbrakk> \<Longrightarrow> (f\<dieresis>\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub>) X = (f\<dieresis>\<^bsub>F,G\<^esub>) X
[PROOF STEP]
apply (frule gker_hom_to_img [of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; X \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f); gker\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub> f = gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> (f\<dieresis>\<^bsub>F,Img\<^bsub>F,G\<^esub> f\<^esub>) X = (f\<dieresis>\<^bsub>F,G\<^esub>) X
[PROOF STEP]
apply (simp add:induced_ghom_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma n_gt_1: "n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < n
[PROOF STEP]
using kyber_spec_axioms kyber_spec_def
[PROOF STATE]
proof (prove)
using this:
kyber_spec TYPE('a) TYPE('k) n q k n'
kyber_spec TYPE(?'a) TYPE(?'k) ?n ?q ?k ?n' \<equiv> ((?n = 2 ^ ?n' \<and> 0 < ?n') \<and> 2 < ?q \<and> ?q mod 4 = 1) \<and> (prime ?q \<and> int CARD(?'a) = ?q) \<and> int CARD(?'k) = int ?k \<and> qr_poly' TYPE(?'a) = Polynomial.monom 1 (nat ?n) + 1

goal (1 subgoal):
 1. 1 < n
[PROOF STEP]
by (simp add: n'_gr_0 n_powr_2)


[STATEMENT]
theorem translation_inverse_monoid_isomorphism [intro]:
  "monoid_isomorphism (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G (\<cdot>) \<one> Translations (compose G) (identity G)"
  (is "monoid_isomorphism ?inv _ _ _ _ _ _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid_isomorphism (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G (\<cdot>) \<one> Translations (compose G) (identity G)
[PROOF STEP]
proof unfold_locales
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<in> G \<rightarrow>\<^sub>E Translations
 2. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 3. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 4. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
show "?inv \<in> G \<rightarrow>\<^sub>E Translations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<in> G \<rightarrow>\<^sub>E Translations
[PROOF STEP]
by (simp del: translation_unit_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<in> G \<rightarrow>\<^sub>E Translations

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
note bij_betw_compose [trans]
[PROOF STATE]
proof (state)
this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?g ?B ?C\<rbrakk> \<Longrightarrow> bij_betw (compose ?A ?g ?f) ?A ?C

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
have "bij_betw inverse G G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw inverse G G
[PROOF STEP]
by (rule bij_betwI [where g = inverse]) auto
[PROOF STATE]
proof (state)
this:
bij_betw inverse G G

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bij_betw inverse G G

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
have "bij_betw translation G Translations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw translation G Translations
[PROOF STEP]
by (rule bij_betwI [where g = "\<lambda>\<alpha>\<in>Translations. \<alpha> \<one>"]) (auto simp: translation_apply)
[PROOF STATE]
proof (state)
this:
bij_betw translation G Translations

goal (3 subgoals):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
 2. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 3. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bij_betw (compose G translation inverse) G Translations
[PROOF STEP]
show "bij_betw ?inv G Translations"
[PROOF STATE]
proof (prove)
using this:
bij_betw (compose G translation inverse) G Translations

goal (1 subgoal):
 1. bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations
[PROOF STEP]
by (simp cong: bij_betw_cong add: compose_eq del: translation_unit_eq)
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) G Translations

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
fix x and y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
assume [simp]: "x \<in> G" "y \<in> G"
[PROOF STATE]
proof (state)
this:
x \<in> G
y \<in> G

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> G; y \<in> G\<rbrakk> \<Longrightarrow> compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
 2. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
show "compose G (?inv x) (?inv y) = (?inv (x \<cdot> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)
[PROOF STEP]
by (simp add: inverse_composition_commute del: translation_unit_eq)
[PROOF STATE]
proof (state)
this:
compose G ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) x) ((\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) y) = (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) (x \<cdot> y)

goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
show "?inv \<one> = identity G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G
[PROOF STEP]
by (simp del: translation_unit_eq) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>a\<in>G. transformation.symmetric.inverse (a)\<^sub>R) \<one> = identity G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<forall>x. p a \<and> (p x \<longrightarrow> (\<exists>y. p y \<and> r x y)) \<longrightarrow>
           (\<exists>z. \<exists>w. p z \<and> r x w \<and> r w z))  =
      (\<forall>x. (\<not>p a \<or> p x \<or> (\<exists>z. \<exists>w. p z \<and> r x w \<and> r w z)) \<and>
            (\<not>p a \<or> \<not>(\<exists>y. p y \<and> r x y) \<or>
             (\<exists>z. \<exists>w. p z \<and> r x w \<and> r w z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. p a \<and> (p x \<longrightarrow> (\<exists>y. p y \<and> r x y)) \<longrightarrow> (\<exists>z w. p z \<and> r x w \<and> r w z)) = (\<forall>x. (\<not> p a \<or> p x \<or> (\<exists>z w. p z \<and> r x w \<and> r w z)) \<and> (\<not> p a \<or> (\<nexists>y. p y \<and> r x y) \<or> (\<exists>z w. p z \<and> r x w \<and> r w z)))
[PROOF STEP]
by blast


[STATEMENT]
lemma to_fun_lin_part:
  assumes "f \<in> carrier P"
  assumes "b \<in> carrier R"
  shows "to_fun (lin_part f) b = (f 0) \<oplus> (f 1) \<otimes> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (lin_part f) b = f 0 \<oplus> f 1 \<otimes> b
[PROOF STEP]
using assms lin_part_id[of f] to_fun_ctrm to_fun_monom monom_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier P
b \<in> carrier R
f \<in> carrier P \<Longrightarrow> lin_part f = monom P (f 0) 0 \<oplus>\<^bsub>P\<^esub> monom P (f 1) 1
\<lbrakk>?f \<in> carrier P; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P (?f 0) 0) ?b = ?f 0
\<lbrakk>?c \<in> carrier R; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P ?c ?n) ?x = ?c \<otimes> ?x [^] ?n
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n \<in> carrier P

goal (1 subgoal):
 1. to_fun (lin_part f) b = f 0 \<oplus> f 1 \<otimes> b
[PROOF STEP]
by (simp add: cfs_closed to_fun_plus)


[STATEMENT]
lemma monoid_mult_ow: "class.monoid_mult = monoid_mult_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.monoid_mult = monoid_mult_ow UNIV
[PROOF STEP]
unfolding
    class.monoid_mult_def monoid_mult_ow_def
    class.monoid_mult_axioms_def monoid_mult_ow_axioms_def
    one_ow_def neutral_ow_def
    semigroup_mult_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>one times. semigroup_mult_ow UNIV times \<and> (\<forall>a. times one a = a) \<and> (\<forall>a. times a one = a)) = (\<lambda>one times. semigroup_mult_ow UNIV times \<and> one \<in> UNIV \<and> (\<forall>a. a \<in> UNIV \<longrightarrow> times one a = a) \<and> (\<forall>a. a \<in> UNIV \<longrightarrow> times a one = a))
[PROOF STEP]
by simp


[STATEMENT]
lemma Smith_normal_form_upt_k1_intro:
  fixes A::"'a::{bezout_ring}^'cols::mod_type^'rows::mod_type"
  assumes s: "Smith_normal_form_upt_k A k"
  and cond1: "A $ from_nat (k - 1) $ from_nat (k-1) dvd A $ (from_nat k) $ (from_nat k)"
  and cond2a: "\<forall>a. to_nat a > k \<longrightarrow> A $ a $ from_nat k = 0"
  and cond2b: "\<forall>b. to_nat b > k \<longrightarrow> A $ from_nat k $ b = 0"
shows "Smith_normal_form_upt_k A (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Smith_normal_form_upt_k A (Suc k)
[PROOF STEP]
proof (rule Smith_normal_form_upt_k_intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
 2. \<And>a b. mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k) \<Longrightarrow> A $ a $ b = (0::'a)
[PROOF STEP]
fix a::'rows and b::'cols
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
 2. \<And>a b. mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k) \<Longrightarrow> A $ a $ b = (0::'a)
[PROOF STEP]
assume a: "to_nat a \<noteq> to_nat b \<and> (to_nat a < Suc k \<or> to_nat b < Suc k)"
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k)

goal (2 subgoals):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
 2. \<And>a b. mod_type_class.to_nat a \<noteq> mod_type_class.to_nat b \<and> (mod_type_class.to_nat a < Suc k \<or> mod_type_class.to_nat b < Suc k) \<Longrightarrow> A $ a $ b = (0::'a)
[PROOF STEP]
show "A $ a $ b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ a $ b = (0::'a)
[PROOF STEP]
by (metis Smith_normal_form_upt_k_condition2 a
        assms(1) cond2a cond2b from_nat_to_nat_id less_SucE nat_neq_iff)
[PROOF STATE]
proof (state)
this:
A $ a $ b = (0::'a)

goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
fix a::'rows and b::'cols
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
assume a: "to_nat a = to_nat b \<and> to_nat a + 1 < Suc k \<and> to_nat b + 1 < Suc k"
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k

goal (1 subgoal):
 1. \<And>a b. mod_type_class.to_nat a = mod_type_class.to_nat b \<and> mod_type_class.to_nat a + 1 < Suc k \<and> mod_type_class.to_nat b + 1 < Suc k \<Longrightarrow> A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
show "A $ a $ b dvd A $ (a + 1) $ (b + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))
[PROOF STEP]
by (metis (mono_tags, lifting) Smith_normal_form_upt_k_condition1 a add_diff_cancel_right' cond1
        from_nat_suc from_nat_to_nat_id less_SucE s)
[PROOF STATE]
proof (state)
this:
A $ a $ b dvd A $ (a + (1::'rows)) $ (b + (1::'cols))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma univalent_finite[simp]:
  assumes "univalent R"
  shows "card (Domain R) = card R"
        "finite (Domain R) \<longleftrightarrow> finite R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Domain R) = card R &&& finite (Domain R) = finite R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (Domain R) = card R
 2. finite (Domain R) = finite R
[PROOF STEP]
let ?R = "BNF_Def.Gr (Domain R) (\<lambda> x. SOME y. (x,y) \<in> R)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (Domain R) = card R
 2. finite (Domain R) = finite R
[PROOF STEP]
have "card (Domain ?R) = card ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Domain (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))) = card (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (Domain (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))) = card (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))

goal (2 subgoals):
 1. card (Domain R) = card R
 2. finite (Domain R) = finite R
[PROOF STEP]
thus "card (Domain  R) = card  R"
[PROOF STATE]
proof (prove)
using this:
card (Domain (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))) = card (BNF_Def.Gr (Domain R) (\<lambda>x. SOME y. (x, y) \<in> R))

goal (1 subgoal):
 1. card (Domain R) = card R
[PROOF STEP]
unfolding univalent_fn[OF assms]
[PROOF STATE]
proof (prove)
using this:
card (Domain R) = card R

goal (1 subgoal):
 1. card (Domain R) = card R
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (Domain R) = card R

goal (1 subgoal):
 1. finite (Domain R) = finite R
[PROOF STEP]
thus "finite (Domain R) \<longleftrightarrow> finite R"
[PROOF STATE]
proof (prove)
using this:
card (Domain R) = card R

goal (1 subgoal):
 1. finite (Domain R) = finite R
[PROOF STEP]
by (metis Domain_empty_iff card_0_eq card.infinite finite.emptyI)
[PROOF STATE]
proof (state)
this:
finite (Domain R) = finite R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tuple_partial_image_indices:
  assumes "length fs > 0"
  assumes "is_function_tuple Q\<^sub>p n fs"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n+l\<^esup>)"
  assumes "i < length fs"
  shows "(tuple_partial_image n fs x) ! i = (fs!i) (take n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
have 0: "(function_tuple_eval Q\<^sub>p n fs (take n x)) ! i = (fs!i) (take n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
[PROOF STEP]
unfolding function_tuple_eval_def
[PROOF STATE]
proof (prove)
using this:
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. map (\<lambda>f. f (take n x)) fs ! i = (fs ! i) (take n x)
[PROOF STEP]
by (meson nth_map)
[PROOF STATE]
proof (state)
this:
function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)

goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
have 1: "length (function_tuple_eval Q\<^sub>p n fs (take n x)) > i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (function_tuple_eval Q\<^sub>p n fs (take n x))
[PROOF STEP]
by (metis assms(4) function_tuple_eval_def length_map)
[PROOF STATE]
proof (state)
this:
i < length (function_tuple_eval Q\<^sub>p n fs (take n x))

goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
using 0 1 assms
[PROOF STATE]
proof (prove)
using this:
function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
i < length (function_tuple_eval Q\<^sub>p n fs (take n x))
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. tuple_partial_image n fs x ! i = (fs ! i) (take n x)
[PROOF STEP]
unfolding tuple_partial_image_def
[PROOF STATE]
proof (prove)
using this:
function_tuple_eval Q\<^sub>p n fs (take n x) ! i = (fs ! i) (take n x)
i < length (function_tuple_eval Q\<^sub>p n fs (take n x))
0 < length fs
is_function_tuple Q\<^sub>p n fs
x \<in> carrier (Q\<^sub>p\<^bsup>n + l\<^esup>)
i < length fs

goal (1 subgoal):
 1. (function_tuple_eval Q\<^sub>p n fs (take n x) @ drop n x) ! i = (fs ! i) (take n x)
[PROOF STEP]
by (metis nth_append)
[PROOF STATE]
proof (state)
this:
tuple_partial_image n fs x ! i = (fs ! i) (take n x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mahler_measure_poly_ge_1:
  assumes "h \<noteq> 0"
  shows "(1::real) \<le> mahler_measure h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
have rc: "\<bar>real_of_int i\<bar> = of_int \<bar>i\<bar>" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>real_of_int i\<bar> = real_of_int \<bar>i\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int ?i\<bar> = real_of_int \<bar>?i\<bar>

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
h \<noteq> 0
[PROOF STEP]
have "cmod (lead_coeff (map_poly complex_of_int h)) > 0"
[PROOF STATE]
proof (prove)
using this:
h \<noteq> 0

goal (1 subgoal):
 1. 0 < cmod (lead_coeff (of_int_poly h))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < cmod (lead_coeff (of_int_poly h))

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
hence "cmod (lead_coeff (map_poly complex_of_int h)) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < cmod (lead_coeff (of_int_poly h))

goal (1 subgoal):
 1. 1 \<le> cmod (lead_coeff (of_int_poly h))
[PROOF STEP]
by(cases "lead_coeff h = 0", auto simp del: leading_coeff_0_iff)
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (lead_coeff (of_int_poly h))

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
from mult_mono[OF this mahler_measure_monic_ge_1 norm_ge_zero]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> 1 \<Longrightarrow> 1 * 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic ?p2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> 1 \<Longrightarrow> 1 * 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic ?p2

goal (1 subgoal):
 1. 1 \<le> mahler_measure h
[PROOF STEP]
unfolding mahler_measure_def mahler_measure_poly_via_monic
[PROOF STATE]
proof (prove)
using this:
0 \<le> 1 \<Longrightarrow> 1 * 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic ?p2

goal (1 subgoal):
 1. 1 \<le> cmod (lead_coeff (of_int_poly h)) * mahler_measure_monic (of_int_poly h)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> mahler_measure h

goal:
No subgoals!
[PROOF STEP]
qed