[STATEMENT]
lemma finite_stable_completion:
     "[| finite I;
         !!i. i \<in> I ==> F \<in> (A i) leadsTo (A' i);
         !!i. i \<in> I ==> F \<in> stable (A' i) |]
      ==> F \<in> (\<Inter>i \<in> I. A i) leadsTo (\<Inter>i \<in> I. A' i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> UNITY.stable (A' i)\<rbrakk> \<Longrightarrow> F \<in> \<Inter> (A ` I) \<longmapsto> \<Inter> (A' ` I)
[PROOF STEP]
apply (unfold stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> F \<in> \<Inter> (A ` I) \<longmapsto> \<Inter> (A' ` I)
[PROOF STEP]
apply (rule_tac C1 = "{}" in finite_completion [THEN leadsTo_weaken_R])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> finite I
 2. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> A i \<longmapsto> ?A'1 i \<union> {}
 3. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> ?A'1 i co ?A'1 i \<union> {}
 4. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> \<Inter> (?A'1 ` I) \<union> {} \<subseteq> \<Inter> (A' ` I)
[PROOF STEP]
apply (simp_all (no_asm_simp))
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> A i \<longmapsto> ?A'1 i
 2. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> ?A'1 i co ?A'1 i
 3. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> \<Inter> (?A'1 ` I) \<subseteq> \<Inter> (A' ` I)
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma int_simps:
  "\<turnstile> (x=x) = #True"
  "\<turnstile> (\<not> #True) = #False"
  "\<turnstile> (\<not> #False) = #True"
  "\<turnstile> (\<not>\<not> P) = P"
  "\<turnstile> ((\<not> P) = P) = #False"
  "\<turnstile> (P = (\<not>P)) = #False"
  "\<turnstile> (P \<noteq> Q) = (P = (\<not> Q))"
  "\<turnstile> (#True=P) = P"
  "\<turnstile> (P=#True) = P"
  "\<turnstile> (#True \<longrightarrow> P) = P"
  "\<turnstile> (#False \<longrightarrow> P) = #True"
  "\<turnstile> (P \<longrightarrow> #True) = #True"
  "\<turnstile> (P \<longrightarrow> P) = #True"
  "\<turnstile> (P \<longrightarrow> #False) = (\<not>P)"
  "\<turnstile> (P \<longrightarrow> ~P) = (\<not>P)"
  "\<turnstile> (P \<and> #True) = P"
  "\<turnstile> (#True \<and> P) = P"
  "\<turnstile> (P \<and> #False) = #False"
  "\<turnstile> (#False \<and> P) = #False"
  "\<turnstile> (P \<and> P) = P"
  "\<turnstile> (P \<and> ~P) = #False"
  "\<turnstile> (\<not>P \<and> P) = #False"
  "\<turnstile> (P \<or> #True) = #True"
  "\<turnstile> (#True \<or> P) = #True"
  "\<turnstile> (P \<or> #False) = P"
  "\<turnstile> (#False \<or> P) = P"
  "\<turnstile> (P \<or> P) = P"
  "\<turnstile> (P \<or> \<not>P) = #True"
  "\<turnstile> (\<not>P \<or> P) = #True"
  "\<turnstile> (\<forall> x. P) = P"
  "\<turnstile> (\<exists> x. P) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((\<turnstile> x = x = #True &&& \<turnstile> \<not> #True = #False &&& \<turnstile> \<not> #False = #True) &&& (\<turnstile> \<not> \<not> P = P &&& \<turnstile> \<not> P = P = #False) &&& \<turnstile> P = \<not> P = #False &&& \<turnstile> P \<noteq> Q = (P = \<not> Q)) &&& ((\<turnstile> #True = P = P &&& \<turnstile> P = #True = P) &&& \<turnstile> (#True \<longrightarrow> P) = P &&& \<turnstile> (#False \<longrightarrow> P) = #True) &&& (\<turnstile> (P \<longrightarrow> #True) = #True &&& \<turnstile> (P \<longrightarrow> P) = #True) &&& \<turnstile> (P \<longrightarrow> #False) = \<not> P &&& \<turnstile> (P \<longrightarrow> \<not> P) = \<not> P) &&& (((\<turnstile> (P \<and> #True) = P &&& \<turnstile> (#True \<and> P) = P) &&& \<turnstile> (P \<and> #False) = #False &&& \<turnstile> (#False \<and> P) = #False) &&& (\<turnstile> (P \<and> P) = P &&& \<turnstile> (P \<and> \<not> P) = #False) &&& \<turnstile> (\<not> P \<and> P) = #False &&& \<turnstile> (P \<or> #True) = #True) &&& ((\<turnstile> (#True \<or> P) = #True &&& \<turnstile> (P \<or> #False) = P) &&& \<turnstile> (#False \<or> P) = P &&& \<turnstile> (P \<or> P) = P) &&& (\<turnstile> (P \<or> \<not> P) = #True &&& \<turnstile> (\<not> P \<or> P) = #True) &&& \<turnstile> (\<forall>x. P) = P &&& \<turnstile> (\<exists>x. P) = P
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_decomposition: "unit_factor x * prod_mset (prime_factorization x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor x * \<Prod>\<^sub># (prime_factorization x) = x
[PROOF STEP]
by (cases "x = 0") (simp_all add: prod_mset_prime_factorization)


[STATEMENT]
lemma graph_minus_set_aimpl:
  fixes E1 E2 :: "'a rel"
  shows "E1-E2 = E_of_succ (\<lambda>u. {v\<in>E1``{u}. (u,v)\<notin>E2})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E1 - E2 = E_of_succ (\<lambda>u. {v \<in> E1 `` {u}. (u, v) \<notin> E2})
[PROOF STEP]
by (auto simp: E_of_succ_def)


[STATEMENT]
lemma spectral_radius_mem_max: assumes A: "A \<in> carrier_mat n n"
  and n: "n > 0"
  shows "spectral_radius A \<in> norm ` spectrum A" (is ?one)
  "a \<in> norm ` spectrum A \<Longrightarrow> a \<le> spectral_radius A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spectral_radius A \<in> cmod ` spectrum A &&& (a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
define SA where "SA = norm ` spectrum A"
[PROOF STATE]
proof (state)
this:
SA = cmod ` spectrum A

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
from card_finite_spectrum[OF A]
[PROOF STATE]
proof (chain)
picking this:
finite (spectrum A)
card (spectrum A) \<le> n
[PROOF STEP]
have fin: "finite SA"
[PROOF STATE]
proof (prove)
using this:
finite (spectrum A)
card (spectrum A) \<le> n

goal (1 subgoal):
 1. finite SA
[PROOF STEP]
unfolding SA_def
[PROOF STATE]
proof (prove)
using this:
finite (spectrum A)
card (spectrum A) \<le> n

goal (1 subgoal):
 1. finite (cmod ` spectrum A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite SA

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
from spectrum_non_empty[OF A n]
[PROOF STATE]
proof (chain)
picking this:
spectrum A \<noteq> {}
[PROOF STEP]
have ne: "SA \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
spectrum A \<noteq> {}

goal (1 subgoal):
 1. SA \<noteq> {}
[PROOF STEP]
unfolding SA_def
[PROOF STATE]
proof (prove)
using this:
spectrum A \<noteq> {}

goal (1 subgoal):
 1. cmod ` spectrum A \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SA \<noteq> {}

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
note d = spectral_radius_def SA_def[symmetric] Sup_fin_Max[symmetric]
[PROOF STATE]
proof (state)
this:
spectral_radius ?A = Max (cmod ` spectrum ?A)
cmod ` spectrum A = SA
Max = Sup_fin

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
show ?one
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spectral_radius A \<in> cmod ` spectrum A
[PROOF STEP]
unfolding d
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>f\<^sub>i\<^sub>n SA \<in> SA
[PROOF STEP]
by (rule Sup_fin.closed[OF fin ne], auto simp: sup_real_def)
[PROOF STATE]
proof (state)
this:
spectral_radius A \<in> cmod ` spectrum A

goal (1 subgoal):
 1. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
assume "a \<in> norm ` spectrum A"
[PROOF STATE]
proof (state)
this:
a \<in> cmod ` spectrum A

goal (1 subgoal):
 1. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
thus "a \<le> spectral_radius A"
[PROOF STATE]
proof (prove)
using this:
a \<in> cmod ` spectrum A

goal (1 subgoal):
 1. a \<le> spectral_radius A
[PROOF STEP]
unfolding d
[PROOF STATE]
proof (prove)
using this:
a \<in> SA

goal (1 subgoal):
 1. a \<le> \<Squnion>\<^sub>f\<^sub>i\<^sub>n SA
[PROOF STEP]
by (intro Sup_fin.coboundedI[OF fin])
[PROOF STATE]
proof (state)
this:
a \<le> spectral_radius A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_subseq_ofE:
  assumes "s \<in> closed_seqs Zp"
  assumes "is_subseq_of s s'"
  shows "\<exists>k. k \<ge> n \<and> s' n = s k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
obtain f where "is_increasing f \<and> s' = take_subseq s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. is_increasing f \<and> s' = take_subseq s f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2) is_subseq_of_def
[PROOF STATE]
proof (prove)
using this:
is_subseq_of s s'
is_subseq_of ?s ?s' = (\<exists>f. is_increasing f \<and> ?s' = take_subseq ?s f)

goal (1 subgoal):
 1. (\<And>f. is_increasing f \<and> s' = take_subseq s f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_increasing f \<and> s' = take_subseq s f

goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_increasing f \<and> s' = take_subseq s f
[PROOF STEP]
have  " f n \<ge> n \<and> s' n = s (f n)"
[PROOF STATE]
proof (prove)
using this:
is_increasing f \<and> s' = take_subseq s f

goal (1 subgoal):
 1. n \<le> f n \<and> s' n = s (f n)
[PROOF STEP]
unfolding take_subseq_def
[PROOF STATE]
proof (prove)
using this:
is_increasing f \<and> s' = (\<lambda>k. s (f k))

goal (1 subgoal):
 1. n \<le> f n \<and> s' n = s (f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n \<le> f n \<and> s' n = s (f n)

goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> f n \<and> s' n = s (f n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> f n \<and> s' n = s (f n)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma combine_neq_Leaf_if_both_non_Leaf: "\<lbrakk>a \<noteq> Leaf; z \<noteq> Leaf\<rbrakk> \<Longrightarrow>
  combine a z \<noteq> Leaf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> Leaf; z \<noteq> Leaf\<rbrakk> \<Longrightarrow> combine a z \<noteq> Leaf
[PROOF STEP]
by (simp add: combine_non_Leaves)


[STATEMENT]
lemma transfer_set_eq [transfer_intro]:
  "a \<equiv> Iset (star_n A) \<Longrightarrow> b \<equiv> Iset (star_n B) \<Longrightarrow> a = b \<equiv> eventually (\<lambda>n. A n = B n) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<equiv> Iset (star_n A); b \<equiv> Iset (star_n B)\<rbrakk> \<Longrightarrow> a = b \<equiv> \<forall>\<^sub>F n in \<U>. A n = B n
[PROOF STEP]
by (simp only: set_eq_iff transfer_all transfer_iff transfer_mem)


[STATEMENT]
lemma vrat_inverses_law_addition:
  assumes [simp]: "x \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>"
  shows "x +\<^sub>\<rat> (-\<^sub>\<rat> x) = 0\<^sub>\<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
have "x' + (-x') = 0" for x' :: rat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' + - x' = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' + - ?x' = 0

goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem regular_Compl:
  assumes S: "regular S" shows "regular (-S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
obtain MS  where M: "dfa MS" and lang: "dfa.language MS = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>MS. \<lbrakk>dfa MS; dfa.language MS = S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
regular S

goal (1 subgoal):
 1. (\<And>MS. \<lbrakk>dfa MS; dfa.language MS = S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: regular_def)
[PROOF STATE]
proof (state)
this:
dfa MS
dfa.language MS = S

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
interpret ST: dfa "\<lparr>dfa.states= dfa.states MS,
                     init= dfa.init MS, final= dfa.states MS - dfa.final MS,
                     nxt= \<lambda>q x. dfa.nxt MS q x\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa \<lparr>dfa.states = dfa.states MS, init = dfa.init MS, final = dfa.states MS - dfa.final MS, nxt = dfa.nxt MS\<rparr>
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
dfa MS

goal (1 subgoal):
 1. dfa \<lparr>dfa.states = dfa.states MS, init = dfa.init MS, final = dfa.states MS - dfa.final MS, nxt = dfa.nxt MS\<rparr>
[PROOF STEP]
by (force simp add: dfa_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
have "ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u
[PROOF STEP]
by (induct u rule: List.rev_induct) (auto simp: dfa.nextl_snoc dfa.nextl.simps M)
[PROOF STATE]
proof (state)
this:
ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u
[PROOF STEP]
have "u \<in> ST.language \<longleftrightarrow> u \<notin> dfa.language MS"
[PROOF STATE]
proof (prove)
using this:
ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u

goal (1 subgoal):
 1. (u \<in> ST.language) = (u \<notin> dfa.language MS)
[PROOF STEP]
by (auto simp: M dfa.nextl_init_state ST.language_def dfa.language_def)
[PROOF STATE]
proof (state)
this:
(u \<in> ST.language) = (u \<notin> dfa.language MS)

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)
[PROOF STEP]
have eq_L: "ST.language = -S"
[PROOF STATE]
proof (prove)
using this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)

goal (1 subgoal):
 1. ST.language = - S
[PROOF STEP]
using lang
[PROOF STATE]
proof (prove)
using this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)
dfa.language MS = S

goal (1 subgoal):
 1. ST.language = - S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ST.language = - S

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
unfolding regular_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. dfa M \<and> dfa.language M = - S
[PROOF STEP]
by (intro exI conjI, unfold_locales) (rule eq_L)
[PROOF STATE]
proof (state)
this:
regular (- S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prio_add_abc2:
  assumes "(a::('e,'a::linorder)Prio) \<le> a + b"
  shows "a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> False
[PROOF STEP]
assume ann: "\<not> a \<le> b"
[PROOF STATE]
proof (state)
this:
\<not> a \<le> b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> False
[PROOF STEP]
hence "a + b = b"
[PROOF STATE]
proof (prove)
using this:
\<not> a \<le> b

goal (1 subgoal):
 1. a + b = b
[PROOF STEP]
apply (auto simp add: plus_def plesseq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> p_less_eq a b \<Longrightarrow> p_min a b = b
[PROOF STEP]
apply (cases "(a,b)" rule: p_min.cases)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Infty, Infty)\<rbrakk> \<Longrightarrow> p_min a b = b
 2. \<And>e aa. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Infty, Prio e aa)\<rbrakk> \<Longrightarrow> p_min a b = b
 3. \<And>e aa. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Prio e aa, Infty)\<rbrakk> \<Longrightarrow> p_min a b = b
 4. \<And>e1 aa e2 ba. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Prio e1 aa, Prio e2 ba)\<rbrakk> \<Longrightarrow> p_min a b = b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
a + b = b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
a + b = b

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms ann
[PROOF STATE]
proof (prove)
using this:
a + b = b
a \<le> a + b
\<not> a \<le> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_unfoldl_eq [simp]: "1 + x \<cdot> x\<^sup>\<star> = x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + x \<cdot> x\<^sup>\<star> = x\<^sup>\<star>
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (1::'a) + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>
 2. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
show "1 + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>
[PROOF STEP]
by (fact star_unfoldl)
[PROOF STATE]
proof (state)
this:
(1::'a) + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
have "1 + x \<cdot> (1 + x \<cdot> x\<^sup>\<star>) \<le> 1 + x \<cdot> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + x \<cdot> ((1::'a) + x \<cdot> x\<^sup>\<star>) \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
by (meson join.sup_mono eq_refl mult_isol star_unfoldl)
[PROOF STATE]
proof (state)
this:
(1::'a) + x \<cdot> ((1::'a) + x \<cdot> x\<^sup>\<star>) \<le> (1::'a) + x \<cdot> x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
thus "x\<^sup>\<star> \<le> 1 + x \<cdot> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + x \<cdot> ((1::'a) + x \<cdot> x\<^sup>\<star>) \<le> (1::'a) + x \<cdot> x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
by (simp add: star_inductl_one)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f_fold_merge: "(\<And>y. y \<in> set xs \<Longrightarrow> f y = f x) \<Longrightarrow> f (fold merge xs x) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> set xs \<Longrightarrow> f y = f x) \<Longrightarrow> f (fold merge xs x) = f x
[PROOF STEP]
by (induction xs rule: rev_induct) (auto simp: f_merge)


[STATEMENT]
lemma continuous_on_product_then_coordinatewise:
  assumes "continuous_on S f"
  shows "continuous_on S (\<lambda>x. f x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
have "continuous_on S ((\<lambda>q. q i) \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S ((\<lambda>q. q i) \<circ> f)
[PROOF STEP]
by (metis assms continuous_on_compose continuous_on_id
        continuous_on_product_then_coordinatewise_UNIV continuous_on_subset subset_UNIV)
[PROOF STATE]
proof (state)
this:
continuous_on S ((\<lambda>q. q i) \<circ> f)

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on S ((\<lambda>q. q i) \<circ> f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on S ((\<lambda>q. q i) \<circ> f)

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on S (\<lambda>x. f x i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multi_take_drop:
  assumes "multi_plus l \<omega>"
      and "length l \<ge> 2"
    shows "\<exists>n a b. n > 0 \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
obtain a b la lb where asm0: "l = la @ lb \<and> length la > 0 \<and> length lb > 0 \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>la lb a b. l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1) assms(2) multi_decompose
[PROOF STATE]
proof (prove)
using this:
multi_plus l \<omega>
2 \<le> length l
\<lbrakk>multi_plus ?l ?\<omega>; 2 \<le> length ?l\<rbrakk> \<Longrightarrow> \<exists>a b la lb. ?l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some ?\<omega> = a \<oplus> b

goal (1 subgoal):
 1. (\<And>la lb a b. l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
let ?n = "length la"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
have "la = take ?n l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. la = take (length la) l
[PROOF STEP]
by (simp add: asm0)
[PROOF STATE]
proof (state)
this:
la = take (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
la = take (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
have "lb = drop ?n l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lb = drop (length la) l
[PROOF STEP]
by (simp add: asm0)
[PROOF STATE]
proof (state)
this:
lb = drop (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
la = take (length la) l
lb = drop (length la) l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
la = take (length la) l
lb = drop (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
by (metis asm0 length_drop zero_less_diff)
[PROOF STATE]
proof (state)
this:
\<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upper:
  "turn_into_distance f x y \<le> f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. turn_into_distance f x y \<le> f x y
[PROOF STEP]
unfolding turn_into_distance_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<le> f x y
[PROOF STEP]
proof (rule cInf_lower, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
define u::"nat \<Rightarrow> 'a" where "u = (\<lambda>n. if n = 0 then x else y)"
[PROOF STATE]
proof (state)
this:
u = (\<lambda>n. if n = 0 then x else y)

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
define n::nat where "n = 1"
[PROOF STATE]
proof (state)
this:
n = 1

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
have "u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))
[PROOF STEP]
unfolding u_def n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 = 0 then x else y) = x \<and> (if 1 = 0 then x else y) = y \<and> f x y = (\<Sum>i = 0..<1. f (if i = 0 then x else y) (if Suc i = 0 then x else y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))
[PROOF STEP]
show "\<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y"
[PROOF STATE]
proof (prove)
using this:
u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lub_is_union: "lub S = \<Union>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lub S = \<Union> S
[PROOF STEP]
using is_lub_set
[PROOF STATE]
proof (prove)
using this:
?S <<| \<Union> ?S

goal (1 subgoal):
 1. lub S = \<Union> S
[PROOF STEP]
by (rule lub_eqI)


[STATEMENT]
lemma primepow_odd_imp_primepow:
  assumes "primepow_odd n"
  shows   "primepow n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primepow n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primepow n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
primepow_odd n
[PROOF STEP]
obtain p k where "1 \<le> k" "prime p" "n = p ^ (2 * k + 1)"
[PROOF STATE]
proof (prove)
using this:
primepow_odd n

goal (1 subgoal):
 1. (\<And>k p. \<lbrakk>1 \<le> k; prime p; n = p ^ (2 * k + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding primepow_odd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p k. 1 \<le> k \<and> prime p \<and> n = p ^ (2 * k + 1)

goal (1 subgoal):
 1. (\<And>k p. \<lbrakk>1 \<le> k; prime p; n = p ^ (2 * k + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
from \<open>1 \<le> k\<close>
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
[PROOF STEP]
have "Suc (2 * k) > 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> k

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

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)
0 < Suc (2 * k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)
0 < Suc (2 * k)

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
unfolding primepow_def
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)
0 < Suc (2 * k)

goal (1 subgoal):
 1. \<exists>p k. prime p \<and> 0 < k \<and> n = p ^ k
[PROOF STEP]
by (auto simp del: power_Suc)
[PROOF STATE]
proof (state)
this:
primepow n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_poly_power [simp]: "of_int_poly (p ^ n) = of_int_poly p ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly (p ^ n) = of_int_poly p ^ n
[PROOF STEP]
by (induction n) simp_all


[STATEMENT]
lemma minGraphProps_facesAt_eq: "minGraphProps g \<Longrightarrow>
  v \<in> \<V> g \<Longrightarrow> set (facesAt g v) = {f \<in> \<F> g. v \<in> \<V> f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>minGraphProps g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = {f \<in> \<F> g. v \<in> \<V> f}
[PROOF STEP]
by (simp add: minGraphProps_def facesAt_eq_def)


[STATEMENT]
lemma valid_path_shiftpath [intro]:
  assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
    shows "valid_path(shiftpath a g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (shiftpath a g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path g
pathfinish g = pathstart g
a \<in> {0..1}

goal (1 subgoal):
 1. valid_path (shiftpath a g)
[PROOF STEP]
apply (auto simp: valid_path_def shiftpath_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. if x \<le> 1 - a then g (a + x) else g (a + x - 1)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
apply (rule piecewise_C1_differentiable_cases)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (a + x)) piecewise_C1_differentiable_on {0..1 - a}
 2. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (a + x - 1)) piecewise_C1_differentiable_on {1 - a..1}
 3. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> 1 - a
 4. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> 1 - a \<le> 1
 5. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g (a + (1 - a)) = g (a + (1 - a) - 1)
[PROOF STEP]
apply (auto simp: algebra_simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a)) piecewise_C1_differentiable_on {0..1 - a}
 2. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a - 1)) piecewise_C1_differentiable_on {1 - a..1}
 3. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g 1 = g 0
[PROOF STEP]
apply (rule piecewise_C1_differentiable_affine [of g 1 a, simplified o_def scaleR_one])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g piecewise_C1_differentiable_on (\<lambda>x. 1 * x + a) ` {0..1 - a}
 2. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a - 1)) piecewise_C1_differentiable_on {1 - a..1}
 3. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g 1 = g 0
[PROOF STEP]
apply (auto simp: pathfinish_def pathstart_def elim: piecewise_C1_differentiable_on_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; g 1 = g 0; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a - 1)) piecewise_C1_differentiable_on {1 - a..1}
[PROOF STEP]
apply (rule piecewise_C1_differentiable_affine [of g 1 "a-1", simplified o_def scaleR_one algebra_simps])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; g 1 = g 0; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g piecewise_C1_differentiable_on (\<lambda>x. a + x * 1 - 1) ` {1 - a..1}
[PROOF STEP]
apply (auto simp: pathfinish_def pathstart_def elim: piecewise_C1_differentiable_on_subset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_permute_list [simp]:
  assumes "f permutes {..<length xs}"
  shows "set (permute_list f xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (permute_list f xs) = set xs
[PROOF STEP]
by (rule mset_eq_setD[OF mset_permute_list]) fact


[STATEMENT]
lemma wlp_measure_expand_m:
  assumes m: "m \<le> n" and wc: "well_com (Measure n M S)"
  shows "wlp (Measure m M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wlp (Measure m M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
unfolding wlp.simps wlp_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
have "k < m \<Longrightarrow> map wlp S ! k = wlp (S!k)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < m \<Longrightarrow> map wlp S ! k = wlp (S ! k)
[PROOF STEP]
using wc m
[PROOF STATE]
proof (prove)
using this:
well_com (Measure n M S)
m \<le> n

goal (1 subgoal):
 1. k < m \<Longrightarrow> map wlp S ! k = wlp (S ! k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < m \<Longrightarrow> map wlp S ! ?k = wlp (S ! ?k)

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < m \<Longrightarrow> map wlp S ! ?k = wlp (S ! ?k)
[PROOF STEP]
have "k < m \<Longrightarrow> (map wlp S ! k) P = wlp (S!k) P" for k
[PROOF STATE]
proof (prove)
using this:
?k < m \<Longrightarrow> map wlp S ! ?k = wlp (S ! ?k)

goal (1 subgoal):
 1. k < m \<Longrightarrow> (map wlp S ! k) P = wlp (S ! k) P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P
[PROOF STEP]
show "matrix_sum d (\<lambda>k. adjoint (M k) * ((map wlp S ! k) P) * (M k)) m
    = matrix_sum d (\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)) m"
[PROOF STATE]
proof (prove)
using this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
using matrix_sum_cong[of m "\<lambda>k. adjoint (M k) * ((map wlp S ! k) P) * (M k)" "\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)"]
[PROOF STATE]
proof (prove)
using this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P
(\<And>k. k < m \<Longrightarrow> adjoint (M k) * (map wlp S ! k) P * M k = adjoint (M k) * wlp (S ! k) P * M k) \<Longrightarrow> matrix_sum ?d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum ?d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_sublist_exists:
  "ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs)
[PROOF STEP]
proof (induction xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. ys \<subseteq> set [] \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs [])
 2. \<And>a xs ys. \<lbrakk>\<And>ys. ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs); ys \<subseteq> set (a # xs)\<rbrakk> \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a # xs))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
?ys \<subseteq> set xs_ \<Longrightarrow> \<exists>zs. set zs = ?ys \<and> zs \<in> set (subseqs xs_)
ys \<subseteq> set (a_ # xs_)

goal (2 subgoals):
 1. \<And>ys. ys \<subseteq> set [] \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs [])
 2. \<And>a xs ys. \<lbrakk>\<And>ys. ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs); ys \<subseteq> set (a # xs)\<rbrakk> \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?ys \<subseteq> set xs_ \<Longrightarrow> \<exists>zs. set zs = ?ys \<and> zs \<in> set (subseqs xs_)
ys \<subseteq> set (a_ # xs_)

goal (1 subgoal):
 1. \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a_ # xs_))
[PROOF STEP]
by (metis (no_types, lifting) Pow_iff imageE subseqs_powset)
[PROOF STATE]
proof (state)
this:
\<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a_ # xs_))

goal (1 subgoal):
 1. \<And>ys. ys \<subseteq> set [] \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma s'_nonneg: "0 \<le> v \<Longrightarrow> a \<le> 0 \<Longrightarrow> 0 \<le> s' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> v; a \<le> 0\<rbrakk> \<Longrightarrow> 0 \<le> s' x
[PROOF STEP]
by (auto simp: s'_def p'_def t_stop_def field_split_simps)


[STATEMENT]
lemma degree_add_less: "degree p < n \<Longrightarrow> degree q < n \<Longrightarrow> degree (p + q) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>degree p < n; degree q < n\<rbrakk> \<Longrightarrow> degree (p + q) < n
[PROOF STEP]
by (auto intro: le_less_trans degree_add_le_max)


[STATEMENT]
lemma bitxor_cancel [simp]: "(b \<oplus>\<^sub>b b) = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<oplus>\<^sub>b b) = \<zero>
[PROOF STEP]
by (cases b) simp_all


[STATEMENT]
lemma fls_subdegree_lt_fls_regpart_subdegree:
  "fls_subdegree f \<le> int (subdegree (fls_regpart f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_subdegree f \<le> int (subdegree (fls_regpart f))
[PROOF STEP]
using fls_subdegree_leI nth_subdegree_nonzero[of "fls_regpart f"]
[PROOF STATE]
proof (prove)
using this:
?f $$ ?n \<noteq> (0::?'a) \<Longrightarrow> fls_subdegree ?f \<le> ?n
fls_regpart f \<noteq> 0 \<Longrightarrow> fls_regpart f $ subdegree (fls_regpart f) \<noteq> (0::'a)

goal (1 subgoal):
 1. fls_subdegree f \<le> int (subdegree (fls_regpart f))
[PROOF STEP]
by    (cases "(fls_regpart f) = 0")
        (simp_all add: fls_regpart_eq0_imp_nonpos_subdegree)


[STATEMENT]
lemma mono_arctan_real: "mono (arctan :: real \<Rightarrow> real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono arctan
[PROOF STEP]
by (auto intro!: monoI arctan_monotone')


[STATEMENT]
lemma Range_outside_sub:
  assumes "Range R \<subseteq> Y"
  shows "Range (R outside X) \<subseteq> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range (R outside X) \<subseteq> Y
[PROOF STEP]
using assms outside_union_restrict
[PROOF STATE]
proof (prove)
using this:
Range R \<subseteq> Y
?P = ?P outside ?X \<union> ?P || ?X

goal (1 subgoal):
 1. Range (R outside X) \<subseteq> Y
[PROOF STEP]
by (metis Range_mono inf_sup_ord(3) subset_trans)


[STATEMENT]
lemma us_inj: "inj (us::'a::order_with_dual \<Rightarrow> 'a upset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj us
[PROOF STEP]
unfolding inj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. us x = us y \<longrightarrow> x = y
[PROOF STEP]
by (simp add: us_faithful dual_order.antisym)


[STATEMENT]
lemma (in Ring) ring_inv1_3:"\<lbrakk>a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow>
                           a \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (subst  aGroup.ag_inv_inv[THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> (-\<^sub>a (-\<^sub>a a)) \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (frule aGroup.ag_mOp_closed[of "R" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R; -\<^sub>a a \<in> carrier R\<rbrakk> \<Longrightarrow> (-\<^sub>a (-\<^sub>a a)) \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (subst ring_inv1_1[THEN sym, of "-\<^sub>a a" "b"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R; -\<^sub>a a \<in> carrier R\<rbrakk> \<Longrightarrow> -\<^sub>a (-\<^sub>a a) \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (subst ring_inv1_2[of "-\<^sub>a a" "b"], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unit_vec_carrier[simp]: "unit_vec n i \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_vec n i \<in> carrier_vec n
[PROOF STEP]
unfolding unit_vec_def carrier_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>j. if j = i then 1::'a else (0::'a)) \<in> {v. dim_vec v = n}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Torder) less_in_Iod:"\<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<prec> b\<rbrakk>
      \<Longrightarrow> (a \<prec> b) = (a \<in> carrier (Iod D (segment D b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<prec> b\<rbrakk> \<Longrightarrow> a \<prec> b = (a \<in> carrier (Iod D (segment D b)))
[PROOF STEP]
apply (simp add:Iod_def segment_inc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma comp_of_ords: assumes "class.linorder le lt"
  shows "comparator (comp_of_ords le lt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
interpret linorder le lt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.linorder le lt
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
by (unfold_locales, auto simp: comp_of_ords_def split: if_splits)
[PROOF STATE]
proof (state)
this:
comparator (comp_of_ords le lt)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Plus_neg_iRelease_conv: "(P t1. t1 \<R> t2 (I \<oplus>- k). Q t2) = (P (t1 - k). t1 \<R> t2 (I \<down>\<ge> k). Q (t2 - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t1. t1 \<R> t2 I \<oplus>- k. Q t2) = (P (t1 - k). t1 \<R> t2 I \<down>\<ge> k. Q (t2 - k))
[PROOF STEP]
by (simp add: iRelease_iWeakUntil_conv iT_Plus_neg_iWeakUntil_conv)


[STATEMENT]
theorem \<pi>_upper_bound:
  fixes x :: real
  assumes "x \<ge> 2"
  shows   "\<pi> x < 3 * (exp (-1) + ln 2) * x / ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
proof (cases "x \<ge> 3")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 3 \<le> x

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<pi> x = \<pi> (nat \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> x = \<pi> (real (nat \<lfloor>x\<rfloor>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real (nat \<lfloor>x\<rfloor>))

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real (nat \<lfloor>x\<rfloor>))

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
from False and assms
[PROOF STATE]
proof (chain)
picking this:
\<not> 3 \<le> x
2 \<le> x
[PROOF STEP]
have "nat \<lfloor>x\<rfloor> = 2"
[PROOF STATE]
proof (prove)
using this:
\<not> 3 \<le> x
2 \<le> x

goal (1 subgoal):
 1. nat \<lfloor>x\<rfloor> = 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
nat \<lfloor>x\<rfloor> = 2

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> x = \<pi> (real 2)
[PROOF STEP]
have "\<pi> x = 1"
[PROOF STATE]
proof (prove)
using this:
\<pi> x = \<pi> (real 2)

goal (1 subgoal):
 1. \<pi> x = 1
[PROOF STEP]
by (simp add: eval_\<pi>)
[PROOF STATE]
proof (state)
this:
\<pi> x = 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> x = 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<dots> < 3 * (exp (-1) + ln 2) * exp 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < 3 * (exp (- 1) + ln 2) * exp 1
[PROOF STEP]
by (simp add: exp_minus field_simps add_pos_pos
             del: div_mult_self3 div_mult_self4 div_mult_self2 div_mult_self1)
[PROOF STATE]
proof (state)
this:
1 < 3 * (exp (- 1) + ln 2) * exp 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < 3 * (exp (- 1) + ln 2) * exp 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<dots> \<le> 3 * (exp (-1) + ln 2) * (x / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * exp 1 \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
using \<pi>_upper_bound_aux[of 1 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; 0 < x\<rbrakk> \<Longrightarrow> x powr - 1 * ln x \<le> 1 / (1 * exp 1)

goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * exp 1 \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
by (intro mult_left_mono) (use assms in \<open>auto simp: field_simps powr_minus\<close>)
[PROOF STATE]
proof (state)
this:
3 * (exp (- 1) + ln 2) * exp 1 \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)
2 \<le> x

goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
3 \<le> x

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
define n where "n = nat \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (state)
this:
n = nat \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
3 \<le> x
[PROOF STEP]
have n: "n \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
3 \<le> x

goal (1 subgoal):
 1. 3 \<le> n
[PROOF STEP]
by (simp add: n_def le_nat_iff le_floor_iff)
[PROOF STATE]
proof (state)
this:
3 \<le> n

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<pi> x = \<pi> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> x = \<pi> (real n)
[PROOF STEP]
by (simp add: n_def)
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real n)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real n)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<pi> n < 3 * (exp (-1) + ln 2) * (n / ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))
[PROOF STEP]
using \<pi>_upper_bound_strong[of n "2 / 3"] ln_realpow[of 2 2] n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 \<le> n; 2 / 3 \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<pi> (real n) < (1 / ((1 - 2 / 3) * exp 1) + ln 4 / (2 / 3)) * real n / ln (real n)
0 < 2 \<Longrightarrow> ln (2\<^sup>2) = real 2 * ln 2
3 \<le> n

goal (1 subgoal):
 1. \<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))
[PROOF STEP]
by (simp add: field_simps exp_minus
             del: div_mult_self3 div_mult_self4 div_mult_self2 div_mult_self1)
[PROOF STATE]
proof (state)
this:
\<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<dots> \<le> 3 * (exp (-1) + ln 2) * (x / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * (real n / ln (real n)) \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
using n True
[PROOF STATE]
proof (prove)
using this:
3 \<le> n
3 \<le> x

goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * (real n / ln (real n)) \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
by (intro mult_left_mono divide_ln_mono) (auto simp: n_def)
[PROOF STATE]
proof (state)
this:
3 * (exp (- 1) + ln 2) * (real n / ln (real n)) \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
\<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
let "?P t" = ?thesis
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
let ?Q = "\<lambda>ts. subst_term_list (subst_term f1 \<circ> f2) ts =
    subst_term_list f1 (subst_term_list f2 ts)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
proof (induct t rule: subst_term.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. subst_term (subst_term f1 \<circ> f2) (Var x) = subst_term f1 (subst_term f2 (Var x))
 2. \<And>x1 x2. ?P2.0 x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1 x2) = subst_term f1 (subst_term f2 (App x1 x2))
 3. ?P2.0 []
 4. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); ?P2.0 x2\<rbrakk> \<Longrightarrow> ?P2.0 (x1 # x2)
[PROOF STEP]
show "?P (Var a)" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (Var a) = subst_term f1 (subst_term f2 (Var a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subst_term (subst_term f1 \<circ> f2) (Var ?a) = subst_term f1 (subst_term f2 (Var ?a))

goal (3 subgoals):
 1. \<And>x1 x2. ?P2.0 x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1 x2) = subst_term f1 (subst_term f2 (App x1 x2))
 2. ?P2.0 []
 3. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); ?P2.0 x2\<rbrakk> \<Longrightarrow> ?P2.0 (x1 # x2)
[PROOF STEP]
show "?P (App b ts)" if "?Q ts" for b ts
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (App b ts) = subst_term f1 (subst_term f2 (App b ts))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
subst_term_list (subst_term f1 \<circ> f2) ts = subst_term_list f1 (subst_term_list f2 ts)

goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (App b ts) = subst_term f1 (subst_term f2 (App b ts))
[PROOF STEP]
by (simp only: subst_simps)
[PROOF STATE]
proof (state)
this:
subst_term_list (subst_term f1 \<circ> f2) ?ts = subst_term_list f1 (subst_term_list f2 ?ts) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App ?b ?ts) = subst_term f1 (subst_term f2 (App ?b ?ts))

goal (2 subgoals):
 1. subst_term_list (subst_term f1 \<circ> f2) [] = subst_term_list f1 (subst_term_list f2 [])
 2. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); subst_term_list (subst_term f1 \<circ> f2) x2 = subst_term_list f1 (subst_term_list f2 x2)\<rbrakk> \<Longrightarrow> subst_term_list (subst_term f1 \<circ> f2) (x1 # x2) = subst_term_list f1 (subst_term_list f2 (x1 # x2))
[PROOF STEP]
show "?Q []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term_list (subst_term f1 \<circ> f2) [] = subst_term_list f1 (subst_term_list f2 [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subst_term_list (subst_term f1 \<circ> f2) [] = subst_term_list f1 (subst_term_list f2 [])

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); subst_term_list (subst_term f1 \<circ> f2) x2 = subst_term_list f1 (subst_term_list f2 x2)\<rbrakk> \<Longrightarrow> subst_term_list (subst_term f1 \<circ> f2) (x1 # x2) = subst_term_list f1 (subst_term_list f2 (x1 # x2))
[PROOF STEP]
show "?Q (t # ts)" if "?P t" "?Q ts" for t ts
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term_list (subst_term f1 \<circ> f2) (t # ts) = subst_term_list f1 (subst_term_list f2 (t # ts))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
subst_term_list (subst_term f1 \<circ> f2) ts = subst_term_list f1 (subst_term_list f2 ts)

goal (1 subgoal):
 1. subst_term_list (subst_term f1 \<circ> f2) (t # ts) = subst_term_list f1 (subst_term_list f2 (t # ts))
[PROOF STEP]
by (simp only: subst_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>subst_term (subst_term f1 \<circ> f2) ?t = subst_term f1 (subst_term f2 ?t); subst_term_list (subst_term f1 \<circ> f2) ?ts = subst_term_list f1 (subst_term_list f2 ?ts)\<rbrakk> \<Longrightarrow> subst_term_list (subst_term f1 \<circ> f2) (?t # ?ts) = subst_term_list f1 (subst_term_list f2 (?t # ?ts))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_poly_append[simp]: "eval_poly \<alpha> (mc1 @ mc2) = eval_poly \<alpha> mc1 + eval_poly \<alpha> mc2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<alpha> (mc1 @ mc2) = eval_poly \<alpha> mc1 + eval_poly \<alpha> mc2
[PROOF STEP]
by (induct mc1, auto simp: field_simps)


[STATEMENT]
lemma mult_float_interval_mono:
  "mult_float_interval prec A B \<le> mult_float_interval prec X Y"
  if "A \<le> X" "B \<le> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_float_interval prec A B \<le> mult_float_interval prec X Y
[PROOF STEP]
using mult_float_interval_mono'[of A X B Y prec] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set_of A \<subseteq> set_of X; set_of B \<subseteq> set_of Y\<rbrakk> \<Longrightarrow> set_of (mult_float_interval prec A B) \<subseteq> set_of (mult_float_interval prec X Y)
A \<le> X
B \<le> Y

goal (1 subgoal):
 1. mult_float_interval prec A B \<le> mult_float_interval prec X Y
[PROOF STEP]
by (simp add: set_of_subset_iff')


[STATEMENT]
lemma (in bounded_bilinear) tendsto_right_zero:
  "(f \<longlongrightarrow> 0) F \<Longrightarrow> ((\<lambda>x. c ** f x) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'b)) F \<Longrightarrow> ((\<lambda>x. c ** f x) \<longlongrightarrow> (0::'c)) F
[PROOF STEP]
by (rule bounded_linear.tendsto_zero [OF bounded_linear_right])


[STATEMENT]
lemma uprod_mono: "[| A<=A';  B<=B' |] ==> uprod A B <= uprod A' B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> A'; B \<subseteq> B'\<rbrakk> \<Longrightarrow> uprod A B \<subseteq> uprod A' B'
[PROOF STEP]
by (simp add: uprod_def, blast)


[STATEMENT]
lemma (in equivalence) set_eq_sym [sym]:
  assumes "A \<subseteq> carrier S" "B \<subseteq> carrier S"
  shows "A {.=} B \<Longrightarrow> B {.=} A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A {.=} B \<Longrightarrow> B {.=} A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier S
B \<subseteq> carrier S

goal (1 subgoal):
 1. A {.=} B \<Longrightarrow> B {.=} A
[PROOF STEP]
unfolding set_eq_def elem_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier S
B \<subseteq> carrier S

goal (1 subgoal):
 1. (\<forall>x\<in>A. Bex B ((.=) x)) \<and> (\<forall>x\<in>B. Bex A ((.=) x)) \<Longrightarrow> (\<forall>x\<in>B. Bex A ((.=) x)) \<and> (\<forall>x\<in>A. Bex B ((.=) x))
[PROOF STEP]
by auto


[STATEMENT]
lemma lepoll_funcset_right:
   "B \<lesssim> B' \<Longrightarrow> A \<rightarrow>\<^sub>E B \<lesssim> A \<rightarrow>\<^sub>E B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<lesssim> B' \<Longrightarrow> A \<rightarrow>\<^sub>E B \<lesssim> A \<rightarrow>\<^sub>E B'
[PROOF STEP]
apply (auto simp: lepoll_def inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'\<rbrakk> \<Longrightarrow> \<exists>f. (\<forall>x\<in>A \<rightarrow>\<^sub>E B. \<forall>y\<in>A \<rightarrow>\<^sub>E B. f x = f y \<longrightarrow> x = y) \<and> f ` (A \<rightarrow>\<^sub>E B) \<subseteq> A \<rightarrow>\<^sub>E B'
[PROOF STEP]
apply (rule_tac x = "\<lambda>g. \<lambda>z \<in> A. f(g z)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'\<rbrakk> \<Longrightarrow> (\<forall>x\<in>A \<rightarrow>\<^sub>E B. \<forall>y\<in>A \<rightarrow>\<^sub>E B. (\<lambda>z\<in>A. f (x z)) = (\<lambda>z\<in>A. f (y z)) \<longrightarrow> x = y) \<and> (\<lambda>x. \<lambda>z\<in>A. f (x z)) ` (A \<rightarrow>\<^sub>E B) \<subseteq> A \<rightarrow>\<^sub>E B'
[PROOF STEP]
apply (auto simp: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f x y xa. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'; x \<in> A \<rightarrow>\<^sub>E B; y \<in> A \<rightarrow>\<^sub>E B; \<forall>xa. xa \<in> A \<longrightarrow> f (x xa) = f (y xa)\<rbrakk> \<Longrightarrow> x xa = y xa
 2. \<And>f xa xb. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'; xa \<in> A \<rightarrow>\<^sub>E B; xb \<in> A\<rbrakk> \<Longrightarrow> f (xa xb) \<in> B'
[PROOF STEP]
apply (metis PiE_E)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f xa xb. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'; xa \<in> A \<rightarrow>\<^sub>E B; xb \<in> A\<rbrakk> \<Longrightarrow> f (xa xb) \<in> B'
[PROOF STEP]
by blast


[STATEMENT]
lemma subpath_translation: "subpath u v ((\<lambda>x. a + x) \<circ> g) = (\<lambda>x. a + x) \<circ> subpath u v g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subpath u v ((+) a \<circ> g) = (+) a \<circ> subpath u v g
[PROOF STEP]
by (rule ext) (simp add: subpath_def)


[STATEMENT]
lemma vinsert_compr: "vinsert y A = set {x. x = y \<or> x \<in>\<^sub>\<circ> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vinsert y A = set {x. x = y \<or> x \<in>\<^sub>\<circ> A}
[PROOF STEP]
unfolding vunion_def vinsert_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set {x. x \<in>\<^sub>\<circ> set {x. x = y} \<or> x \<in>\<^sub>\<circ> A} = set {x. x = y \<or> x \<in>\<^sub>\<circ> A}
[PROOF STEP]
by simp_all


[STATEMENT]
lemma iT_Mult_iWeakSince_conv: "0 < k \<Longrightarrow> (P t1. t1 \<B> t2 (I \<otimes> k). Q t2) = (P (t1 * k). t1 \<B> t2 I. Q (t2 * k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (P t1. t1 \<B> t2 I \<otimes> k. Q t2) = (P (t1 * k). t1 \<B> t2 I. Q (t2 * k))
[PROOF STEP]
by (simp add: iWeakSince_iSince_conv iT_Mult_iSince_conv iT_Mult_iAll_conv)


[STATEMENT]
lemma (in prisoner) J_is_gate:
  shows "gate 2 J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gate 2 (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
 2. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
 3. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
show "dim_row J = 2\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2

goal (2 subgoals):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
 2. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2

goal (2 subgoals):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
 2. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
show "square_mat J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])

goal (1 subgoal):
 1. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
show "unitary J"
[PROOF STATE]
proof (prove)
using this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])

goal (1 subgoal):
 1. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
using mat_of_cols_list_def unitary_def J_cnj_times_J J_times_J_cnj
[PROOF STATE]
proof (prove)
using this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)
unitary ?M \<equiv> ?M\<^sup>\<dagger> * ?M = 1\<^sub>m (dim_col ?M) \<and> ?M * ?M\<^sup>\<dagger> = 1\<^sub>m (dim_row ?M)
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] = 1\<^sub>m 4
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 1\<^sub>m 4

goal (1 subgoal):
 1. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "[| P = (x = 0); (~P) = (y = 0) |] ==> min (x::nat) y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P = (x = 0); (\<not> P) = (y = 0)\<rbrakk> \<Longrightarrow> min x y = 0
[PROOF STEP]
by linarith


[STATEMENT]
lemma wf_wellorderI2:
  assumes wf: "wf {(x::'a::ord, y). y < x}"
  assumes lin: "class.linorder (\<lambda>(x::'a) y::'a. y \<le> x) (\<lambda>(x::'a) y::'a. y < x)"
  shows "class.wellorder (\<lambda>(x::'a) y::'a. y \<le> x) (\<lambda>(x::'a) y::'a. y < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.wellorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)
[PROOF STEP]
using lin
[PROOF STATE]
proof (prove)
using this:
class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)

goal (1 subgoal):
 1. class.wellorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)
[PROOF STEP]
unfolding class.wellorder_def
[PROOF STATE]
proof (prove)
using this:
class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)

goal (1 subgoal):
 1. class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) \<and> class.wellorder_axioms (\<lambda>x y. y < x)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.wellorder_axioms (\<lambda>x y. y < x)
[PROOF STEP]
apply (rule class.wellorder_axioms.intro)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P a. (\<And>x. (\<And>y. x < y \<Longrightarrow> P y) \<Longrightarrow> P x) \<Longrightarrow> P a
[PROOF STEP]
by (blast intro: wf_induct_rule [OF wf])


[STATEMENT]
lemma Compl_step1:
"Kripke {s :: ('s :: state). \<exists> i \<in> I. (i \<rightarrow>\<^sub>i* s)} I  \<turnstile> EF s
\<Longrightarrow> \<forall> x \<in> I. \<exists> y \<in> s. x \<rightarrow>\<^sub>i* y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Kripke {s. \<exists>i\<in>I. i \<rightarrow>\<^sub>i* s} I \<turnstile> EF s \<Longrightarrow> \<forall>x\<in>I. \<exists>y\<in>s. x \<rightarrow>\<^sub>i* y
[PROOF STEP]
by (simp add: EF_step_star_rev valEF_E)


[STATEMENT]
lemma lookup_monom_mult_eq_zero:
  assumes "s \<oplus> lt p \<prec>\<^sub>t v"
  shows "lookup (monom_mult (c::'b::semiring_no_zero_divisors) s p) v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monom_mult c s p) v = (0::'b)
[PROOF STEP]
by (metis assms aux lt_gr lt_monom_mult monom_mult_zero_left monom_mult_zero_right
      ord_term_lin.order.strict_implies_not_eq)


[STATEMENT]
lemma "is_succ_in_set S x y \<longleftrightarrow> min_in_set {s . s \<in> S \<and> s > x} y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_succ_in_set S x y = min_in_set {s \<in> S. x < s} y
[PROOF STEP]
using is_succ_in_set_def min_in_set_def
[PROOF STATE]
proof (prove)
using this:
is_succ_in_set ?xs ?x ?y = (?y \<in> ?xs \<and> ?x < ?y \<and> (\<forall>z\<in>?xs. ?x < z \<longrightarrow> ?y \<le> z))
min_in_set ?xs ?x = (?x \<in> ?xs \<and> (\<forall>y\<in>?xs. ?x \<le> y))

goal (1 subgoal):
 1. is_succ_in_set S x y = min_in_set {s \<in> S. x < s} y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in group) rcosets_part_G:
  assumes "subgroup H G"
  shows "\<Union>(rcosets H) = carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
interpret subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
unfolding RCOSETS_def r_coset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (\<Union>a\<in>carrier G. {\<Union>h\<in>H. {h \<otimes> a}}) = carrier G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (rcosets H) = carrier G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nset_pre:"\<lbrakk> (x::nat) \<in> {i. i \<le> (Suc n)}; x \<noteq> Suc n \<rbrakk> \<Longrightarrow> x \<in> {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> {i. i \<le> Suc n}; x \<noteq> Suc n\<rbrakk> \<Longrightarrow> x \<in> {i. i \<le> n}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma positive_Real: "cauchy X \<Longrightarrow> positive (Real X) \<longleftrightarrow> (\<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy X \<Longrightarrow> positive (Real X) = (\<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n)
[PROOF STEP]
using positive.transfer
[PROOF STATE]
proof (prove)
using this:
rel_fun pcr_real (=) (\<lambda>X. \<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n) positive

goal (1 subgoal):
 1. cauchy X \<Longrightarrow> positive (Real X) = (\<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n)
[PROOF STEP]
by (simp add: cr_real_eq rel_fun_def)


[STATEMENT]
lemma gbinomial_index_swap:
  "((-1) ^ k) * ((- (of_nat n) - 1) gchoose k) = ((-1) ^ n) * ((- (of_nat k) - 1) gchoose n)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "?lhs = (of_nat (k + n) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k
[PROOF STEP]
by (subst gbinomial_negated_upper) (simp add: power_mult_distrib [symmetric])
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = (of_nat (k + n) gchoose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose k = of_nat (k + n) gchoose n
[PROOF STEP]
by (subst gbinomial_of_nat_symmetric) simp_all
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
by (subst gbinomial_negated_upper) simp
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_factors_size_bound:
  assumes "n \<in> mset_factors m"
  shows "size n \<le> size m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size n \<le> size m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<in> mset_factors m

goal (1 subgoal):
 1. size n \<le> size m
[PROOF STEP]
unfolding mset_factors_def
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. n \<subseteq># m}

goal (1 subgoal):
 1. size n \<le> size m
[PROOF STEP]
by (simp add: size_mset_mono)


[STATEMENT]
lemma sum_in_Rats [intro]: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<rat>) \<Longrightarrow> sum f A \<in> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<rat>) \<Longrightarrow> sum f A \<in> \<rat>
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma stirling_sum_complex_of_real:
  "stirling_sum j m (complex_of_real x) = complex_of_real (stirling_sum j m x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stirling_sum j m (complex_of_real x) = complex_of_real (stirling_sum j m x)
[PROOF STEP]
by (simp add: stirling_sum_def pochhammer_of_real [symmetric] del: of_nat_Suc)


[STATEMENT]
lemma echelon_form_of_column_k_efficient[code]:
  "(echelon_form_of_column_k bezout) (A,i) k
    = (echelon_form_of_column_k_efficient bezout) (A,i) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_of_column_k bezout (A, i) k = echelon_form_of_column_k_efficient bezout (A, i) k
[PROOF STEP]
unfolding echelon_form_of_column_k_def echelon_form_of_column_k_efficient_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let (A, i) = (A, i) in if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (A, i) else if \<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) then (A, i + 1) else let n = LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n; interchange_A = interchange_rows A (mod_type_class.from_nat i) n in (bezout_iterate interchange_A (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) bezout, i + 1)) = (let (A, i) = (A, i); from_nat_k = mod_type_class.from_nat k; from_nat_i = mod_type_class.from_nat i; all_zero_below_i = \<forall>m>from_nat_i. A $ m $ from_nat_k = (0::'a) in if i = nrows A \<or> A $ from_nat_i $ from_nat_k = (0::'a) \<and> all_zero_below_i then (A, i) else if all_zero_below_i then (A, i + 1) else let n = LEAST n. A $ n $ from_nat_k \<noteq> (0::'a) \<and> from_nat_i \<le> n; interchange_A = interchange_rows A from_nat_i n in (bezout_iterate interchange_A (nrows A - 1) from_nat_i from_nat_k bezout, i + 1))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (A, i) of (A, i) \<Rightarrow> if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (A, i) else if \<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) then (A, i + 1) else (bezout_iterate (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) bezout, i + 1)) = (case (A, i) of (A, i) \<Rightarrow> if i = nrows A \<or> A $ mod_type_class.from_nat i $ mod_type_class.from_nat k = (0::'a) \<and> (\<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) then (A, i) else if \<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) then (A, i + 1) else (bezout_iterate (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) bezout, i + 1))
[PROOF STEP]
by force


[STATEMENT]
lemma lunionM_assoc: "lunionM (lunionM x y) z = lunionM x (lunionM y z)" for x y z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lunionM (lunionM x y) z = lunionM x (lunionM y z)
[PROOF STEP]
by(simp add: lunionM_def bind_assoc return_bind)


[STATEMENT]
theorem t3_1_4_2:
"((P1 \<turnstile> Q1) \<triangleleft> b \<triangleright> (P2 \<turnstile> Q2)) = ((P1 \<triangleleft> b \<triangleright> P2) \<turnstile> (Q1 \<triangleleft> b \<triangleright> Q2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((P1 \<turnstile> Q1) \<triangleleft> b \<triangleright>  (P2 \<turnstile> Q2)) = (P1 \<triangleleft> b \<triangleright>  P2 \<turnstile> Q1 \<triangleleft> b \<triangleright>  Q2)
[PROOF STEP]
by (auto simp: fun_eq_iff design_defs split: cond_splits)