[STATEMENT]
lemma inj_injf_max: "\<forall>x. \<exists>y \<in> E. x < y \<Longrightarrow> inj (\<lambda>n. injf_max n E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>y\<in>E. x < y \<Longrightarrow> inj (\<lambda>n. injf_max n E)
[PROOF STEP]
by (metis injf_max_order_preserving2 linorder_injI order_less_irrefl)


[STATEMENT]
lemma map_hf2term_eq: "map (\<lambda>x. hf2term (AHI x)) hfs = map (\<lambda>x. hf2term (AHI x)) hfs'
\<Longrightarrow> AHIS hfs' = AHIS hfs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>x. hf2term (AHI x)) hfs = map (\<lambda>x. hf2term (AHI x)) hfs' \<Longrightarrow> AHIS hfs' = AHIS hfs
[PROOF STEP]
apply(induction hfs hfs' rule: list_induct2', auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>map AHI ys = map AHI xs; hf2term (AHI x) = hf2term (AHI y); map (\<lambda>x. hf2term (AHI x)) xs = map (\<lambda>x. hf2term (AHI x)) ys\<rbrakk> \<Longrightarrow> AHI y = AHI x
[PROOF STEP]
using term2hf_hf2term
[PROOF STATE]
proof (prove)
using this:
term2hf (hf2term ?hf) = ?hf

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>map AHI ys = map AHI xs; hf2term (AHI x) = hf2term (AHI y); map (\<lambda>x. hf2term (AHI x)) xs = map (\<lambda>x. hf2term (AHI x)) ys\<rbrakk> \<Longrightarrow> AHI y = AHI x
[PROOF STEP]
by (metis)


[STATEMENT]
lemma indicator_compl: "indicator (- A) x = 1 - (indicator A x :: 'a::ring_1)"
  and indicator_diff: "indicator (A - B) x = indicator A x * (1 - indicator B x ::'a::ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator (- A) x = (1::'a) - indicator A x &&& indicator (A - B) x = indicator A x * ((1::'a) - indicator B x)
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_bool (x \<in> - A) = (1::'a) - of_bool (x \<in> A) &&& of_bool (x \<in> A - B) = of_bool (x \<in> A) * ((1::'a) - of_bool (x \<in> B))
[PROOF STEP]
by (auto simp: min_def max_def)


[STATEMENT]
lemma infs_snth: "infs A w \<longleftrightarrow> (\<forall> n. \<exists> k \<ge> n. w !! k \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infs A w = (\<forall>n. \<exists>k\<ge>n. w !! k \<in> A)
[PROOF STEP]
by (auto simp: alw_iff_sdrop ev_iff_sdrop HLD_iff intro: le_add1 dest: le_Suc_ex)


[STATEMENT]
lemma fpower_supdistl:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "mono f \<Longrightarrow> f \<circ> fstar g \<le> (\<Sqinter>i. f \<circ> fpower g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> f \<circ> fstar g \<le> (\<Sqinter>i. f \<circ> fpower g i)
[PROOF STEP]
by (simp add: Isotone_Transformers.fun_isol fstar_def mono_INF mono_def)


[STATEMENT]
lemma mult_le_cancel1_hmset[simp]: "k * m \<le> k * n \<longleftrightarrow> (0 < k \<longrightarrow> m \<le> n)" for k m n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k * m \<le> k * n) = (0 < k \<longrightarrow> m \<le> n)
[PROOF STEP]
by (simp add: linorder_not_less[symmetric], auto)


[STATEMENT]
lemma Rats_eq_int_div_int': "(\<rat> :: real set) = {of_int p / of_int q |p q. q > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<rat> = {real_of_int p / real_of_int q |p q. 0 < q}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> \<rat> \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
 2. \<And>x p q. 0 < q \<Longrightarrow> real_of_int p / real_of_int q \<in> \<rat>
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> \<rat> \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
 2. \<And>x p q. 0 < q \<Longrightarrow> real_of_int p / real_of_int q \<in> \<rat>
[PROOF STEP]
assume "x \<in> \<rat>"
[PROOF STATE]
proof (state)
this:
x \<in> \<rat>

goal (2 subgoals):
 1. \<And>x. x \<in> \<rat> \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
 2. \<And>x p q. 0 < q \<Longrightarrow> real_of_int p / real_of_int q \<in> \<rat>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<rat>
[PROOF STEP]
obtain p q where pq: "x = of_int p / of_int q" "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<rat>

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>x = real_of_int p / real_of_int q; q \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) Rats_eq_int_div_int) auto
[PROOF STATE]
proof (state)
this:
x = real_of_int p / real_of_int q
q \<noteq> 0

goal (2 subgoals):
 1. \<And>x. x \<in> \<rat> \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
 2. \<And>x p q. 0 < q \<Longrightarrow> real_of_int p / real_of_int q \<in> \<rat>
[PROOF STEP]
show "\<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
[PROOF STEP]
proof (cases "q > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < q \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
 2. \<not> 0 < q \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < q

goal (2 subgoals):
 1. 0 < q \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
 2. \<not> 0 < q \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
[PROOF STEP]
by (rule exI[of _ "-p"], rule exI[of _ "-q"]) (insert False pq, auto)
[PROOF STATE]
proof (state)
this:
\<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q

goal (1 subgoal):
 1. 0 < q \<Longrightarrow> \<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q
[PROOF STEP]
qed (insert pq, force)
[PROOF STATE]
proof (state)
this:
\<exists>p q. x = real_of_int p / real_of_int q \<and> 0 < q

goal (1 subgoal):
 1. \<And>x p q. 0 < q \<Longrightarrow> real_of_int p / real_of_int q \<in> \<rat>
[PROOF STEP]
qed auto


[STATEMENT]
lemma diffE:
  assumes "x \<in> src.carrier"
  obtains c1::"('a, 'e) chart"
    and c2::"('b, 'f) chart"
  where
    "c1 \<in> src.atlas" "c2 \<in> dest.atlas" "x \<in> domain c1" "f ` domain c1 \<subseteq> domain c2"
    "k-smooth_on (codomain c1) (apply_chart c2 \<circ> f \<circ> inv_chart c1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>c1 \<in> src.atlas; c2 \<in> dest.atlas; x \<in> domain c1; f ` domain c1 \<subseteq> domain c2; k-smooth_on (codomain c1) (apply_chart c2 \<circ> f \<circ> inv_chart c1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using exists_smooth_on assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> src.carrier \<Longrightarrow> \<exists>c1\<in>src.atlas. \<exists>c2\<in>dest.atlas. ?x \<in> domain c1 \<and> f ` domain c1 \<subseteq> domain c2 \<and> k-smooth_on (codomain c1) (apply_chart c2 \<circ> f \<circ> inv_chart c1)
x \<in> src.carrier

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>c1 \<in> src.atlas; c2 \<in> dest.atlas; x \<in> domain c1; f ` domain c1 \<subseteq> domain c2; k-smooth_on (codomain c1) (apply_chart c2 \<circ> f \<circ> inv_chart c1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force


[STATEMENT]
lemma nat_mirror_less_imp_less: "
  nat_mirror b l r < nat_mirror a l r \<Longrightarrow> a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_mirror b l r < nat_mirror a l r \<Longrightarrow> a < b
[PROOF STEP]
unfolding nat_mirror_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l + r - b < l + r - a \<Longrightarrow> a < b
[PROOF STEP]
by simp


[STATEMENT]
lemma bind_mono_pfun[partial_function_mono]:
  fixes C :: "'a \<Rightarrow> ('b \<Rightarrow> 'c nres) \<Rightarrow> ('d nres)"
  shows
  "\<lbrakk> monotone (fun_ord (\<le>)) (\<le>) B;
    \<And>y. monotone (fun_ord (\<le>)) (\<le>) (\<lambda>f. C y f) \<rbrakk> \<Longrightarrow>
     monotone (fun_ord (\<le>)) (\<le>) (\<lambda>f. bind (B f) (\<lambda>y. C y f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>monotone nrec.le_fun (\<le>) B; \<And>y. monotone nrec.le_fun (\<le>) (C y)\<rbrakk> \<Longrightarrow> monotone nrec.le_fun (\<le>) (\<lambda>f. B f \<bind> (\<lambda>y. C y f))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>monotone nrec.le_fun (\<le>) B; \<And>y. monotone nrec.le_fun (\<le>) (C y); nrec.le_fun x y\<rbrakk> \<Longrightarrow> B x \<bind> (\<lambda>y. C y x) \<le> B y \<bind> (\<lambda>ya. C ya y)
[PROOF STEP]
apply (rule Refine_Basic.bind_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>monotone nrec.le_fun (\<le>) B; \<And>y. monotone nrec.le_fun (\<le>) (C y); nrec.le_fun x y\<rbrakk> \<Longrightarrow> B x \<le> B y
 2. \<And>x y xa. \<lbrakk>monotone nrec.le_fun (\<le>) B; \<And>y. monotone nrec.le_fun (\<le>) (C y); nrec.le_fun x y; RETURN xa \<le> B x\<rbrakk> \<Longrightarrow> C xa x \<le> C xa y
[PROOF STEP]
apply (blast dest: monotoneD)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma delete_edges_nodes: "nodesL (delete_edges G es) = nodesL G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodesL (FiniteListGraph.delete_edges G es) = nodesL G
[PROOF STEP]
by (induction es arbitrary: G) (auto simp: delete_edge_def)


[STATEMENT]
lemma quant_lessI [si_transfer]:
  "\<lbrakk>x\<rbrakk>\<^sub>Q < \<lbrakk>y\<rbrakk>\<^sub>Q \<Longrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x\<rbrakk>\<^sub>Q < \<lbrakk>y\<rbrakk>\<^sub>Q \<Longrightarrow> x < y
[PROOF STEP]
by (simp add: quant_less_iff_magn_less)


[STATEMENT]
lemma mat_vec_mult_index:
  assumes wf: "mat nr nc m"
  and wfV: "vec nc v"
  and i: "i < nr"
  shows "matT_vec_multI ze pl ti (transpose nr m) v ! i = scalar_prodI ze pl ti (row m i) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matT_vec_multI ze pl ti (Matrix_Legacy.transpose nr m) v ! i = scalar_prodI ze pl ti (row m i) v
[PROOF STEP]
by (simp only:matT_vec_mult_to_scalar[OF transpose[OF wf] wfV i],
  simp only: col_transpose_is_row[OF wf i])


[STATEMENT]
lemma contour_integrable_inversediff:
  assumes g: "valid_path g"
      and notin: "z \<notin> path_image g"
    shows "(\<lambda>w. 1 / (w-z)) contour_integrable_on g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. 1 / (w - z)) contour_integrable_on g
[PROOF STEP]
proof (rule contour_integrable_holomorphic_simple)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<lambda>w. 1 / (w - z)) holomorphic_on ?S
 2. open ?S
 3. valid_path g
 4. path_image g \<subseteq> ?S
[PROOF STEP]
show "(\<lambda>w. 1 / (w-z)) holomorphic_on UNIV - {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}
[PROOF STEP]
by (auto simp: holomorphic_on_open open_delete intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}

goal (3 subgoals):
 1. open (UNIV - {z})
 2. valid_path g
 3. path_image g \<subseteq> UNIV - {z}
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma A_prod_relprime: "coprime (prod id A) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (prod id A) (int p)
[PROOF STEP]
by (auto intro: prod_coprime_left all_A_relprime)


[STATEMENT]
lemma eval_eval_max: "\<lbrakk>s1 -e1\<succ>v1-    n1   \<rightarrow> t1 ; s2 -e2\<succ>v2-       n2\<rightarrow> t2\<rbrakk> \<Longrightarrow>
                       s1 -e1\<succ>v1-max n1 n2\<rightarrow> t1 \<and> s2 -e2\<succ>v2-max n1 n2\<rightarrow> t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s1 -e1\<succ>v1-n1\<rightarrow> t1; s2 -e2\<succ>v2-n2\<rightarrow> t2\<rbrakk> \<Longrightarrow> s1 -e1\<succ>v1-max n1 n2\<rightarrow> t1 \<and> s2 -e2\<succ>v2-max n1 n2\<rightarrow> t2
[PROOF STEP]
by (fast intro: eval_mono max.cobounded1 max.cobounded2)


[STATEMENT]
lemma SA_Units_Qp_funs_inv:
  assumes "f \<in> (Units (SA n))"
  shows "inv\<^bsub>SA n\<^esub> f = inv\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>SA n\<^esub> f = inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f
[PROOF STEP]
using assms SA_Units_Qp_funs_Units
[PROOF STATE]
proof (prove)
using this:
f \<in> Units (SA n)
?f \<in> Units (SA ?n) \<Longrightarrow> ?f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p)

goal (1 subgoal):
 1. inv\<^bsub>SA n\<^esub> f = inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f
[PROOF STEP]
by (metis (no_types, opaque_lifting) Qp_funs_is_cring Qp_funs_is_monoid SA_Units_memE(1)
      SA_is_monoid SA_one SA_times cring.invI(1) monoid.Units_closed monoid.Units_inv_Units)


[STATEMENT]
lemma Lcm_Gcd: "Lcm A = Gcd {b. \<forall>a\<in>A. a dvd b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm A = Gcd {b. \<forall>a\<in>A. a dvd b}
[PROOF STEP]
by (rule associated_eqI) (auto intro: Gcd_dvd dvd_Lcm Gcd_greatest Lcm_least)


[STATEMENT]
lemma common_boundary_sudivision_commutative:
  "(common_boundary_sudivision_exists one_chain1 one_chain2) = (common_boundary_sudivision_exists one_chain2 one_chain1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. common_boundary_sudivision_exists one_chain1 one_chain2 = common_boundary_sudivision_exists one_chain2 one_chain1
[PROOF STEP]
apply (simp add: common_boundary_sudivision_exists_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>subdiv. chain_subdiv_chain one_chain1 subdiv \<and> chain_subdiv_chain one_chain2 subdiv \<and> (\<forall>x\<in>subdiv. case x of (k, \<gamma>) \<Rightarrow> valid_path \<gamma>) \<and> boundary_chain subdiv) = (\<exists>subdiv. chain_subdiv_chain one_chain2 subdiv \<and> chain_subdiv_chain one_chain1 subdiv \<and> (\<forall>x\<in>subdiv. case x of (k, \<gamma>) \<Rightarrow> valid_path \<gamma>) \<and> boundary_chain subdiv)
[PROOF STEP]
by blast


[STATEMENT]
lemma to_bl_1:
  "to_bl (1::'a::len word) = replicate (LENGTH('a) - 1) False @ [True]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl 1 = replicate (LENGTH('a) - 1) False @ [True]
[PROOF STEP]
by (rule nth_equalityI) (auto simp add: to_bl_unfold nth_append rev_nth bit_1_iff not_less not_le)


[STATEMENT]
theorem hoare_partial_complete:
  "\<Turnstile>\<^sub>p {P} S {Q} \<Longrightarrow> well_com S \<Longrightarrow> is_quantum_predicate P \<Longrightarrow> is_quantum_predicate Q \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
assume p: "\<Turnstile>\<^sub>p {P} S {Q}" and wc: "well_com S" and qpP: "is_quantum_predicate P" and qpQ: "is_quantum_predicate Q"
[PROOF STATE]
proof (state)
this:
\<Turnstile>\<^sub>p {P} S {Q}
well_com S
is_quantum_predicate P
is_quantum_predicate Q

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Turnstile>\<^sub>p {P} S {Q}
well_com S
is_quantum_predicate P
is_quantum_predicate Q
[PROOF STEP]
have dQ: "Q \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
using this:
\<Turnstile>\<^sub>p {P} S {Q}
well_com S
is_quantum_predicate P
is_quantum_predicate Q

goal (1 subgoal):
 1. Q \<in> carrier_mat d d
[PROOF STEP]
using is_quantum_predicate_def
[PROOF STATE]
proof (prove)
using this:
\<Turnstile>\<^sub>p {P} S {Q}
well_com S
is_quantum_predicate P
is_quantum_predicate Q
is_quantum_predicate ?P = (?P \<in> carrier_mat d d \<and> positive ?P \<and> ?P \<le>\<^sub>L 1\<^sub>m d)

goal (1 subgoal):
 1. Q \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Q \<in> carrier_mat d d

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
have qpWP: "is_quantum_predicate (wlp S Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_quantum_predicate (wlp S Q)
[PROOF STEP]
using wlp_close wc qpQ
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_com ?S; is_quantum_predicate ?P\<rbrakk> \<Longrightarrow> is_quantum_predicate (wlp ?S ?P)
well_com S
is_quantum_predicate Q

goal (1 subgoal):
 1. is_quantum_predicate (wlp S Q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_quantum_predicate (wlp S Q)

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_quantum_predicate (wlp S Q)
[PROOF STEP]
have dWP: "wlp S Q \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
using this:
is_quantum_predicate (wlp S Q)

goal (1 subgoal):
 1. wlp S Q \<in> carrier_mat d d
[PROOF STEP]
using is_quantum_predicate_def
[PROOF STATE]
proof (prove)
using this:
is_quantum_predicate (wlp S Q)
is_quantum_predicate ?P = (?P \<in> carrier_mat d d \<and> positive ?P \<and> ?P \<le>\<^sub>L 1\<^sub>m d)

goal (1 subgoal):
 1. wlp S Q \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wlp S Q \<in> carrier_mat d d

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
have eq: "trace (wlp S Q * \<rho>) = trace (Q * (denote S \<rho>)) + trace \<rho> - trace (denote S \<rho>)" if dsr: "\<rho> \<in> density_states" for \<rho>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (wlp S Q * \<rho>) = trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)
[PROOF STEP]
using wlp_soundness wc qpQ dsr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_com ?S; is_quantum_predicate ?P\<rbrakk> \<Longrightarrow> \<forall>\<rho>\<in>density_states. trace (wlp ?S ?P * \<rho>) = trace (?P * denote ?S \<rho>) + trace \<rho> - trace (denote ?S \<rho>)
well_com S
is_quantum_predicate Q
\<rho> \<in> density_states

goal (1 subgoal):
 1. trace (wlp S Q * \<rho>) = trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?\<rho> \<in> density_states \<Longrightarrow> trace (wlp S Q * ?\<rho>) = trace (Q * denote S ?\<rho>) + trace ?\<rho> - trace (denote S ?\<rho>)

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?\<rho> \<in> density_states \<Longrightarrow> trace (wlp S Q * ?\<rho>) = trace (Q * denote S ?\<rho>) + trace ?\<rho> - trace (denote S ?\<rho>)
[PROOF STEP]
have "\<Turnstile>\<^sub>p {wlp S Q} S {Q}"
[PROOF STATE]
proof (prove)
using this:
?\<rho> \<in> density_states \<Longrightarrow> trace (wlp S Q * ?\<rho>) = trace (Q * denote S ?\<rho>) + trace ?\<rho> - trace (denote S ?\<rho>)

goal (1 subgoal):
 1. \<Turnstile>\<^sub>p {wlp S Q} S {Q}
[PROOF STEP]
unfolding hoare_partial_correct_def
[PROOF STATE]
proof (prove)
using this:
?\<rho> \<in> density_states \<Longrightarrow> trace (wlp S Q * ?\<rho>) = trace (Q * denote S ?\<rho>) + trace ?\<rho> - trace (denote S ?\<rho>)

goal (1 subgoal):
 1. \<forall>\<rho>\<in>density_states. trace (wlp S Q * \<rho>) \<le> trace (Q * denote S \<rho>) + (trace \<rho> - trace (denote S \<rho>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Turnstile>\<^sub>p {wlp S Q} S {Q}

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<Turnstile>\<^sub>p {wlp S Q} S {Q}

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
fix \<rho>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
assume dsr: "\<rho> \<in> density_states"
[PROOF STATE]
proof (state)
this:
\<rho> \<in> density_states

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<rho> \<in> density_states
[PROOF STEP]
have "trace (P * \<rho>) \<le> trace (Q * (denote S \<rho>)) + trace \<rho> - trace (denote S \<rho>)"
[PROOF STATE]
proof (prove)
using this:
\<rho> \<in> density_states

goal (1 subgoal):
 1. trace (P * \<rho>) \<le> trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)
[PROOF STEP]
using hoare_partial_correct_def p
[PROOF STATE]
proof (prove)
using this:
\<rho> \<in> density_states
(\<Turnstile>\<^sub>p {?P} ?S {?Q}) = (\<forall>\<rho>\<in>density_states. trace (?P * \<rho>) \<le> trace (?Q * denote ?S \<rho>) + (trace \<rho> - trace (denote ?S \<rho>)))
\<Turnstile>\<^sub>p {P} S {Q}

goal (1 subgoal):
 1. trace (P * \<rho>) \<le> trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)
[PROOF STEP]
by (auto simp: less_eq_complex_def)
[PROOF STATE]
proof (state)
this:
trace (P * \<rho>) \<le> trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
trace (P * \<rho>) \<le> trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)
[PROOF STEP]
have "trace (P * \<rho>) \<le> trace (wlp S Q * \<rho>)"
[PROOF STATE]
proof (prove)
using this:
trace (P * \<rho>) \<le> trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)

goal (1 subgoal):
 1. trace (P * \<rho>) \<le> trace (wlp S Q * \<rho>)
[PROOF STEP]
using eq[symmetric] dsr
[PROOF STATE]
proof (prove)
using this:
trace (P * \<rho>) \<le> trace (Q * denote S \<rho>) + trace \<rho> - trace (denote S \<rho>)
?\<rho> \<in> density_states \<Longrightarrow> trace (Q * denote S ?\<rho>) + trace ?\<rho> - trace (denote S ?\<rho>) = trace (wlp S Q * ?\<rho>)
\<rho> \<in> density_states

goal (1 subgoal):
 1. trace (P * \<rho>) \<le> trace (wlp S Q * \<rho>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (P * \<rho>) \<le> trace (wlp S Q * \<rho>)

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?\<rho>2 \<in> density_states \<Longrightarrow> trace (P * ?\<rho>2) \<le> trace (wlp S Q * ?\<rho>2)

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?\<rho>2 \<in> density_states \<Longrightarrow> trace (P * ?\<rho>2) \<le> trace (wlp S Q * ?\<rho>2)
[PROOF STEP]
have le: "P \<le>\<^sub>L wlp S Q"
[PROOF STATE]
proof (prove)
using this:
?\<rho>2 \<in> density_states \<Longrightarrow> trace (P * ?\<rho>2) \<le> trace (wlp S Q * ?\<rho>2)

goal (1 subgoal):
 1. P \<le>\<^sub>L wlp S Q
[PROOF STEP]
using lowner_le_trace density_states_def qpP qpWP is_quantum_predicate_def
[PROOF STATE]
proof (prove)
using this:
?\<rho>2 \<in> density_states \<Longrightarrow> trace (P * ?\<rho>2) \<le> trace (wlp S Q * ?\<rho>2)
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n\<rbrakk> \<Longrightarrow> (?A \<le>\<^sub>L ?B) = (\<forall>\<rho>\<in>carrier_mat ?n ?n. partial_density_operator \<rho> \<longrightarrow> trace (?A * \<rho>) \<le> trace (?B * \<rho>))
density_states = {\<rho> \<in> carrier_mat d d. partial_density_operator \<rho>}
is_quantum_predicate P
is_quantum_predicate (wlp S Q)
is_quantum_predicate ?P = (?P \<in> carrier_mat d d \<and> positive ?P \<and> ?P \<le>\<^sub>L 1\<^sub>m d)

goal (1 subgoal):
 1. P \<le>\<^sub>L wlp S Q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<le>\<^sub>L wlp S Q

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P \<le>\<^sub>L wlp S Q

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
have wlp: "\<turnstile>\<^sub>p {wlp S Q} S {Q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile>\<^sub>p {wlp S Q} S {Q}
[PROOF STEP]
using wlp_complete wc qpQ
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_com ?S; is_quantum_predicate ?P\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {wlp ?S ?P} ?S {?P}
well_com S
is_quantum_predicate Q

goal (1 subgoal):
 1. \<turnstile>\<^sub>p {wlp S Q} S {Q}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>p {wlp S Q} S {Q}

goal (1 subgoal):
 1. \<lbrakk>\<Turnstile>\<^sub>p {P} S {Q}; well_com S; is_quantum_predicate P; is_quantum_predicate Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
P \<le>\<^sub>L wlp S Q
\<turnstile>\<^sub>p {wlp S Q} S {Q}
[PROOF STEP]
show "\<turnstile>\<^sub>p {P} S {Q}"
[PROOF STATE]
proof (prove)
using this:
P \<le>\<^sub>L wlp S Q
\<turnstile>\<^sub>p {wlp S Q} S {Q}

goal (1 subgoal):
 1. \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
using hoare_partial.intros(6)[OF qpP qpQ qpWP qpQ] lowner_le_refl[OF dQ]
[PROOF STATE]
proof (prove)
using this:
P \<le>\<^sub>L wlp S Q
\<turnstile>\<^sub>p {wlp S Q} S {Q}
\<lbrakk>P \<le>\<^sub>L wlp S Q; \<turnstile>\<^sub>p {wlp S Q} ?S {Q}; Q \<le>\<^sub>L Q\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>p {P} ?S {Q}
Q \<le>\<^sub>L Q

goal (1 subgoal):
 1. \<turnstile>\<^sub>p {P} S {Q}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>p {P} S {Q}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma at_top_within_at_top_unbounded_rightI:
  fixes a::"'a::linorder"
  assumes "{a..} \<subseteq> s"
  shows "at_top_within s = at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_top_within s = at_top
[PROOF STEP]
unfolding at_top_within_def at_top_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF k\<in>s. principal ({k..} \<inter> s)) = (INF k. principal {k..})
[PROOF STEP]
apply (auto intro!: INF_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i \<in> s \<Longrightarrow> \<exists>j\<ge>i. {j..} \<subseteq> s
 2. \<And>j. \<exists>i\<in>s. {i..} \<inter> s \<subseteq> {j..}
[PROOF STEP]
apply (meson Ici_subset_Ioi_iff Ioi_le_Ico assms dual_order.refl dual_order.trans leI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. \<exists>i\<in>s. {i..} \<inter> s \<subseteq> {j..}
[PROOF STEP]
by (metis assms atLeast_iff atLeast_subset_iff inf.cobounded1 linear subsetD)


[STATEMENT]
lemma multiplicity_prime_cong_1_mod_4:
  fixes p :: gauss_int
  assumes "prime_elem p" "ReZ p > 0" "ImZ p > 0" "ImZ p \<noteq> ReZ p"
  shows "multiplicity (gauss_int_norm p) (gauss_int_norm z) =
           multiplicity p z + multiplicity (gauss_cnj p) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
proof (cases "z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
case [simp]: False
[PROOF STATE]
proof (state)
this:
z \<noteq> 0

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
have "multiplicity (gauss_int_norm p) (gauss_int_norm z) =
          multiplicity p (of_nat (gauss_int_norm z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p (of_nat (gauss_int_norm z))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime_elem p
0 < ReZ p
0 < ImZ p
ImZ p \<noteq> ReZ p

goal (1 subgoal):
 1. multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p (of_nat (gauss_int_norm z))
[PROOF STEP]
by (subst multiplicity_prime_cong_1_mod_4_aux) auto
[PROOF STATE]
proof (state)
this:
multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p (of_nat (gauss_int_norm z))

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p (of_nat (gauss_int_norm z))

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
have "\<dots> = multiplicity p (z * gauss_cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (of_nat (gauss_int_norm z)) = multiplicity p (z * gauss_cnj z)
[PROOF STEP]
by (simp add: self_mult_gauss_cnj)
[PROOF STATE]
proof (state)
this:
multiplicity p (of_nat (gauss_int_norm z)) = multiplicity p (z * gauss_cnj z)

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p (of_nat (gauss_int_norm z)) = multiplicity p (z * gauss_cnj z)

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
have "\<dots> = multiplicity p z + multiplicity p (gauss_cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (z * gauss_cnj z) = multiplicity p z + multiplicity p (gauss_cnj z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime_elem p
0 < ReZ p
0 < ImZ p
ImZ p \<noteq> ReZ p

goal (1 subgoal):
 1. multiplicity p (z * gauss_cnj z) = multiplicity p z + multiplicity p (gauss_cnj z)
[PROOF STEP]
by (subst prime_elem_multiplicity_mult_distrib) auto
[PROOF STATE]
proof (state)
this:
multiplicity p (z * gauss_cnj z) = multiplicity p z + multiplicity p (gauss_cnj z)

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p (z * gauss_cnj z) = multiplicity p z + multiplicity p (gauss_cnj z)

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
have "multiplicity p (gauss_cnj z) = multiplicity (gauss_cnj p) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (gauss_cnj z) = multiplicity (gauss_cnj p) z
[PROOF STEP]
by (subst multiplicity_gauss_cnj [symmetric]) auto
[PROOF STATE]
proof (state)
this:
multiplicity p (gauss_cnj z) = multiplicity (gauss_cnj p) z

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
 2. z \<noteq> 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z

goal (1 subgoal):
 1. multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z

goal (1 subgoal):
 1. z = 0 \<Longrightarrow> multiplicity (gauss_int_norm p) (gauss_int_norm z) = multiplicity p z + multiplicity (gauss_cnj p) z
[PROOF STEP]
qed auto


[STATEMENT]
lemma td_nat_int: "type_definition int nat (Collect ((\<le>) 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. type_definition int nat (Collect ((\<le>) 0))
[PROOF STEP]
unfolding type_definition_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. int x \<in> Collect ((\<le>) 0)) \<and> (\<forall>x. nat (int x) = x) \<and> (\<forall>y. y \<in> Collect ((\<le>) 0) \<longrightarrow> int (nat y) = y)
[PROOF STEP]
by auto


[STATEMENT]
lemma all_edges_between_Union1:
  "all_edges_between (Union \<X>) Y = (\<Union>X\<in>\<X>. all_edges_between X Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between (\<Union> \<X>) Y = (\<Union>X\<in>\<X>. all_edges_between X Y)
[PROOF STEP]
by (auto simp: all_edges_between_def)


[STATEMENT]
lemma star_n_less: "star_n X < star_n Y = eventually (\<lambda>n. X n < Y n) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X < star_n Y) = (\<forall>\<^sub>F n in \<U>. X n < Y n)
[PROOF STEP]
by (simp only: star_less_def starP2_star_n)


[STATEMENT]
lemma subdivide_count: "L * abs (t1 - t0) / Suc subdivide_count < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L * \<bar>t1 - t0\<bar> / real (Suc subdivide_count) < 1
[PROOF STEP]
unfolding subdivide_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L * \<bar>t1 - t0\<bar> / real (Suc (SOME n. L * \<bar>t1 - t0\<bar> / real (Suc n) < 1)) < 1
[PROOF STEP]
using subdivide_count_ex
[PROOF STATE]
proof (prove)
using this:
\<exists>n. L * \<bar>t1 - t0\<bar> / real (Suc n) < 1

goal (1 subgoal):
 1. L * \<bar>t1 - t0\<bar> / real (Suc (SOME n. L * \<bar>t1 - t0\<bar> / real (Suc n) < 1)) < 1
[PROOF STEP]
by (rule someI_ex)


[STATEMENT]
lemma has_integral_vec1_D_cbox:
  fixes f :: "real^1 \<Rightarrow> 'a::real_normed_vector"
  assumes "((f \<circ> vec) has_integral y) {a$1..b$1}"
  shows "(f has_integral y) (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) (cbox a b)
[PROOF STEP]
by (metis (mono_tags, lifting) assms comp_apply has_integral_eq has_integral_vec1_nth_cbox vector_one_nth)


[STATEMENT]
lemma vifunion_VPow: "(\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. VPow (f i)) \<subseteq>\<^sub>\<circ> VPow (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. VPow (f a)) `\<^sub>\<circ> I) \<subseteq>\<^sub>\<circ> VPow (\<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I))
[PROOF STEP]
by force


[STATEMENT]
lemma butlast_conv_take: "butlast xs = take (length xs - 1) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast xs = take (length xs - 1) xs
[PROOF STEP]
by (induction xs rule: induct_list012) simp_all


[STATEMENT]
lemma contractible_space_subset_singleton:
   "topspace X \<subseteq> {a} \<Longrightarrow> contractible_space X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace X \<subseteq> {a} \<Longrightarrow> contractible_space X
[PROOF STEP]
by (meson contractible_space_empty contractible_space_singleton subset_singletonD)


[STATEMENT]
lemma union_assoc: "(M + N) + K = M + (N + (K::'a multiset))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M + N + K = M + (N + K)
[PROOF STEP]
by (fact add.assoc)


[STATEMENT]
lemma is_right_inverseE[elim]:
  assumes "is_right_inverse \<CC> g f"
  obtains a b where "g : b \<mapsto>\<^bsub>\<CC>\<^esub> a"
    and "f : a \<mapsto>\<^bsub>\<CC>\<^esub> b"
    and "f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g = \<CC>\<lparr>CId\<rparr>\<lparr>b\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b a. \<lbrakk>g : b \<mapsto>\<^bsub>\<CC>\<^esub> a; f : a \<mapsto>\<^bsub>\<CC>\<^esub> b; f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g = \<CC>\<lparr>CId\<rparr>\<lparr>b\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_right_inverse \<CC> g f

goal (1 subgoal):
 1. (\<And>b a. \<lbrakk>g : b \<mapsto>\<^bsub>\<CC>\<^esub> a; f : a \<mapsto>\<^bsub>\<CC>\<^esub> b; f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g = \<CC>\<lparr>CId\<rparr>\<lparr>b\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma diagonalize_2x2_JNF_works:
  assumes A: "A \<in> carrier_mat 2 2"
  and PDQ: "(P,D,Q) = diagonalize_2x2_JNF A"
  shows "D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P\<in>carrier_mat 2 2
  \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
let ?A = "(Mod_Type_Connect.to_hma\<^sub>m A::'a^2^2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have A[transfer_rule]: "Mod_Type_Connect.HMA_M A ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mod_Type_Connect.HMA_M A (Mod_Type_Connect.to_hma\<^sub>m A)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat 2 2

goal (1 subgoal):
 1. Mod_Type_Connect.HMA_M A (Mod_Type_Connect.to_hma\<^sub>m A)
[PROOF STEP]
unfolding Mod_Type_Connect.HMA_M_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat 2 2

goal (1 subgoal):
 1. A = Mod_Type_Connect.from_hma\<^sub>m (Mod_Type_Connect.to_hma\<^sub>m A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mod_Type_Connect.HMA_M A (Mod_Type_Connect.to_hma\<^sub>m A)

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
obtain P_HMA D_HMA Q_HMA where PDQ_HMA: "(P_HMA,D_HMA,Q_HMA) = diagonalize_2x2 ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P_HMA D_HMA Q_HMA. (P_HMA, D_HMA, Q_HMA) = diagonalize_2x2 (Mod_Type_Connect.to_hma\<^sub>m A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis prod_cases3)
[PROOF STATE]
proof (state)
this:
(P_HMA, D_HMA, Q_HMA) = diagonalize_2x2 (Mod_Type_Connect.to_hma\<^sub>m A)

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
(*  have "HMA_M3 (diagonalize_2x2_JNF A) (diagonalize_2x2 ?A)"
    using HMA_diagonalize_2x2 A rel_funE by fastforce*)
[PROOF STATE]
proof (state)
this:
(P_HMA, D_HMA, Q_HMA) = diagonalize_2x2 (Mod_Type_Connect.to_hma\<^sub>m A)

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have P: "P = Mod_Type_Connect.from_hma\<^sub>m P_HMA" and Q: "Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA"
    and D: "D = Mod_Type_Connect.from_hma\<^sub>m D_HMA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = Mod_Type_Connect.from_hma\<^sub>m P_HMA &&& Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA &&& D = Mod_Type_Connect.from_hma\<^sub>m D_HMA
[PROOF STEP]
using PDQ_HMA PDQ
[PROOF STATE]
proof (prove)
using this:
(P_HMA, D_HMA, Q_HMA) = diagonalize_2x2 (Mod_Type_Connect.to_hma\<^sub>m A)
(P, D, Q) = diagonalize_2x2_JNF A

goal (1 subgoal):
 1. P = Mod_Type_Connect.from_hma\<^sub>m P_HMA &&& Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA &&& D = Mod_Type_Connect.from_hma\<^sub>m D_HMA
[PROOF STEP]
unfolding diagonalize_2x2_JNF_def
[PROOF STATE]
proof (prove)
using this:
(P_HMA, D_HMA, Q_HMA) = diagonalize_2x2 (Mod_Type_Connect.to_hma\<^sub>m A)
(P, D, Q) = (let (P, D, Q) = diagonalize_2x2 (Mod_Type_Connect.to_hma\<^sub>m A) in (Mod_Type_Connect.from_hma\<^sub>m P, Mod_Type_Connect.from_hma\<^sub>m D, Mod_Type_Connect.from_hma\<^sub>m Q))

goal (1 subgoal):
 1. P = Mod_Type_Connect.from_hma\<^sub>m P_HMA &&& Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA &&& D = Mod_Type_Connect.from_hma\<^sub>m D_HMA
[PROOF STEP]
by (metis prod.simps(1) split_conv)+
[PROOF STATE]
proof (state)
this:
P = Mod_Type_Connect.from_hma\<^sub>m P_HMA
Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA
D = Mod_Type_Connect.from_hma\<^sub>m D_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have [transfer_rule]: "Mod_Type_Connect.HMA_M P P_HMA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mod_Type_Connect.HMA_M P P_HMA
[PROOF STEP]
unfolding Mod_Type_Connect.HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = Mod_Type_Connect.from_hma\<^sub>m P_HMA
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
P = Mod_Type_Connect.from_hma\<^sub>m P_HMA

goal (1 subgoal):
 1. P = Mod_Type_Connect.from_hma\<^sub>m P_HMA
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mod_Type_Connect.HMA_M P P_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have [transfer_rule]: "Mod_Type_Connect.HMA_M Q Q_HMA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mod_Type_Connect.HMA_M Q Q_HMA
[PROOF STEP]
unfolding Mod_Type_Connect.HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA
[PROOF STEP]
using Q
[PROOF STATE]
proof (prove)
using this:
Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA

goal (1 subgoal):
 1. Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mod_Type_Connect.HMA_M Q Q_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have [transfer_rule]: "Mod_Type_Connect.HMA_M D D_HMA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mod_Type_Connect.HMA_M D D_HMA
[PROOF STEP]
unfolding Mod_Type_Connect.HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D = Mod_Type_Connect.from_hma\<^sub>m D_HMA
[PROOF STEP]
using D
[PROOF STATE]
proof (prove)
using this:
D = Mod_Type_Connect.from_hma\<^sub>m D_HMA

goal (1 subgoal):
 1. D = Mod_Type_Connect.from_hma\<^sub>m D_HMA
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mod_Type_Connect.HMA_M D D_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have r: "D_HMA = P_HMA ** ?A ** Q_HMA \<and> invertible P_HMA \<and> invertible Q_HMA \<and> isDiagonal D_HMA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D_HMA = P_HMA ** Mod_Type_Connect.to_hma\<^sub>m A ** Q_HMA \<and> invertible P_HMA \<and> invertible Q_HMA \<and> isDiagonal D_HMA
[PROOF STEP]
by (rule diagonalize_2x2_works[OF PDQ_HMA])
[PROOF STATE]
proof (state)
this:
D_HMA = P_HMA ** Mod_Type_Connect.to_hma\<^sub>m A ** Q_HMA \<and> invertible P_HMA \<and> invertible Q_HMA \<and> isDiagonal D_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
have "D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
D_HMA = P_HMA ** Mod_Type_Connect.to_hma\<^sub>m A ** Q_HMA \<and> invertible P_HMA \<and> invertible Q_HMA \<and> isDiagonal D_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D
[PROOF STEP]
by (transfer, rule)
[PROOF STATE]
proof (state)
this:
D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
using P Q D
[PROOF STATE]
proof (prove)
using this:
D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D
P = Mod_Type_Connect.from_hma\<^sub>m P_HMA
Q = Mod_Type_Connect.from_hma\<^sub>m Q_HMA
D = Mod_Type_Connect.from_hma\<^sub>m D_HMA

goal (1 subgoal):
 1. D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> isDiagonal_mat D \<and> P \<in> carrier_mat 2 2 \<and> Q \<in> carrier_mat 2 2 \<and> D \<in> carrier_mat 2 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_Ima''m: "(\<lambda>n. $(I^{m}a'')^{m}_n) \<longlonglongrightarrow> 1 / ($d^{m})^2" if "m \<noteq> 0" "i > 0" for m::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ann_due_incr' m m \<longlonglongrightarrow> 1 / ($d^{m})\<^sup>2
[PROOF STEP]
unfolding perp_due_incr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ann_due_incr' m m \<longlonglongrightarrow> 1 / ($d^{m})\<^sup>2
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
0 < i

goal (1 subgoal):
 1. ann_due_incr' m m \<longlonglongrightarrow> 1 / ($d^{m})\<^sup>2
[PROOF STEP]
apply (subst Ila''m_Ilam, simp, subst mult.commute, subst i_v_powr, subst powr_minus_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i\<rbrakk> \<Longrightarrow> (\<lambda>n. $(I^{m}a)^{m}_n * (1 / $v .^ (1 / real m))) \<longlonglongrightarrow> 1 / ($d^{m})\<^sup>2
[PROOF STEP]
apply (subgoal_tac "1/($d^{m})^2 = (1/($i^{m}*$d^{m}))*(1/$v.^(1/m))", erule ssubst)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i\<rbrakk> \<Longrightarrow> (\<lambda>n. $(I^{m}a)^{m}_n * (1 / $v .^ (1 / real m))) \<longlonglongrightarrow> 1 / ($i^{m} * $d^{m}) * (1 / $v .^ (1 / real m))
 2. \<lbrakk>m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i\<rbrakk> \<Longrightarrow> 1 / ($d^{m})\<^sup>2 = 1 / ($i^{m} * $d^{m}) * (1 / $v .^ (1 / real m))
[PROOF STEP]
apply (intro tendsto_intros, simp add: lim_Imam)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i; m \<noteq> 0; 0 < i\<rbrakk> \<Longrightarrow> 1 / ($d^{m})\<^sup>2 = 1 / ($i^{m} * $d^{m}) * (1 / $v .^ (1 / real m))
[PROOF STEP]
by (simp add: d_nom_i_nom_v power2_eq_square)


[STATEMENT]
lemma Affine_inl: "Affine (fst X, pdevs_of_list (inl (snd X))) = Affine X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Affine (fst X, pdevs_of_list (inl (snd X))) = Affine X
[PROOF STEP]
by (auto simp: Affine_def valuate_def aform_val_def
    elim: pdevs_val_pdevs_of_list_inlE[of _ _ "snd X"] pdevs_val_pdevs_of_list_inl2E[of _ "snd X"])


[STATEMENT]
lemma [code_abbrev]:
  "nat_of_integer (numeral k) = nat_of_num k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_integer (numeral k) = nat_of_num k
[PROOF STEP]
by transfer (simp add: nat_of_num_numeral)


[STATEMENT]
lemma adjugate_eq: "adjugate = to_vec \<circ> Square_Matrix.adjugate \<circ> from_vec"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjugate = to_vec \<circ> Square_Matrix.adjugate \<circ> from_vec
[PROOF STEP]
apply (simp add: adjugate_def Square_Matrix.adjugate_def fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. Finite_Cartesian_Product.transpose (cofactorM x) = to_vec (Square_Matrix.transpose (Square_Matrix.cofactor (from_vec x)))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Finite_Cartesian_Product.transpose (cofactorM x) = to_vec (Square_Matrix.transpose (Square_Matrix.cofactor (from_vec x)))
[PROOF STEP]
apply transfer'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Finite_Cartesian_Product.transpose (cofactorM x) = (\<chi>i j. Square_Matrix.det (minor (from_vec x) j i))
[PROOF STEP]
apply (simp add: transpose_def cofactorM_eq to_vec.rep_eq
    Square_Matrix.cofactor.rep_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem induced_image:
  "induced ` (G // L) = \<eta> ` G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induced ` contained.Partition = \<eta> ` G
[PROOF STEP]
by (metis factorization contained.natural.surjective surj_compose)


[STATEMENT]
lemma in_open_segment_rotD:
  "x \<in> {a<--<b} \<Longrightarrow> (x - a) \<bullet> rot (b - a) = 0 \<and> x \<bullet> (b - a) \<in> {a\<bullet>(b - a) <..< b \<bullet> (b - a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {a<--<b} \<Longrightarrow> (x - a) \<bullet> rot (b - a) = 0 \<and> x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}
[PROOF STEP]
by (subst in_open_segment_iff_rot[symmetric]) auto


[STATEMENT]
lemma is_UP_monom_mult:
  assumes "is_UP_monom p"
  assumes "is_UP_monom q"
  shows "is_UP_monom (p \<otimes>\<^bsub>P\<^esub> q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_UP_monom (p \<otimes>\<^bsub>P\<^esub> q)
[PROOF STEP]
apply(rule is_UP_monomI')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. p \<otimes>\<^bsub>P\<^esub> q \<in> carrier (UP R)
 2. p \<otimes>\<^bsub>P\<^esub> q = monom P ((p \<otimes>\<^bsub>P\<^esub> q) (deg R (p \<otimes>\<^bsub>P\<^esub> q))) (deg R (p \<otimes>\<^bsub>P\<^esub> q))
[PROOF STEP]
using assms is_UP_monomE P_def UP_mult_closed
[PROOF STATE]
proof (prove)
using this:
is_UP_monom p
is_UP_monom q
is_UP_monom ?f \<Longrightarrow> ?f \<in> carrier P
is_UP_monom ?f \<Longrightarrow> ?f = monom P (?f (deg R ?f)) (deg R ?f)
is_UP_monom ?f \<Longrightarrow> ?f = monom (UP R) (?f (deg R ?f)) (deg R ?f)
P \<equiv> UP R
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P\<rbrakk> \<Longrightarrow> ?p \<otimes>\<^bsub>P\<^esub> ?q \<in> carrier P

goal (2 subgoals):
 1. p \<otimes>\<^bsub>P\<^esub> q \<in> carrier (UP R)
 2. p \<otimes>\<^bsub>P\<^esub> q = monom P ((p \<otimes>\<^bsub>P\<^esub> q) (deg R (p \<otimes>\<^bsub>P\<^esub> q))) (deg R (p \<otimes>\<^bsub>P\<^esub> q))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<otimes>\<^bsub>P\<^esub> q = monom P ((p \<otimes>\<^bsub>P\<^esub> q) (deg R (p \<otimes>\<^bsub>P\<^esub> q))) (deg R (p \<otimes>\<^bsub>P\<^esub> q))
[PROOF STEP]
using assms is_UP_monomE[of p] is_UP_monomE[of q]
        P_def monom_mult
[PROOF STATE]
proof (prove)
using this:
is_UP_monom p
is_UP_monom q
is_UP_monom p \<Longrightarrow> p \<in> carrier P
is_UP_monom p \<Longrightarrow> p = monom P (p (deg R p)) (deg R p)
is_UP_monom p \<Longrightarrow> p = monom (UP R) (p (deg R p)) (deg R p)
is_UP_monom q \<Longrightarrow> q \<in> carrier P
is_UP_monom q \<Longrightarrow> q = monom P (q (deg R q)) (deg R q)
is_UP_monom q \<Longrightarrow> q = monom (UP R) (q (deg R q)) (deg R q)
P \<equiv> UP R
\<lbrakk>?a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> monom P (?a \<otimes> ?b) (?n + ?m) = monom P ?a ?n \<otimes>\<^bsub>P\<^esub> monom P ?b ?m

goal (1 subgoal):
 1. p \<otimes>\<^bsub>P\<^esub> q = monom P ((p \<otimes>\<^bsub>P\<^esub> q) (deg R (p \<otimes>\<^bsub>P\<^esub> q))) (deg R (p \<otimes>\<^bsub>P\<^esub> q))
[PROOF STEP]
by (metis lcf_closed ltrm_monom R.m_closed)


[STATEMENT]
lemma row_four_block_mat:
  assumes c: "A \<in> carrier_mat nr1 nc1" "B \<in> carrier_mat nr1 nc2"
  "C \<in> carrier_mat nr2 nc1" "D \<in> carrier_mat nr2 nc2"
  shows
  "i < nr1 \<Longrightarrow> row (four_block_mat A B C D) i = row A i @\<^sub>v row B i" (is "_ \<Longrightarrow> ?AB")
  "\<not> i < nr1 \<Longrightarrow> i < nr1 + nr2 \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)"
  (is "_ \<Longrightarrow> _ \<Longrightarrow> ?CD")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < nr1 \<Longrightarrow> row (four_block_mat A B C D) i = row A i @\<^sub>v row B i) &&& (\<lbrakk>\<not> i < nr1; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A B C D) i = row A i @\<^sub>v row B i
 2. \<lbrakk>\<not> i < nr1; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
assume i: "i < nr1"
[PROOF STATE]
proof (state)
this:
i < nr1

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A B C D) i = row A i @\<^sub>v row B i
 2. \<lbrakk>\<not> i < nr1; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
show ?AB
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A B C D) i = row A i @\<^sub>v row B i
[PROOF STEP]
by (rule eq_vecI, insert i c, auto)
[PROOF STATE]
proof (state)
this:
row (four_block_mat A B C D) i = row A i @\<^sub>v row B i

goal (1 subgoal):
 1. \<lbrakk>\<not> i < nr1; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> i < nr1; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
assume i: "\<not> i < nr1" "i < nr1 + nr2"
[PROOF STATE]
proof (state)
this:
\<not> i < nr1
i < nr1 + nr2

goal (1 subgoal):
 1. \<lbrakk>\<not> i < nr1; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
show ?CD
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
by (rule eq_vecI, insert i c, auto)
[PROOF STATE]
proof (state)
this:
row (four_block_mat A B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_n2: "inorder(n2 l a r) = inorder l @ a # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder (n2 l a r) = inorder l @ a # inorder r
[PROOF STEP]
by(cases "(l,a,r)" rule: n2.cases) (auto simp: sorted_lems)


[STATEMENT]
lemma compact_cbox [simp]:
  fixes a :: "'a::euclidean_space"
  shows "compact (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (cbox a b)
[PROOF STEP]
using bounded_closed_imp_seq_compact[of "cbox a b"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded (cbox a b); closed (cbox a b)\<rbrakk> \<Longrightarrow> seq_compact (cbox a b)

goal (1 subgoal):
 1. compact (cbox a b)
[PROOF STEP]
using bounded_cbox[of a b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded (cbox a b); closed (cbox a b)\<rbrakk> \<Longrightarrow> seq_compact (cbox a b)
bounded (cbox a b)

goal (1 subgoal):
 1. compact (cbox a b)
[PROOF STEP]
by (auto simp: compact_eq_seq_compact_metric)


[STATEMENT]
lemma rel_list_all2_Cons2:
  "list_all2 (fun_of S) xs (y#ys) =
  (\<exists>z zs. xs = z#zs \<and> (z,y) \<in> S \<and> list_all2 (fun_of S) zs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (fun_of S) xs (y # ys) = (\<exists>z zs. xs = z # zs \<and> (z, y) \<in> S \<and> list_all2 (fun_of S) zs ys)
[PROOF STEP]
by (cases xs) auto


[STATEMENT]
lemma length_minus_list [simp]:
  fixes xs :: "'a::minus list"
  shows "length (xs-ys) = min (length xs) (length ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs - ys) = min (length xs) (length ys)
[PROOF STEP]
by (simp add: minus_list_def)


[STATEMENT]
lemma parAssoc:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  shows "(P \<parallel> Q) \<parallel> R \<approx> P \<parallel> (Q \<parallel> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<parallel> Q) \<parallel> R \<approx> P \<parallel> Q \<parallel> R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (P \<parallel> Q) \<parallel> R \<approx> P \<parallel> Q \<parallel> R
[PROOF STEP]
have "(P \<parallel> Q) \<parallel> R \<sim>\<^sub>e P \<parallel> (Q \<parallel> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<parallel> Q) \<parallel> R \<sim>\<^sub>e P \<parallel> Q \<parallel> R
[PROOF STEP]
by(rule Strong_Early_Bisim_SC.parAssoc)
[PROOF STATE]
proof (state)
this:
(P \<parallel> Q) \<parallel> R \<sim>\<^sub>e P \<parallel> Q \<parallel> R

goal (1 subgoal):
 1. (P \<parallel> Q) \<parallel> R \<approx> P \<parallel> Q \<parallel> R
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(P \<parallel> Q) \<parallel> R \<sim>\<^sub>e P \<parallel> Q \<parallel> R

goal (1 subgoal):
 1. (P \<parallel> Q) \<parallel> R \<approx> P \<parallel> Q \<parallel> R
[PROOF STEP]
by(rule strongBisimWeakBisim)
[PROOF STATE]
proof (state)
this:
(P \<parallel> Q) \<parallel> R \<approx> P \<parallel> Q \<parallel> R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ElemLambdaFun : "(\<And> x .Elem x u \<Longrightarrow> Elem (f x) U) \<Longrightarrow> Elem (Lambda u f) (Fun u U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. Elem x u \<Longrightarrow> Elem (f x) U) \<Longrightarrow> Elem (Lambda u f) (Fun u U)
[PROOF STEP]
apply (subst Elem_Lambda_Fun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. Elem x u \<Longrightarrow> Elem (f x) U) \<Longrightarrow> u = u \<and> (\<forall>x. Elem x u \<longrightarrow> Elem (f x) U)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma valofn_less_2p:
  fixes x :: "('e, 'f) float"
  assumes "exponent x < e"
  shows "valofn x < 2^e / 2^bias TYPE(('e, 'f) float)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
have "1 + real (fraction x) / 2^LENGTH('f) < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + real (fraction x) / 2 ^ LENGTH('f) < 2
[PROOF STEP]
by (simp add: fraction_less_2p)
[PROOF STATE]
proof (state)
this:
1 + real (fraction x) / 2 ^ LENGTH('f) < 2

goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 + real (fraction x) / 2 ^ LENGTH('f) < 2
[PROOF STEP]
have "valofn x < (2^exponent x / 2^bias TYPE(('e, 'f) float)) * 2"
[PROOF STATE]
proof (prove)
using this:
1 + real (fraction x) / 2 ^ LENGTH('f) < 2

goal (1 subgoal):
 1. valofn x < 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2
[PROOF STEP]
unfolding valofn_def
[PROOF STATE]
proof (prove)
using this:
1 + real (fraction x) / 2 ^ LENGTH('f) < 2

goal (1 subgoal):
 1. 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * (1 + real (fraction x) / 2 ^ LENGTH('f)) < 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
valofn x < 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2

goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
valofn x < 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2

goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
have "... \<le> 2^e / 2^bias TYPE(('e, 'f) float)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2 \<le> 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
IEEE.exponent x < e

goal (1 subgoal):
 1. 2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2 \<le> 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
by (auto simp: less_eq_Suc_le field_simps elim: order_trans[rotated, OF exp_less])
[PROOF STATE]
proof (state)
this:
2 ^ IEEE.exponent x / 2 ^ bias TYPE(('e, 'f) IEEE.float) * 2 \<le> 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)

goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)

goal (1 subgoal):
 1. valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
valofn x < 2 ^ e / 2 ^ bias TYPE(('e, 'f) IEEE.float)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_inverse_shift:
  fixes f :: "'a::division_ring fls"
  shows "inverse (fls_shift m f) = fls_shift (-m) (inverse f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (fls_shift m f) = fls_shift (- m) (inverse f)
[PROOF STEP]
using fls_inverse_shift_nonzero
[PROOF STATE]
proof (prove)
using this:
?f \<noteq> 0 \<Longrightarrow> inverse (fls_shift ?m ?f) = fls_shift (- ?m) (inverse ?f)

goal (1 subgoal):
 1. inverse (fls_shift m f) = fls_shift (- m) (inverse f)
[PROOF STEP]
by    (cases "f=0") simp_all


[STATEMENT]
lemma mdeg_eq_child_if_singleton_gt1:
  "max_deg (Node r {|(t1,e1)|}) > 1 \<Longrightarrow> max_deg (Node r {|(t1,e1)|}) = max_deg t1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < max_deg (Node r {|(t1, e1)|}) \<Longrightarrow> max_deg (Node r {|(t1, e1)|}) = max_deg t1
[PROOF STEP]
using mdeg_singleton[of r t1]
[PROOF STATE]
proof (prove)
using this:
max_deg (Node r {|(t1, ?e1.0)|}) = max (max_deg t1) (fcard {|(t1, ?e1.0)|})

goal (1 subgoal):
 1. 1 < max_deg (Node r {|(t1, e1)|}) \<Longrightarrow> max_deg (Node r {|(t1, e1)|}) = max_deg t1
[PROOF STEP]
by (auto simp: fcard_single_1 max_def)


[STATEMENT]
lemma polynomial_of_mset_mult_poly_by_monom[simp]:
  \<open>polynomial_of_mset (mult_poly_by_monom x ys) =
       (Const (snd x) * poly_of_vars (fst x) * polynomial_of_mset ys)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial_of_mset (mult_poly_by_monom x ys) = Const (snd x) * poly_of_vars (fst x) * polynomial_of_mset ys
[PROOF STEP]
by (induction ys)
   (auto simp: Const_mult algebra_simps)


[STATEMENT]
lemma valuate_uminus: "(-p) \<lbrace>v\<rbrace> = - (p \<lbrace>v\<rbrace>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p \<lbrace> v \<rbrace> = - p \<lbrace> v \<rbrace>
[PROOF STEP]
unfolding uminus_linear_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 *R p \<lbrace> v \<rbrace> = - p \<lbrace> v \<rbrace>
[PROOF STEP]
by (transfer, auto simp: sum_negf)


[STATEMENT]
lemma mult_pos_pos[simp]: "0 < a \<Longrightarrow> 0 < b \<Longrightarrow> 0 < a * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < a; (0::'a) < b\<rbrakk> \<Longrightarrow> (0::'a) < a * b
[PROOF STEP]
using mult_strict_left_mono [of 0 b a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) < b; (0::'a) < a\<rbrakk> \<Longrightarrow> a * (0::'a) < a * b

goal (1 subgoal):
 1. \<lbrakk>(0::'a) < a; (0::'a) < b\<rbrakk> \<Longrightarrow> (0::'a) < a * b
[PROOF STEP]
by simp


[STATEMENT]
lemma S_intv_cl: "\<lbrakk>a \<in> A; b \<in> A; S \<subseteq> interval r a b\<rbrakk> \<Longrightarrow> S \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> A; S \<subseteq> interval r a b\<rbrakk> \<Longrightarrow> S \<subseteq> A
[PROOF STEP]
by (simp add: subset_trans [OF _ interval_subset])


[STATEMENT]
lemma Iter_comm:
  "(Iter f n) (f x) = f ((Iter f n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Iter f n (f x) = f (Iter f n x)
[PROOF STEP]
by (induct n) (simp_all)


[STATEMENT]
lemma ceiling_less_numeral [simp]: "\<lceil>x\<rceil> < numeral v \<longleftrightarrow> x \<le> numeral v - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> < numeral v) = (x \<le> numeral v - (1::'a))
[PROOF STEP]
by (simp add: ceiling_less_iff)


[STATEMENT]
lemma lowner_le_traceI:
  assumes "A \<in> carrier_mat n n"
    and "B \<in> carrier_mat n n"
    and "\<And>\<rho>. \<rho> \<in> carrier_mat n n \<Longrightarrow> partial_density_operator \<rho> \<Longrightarrow> trace (A * \<rho>) \<le> trace (B * \<rho>)"
  shows "A \<le>\<^sub>L B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le>\<^sub>L B
[PROOF STEP]
using lowner_le_trace assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n\<rbrakk> \<Longrightarrow> (?A \<le>\<^sub>L ?B) = (\<forall>\<rho>\<in>carrier_mat ?n ?n. partial_density_operator \<rho> \<longrightarrow> trace (?A * \<rho>) \<le> trace (?B * \<rho>))
A \<in> carrier_mat n n
B \<in> carrier_mat n n
\<lbrakk>?\<rho> \<in> carrier_mat n n; partial_density_operator ?\<rho>\<rbrakk> \<Longrightarrow> trace (A * ?\<rho>) \<le> trace (B * ?\<rho>)

goal (1 subgoal):
 1. A \<le>\<^sub>L B
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_with: "sum f S = sum_with (+) 0 f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f S = sum_with (+) (0::'a) f S
[PROOF STEP]
proof (induction rule: sum_with_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>C. \<lbrakk>f ` S \<subseteq> C; comm_monoid_add_on_with C (+) (0::'a)\<rbrakk> \<Longrightarrow> sum f S = Finite_Set.fold ((+) \<circ> f) (0::'a) S
 2. (\<And>C. comm_monoid_add_on_with C (+) (0::'a) \<Longrightarrow> \<exists>s\<in>S. f s \<notin> C) \<Longrightarrow> sum f S = (0::'a)
[PROOF STEP]
case (comm C)
[PROOF STATE]
proof (state)
this:
f ` S \<subseteq> C
comm_monoid_add_on_with C (+) (0::'a)

goal (2 subgoals):
 1. \<And>C. \<lbrakk>f ` S \<subseteq> C; comm_monoid_add_on_with C (+) (0::'a)\<rbrakk> \<Longrightarrow> sum f S = Finite_Set.fold ((+) \<circ> f) (0::'a) S
 2. (\<And>C. comm_monoid_add_on_with C (+) (0::'a) \<Longrightarrow> \<exists>s\<in>S. f s \<notin> C) \<Longrightarrow> sum f S = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` S \<subseteq> C
comm_monoid_add_on_with C (+) (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f ` S \<subseteq> C
comm_monoid_add_on_with C (+) (0::'a)

goal (1 subgoal):
 1. sum f S = Finite_Set.fold ((+) \<circ> f) (0::'a) S
[PROOF STEP]
unfolding sum.eq_fold
[PROOF STATE]
proof (prove)
using this:
f ` S \<subseteq> C
comm_monoid_add_on_with C (+) (0::'a)

goal (1 subgoal):
 1. Finite_Set.fold ((+) \<circ> f) (0::'a) S = Finite_Set.fold ((+) \<circ> f) (0::'a) S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f S = Finite_Set.fold ((+) \<circ> f) (0::'a) S

goal (1 subgoal):
 1. (\<And>C. comm_monoid_add_on_with C (+) (0::'a) \<Longrightarrow> \<exists>s\<in>S. f s \<notin> C) \<Longrightarrow> sum f S = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>C. comm_monoid_add_on_with C (+) (0::'a) \<Longrightarrow> \<exists>s\<in>S. f s \<notin> C) \<Longrightarrow> sum f S = (0::'a)
[PROOF STEP]
case zero
[PROOF STATE]
proof (state)
this:
comm_monoid_add_on_with ?C (+) (0::'a) \<Longrightarrow> \<exists>s\<in>S. f s \<notin> ?C

goal (1 subgoal):
 1. (\<And>C. comm_monoid_add_on_with C (+) (0::'a) \<Longrightarrow> \<exists>s\<in>S. f s \<notin> C) \<Longrightarrow> sum f S = (0::'a)
[PROOF STEP]
from zero[OF comm_monoid_add_on_with]
[PROOF STATE]
proof (chain)
picking this:
\<exists>s\<in>S. f s \<notin> UNIV
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>s\<in>S. f s \<notin> UNIV

goal (1 subgoal):
 1. sum f S = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f S = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder) iterate_sel_no_map_linord_correct :
assumes it_OK: "set_iterator_linord it S0"
shows "iterate_sel_no_map it P = None \<longleftrightarrow> (\<forall>x\<in>S0. \<not>(P x))"
      "iterate_sel_no_map it P = Some x \<Longrightarrow> (x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x'))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
 2. iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x')
[PROOF STEP]
note iterate_sel_no_map_genord_correct [OF it_OK[unfolded set_iterator_linord_def], of P]
[PROOF STATE]
proof (state)
this:
(iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
iterate_sel_no_map it P = Some ?x \<Longrightarrow> ?x \<in> S0 \<and> P ?x \<and> (\<forall>x'\<in>S0 - {?x}. P x' \<longrightarrow> ?x \<le> x')

goal (2 subgoals):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
 2. iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x')
[PROOF STEP]
thus "iterate_sel_no_map it P = None \<longleftrightarrow> (\<forall>x\<in>S0. \<not>(P x))"
       "iterate_sel_no_map it P = Some x \<Longrightarrow> (x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x'))"
[PROOF STATE]
proof (prove)
using this:
(iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
iterate_sel_no_map it P = Some ?x \<Longrightarrow> ?x \<in> S0 \<and> P ?x \<and> (\<forall>x'\<in>S0 - {?x}. P x' \<longrightarrow> ?x \<le> x')

goal (1 subgoal):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x \<le> x')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_termdiff3:
  fixes h z :: "'a::real_normed_field"
  assumes 1: "h \<noteq> 0"
    and 2: "norm z \<le> K"
    and 3: "norm (z + h) \<le> K"
  shows "norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le>
    of_nat n * of_nat (n - Suc 0) * K ^ (n - 2) * norm h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
have "norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) =
    norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h
[PROOF STEP]
by (metis (lifting, no_types) lemma_termdiff2 [OF 1] mult.commute norm_mult)
[PROOF STATE]
proof (state)
this:
norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h

goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h

goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
have "\<dots> \<le> of_nat n * (of_nat (n - Suc 0) * K ^ (n - 2)) * norm h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h \<le> real n * (real (n - Suc 0) * K ^ (n - 2)) * norm h
[PROOF STEP]
proof (rule mult_right_mono [OF _ norm_ge_zero])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le> real n * (real (n - Suc 0) * K ^ (n - 2))
[PROOF STEP]
from norm_ge_zero 2
[PROOF STATE]
proof (chain)
picking this:
0 \<le> norm ?x
norm z \<le> K
[PROOF STEP]
have K: "0 \<le> K"
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm ?x
norm z \<le> K

goal (1 subgoal):
 1. 0 \<le> K
[PROOF STEP]
by (rule order_trans)
[PROOF STATE]
proof (state)
this:
0 \<le> K

goal (1 subgoal):
 1. norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le> real n * (real (n - Suc 0) * K ^ (n - 2))
[PROOF STEP]
have le_Kn: "norm ((z + h) ^ i * z ^ j) \<le> K ^ n" if "i + j = n" for i j n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((z + h) ^ i * z ^ j) \<le> K ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm ((z + h) ^ i * z ^ j) \<le> K ^ n
[PROOF STEP]
have "norm (z + h) ^ i * norm z ^ j \<le> K ^ i * K ^ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (z + h) ^ i * norm z ^ j \<le> K ^ i * K ^ j
[PROOF STEP]
by (intro mult_mono power_mono 2 3 norm_ge_zero zero_le_power K)
[PROOF STATE]
proof (state)
this:
norm (z + h) ^ i * norm z ^ j \<le> K ^ i * K ^ j

goal (1 subgoal):
 1. norm ((z + h) ^ i * z ^ j) \<le> K ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (z + h) ^ i * norm z ^ j \<le> K ^ i * K ^ j

goal (1 subgoal):
 1. norm ((z + h) ^ i * z ^ j) \<le> K ^ n
[PROOF STEP]
have "... = K^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K ^ i * K ^ j = K ^ n
[PROOF STEP]
by (metis power_add that)
[PROOF STATE]
proof (state)
this:
K ^ i * K ^ j = K ^ n

goal (1 subgoal):
 1. norm ((z + h) ^ i * z ^ j) \<le> K ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (z + h) ^ i * norm z ^ j \<le> K ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (z + h) ^ i * norm z ^ j \<le> K ^ n

goal (1 subgoal):
 1. norm ((z + h) ^ i * z ^ j) \<le> K ^ n
[PROOF STEP]
by (simp add: norm_mult norm_power)
[PROOF STATE]
proof (state)
this:
norm ((z + h) ^ i * z ^ j) \<le> K ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i + ?j = ?n \<Longrightarrow> norm ((z + h) ^ ?i * z ^ ?j) \<le> K ^ ?n

goal (1 subgoal):
 1. norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le> real n * (real (n - Suc 0) * K ^ (n - 2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i + ?j = ?n \<Longrightarrow> norm ((z + h) ^ ?i * z ^ ?j) \<le> K ^ ?n
[PROOF STEP]
have "\<And>p q.
       \<lbrakk>p < n; q < n - Suc 0\<rbrakk> \<Longrightarrow> norm ((z + h) ^ q * z ^ (n - 2 - q)) \<le> K ^ (n - 2)"
[PROOF STATE]
proof (prove)
using this:
?i + ?j = ?n \<Longrightarrow> norm ((z + h) ^ ?i * z ^ ?j) \<le> K ^ ?n

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p < n; q < n - Suc 0\<rbrakk> \<Longrightarrow> norm ((z + h) ^ q * z ^ (n - 2 - q)) \<le> K ^ (n - 2)
[PROOF STEP]
by (simp del: subst_all)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?p < n; ?q < n - Suc 0\<rbrakk> \<Longrightarrow> norm ((z + h) ^ ?q * z ^ (n - 2 - ?q)) \<le> K ^ (n - 2)

goal (1 subgoal):
 1. norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le> real n * (real (n - Suc 0) * K ^ (n - 2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?p < n; ?q < n - Suc 0\<rbrakk> \<Longrightarrow> norm ((z + h) ^ ?q * z ^ (n - 2 - ?q)) \<le> K ^ (n - 2)
[PROOF STEP]
show "norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le>
        of_nat n * (of_nat (n - Suc 0) * K ^ (n - 2))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p < n; ?q < n - Suc 0\<rbrakk> \<Longrightarrow> norm ((z + h) ^ ?q * z ^ (n - 2 - ?q)) \<le> K ^ (n - 2)

goal (1 subgoal):
 1. norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le> real n * (real (n - Suc 0) * K ^ (n - 2))
[PROOF STEP]
by (intro order_trans [OF norm_sum]
          real_sum_nat_ivl_bounded2 mult_nonneg_nonneg of_nat_0_le_iff zero_le_power K)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) \<le> real n * (real (n - Suc 0) * K ^ (n - 2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h \<le> real n * (real (n - Suc 0) * K ^ (n - 2)) * norm h

goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) * norm h \<le> real n * (real (n - Suc 0) * K ^ (n - 2)) * norm h

goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
have "\<dots> = of_nat n * of_nat (n - Suc 0) * K ^ (n - 2) * norm h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * (real (n - Suc 0) * K ^ (n - 2)) * norm h = real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
by (simp only: mult.assoc)
[PROOF STATE]
proof (state)
this:
real n * (real (n - Suc 0) * K ^ (n - 2)) * norm h = real n * real (n - Suc 0) * K ^ (n - 2) * norm h

goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h

goal (1 subgoal):
 1. norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) \<le> real n * real (n - Suc 0) * K ^ (n - 2) * norm h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Map_comp':
    assumes "seq t' t"
    shows "Map (t' \<cdot> t) = vertical_composite.map A B (Map t) (Map t')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Map (t' \<cdot> t) = vertical_composite.map (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Map t) (Map t')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Map (t' \<cdot> t) = vertical_composite.map (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Map t) (Map t')
[PROOF STEP]
interpret t: natural_transformation A B \<open>Dom t\<close> \<open>Cod t\<close> \<open>Map t\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Dom t) (Cod t) (Map t)
[PROOF STEP]
using assms(1) arr_char seq_char
[PROOF STATE]
proof (prove)
using this:
seq t' t
arr ?f = (?f \<noteq> Null \<and> Dom ?f \<in> Collect (functor (\<cdot>\<^sub>A) (\<cdot>\<^sub>B)) \<and> Cod ?f \<in> Collect (functor (\<cdot>\<^sub>A) (\<cdot>\<^sub>B)) \<and> Map ?f \<in> Collect (natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Dom ?f) (Cod ?f)))
seq ?g ?f = (arr ?f \<and> arr ?g \<and> Dom ?g = Cod ?f)

goal (1 subgoal):
 1. natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Dom t) (Cod t) (Map t)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Map (t' \<cdot> t) = vertical_composite.map (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Map t) (Map t')
[PROOF STEP]
interpret t': natural_transformation A B \<open>Cod t\<close> \<open>Cod t'\<close> \<open>Map t'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Cod t) (Cod t') (Map t')
[PROOF STEP]
using assms(1) arr_char seq_char
[PROOF STATE]
proof (prove)
using this:
seq t' t
arr ?f = (?f \<noteq> Null \<and> Dom ?f \<in> Collect (functor (\<cdot>\<^sub>A) (\<cdot>\<^sub>B)) \<and> Cod ?f \<in> Collect (functor (\<cdot>\<^sub>A) (\<cdot>\<^sub>B)) \<and> Map ?f \<in> Collect (natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Dom ?f) (Cod ?f)))
seq ?g ?f = (arr ?f \<and> arr ?g \<and> Dom ?g = Cod ?f)

goal (1 subgoal):
 1. natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Cod t) (Cod t') (Map t')
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Map (t' \<cdot> t) = vertical_composite.map (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Map t) (Map t')
[PROOF STEP]
interpret t'ot: vertical_composite A B \<open>Dom t\<close> \<open>Cod t\<close> \<open>Cod t'\<close> \<open>Map t\<close> \<open>Map t'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vertical_composite (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Dom t) (Cod t) (Cod t') (Map t) (Map t')
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Map (t' \<cdot> t) = t'ot.map
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Map (t' \<cdot> t) = t'ot.map
[PROOF STEP]
using assms(1) seq_char t'ot.natural_transformation_axioms
[PROOF STATE]
proof (prove)
using this:
seq t' t
seq ?g ?f = (arr ?f \<and> arr ?g \<and> Dom ?g = Cod ?f)
natural_transformation (\<cdot>\<^sub>A) (\<cdot>\<^sub>B) (Dom t) (Cod t') t'ot.map

goal (1 subgoal):
 1. Map (t' \<cdot> t) = t'ot.map
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Map (t' \<cdot> t) = t'ot.map

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) trivial_factor_iso:
  shows "the_elem \<in> iso (G Mod {\<one>}) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
have "group_hom G G (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom G G (\<lambda>x. x)
[PROOF STEP]
unfolding group_hom_def group_hom_axioms_def hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G \<and> Group.group G \<and> (\<lambda>x. x) \<in> {h \<in> carrier G \<rightarrow> carrier G. \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. h (x \<otimes> y) = h x \<otimes> h y}
[PROOF STEP]
using is_group
[PROOF STATE]
proof (prove)
using this:
Group.group G

goal (1 subgoal):
 1. Group.group G \<and> Group.group G \<and> (\<lambda>x. x) \<in> {h \<in> carrier G \<rightarrow> carrier G. \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. h (x \<otimes> y) = h x \<otimes> h y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
group_hom G G (\<lambda>x. x)

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
group_hom G G (\<lambda>x. x)

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
have "(\<lambda>x. x) ` carrier G = carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) ` carrier G = carrier G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) ` carrier G = carrier G

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) ` carrier G = carrier G

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
have "kernel G G (\<lambda>x. x) = {\<one>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel G G (\<lambda>x. x) = {\<one>}
[PROOF STEP]
unfolding kernel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier G. x = \<one>} = {\<one>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kernel G G (\<lambda>x. x) = {\<one>}

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
group_hom G G (\<lambda>x. x)
(\<lambda>x. x) ` carrier G = carrier G
kernel G G (\<lambda>x. x) = {\<one>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
group_hom G G (\<lambda>x. x)
(\<lambda>x. x) ` carrier G = carrier G
kernel G G (\<lambda>x. x) = {\<one>}

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
using group_hom.FactGroup_iso_set
[PROOF STATE]
proof (prove)
using this:
group_hom G G (\<lambda>x. x)
(\<lambda>x. x) ` carrier G = carrier G
kernel G G (\<lambda>x. x) = {\<one>}
\<lbrakk>group_hom ?G ?H ?h; ?h ` carrier ?G = carrier ?H\<rbrakk> \<Longrightarrow> (\<lambda>X. the_elem (?h ` X)) \<in> Group.iso (?G Mod kernel ?G ?H ?h) ?H

goal (1 subgoal):
 1. the_elem \<in> Group.iso (G Mod {\<one>}) G
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
the_elem \<in> Group.iso (G Mod {\<one>}) G

goal:
No subgoals!
[PROOF STEP]
qed