[STATEMENT]
lemma algebraic_int_times [intro]:
  fixes x y :: "'a :: field_char_0"
  assumes "algebraic_int x" "algebraic_int y"
  shows   "algebraic_int (x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_int (x * y)
[PROOF STEP]
proof (cases "y = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
case [simp]: False
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
algebraic_int x
[PROOF STEP]
obtain p where p: "lead_coeff p = 1" "ipoly p x = 0"
[PROOF STATE]
proof (prove)
using this:
algebraic_int x

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>monic p; ipoly p x = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: algebraic_int_altdef_ipoly)
[PROOF STATE]
proof (state)
this:
monic p
ipoly p x = (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
algebraic_int y
[PROOF STEP]
obtain q where q: "lead_coeff q = 1" "ipoly q y = 0"
[PROOF STATE]
proof (prove)
using this:
algebraic_int y

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>monic q; ipoly q y = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: algebraic_int_altdef_ipoly)
[PROOF STATE]
proof (state)
this:
monic q
ipoly q y = (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have deg_pos: "degree p > 0" "degree q > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree p &&& 0 < degree q
[PROOF STEP]
using p q
[PROOF STATE]
proof (prove)
using this:
monic p
ipoly p x = (0::'a)
monic q
ipoly q y = (0::'a)

goal (1 subgoal):
 1. 0 < degree p &&& 0 < degree q
[PROOF STEP]
by (auto intro!: Nat.gr0I elim!: degree_eq_zeroE)
[PROOF STATE]
proof (state)
this:
0 < degree p
0 < degree q

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have [simp]: "q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<noteq> 0
[PROOF STEP]
using q
[PROOF STATE]
proof (prove)
using this:
monic q
ipoly q y = (0::'a)

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

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
define n where "n = Polynomial.order 0 q"
[PROOF STATE]
proof (state)
this:
n = Polynomial.order 0 q

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have "monom 1 n dvd q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom 1 n dvd q
[PROOF STEP]
by (simp add: n_def monom_1_dvd_iff)
[PROOF STATE]
proof (state)
this:
monom 1 n dvd q

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
monom 1 n dvd q
[PROOF STEP]
obtain q' where q_split: "q = q' * monom 1 n"
[PROOF STATE]
proof (prove)
using this:
monom 1 n dvd q

goal (1 subgoal):
 1. (\<And>q'. q = q' * monom 1 n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q = q' * monom 1 n

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have "Polynomial.order 0 q = Polynomial.order 0 q' + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.order 0 q = Polynomial.order 0 q' + n
[PROOF STEP]
using \<open>q \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

goal (1 subgoal):
 1. Polynomial.order 0 q = Polynomial.order 0 q' + n
[PROOF STEP]
unfolding q_split
[PROOF STATE]
proof (prove)
using this:
q' * monom 1 n \<noteq> 0

goal (1 subgoal):
 1. Polynomial.order 0 (q' * monom 1 n) = Polynomial.order 0 q' + n
[PROOF STEP]
by (subst order_mult) auto
[PROOF STATE]
proof (state)
this:
Polynomial.order 0 q = Polynomial.order 0 q' + n

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
hence "poly q' 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
Polynomial.order 0 q = Polynomial.order 0 q' + n

goal (1 subgoal):
 1. poly q' 0 \<noteq> 0
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
Polynomial.order 0 q = Polynomial.order 0 q' + Polynomial.order 0 q

goal (1 subgoal):
 1. poly q' 0 \<noteq> 0
[PROOF STEP]
using \<open>q \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
Polynomial.order 0 q = Polynomial.order 0 q' + Polynomial.order 0 q
q \<noteq> 0

goal (1 subgoal):
 1. poly q' 0 \<noteq> 0
[PROOF STEP]
by (simp add: q_split order_root)
[PROOF STATE]
proof (state)
this:
poly q' 0 \<noteq> 0

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have q': "ipoly q' y = 0" "lead_coeff q' = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipoly q' y = (0::'a) &&& monic q'
[PROOF STEP]
using q_split q
[PROOF STATE]
proof (prove)
using this:
q = q' * monom 1 n
monic q
ipoly q y = (0::'a)

goal (1 subgoal):
 1. ipoly q' y = (0::'a) &&& monic q'
[PROOF STEP]
by (auto simp: of_int_poly_hom.hom_mult poly_monom lead_coeff_mult degree_monom_eq)
[PROOF STATE]
proof (state)
this:
ipoly q' y = (0::'a)
monic q'

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
ipoly q' y = (0::'a)
monic q'
[PROOF STEP]
have deg_pos': "degree q' > 0"
[PROOF STATE]
proof (prove)
using this:
ipoly q' y = (0::'a)
monic q'

goal (1 subgoal):
 1. 0 < degree q'
[PROOF STEP]
by (intro Nat.gr0I) (auto elim!: degree_eq_zeroE)
[PROOF STATE]
proof (state)
this:
0 < degree q'

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
from \<open>poly q' 0 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
poly q' 0 \<noteq> 0
[PROOF STEP]
have [simp]: "coeff q' 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
poly q' 0 \<noteq> 0

goal (1 subgoal):
 1. coeff q' 0 \<noteq> 0
[PROOF STEP]
by (auto simp: monom_1_dvd_iff' poly_0_coeff_0)
[PROOF STATE]
proof (state)
this:
coeff q' 0 \<noteq> 0

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have "p represents x" "q' represents y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p represents x &&& q' represents y
[PROOF STEP]
using p q'
[PROOF STATE]
proof (prove)
using this:
monic p
ipoly p x = (0::'a)
ipoly q' y = (0::'a)
monic q'

goal (1 subgoal):
 1. p represents x &&& q' represents y
[PROOF STEP]
by (auto simp: represents_def)
[PROOF STATE]
proof (state)
this:
p represents x
q' represents y

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
hence "poly_mult p q' represents x * y"
[PROOF STATE]
proof (prove)
using this:
p represents x
q' represents y

goal (1 subgoal):
 1. poly_mult p q' represents x * y
[PROOF STEP]
by (rule represents_mult) (simp add: poly_0_coeff_0)
[PROOF STATE]
proof (state)
this:
poly_mult p q' represents x * y

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly_mult p q' represents x * y

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
have "lead_coeff (poly_mult p q') = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (poly_mult p q')
[PROOF STEP]
using p deg_pos q' deg_pos'
[PROOF STATE]
proof (prove)
using this:
monic p
ipoly p x = (0::'a)
0 < degree p
0 < degree q
ipoly q' y = (0::'a)
monic q'
0 < degree q'

goal (1 subgoal):
 1. monic (poly_mult p q')
[PROOF STEP]
by (simp add: lead_coeff_mult lead_coeff_poly_mult)
[PROOF STATE]
proof (state)
this:
monic (poly_mult p q')

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
 2. y \<noteq> (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poly_mult p q' represents x * y
monic (poly_mult p q')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly_mult p q' represents x * y
monic (poly_mult p q')

goal (1 subgoal):
 1. algebraic_int (x * y)
[PROOF STEP]
by (auto simp: algebraic_int_altdef_ipoly represents_def)
[PROOF STATE]
proof (state)
this:
algebraic_int (x * y)

goal (1 subgoal):
 1. y = (0::'a) \<Longrightarrow> algebraic_int (x * y)
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in valid_unMultigraph) degree_frame:
    assumes "finite (edges G)"  "x \<notin> {v, v'}"
    shows "degree x (del_unEdge v w v' G) = degree x G" (is "?L=?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
proof (cases "(v,w,v') \<in> edges G")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(v, w, v') \<in> E

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
have "?L=card({e. e\<in>edges G - {(v,w,v'),(v',w,v)} \<and> fst e=x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree x (del_unEdge v w v' G) = card {e \<in> E - {(v, w, v'), (v', w, v)}. fst e = x}
[PROOF STEP]
by (simp add:del_unEdge_def degree_def)
[PROOF STATE]
proof (state)
this:
degree x (del_unEdge v w v' G) = card {e \<in> E - {(v, w, v'), (v', w, v)}. fst e = x}

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree x (del_unEdge v w v' G) = card {e \<in> E - {(v, w, v'), (v', w, v)}. fst e = x}

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
have "...=card({e. e\<in>edges G \<and> fst e=x}-{e. e\<in>{(v,w,v'),(v',w,v)} \<and> fst e=x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {e \<in> E - {(v, w, v'), (v', w, v)}. fst e = x} = card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x})
[PROOF STEP]
by (metis  set_compre_diff)
[PROOF STATE]
proof (state)
this:
card {e \<in> E - {(v, w, v'), (v', w, v)}. fst e = x} = card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x})

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {e \<in> E - {(v, w, v'), (v', w, v)}. fst e = x} = card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x})

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
have "...=card({e. e\<in>edges G \<and> fst e=x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}
[PROOF STEP]
using \<open>x \<notin> {v, v'}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'}

goal (1 subgoal):
 1. card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}
[PROOF STEP]
have "x\<noteq>v \<and> x\<noteq> v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> v \<and> x \<noteq> v'
[PROOF STEP]
using \<open>x\<notin>{v,v'}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'}

goal (1 subgoal):
 1. x \<noteq> v \<and> x \<noteq> v'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<noteq> v \<and> x \<noteq> v'

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}
[PROOF STEP]
hence "{e. e\<in>{(v,w,v'),(v',w,v)} \<and> fst e=x}={}"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> v \<and> x \<noteq> v'

goal (1 subgoal):
 1. {e \<in> {(v, w, v'), (v', w, v)}. fst e = x} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{e \<in> {(v, w, v'), (v', w, v)}. fst e = x} = {}

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{e \<in> {(v, w, v'), (v', w, v)}. fst e = x} = {}

goal (1 subgoal):
 1. card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}
[PROOF STEP]
by (metis Diff_empty)
[PROOF STATE]
proof (state)
this:
card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ({e \<in> E. fst e = x} - {e \<in> {(v, w, v'), (v', w, v)}. fst e = x}) = card {e \<in> E. fst e = x}

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
have "...=?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {e \<in> E. fst e = x} = degree x G
[PROOF STEP]
by (simp add:degree_def)
[PROOF STATE]
proof (state)
this:
card {e \<in> E. fst e = x} = degree x G

goal (2 subgoals):
 1. (v, w, v') \<in> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
 2. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree x (del_unEdge v w v' G) = degree x G

goal (1 subgoal):
 1. degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree x (del_unEdge v w v' G) = degree x G

goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
(v, w, v') \<notin> E

goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(v, w, v') \<notin> E

goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
hence "(v',w,v)\<notin>E"
[PROOF STATE]
proof (prove)
using this:
(v, w, v') \<notin> E

goal (1 subgoal):
 1. (v', w, v) \<notin> E
[PROOF STEP]
using corres
[PROOF STATE]
proof (prove)
using this:
(v, w, v') \<notin> E
((?v, ?w, ?u') \<in> E) = ((?u', ?w, ?v) \<in> E)

goal (1 subgoal):
 1. (v', w, v) \<notin> E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(v', w, v) \<notin> E

goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(v, w, v') \<notin> E
(v', w, v) \<notin> E
[PROOF STEP]
have "E- {(v,w,v'),(v',w,v)}=E"
[PROOF STATE]
proof (prove)
using this:
(v, w, v') \<notin> E
(v', w, v) \<notin> E

goal (1 subgoal):
 1. E - {(v, w, v'), (v', w, v)} = E
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
E - {(v, w, v'), (v', w, v)} = E

goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
hence "del_unEdge v w v' G=G"
[PROOF STATE]
proof (prove)
using this:
E - {(v, w, v'), (v', w, v)} = E

goal (1 subgoal):
 1. del_unEdge v w v' G = G
[PROOF STEP]
by (auto simp add:del_unEdge_def)
[PROOF STATE]
proof (state)
this:
del_unEdge v w v' G = G

goal (1 subgoal):
 1. (v, w, v') \<notin> E \<Longrightarrow> degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
del_unEdge v w v' G = G

goal (1 subgoal):
 1. degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree x (del_unEdge v w v' G) = degree x G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_reciprocal:
  fixes P :: "('a::zero) poly"
  assumes hP: "degree P \<le> p"
  shows "degree (reciprocal_poly p P) \<le> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (reciprocal_poly p P) \<le> p
[PROOF STEP]
proof (auto simp add: reciprocal_poly_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) \<le> p
[PROOF STEP]
have "degree (reciprocal_poly p P) \<le>
        length (replicate (p - degree P) (0::'a) @ rev (coeffs P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (reciprocal_poly p P) \<le> length (replicate (p - degree P) (0::'a) @ rev (coeffs P))
[PROOF STEP]
by (metis degree_Poly reciprocal_poly_def rev_append rev_replicate)
[PROOF STATE]
proof (state)
this:
degree (reciprocal_poly p P) \<le> length (replicate (p - degree P) (0::'a) @ rev (coeffs P))

goal (1 subgoal):
 1. degree (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) \<le> p
[PROOF STEP]
thus "degree (Poly (replicate (p - degree P) 0 @ rev (coeffs P))) \<le> p"
[PROOF STATE]
proof (prove)
using this:
degree (reciprocal_poly p P) \<le> length (replicate (p - degree P) (0::'a) @ rev (coeffs P))

goal (1 subgoal):
 1. degree (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) \<le> p
[PROOF STEP]
by (smt Suc_le_mono add_Suc_right coeffs_Poly degree_0 hP le_SucE le_SucI
        le_add_diff_inverse2 le_zero_eq length_append length_coeffs_degree
        length_replicate length_rev length_strip_while_le reciprocal_0
        reciprocal_poly_def rev_append rev_replicate)
[PROOF STATE]
proof (state)
this:
degree (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) \<le> p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sf_aux4: "(s::nat) < t \<Longrightarrow> (sf s) + s < sf t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
assume A1: "(s::nat) < t"
[PROOF STATE]
proof (state)
this:
s < t

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
have "s*(s + 1) + 2*(s+1) \<le> t*(t+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
s < t
[PROOF STEP]
have S1: "(s::nat) + 1 \<le> t"
[PROOF STATE]
proof (prove)
using this:
s < t

goal (1 subgoal):
 1. s + 1 \<le> t
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
s + 1 \<le> t

goal (1 subgoal):
 1. s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
s < t
[PROOF STEP]
have "(s::nat) + 2 \<le> t+1"
[PROOF STATE]
proof (prove)
using this:
s < t

goal (1 subgoal):
 1. s + 2 \<le> t + 1
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
s + 2 \<le> t + 1

goal (1 subgoal):
 1. s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
s + 1 \<le> t
s + 2 \<le> t + 1
[PROOF STEP]
have "((s::nat)+1)*(s+2) \<le> t*(t+1)"
[PROOF STATE]
proof (prove)
using this:
s + 1 \<le> t
s + 2 \<le> t + 1

goal (1 subgoal):
 1. (s + 1) * (s + 2) \<le> t * (t + 1)
[PROOF STEP]
by (rule mult_le_mono)
[PROOF STATE]
proof (state)
this:
(s + 1) * (s + 2) \<le> t * (t + 1)

goal (1 subgoal):
 1. s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(s + 1) * (s + 2) \<le> t * (t + 1)

goal (1 subgoal):
 1. s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)
[PROOF STEP]
have S1: "(s*(s+1) + 2*(s+1)) div 2 \<le>  t*(t+1) div 2"
[PROOF STATE]
proof (prove)
using this:
s * (s + 1) + 2 * (s + 1) \<le> t * (t + 1)

goal (1 subgoal):
 1. (s * (s + 1) + 2 * (s + 1)) div 2 \<le> t * (t + 1) div 2
[PROOF STEP]
by (rule div_le_mono)
[PROOF STATE]
proof (state)
this:
(s * (s + 1) + 2 * (s + 1)) div 2 \<le> t * (t + 1) div 2

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
have "(0::nat) < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
0 < 2

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 2
[PROOF STEP]
have "(s*(s+1) + 2*(s+1)) div 2 = (s+1) + (s*(s+1)) div 2"
[PROOF STATE]
proof (prove)
using this:
0 < 2

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

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
(s * (s + 1) + 2 * (s + 1)) div 2 \<le> t * (t + 1) div 2
(s * (s + 1) + 2 * (s + 1)) div 2 = s + 1 + s * (s + 1) div 2
[PROOF STEP]
have "(s*(s+1)) div 2 + (s+1) \<le> t*(t+1) div 2"
[PROOF STATE]
proof (prove)
using this:
(s * (s + 1) + 2 * (s + 1)) div 2 \<le> t * (t + 1) div 2
(s * (s + 1) + 2 * (s + 1)) div 2 = s + 1 + s * (s + 1) div 2

goal (1 subgoal):
 1. s * (s + 1) div 2 + (s + 1) \<le> t * (t + 1) div 2
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
s * (s + 1) div 2 + (s + 1) \<le> t * (t + 1) div 2

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s * (s + 1) div 2 + (s + 1) \<le> t * (t + 1) div 2
[PROOF STEP]
have "(s*(s+1)) div 2 + s < t*(t+1) div 2"
[PROOF STATE]
proof (prove)
using this:
s * (s + 1) div 2 + (s + 1) \<le> t * (t + 1) div 2

goal (1 subgoal):
 1. s * (s + 1) div 2 + s < t * (t + 1) div 2
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
s * (s + 1) div 2 + s < t * (t + 1) div 2

goal (1 subgoal):
 1. s < t \<Longrightarrow> sf s + s < sf t
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
s * (s + 1) div 2 + s < t * (t + 1) div 2

goal (1 subgoal):
 1. sf s + s < sf t
[PROOF STEP]
by (simp add: sf_def)
[PROOF STATE]
proof (state)
this:
sf s + s < sf t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_inf_eq_sup: "a - inf b c = a + sup (- b) (- c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - inf b c = a + sup (- b) (- c)
[PROOF STEP]
using neg_inf_eq_sup [of b c, symmetric]
[PROOF STATE]
proof (prove)
using this:
sup (- b) (- c) = - inf b c

goal (1 subgoal):
 1. a - inf b c = a + sup (- b) (- c)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in weak_lower_semilattice) meetI:
  "[| !!i. greatest L i (Lower L {x, y}) ==> P i;
  x \<in> carrier L; y \<in> carrier L |]
  ==> P (x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. is_glb L i {x, y} \<Longrightarrow> P i; x \<in> carrier L; y \<in> carrier L\<rbrakk> \<Longrightarrow> P (x \<sqinter> y)
[PROOF STEP]
proof (unfold meet_def inf_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. is_glb L i {x, y} \<Longrightarrow> P i; x \<in> carrier L; y \<in> carrier L\<rbrakk> \<Longrightarrow> P (SOME xa. is_glb L xa {x, y})
[PROOF STEP]
assume L: "x \<in> carrier L"  "y \<in> carrier L"
    and P: "!!g. greatest L g (Lower L {x, y}) ==> P g"
[PROOF STATE]
proof (state)
this:
x \<in> carrier L
y \<in> carrier L
is_glb L ?g {x, y} \<Longrightarrow> P ?g

goal (1 subgoal):
 1. \<lbrakk>\<And>i. is_glb L i {x, y} \<Longrightarrow> P i; x \<in> carrier L; y \<in> carrier L\<rbrakk> \<Longrightarrow> P (SOME xa. is_glb L xa {x, y})
[PROOF STEP]
with inf_of_two_exists
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> carrier L; ?y \<in> carrier L\<rbrakk> \<Longrightarrow> \<exists>s. is_glb L s {?x, ?y}
x \<in> carrier L
y \<in> carrier L
is_glb L ?g {x, y} \<Longrightarrow> P ?g
[PROOF STEP]
obtain i where "greatest L i (Lower L {x, y})"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier L; ?y \<in> carrier L\<rbrakk> \<Longrightarrow> \<exists>s. is_glb L s {?x, ?y}
x \<in> carrier L
y \<in> carrier L
is_glb L ?g {x, y} \<Longrightarrow> P ?g

goal (1 subgoal):
 1. (\<And>i. is_glb L i {x, y} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
is_glb L i {x, y}

goal (1 subgoal):
 1. \<lbrakk>\<And>i. is_glb L i {x, y} \<Longrightarrow> P i; x \<in> carrier L; y \<in> carrier L\<rbrakk> \<Longrightarrow> P (SOME xa. is_glb L xa {x, y})
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
is_glb L i {x, y}
[PROOF STEP]
show "P (SOME g. greatest L g (Lower L {x, y}))"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
is_glb L i {x, y}

goal (1 subgoal):
 1. P (SOME g. is_glb L g {x, y})
[PROOF STEP]
by (fast intro: someI2 weak_greatest_unique P)
[PROOF STATE]
proof (state)
this:
P (SOME g. is_glb L g {x, y})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_sum_lemma:
  assumes "e \<le> norm (a + b + c + d)"
    shows "e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d
[PROOF STEP]
have "e \<le> norm ((a + b) + (c + d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<le> norm (a + b + (c + d))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
e \<le> norm (a + b + c + d)

goal (1 subgoal):
 1. e \<le> norm (a + b + (c + d))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
e \<le> norm (a + b + (c + d))

goal (1 subgoal):
 1. e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<le> norm (a + b + (c + d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
e \<le> norm (a + b + (c + d))

goal (1 subgoal):
 1. e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d
[PROOF STEP]
by (auto dest!: norm_sum_half)
[PROOF STATE]
proof (state)
this:
e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finmap_of_eq_iff[simp]:
  assumes "finite i" "finite j"
  shows "finmap_of i m = finmap_of j n \<longleftrightarrow> i = j \<and> (\<forall>k\<in>i. m k= n k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finmap_of i m = finmap_of j n) = (i = j \<and> (\<forall>k\<in>i. m k = n k))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite i
finite j

goal (1 subgoal):
 1. (finmap_of i m = finmap_of j n) = (i = j \<and> (\<forall>k\<in>i. m k = n k))
[PROOF STEP]
by (auto simp: finmap_eq_iff)


[STATEMENT]
lemma (in -) nat_upto_subs_top_removal:
  "S \<subseteq> {0..n::nat} \<Longrightarrow> n \<notin> S \<Longrightarrow> S \<subseteq> {0..n - 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> {0..n}; n \<notin> S\<rbrakk> \<Longrightarrow> S \<subseteq> {0..n - 1}
[PROOF STEP]
using nat_upto_subs_top_removal'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?S \<subseteq> {0..Suc ?n}; Suc ?n \<notin> ?S\<rbrakk> \<Longrightarrow> ?S \<subseteq> {0..?n}

goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> {0..n}; n \<notin> S\<rbrakk> \<Longrightarrow> S \<subseteq> {0..n - 1}
[PROOF STEP]
by (cases n; simp)


[STATEMENT]
lemma pr_comp3_1': "\<lbrakk> pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1' \<rbrakk> \<Longrightarrow> (\<lambda> x. f (g x) (h x) (k x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
assume A1: "pr_conv_3_to_1 f \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
pr_conv_3_to_1 f \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
assume A2: "g \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
g \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
assume A3: "h \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
h \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
assume A4: "k \<in> PrimRec1'"
[PROOF STATE]
proof (state)
this:
k \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
from A2 A3
[PROOF STATE]
proof (chain)
picking this:
g \<in> PrimRec1'
h \<in> PrimRec1'
[PROOF STEP]
have "c_f_pair g h \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
g \<in> PrimRec1'
h \<in> PrimRec1'

goal (1 subgoal):
 1. c_f_pair g h \<in> PrimRec1'
[PROOF STEP]
by (rule PrimRec1'.pair)
[PROOF STATE]
proof (state)
this:
c_f_pair g h \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
from this A4
[PROOF STATE]
proof (chain)
picking this:
c_f_pair g h \<in> PrimRec1'
k \<in> PrimRec1'
[PROOF STEP]
have "c_f_pair (c_f_pair g h) k \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
c_f_pair g h \<in> PrimRec1'
k \<in> PrimRec1'

goal (1 subgoal):
 1. c_f_pair (c_f_pair g h) k \<in> PrimRec1'
[PROOF STEP]
by (rule PrimRec1'.pair)
[PROOF STATE]
proof (state)
this:
c_f_pair (c_f_pair g h) k \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
from A1 this
[PROOF STATE]
proof (chain)
picking this:
pr_conv_3_to_1 f \<in> PrimRec1'
c_f_pair (c_f_pair g h) k \<in> PrimRec1'
[PROOF STEP]
have "(%x. (pr_conv_3_to_1 f) ((c_f_pair (c_f_pair g h) k) x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
pr_conv_3_to_1 f \<in> PrimRec1'
c_f_pair (c_f_pair g h) k \<in> PrimRec1'

goal (1 subgoal):
 1. (\<lambda>x. pr_conv_3_to_1 f (c_f_pair (c_f_pair g h) k x)) \<in> PrimRec1'
[PROOF STEP]
by (rule PrimRec1'.comp)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. pr_conv_3_to_1 f (c_f_pair (c_f_pair g h) k x)) \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; g \<in> PrimRec1'; h \<in> PrimRec1'; k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. pr_conv_3_to_1 f (c_f_pair (c_f_pair g h) k x)) \<in> PrimRec1'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. pr_conv_3_to_1 f (c_f_pair (c_f_pair g h) k x)) \<in> PrimRec1'

goal (1 subgoal):
 1. (\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'
[PROOF STEP]
by (simp add: c_f_pair_def pr_conv_3_to_1_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x) (h x) (k x)) \<in> PrimRec1'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partial_equivalence_cong:
  assumes r: "\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> r a b \<longleftrightarrow> r' a b"
  shows "partial_equivalence A r \<longleftrightarrow> partial_equivalence A r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_equivalence A r = partial_equivalence A r'
[PROOF STEP]
by (simp add: partial_equivalence_def partial_equivalence_axioms_def r
      cong: transitive_cong symmetric_cong)


[STATEMENT]
lemma diff_sup_eq_inf: "a - sup b c = a + inf (- b) (- c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - sup b c = a + inf (- b) (- c)
[PROOF STEP]
using neg_sup_eq_inf [of b c, symmetric]
[PROOF STATE]
proof (prove)
using this:
inf (- b) (- c) = - sup b c

goal (1 subgoal):
 1. a - sup b c = a + inf (- b) (- c)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in cring)
  assumes "x \<in> carrier R" "y \<in> carrier R" "z \<in> carrier R"
  shows "\<guillemotleft>4\<guillemotright> \<otimes> x [^] (5::nat) \<otimes> y [^] (3::nat) \<otimes> x [^] (2::nat) \<otimes> \<guillemotleft>3\<guillemotright> \<oplus> x \<otimes> z \<oplus> \<guillemotleft>3\<guillemotright> [^] (5::nat) =
    \<guillemotleft>12\<guillemotright> \<otimes> x [^] (7::nat) \<otimes> y [^] (3::nat) \<oplus> z \<otimes> x \<oplus> \<guillemotleft>243\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>4\<guillemotright> \<otimes> x [^] 5 \<otimes> y [^] 3 \<otimes> x [^] 2 \<otimes> \<guillemotleft>3\<guillemotright> \<oplus> x \<otimes> z \<oplus> \<guillemotleft>3\<guillemotright> [^] 5 = \<guillemotleft>12\<guillemotright> \<otimes> x [^] 7 \<otimes> y [^] 3 \<oplus> z \<otimes> x \<oplus> \<guillemotleft>243\<guillemotright>
[PROOF STEP]
by ring


[STATEMENT]
lemma distr_pair_PiM_eq_PiM:
  fixes i' :: "'i" and I :: "'i set" and M :: "'i \<Rightarrow> 'a measure"
  assumes M: "\<And>i. i \<in> I \<Longrightarrow> prob_space (M i)" "prob_space (M i')"
  shows "distr (M i' \<Otimes>\<^sub>M (\<Pi>\<^sub>M i\<in>I. M i)) (\<Pi>\<^sub>M i\<in>insert i' I. M i) (\<lambda>(x, X). X(i' := x)) =
    (\<Pi>\<^sub>M i\<in>insert i' I. M i)" (is "?L = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x)) = Pi\<^sub>M (insert i' I) M
[PROOF STEP]
proof (rule measure_eqI_PiM_infinite[symmetric, OF refl])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = sets (Pi\<^sub>M (insert i' I) M)
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
 3. finite_measure (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
interpret M': prob_space "M i'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (M i')
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = sets (Pi\<^sub>M (insert i' I) M)
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
 3. finite_measure (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
interpret I: prob_space "(\<Pi>\<^sub>M i\<in>I. M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> prob_space (M ?i)
prob_space (M i')

goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
by (intro prob_space_PiM) auto
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = sets (Pi\<^sub>M (insert i' I) M)
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
 3. finite_measure (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
interpret I': prob_space "(\<Pi>\<^sub>M i\<in>insert i' I. M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> prob_space (M ?i)
prob_space (M i')

goal (1 subgoal):
 1. prob_space (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
by (intro prob_space_PiM) auto
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
 3. finite_measure (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
show "finite_measure (\<Pi>\<^sub>M i\<in>insert i' I. M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure (Pi\<^sub>M (insert i' I) M)
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
finite_measure (Pi\<^sub>M (insert i' I) M)

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
fix J A
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
assume J: "finite J" "J \<subseteq> insert i' I" and A: "\<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)"
[PROOF STATE]
proof (state)
this:
finite J
J \<subseteq> insert i' I
?i1 \<in> J \<Longrightarrow> A ?i1 \<in> sets (M ?i1)

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
let ?X = "prod_emb (insert i' I) M J (Pi\<^sub>E J A)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
have "Pi\<^sub>M (insert i' I) M ?X = (\<Prod>i\<in>J. M i (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = (\<Prod>i\<in>J. emeasure (M i) (A i))
[PROOF STEP]
using M J A
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> prob_space (M ?i)
prob_space (M i')
finite J
J \<subseteq> insert i' I
?i1 \<in> J \<Longrightarrow> A ?i1 \<in> sets (M ?i1)

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = (\<Prod>i\<in>J. emeasure (M i) (A i))
[PROOF STEP]
by (intro emeasure_PiM_emb) auto
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = (\<Prod>i\<in>J. emeasure (M i) (A i))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = (\<Prod>i\<in>J. emeasure (M i) (A i))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
have "\<dots> = M i' (if i' \<in> J then (A i') else space (M i')) * (\<Prod>i\<in>J-{i'}. M i (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>J. emeasure (M i) (A i)) = emeasure (M i') (if i' \<in> J then A i' else space (M i')) * (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i))
[PROOF STEP]
using prod.insert_remove[of J "\<lambda>i. M i (A i)" i'] J M'.emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
finite J \<Longrightarrow> (\<Prod>i\<in>insert i' J. emeasure (M i) (A i)) = emeasure (M i') (A i') * (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i))
finite J
J \<subseteq> insert i' I
emeasure (M i') (space (M i')) = 1

goal (1 subgoal):
 1. (\<Prod>i\<in>J. emeasure (M i) (A i)) = emeasure (M i') (if i' \<in> J then A i' else space (M i')) * (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i))
[PROOF STEP]
by (cases "i' \<in> J") (auto simp: insert_absorb)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>J. emeasure (M i) (A i)) = emeasure (M i') (if i' \<in> J then A i' else space (M i')) * (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>J. emeasure (M i) (A i)) = emeasure (M i') (if i' \<in> J then A i' else space (M i')) * (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
have "(\<Prod>i\<in>J-{i'}. M i (A i)) = Pi\<^sub>M I M (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i)) = emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))
[PROOF STEP]
using M J A
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> prob_space (M ?i)
prob_space (M i')
finite J
J \<subseteq> insert i' I
?i1 \<in> J \<Longrightarrow> A ?i1 \<in> sets (M ?i1)

goal (1 subgoal):
 1. (\<Prod>i\<in>J - {i'}. emeasure (M i) (A i)) = emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))
[PROOF STEP]
by (intro emeasure_PiM_emb[symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>J - {i'}. emeasure (M i) (A i)) = emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>J - {i'}. emeasure (M i) (A i)) = emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
have "M i' (if i' \<in> J then (A i') else space (M i')) * \<dots> =
    (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((if i' \<in> J then (A i') else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (M i') (if i' \<in> J then A i' else space (M i')) * emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))
[PROOF STEP]
using J A
[PROOF STATE]
proof (prove)
using this:
finite J
J \<subseteq> insert i' I
?i1 \<in> J \<Longrightarrow> A ?i1 \<in> sets (M ?i1)

goal (1 subgoal):
 1. emeasure (M i') (if i' \<in> J then A i' else space (M i')) * emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))
[PROOF STEP]
by (intro I.emeasure_pair_measure_Times[symmetric] sets_PiM_I) auto
[PROOF STATE]
proof (state)
this:
emeasure (M i') (if i' \<in> J then A i' else space (M i')) * emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (M i') (if i' \<in> J then A i' else space (M i')) * emeasure (Pi\<^sub>M I M) (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
have "((if i' \<in> J then (A i') else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A)) =
    (\<lambda>(x, X). X(i' := x)) -` ?X \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A) = (\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M)
[PROOF STEP]
using A[of i', THEN sets.sets_into_space]
[PROOF STATE]
proof (prove)
using this:
i' \<in> J \<Longrightarrow> A i' \<subseteq> space (M i')

goal (1 subgoal):
 1. (if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A) = (\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M)
[PROOF STEP]
unfolding set_eq_iff
[PROOF STATE]
proof (prove)
using this:
i' \<in> J \<Longrightarrow> A i' \<subseteq> space (M i')

goal (1 subgoal):
 1. \<forall>x. (x \<in> (if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A)) = (x \<in> (\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M))
[PROOF STEP]
by (simp add: prod_emb_def space_pair_measure space_PiM PiE_fun_upd ac_simps cong: conj_cong)
       (auto simp add: Pi_iff Ball_def all_conj_distrib)
[PROOF STATE]
proof (state)
this:
(if i' \<in> J then A i' else space (M i')) \<times> prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A) = (\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M)

goal (2 subgoals):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
 2. \<And>A J. \<lbrakk>finite J; J \<subseteq> insert i' I; \<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M i)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M))
[PROOF STEP]
show "Pi\<^sub>M (insert i' I) M ?X = ?L ?X"
[PROOF STATE]
proof (prove)
using this:
emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M))

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
using J A
[PROOF STATE]
proof (prove)
using this:
emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) ((\<lambda>(x, X). X(i' := x)) -` prod_emb (insert i' I) M J (Pi\<^sub>E J A) \<inter> space (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M))
finite J
J \<subseteq> insert i' I
?i1 \<in> J \<Longrightarrow> A ?i1 \<in> sets (M ?i1)

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))
[PROOF STEP]
by (simp add: emeasure_distr)
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert i' I) M) (prod_emb (insert i' I) M J (Pi\<^sub>E J A)) = emeasure (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) (prod_emb (insert i' I) M J (Pi\<^sub>E J A))

goal (1 subgoal):
 1. sets (distr (M i' \<Otimes>\<^sub>M Pi\<^sub>M I M) (Pi\<^sub>M (insert i' I) M) (\<lambda>(x, X). X(i' := x))) = I'.events
[PROOF STEP]
qed simp


[STATEMENT]
lemma extract_var_single':
assumes "v \<noteq> v'"
shows "extract_var (monom (Poly_Mapping.single v n) a) v' = monom (Poly_Mapping.single v n) (monom 0 a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_var (monom (Poly_Mapping.single v n) a) v' = monom (Poly_Mapping.single v n) (monom 0 a)
[PROOF STEP]
unfolding extract_var_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (remove_key v' (Poly_Mapping.single v n)) (monom (Poly_Mapping.single v' (lookup (Poly_Mapping.single v n) v')) a) = monom (Poly_Mapping.single v n) (monom 0 a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<noteq> v'

goal (1 subgoal):
 1. monom (remove_key v' (Poly_Mapping.single v n)) (monom (Poly_Mapping.single v' (lookup (Poly_Mapping.single v n) v')) a) = monom (Poly_Mapping.single v n) (monom 0 a)
[PROOF STEP]
by (metis add.right_neutral lookup_single_not_eq remove_key_sum single_zero)


[STATEMENT]
lemma suminf_split_initial_segment: "summable f \<Longrightarrow> suminf f = (\<Sum>n. f(n + k)) + (\<Sum>i<k. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> suminf f = (\<Sum>n. f (n + k)) + sum f {..<k}
[PROOF STEP]
by (auto simp add: suminf_minus_initial_segment)


[STATEMENT]
lemma constant_res_set_semialg:
  assumes "l \<in> carrier (Zp_res_ring n)"
  shows "is_univ_semialgebraic {x \<in> \<O>\<^sub>p. Qp_res x n = l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_univ_semialgebraic {x \<in> \<O>\<^sub>p. Qp_res x n = l}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_univ_semialgebraic {x \<in> \<O>\<^sub>p. Qp_res x n = l}
[PROOF STEP]
have 0: "{x \<in> \<O>\<^sub>p. Qp_res x n = l} = Qp_cong_set n ([l]\<cdot>\<^bsub>Z\<^sub>p\<^esub>\<one>\<^bsub>Z\<^sub>p\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> \<O>\<^sub>p. Qp_res x n = l} = Qp_cong_set n ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)
[PROOF STEP]
apply(rule equalityI')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {x \<in> \<O>\<^sub>p. Qp_res x n = l} \<Longrightarrow> x \<in> Qp_cong_set n ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)
 2. \<And>x. x \<in> Qp_cong_set n ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<Longrightarrow> x \<in> {x \<in> \<O>\<^sub>p. Qp_res x n = l}
[PROOF STEP]
unfolding mem_Collect_eq Qp_cong_set_def Qp_res_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> \<O>\<^sub>p \<and> to_Zp x n = l \<Longrightarrow> x \<in> \<O>\<^sub>p \<and> to_Zp x n = ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) n
 2. \<And>x. x \<in> \<O>\<^sub>p \<and> to_Zp x n = ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) n \<Longrightarrow> x \<in> \<O>\<^sub>p \<and> to_Zp x n = l
[PROOF STEP]
apply (metis val_ring_memE Zp_int_inc_rep nat_le_linear p_residue_padic_int to_Zp_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> \<O>\<^sub>p \<and> to_Zp x n = ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) n \<Longrightarrow> x \<in> \<O>\<^sub>p \<and> to_Zp x n = l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<in> carrier (residue_ring (p ^ n))

goal (1 subgoal):
 1. \<And>x. x \<in> \<O>\<^sub>p \<and> to_Zp x n = ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) n \<Longrightarrow> x \<in> \<O>\<^sub>p \<and> to_Zp x n = l
[PROOF STEP]
by (metis Zp_int_inc_res mod_pos_pos_trivial p_residue_ring_car_memE(1) p_residue_ring_car_memE(2))
[PROOF STATE]
proof (state)
this:
{x \<in> \<O>\<^sub>p. Qp_res x n = l} = Qp_cong_set n ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)

goal (1 subgoal):
 1. is_univ_semialgebraic {x \<in> \<O>\<^sub>p. Qp_res x n = l}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_univ_semialgebraic {x \<in> \<O>\<^sub>p. Qp_res x n = l}
[PROOF STEP]
unfolding 0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_univ_semialgebraic (Qp_cong_set n ([l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>))
[PROOF STEP]
apply(rule Qp_cong_set_is_univ_semialgebraic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [l] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub> \<in> carrier Z\<^sub>p
[PROOF STEP]
by(rule Zp.int_inc_closed)
[PROOF STATE]
proof (state)
this:
is_univ_semialgebraic {x \<in> \<O>\<^sub>p. Qp_res x n = l}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DomInterAllowsMT_Ports:
  "p \<noteq> po \<Longrightarrow> dom (C (AllowPortFromTo a b p)) \<inter> dom (C (AllowPortFromTo c d po)) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> po \<Longrightarrow> dom (C (AllowPortFromTo a b p)) \<inter> dom (C (AllowPortFromTo c d po)) = {}
[PROOF STEP]
by (simp add: twoNetsDistinct_def netsDistinct_def PLemmas) auto


[STATEMENT]
lemma gSuc_glength_conv: "
  (eSuc n = glength a) =
  (\<exists>x b. a = x #\<^sub>g b \<and> glength b = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eSuc n = glength a) = (\<exists>x b. a = x #\<^sub>g b \<and> glength b = n)
[PROOF STEP]
by (simp add: eq_commute[of _ "glength a"] glength_gSuc_conv)


[STATEMENT]
lemma is_Proj_partial_isometry: \<open>is_Proj P \<Longrightarrow> partial_isometry P\<close> for P :: \<open>_ :: chilbert_space \<Rightarrow>\<^sub>C\<^sub>L _\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Proj P \<Longrightarrow> partial_isometry P
[PROOF STEP]
by (metis Proj_on_own_range Proj_partial_isometry)


[STATEMENT]
lemma rel_fun_inf: "inf (rel_fun Q R) (rel_fun Q R') = rel_fun Q (inf R R')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_fun Q R \<sqinter> rel_fun Q R' = rel_fun Q (R \<sqinter> R')
[PROOF STEP]
by(rule antisym)(auto elim: rel_fun_mono dest: rel_funD)


[STATEMENT]
lemma Rep_Abs_Bot :"Rep_process (Abs_process ({(s,X). front_tickFree s},{d. front_tickFree d})) =
                    ({(s,X). front_tickFree s},{d. front_tickFree d})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_process (Abs_process ({(s, X). front_tickFree s}, {d. front_tickFree d})) = ({(s, X). front_tickFree s}, {d. front_tickFree d})
[PROOF STEP]
by(subst Abs_process_inverse, simp_all only: CollectI Rep_process is_process_REP_Bot)


[STATEMENT]
lemma Lim_bounded_PInfty: "f \<longlonglongrightarrow> l \<Longrightarrow> (\<And>n. f n \<le> ereal B) \<Longrightarrow> l \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<longlonglongrightarrow> l; \<And>n. f n \<le> ereal B\<rbrakk> \<Longrightarrow> l \<noteq> \<infinity>
[PROOF STEP]
using LIMSEQ_le_const2[of f l "ereal B"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f \<longlonglongrightarrow> l; \<exists>N. \<forall>n\<ge>N. f n \<le> ereal B\<rbrakk> \<Longrightarrow> l \<le> ereal B

goal (1 subgoal):
 1. \<lbrakk>f \<longlonglongrightarrow> l; \<And>n. f n \<le> ereal B\<rbrakk> \<Longrightarrow> l \<noteq> \<infinity>
[PROOF STEP]
by auto


[STATEMENT]
lemma mirror_elem_eq_conv': "
  \<lbrakk> finite I; a \<in> I; b \<in> I \<rbrakk> \<Longrightarrow> (mirror_elem a I = mirror_elem b I) = (a = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> (mirror_elem a I = mirror_elem b I) = (a = b)
[PROOF STEP]
apply (rule mirror_elem_eq_conv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> a \<le> iMin I + Max I
 2. \<lbrakk>finite I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> b \<le> iMin I + Max I
[PROOF STEP]
apply (simp_all add: trans_le_add2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem E20: "\<turnstile> \<diamond>\<box>F \<longrightarrow> \<box>\<diamond>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<diamond>\<box>F \<longrightarrow> \<box>\<diamond>F
[PROOF STEP]
by (rule lift_imp_trans[OF E19 E17])


[STATEMENT]
lemma mset_subseqs_size: "mset ` {ys. ys \<in> set (subseqs xs) \<and> length ys = n} =
  {ws. ws \<subseteq># mset xs \<and> size ws = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs xs). length ys = n} = {ws. ws \<subseteq># mset xs \<and> size ws = n}
[PROOF STEP]
proof (induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. mset ` {ys \<in> set (subseqs []). length ys = n} = {ws. ws \<subseteq># mset [] \<and> size ws = n}
 2. \<And>a xs n. (\<And>n. mset ` {ys \<in> set (subseqs xs). length ys = n} = {ws. ws \<subseteq># mset xs \<and> size ws = n}) \<Longrightarrow> mset ` {ys \<in> set (subseqs (a # xs)). length ys = n} = {ws. ws \<subseteq># mset (a # xs) \<and> size ws = n}
[PROOF STEP]
case (Cons x xs n)
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs xs). length ys = ?n} = {ws. ws \<subseteq># mset xs \<and> size ws = ?n}

goal (2 subgoals):
 1. \<And>n. mset ` {ys \<in> set (subseqs []). length ys = n} = {ws. ws \<subseteq># mset [] \<and> size ws = n}
 2. \<And>a xs n. (\<And>n. mset ` {ys \<in> set (subseqs xs). length ys = n} = {ws. ws \<subseteq># mset xs \<and> size ws = n}) \<Longrightarrow> mset ` {ys \<in> set (subseqs (a # xs)). length ys = n} = {ws. ws \<subseteq># mset (a # xs) \<and> size ws = n}
[PROOF STEP]
show ?case (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
 2. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
 2. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
by (auto simp: Let_def)
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
have "?r = {ws. ws \<subseteq># mset (x # xs)} \<inter> {ps. size ps = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ws. ws \<subseteq># mset (x # xs)} \<inter> {ps. size ps = n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ws. ws \<subseteq># mset (x # xs)} \<inter> {ps. size ps = n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ws. ws \<subseteq># mset (x # xs)} \<inter> {ps. size ps = n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
have "{ws. ws \<subseteq># mset (x # xs)} = {ps. ps \<subseteq># mset xs} \<union> ((\<lambda> ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ws. ws \<subseteq># mset (x # xs)} = {ps. ps \<subseteq># mset xs} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs}
[PROOF STEP]
by (simp add: multiset_subset_insert)
[PROOF STATE]
proof (state)
this:
{ws. ws \<subseteq># mset (x # xs)} = {ps. ps \<subseteq># mset xs} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{ws. ws \<subseteq># mset (x # xs)} = {ps. ps \<subseteq># mset xs} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
have "\<dots> \<inter> {ps. size ps = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n}
      \<union> ((\<lambda> ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({ps. ps \<subseteq># mset xs} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs}) \<inter> {ps. size ps = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}
[PROOF STEP]
unfolding Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({ps. ps \<subseteq># mset xs} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs}) \<inter> {ps. size ps = Suc m} = {ps. ps \<subseteq># mset xs \<and> size ps = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
({ps. ps \<subseteq># mset xs} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs}) \<inter> {ps. size ps = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}
[PROOF STEP]
have id: "?r =
      {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}"
[PROOF STATE]
proof (prove)
using this:
{ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}

goal (1 subgoal):
 1. {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{ws. ws \<subseteq># mset (x # xs) \<and> size ws = n} = {ps. ps \<subseteq># mset xs \<and> size ps = n} \<union> (\<lambda>ps. ps + {#x#}) ` {ps. ps \<subseteq># mset xs \<and> size ps = m}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
have "?l = mset ` {ys \<in> set (subseqs xs). length ys = Suc m}
      \<union> mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m}
[PROOF STEP]
unfolding Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs (x # xs)). length ys = Suc m} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m}
[PROOF STEP]
by (auto simp: Let_def)
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
have "mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m}
      = (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m} = (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> (#) x ` set (subseqs xs). length ys = Suc m} = (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}
[PROOF STEP]
have id': "?l = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union>
      (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}"
[PROOF STATE]
proof (prove)
using this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}

goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}
[PROOF STEP]
unfolding id id' Cons[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m} = mset ` {ys \<in> set (subseqs xs). length ys = n} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}
[PROOF STEP]
unfolding Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m} = mset ` {ys \<in> set (subseqs xs). length ys = Suc m} \<union> (\<lambda>ps. ps + {#x#}) ` mset ` {ys \<in> set (subseqs xs). length ys = m}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mset ` {ys \<in> set (subseqs (x # xs)). length ys = n} = {ws. ws \<subseteq># mset (x # xs) \<and> size ws = n}

goal (1 subgoal):
 1. \<And>n. mset ` {ys \<in> set (subseqs []). length ys = n} = {ws. ws \<subseteq># mset [] \<and> size ws = n}
[PROOF STEP]
qed auto


[STATEMENT]
lemma Bex_inj_conv: assumes "inj f" shows "(\<exists>y\<in>f ` A. P (inv f y)) \<longleftrightarrow> (\<exists>x\<in>A. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y\<in>f ` A. P (inv f y)) = (\<exists>x\<in>A. P x)
[PROOF STEP]
using bex_simps(7)[of f A "\<lambda>y. P (inv f y)"]
[PROOF STATE]
proof (prove)
using this:
(\<exists>x\<in>f ` A. P (inv f x)) = (\<exists>x\<in>A. P (inv f (f x)))

goal (1 subgoal):
 1. (\<exists>y\<in>f ` A. P (inv f y)) = (\<exists>x\<in>A. P x)
[PROOF STEP]
unfolding inv_f_f[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<exists>x\<in>f ` A. P (inv f x)) = (\<exists>x\<in>A. P x)

goal (1 subgoal):
 1. (\<exists>y\<in>f ` A. P (inv f y)) = (\<exists>x\<in>A. P x)
[PROOF STEP]
.


[STATEMENT]
lemma rot_eq_0_iff[simp]: "rot x = 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rot x = (0::'a)) = (x = (0::'a))
[PROOF STEP]
apply (auto simp: rot_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. eucl_of_list [x $\<^sub>e Suc 0, - x $\<^sub>e 0] = (0::'a) \<Longrightarrow> x = (0::'a)
 2. x = (0::'a) \<Longrightarrow> eucl_of_list [(0::'a) $\<^sub>e Suc 0, - (0::'a) $\<^sub>e 0] = (0::'a)
[PROOF STEP]
apply (metis One_nat_def norm_eq_zero norm_rot norm_zero rot_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (0::'a) \<Longrightarrow> eucl_of_list [(0::'a) $\<^sub>e Suc 0, - (0::'a) $\<^sub>e 0] = (0::'a)
[PROOF STEP]
using rot_0 rot_def
[PROOF STATE]
proof (prove)
using this:
rot (0::'a) = (0::'a)
rot ?v = eucl_of_list [?v $\<^sub>e 1, - ?v $\<^sub>e 0]

goal (1 subgoal):
 1. x = (0::'a) \<Longrightarrow> eucl_of_list [(0::'a) $\<^sub>e Suc 0, - (0::'a) $\<^sub>e 0] = (0::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma ile_eSuc [simp]: "(n::eint) \<le> n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> n + 1
[PROOF STEP]
by (metis add.right_neutral add_left_mono eint_1_iff(2) eint_ord_code(1) linear not_one_le_zero zero_eint_def)


[STATEMENT]
lemma per_cong_mid:
  assumes "B \<noteq> C" and
    "Bet A B C" and
    "Cong A H C H" and
    "Per H B C"
  shows "B Midpoint A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B Midpoint A C
[PROOF STEP]
using assms(1) assms(2) assms(3) assms(4) per_cong_mid_R1 per_cong_mid_R2
[PROOF STATE]
proof (prove)
using this:
B \<noteq> C
Bet A B C
Cong A H C H
Per H B C
\<lbrakk>?B = ?H; Bet ?A ?B ?C; Cong ?A ?H ?C ?H; Per ?H ?B ?C\<rbrakk> \<Longrightarrow> ?B Midpoint ?A ?C
\<lbrakk>?B \<noteq> ?C; Bet ?A ?B ?C; Cong ?A ?H ?C ?H; Per ?H ?B ?C\<rbrakk> \<Longrightarrow> ?B Midpoint ?A ?C

goal (1 subgoal):
 1. B Midpoint A C
[PROOF STEP]
by blast


[STATEMENT]
lemma cindex_polyE_mult_cancel:
  fixes p q p'::"real poly"
  assumes "p'\<noteq> 0"
  shows "cindex_polyE a b (p' * q ) (p' * p) = cindex_polyE a b q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b (p' * q) (p' * p) = cindex_polyE a b q p
[PROOF STEP]
unfolding cindex_polyE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR (p' * q) (p' * p) a + real_of_int (cindex_poly a b (p' * q) (p' * p)) - jumpF_polyL (p' * q) (p' * p) b = jumpF_polyR q p a + real_of_int (cindex_poly a b q p) - jumpF_polyL q p b
[PROOF STEP]
using cindex_poly_mult[OF \<open>p'\<noteq>0\<close>] jumpF_polyL_mult_cancel[OF \<open>p'\<noteq>0\<close>]
    jumpF_polyR_mult_cancel[OF \<open>p'\<noteq>0\<close>]
[PROOF STATE]
proof (prove)
using this:
cindex_poly ?a ?b (p' * ?q) (p' * ?p) = cindex_poly ?a ?b ?q ?p
jumpF_polyL (p' * ?q) (p' * ?p) ?a = jumpF_polyL ?q ?p ?a
jumpF_polyR (p' * ?q) (p' * ?p) ?a = jumpF_polyR ?q ?p ?a

goal (1 subgoal):
 1. jumpF_polyR (p' * q) (p' * p) a + real_of_int (cindex_poly a b (p' * q) (p' * p)) - jumpF_polyL (p' * q) (p' * p) b = jumpF_polyR q p a + real_of_int (cindex_poly a b q p) - jumpF_polyL q p b
[PROOF STEP]
by simp


[STATEMENT]
lemma bounded_linear_bfun_nth: "bounded_linear f \<Longrightarrow> bounded_linear (\<lambda>v. bfun.Bfun (($) (f v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f \<Longrightarrow> bounded_linear (\<lambda>v. bfun.Bfun (($) (f v)))
[PROOF STEP]
using order_trans[OF Finite_Cartesian_Product.norm_nth_le onorm, of f]
[PROOF STATE]
proof (prove)
using this:
bounded_linear f \<Longrightarrow> norm (f ?x1 $ ?i2) \<le> onorm f * norm ?x1

goal (1 subgoal):
 1. bounded_linear f \<Longrightarrow> bounded_linear (\<lambda>v. bfun.Bfun (($) (f v)))
[PROOF STEP]
by (auto simp: Bfun_inverse mult.commute linear_simps dist_bfun_def norm_bfun_def
      intro!: bounded_linear_intro cSup_least)


[STATEMENT]
lemma carrier_DirProd [simp]: "carrier (G \<times>\<times> H) = carrier G \<times> carrier H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (G \<times>\<times> H) = carrier G \<times> carrier H
[PROOF STEP]
by (simp add: DirProd_def)


[STATEMENT]
lemma rquot_node:
  "dfa_is_node (rquot M n) q = dfa_is_node M q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa_is_node (rquot M n) q = dfa_is_node M q
[PROOF STEP]
by (simp add: rquot_def dfa_is_node_def split_beta)


[STATEMENT]
lemma swapnorm:
  assumes nbs: "n < length bs"
    and mbs: "m < length bs"
  shows "((Ipoly bs (swapnorm n m t) :: 'a::field_char_0)) =
    Ipoly ((bs[n:= bs!m])[m:= bs!n]) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>swapnorm n m t\<rparr>\<^sub>p\<^bsup>bs\<^esup> = \<lparr>t\<rparr>\<^sub>p\<^bsup>bs[n := bs ! m, m := bs ! n]\<^esup>
[PROOF STEP]
using swap[OF assms] swapnorm_def
[PROOF STATE]
proof (prove)
using this:
\<lparr>swap n m ?t\<rparr>\<^sub>p\<^bsup>bs\<^esup> = \<lparr>?t\<rparr>\<^sub>p\<^bsup>bs[n := bs ! m, m := bs ! n]\<^esup>
swapnorm ?n ?m ?t = polynate (swap ?n ?m ?t)

goal (1 subgoal):
 1. \<lparr>swapnorm n m t\<rparr>\<^sub>p\<^bsup>bs\<^esup> = \<lparr>t\<rparr>\<^sub>p\<^bsup>bs[n := bs ! m, m := bs ! n]\<^esup>
[PROOF STEP]
by simp


[STATEMENT]
lemma vdwE:
  assumes "vdw k l n"
          "b + 1 \<ge> a + int n"
          "col \<in> {a..b} \<rightarrow> {..<k}"
  obtains j start step where
    "j < k" "step > 0"
    "is_arith_prog_on l start step a b"
    "arith_prog start step ` {..<l} \<subseteq> col -` {j} \<inter> {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j step start. \<lbrakk>j < k; 0 < step; is_arith_prog_on l start step a b; arith_prog start step ` {..<l} \<subseteq> col -` {j} \<inter> {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
vdw k l n
a + int n \<le> b + 1
col \<in> {a..b} \<rightarrow> {..<k}
\<lbrakk>?j < k; 0 < ?step; is_arith_prog_on l ?start ?step a b; arith_prog ?start ?step ` {..<l} \<subseteq> col -` {?j} \<inter> {a..b}\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. (\<And>j step start. \<lbrakk>j < k; 0 < step; is_arith_prog_on l start step a b; arith_prog start step ` {..<l} \<subseteq> col -` {j} \<inter> {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding vdw_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a b col. a + int n \<le> b + 1 \<and> col \<in> {a..b} \<rightarrow> {..<k} \<longrightarrow> (\<exists>j start step. j < k \<and> 0 < step \<and> is_arith_prog_on l start step a b \<and> arith_prog start step ` {..<l} \<subseteq> col -` {j} \<inter> {a..b})
a + int n \<le> b + 1
col \<in> {a..b} \<rightarrow> {..<k}
\<lbrakk>?j < k; 0 < ?step; is_arith_prog_on l ?start ?step a b; arith_prog ?start ?step ` {..<l} \<subseteq> col -` {?j} \<inter> {a..b}\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. (\<And>j step start. \<lbrakk>j < k; 0 < step; is_arith_prog_on l start step a b; arith_prog start step ` {..<l} \<subseteq> col -` {j} \<inter> {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis


[STATEMENT]
lemma flatten_sum: "flatten (sum f I) = (\<Sum>i\<in>I. flatten (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flatten (sum f I) = (\<Sum>i\<in>I. flatten (f i))
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (simp_all add: flatten_plus)


[STATEMENT]
lemma Im_complex_div_le_0: "Im (a / b) \<le> 0 \<longleftrightarrow> Im (a * cnj b) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im (a / b) \<le> 0) = (Im (a * cnj b) \<le> 0)
[PROOF STEP]
by (metis Im_complex_div_gt_0 not_le)


[STATEMENT]
lemma limitin_sequentially_offset:
   "limitin X f l sequentially \<Longrightarrow> limitin X (\<lambda>i. f (i + k)) l sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limitin X f l sequentially \<Longrightarrow> limitin X (\<lambda>i. f (i + k)) l sequentially
[PROOF STEP]
unfolding limitin_sequentially
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. f n \<in> U)) \<Longrightarrow> l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. f (n + k) \<in> U))
[PROOF STEP]
by (metis add.commute le_add2 order_trans)


[STATEMENT]
lemma integral_restrict_Int:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: banach"
  shows "integral T (\<lambda>x. if x \<in> S then f x else 0) = integral (S \<inter> T) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral T (\<lambda>x. if x \<in> S then f x else (0::'b)) = integral (S \<inter> T) f
[PROOF STEP]
by (metis (no_types, lifting) has_integral_cong has_integral_restrict_Int integrable_integral integral_unique not_integrable_integral)


[STATEMENT]
lemma succ_empty: "succ empty v = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. succ FiniteGraph.empty v = {}
[PROOF STEP]
unfolding empty_def succ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v'. (v, v') \<in> edges \<lparr>nodes = {}, edges = {}\<rparr>} = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma suminf_split_initial_segment: "summable f \<Longrightarrow> suminf f = (\<Sum>n. f(n + k)) + (\<Sum>i<k. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> suminf f = (\<Sum>n. f (n + k)) + sum f {..<k}
[PROOF STEP]
by (auto simp add: suminf_minus_initial_segment)


[STATEMENT]
lemma inf_a_b: "inf_a = inf_b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_a = inf_b
[PROOF STEP]
apply (simp add: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x xa. inf_a x xa = inf_b x xa
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. inf_a x xa = inf_b x xa
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. inf_a x xa \<le> inf_b x xa
 2. \<And>x xa. inf_b x xa \<le> inf_a x xa
[PROOF STEP]
by simp_all


[STATEMENT]
lemma tdev_pdevs_of_list[simp]: "tdev (pdevs_of_list xs) = sum_list (map abs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tdev (pdevs_of_list xs) = sum_list (map abs xs)
[PROOF STEP]
by (auto simp: tdev_def pdevs_apply_pdevs_of_list sum_list_sum_nth
    less_degree_pdevs_of_list_imp_less_length
    intro!: sum.mono_neutral_cong_left degree_gt)


[STATEMENT]
lemma par_assoc: "((P || Q) || S) = (P || (Q || S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P||Q||S) = (P||(Q||S))
[PROOF STEP]
by (rule sync_assoc)


[STATEMENT]
lemma Idl_eq_abs: "Idl\<^bsub>\<Z>\<^esub> {k} = Idl\<^bsub>\<Z>\<^esub> {l} \<longleftrightarrow> \<bar>l\<bar> = \<bar>k\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Idl\<^bsub>\<Z>\<^esub> {k} = Idl\<^bsub>\<Z>\<^esub> {l}) = (\<bar>l\<bar> = \<bar>k\<bar>)
[PROOF STEP]
apply (subst dvds_eq_abseq[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Idl\<^bsub>\<Z>\<^esub> {k} = Idl\<^bsub>\<Z>\<^esub> {l}) = (l dvd k \<and> k dvd l)
[PROOF STEP]
apply (rule dvds_eq_Idl[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma proots_count_nzero:
  assumes "\<And>x. x\<in>s \<Longrightarrow> poly p x\<noteq>0"
  shows "proots_count p s = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p s = 0
[PROOF STEP]
unfolding proots_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r\<in>proots_within p s. order r p) = 0
[PROOF STEP]
by(rule sum.neutral) (use assms in auto)


[STATEMENT]
lemma iteration_unfold_eq: "x\<^sup>\<infinity> \<cdot> x = x \<cdot> x\<^sup>\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<infinity> \<cdot> x = x \<cdot> x\<^sup>\<infinity>
[PROOF STEP]
by (metis iteration_unfoldl_distr iteration_unfoldr_distl)


[STATEMENT]
lemma smult_sum: "smult (\<Sum>i \<in> S. f i) p = (\<Sum>i \<in> S. smult (f i) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (sum f S) p = (\<Sum>i\<in>S. smult (f i) p)
[PROOF STEP]
by (induct S rule: infinite_finite_induct, auto simp: smult_add_left)


[STATEMENT]
lemma pmf_expectation_eq_infsetsum: "measure_pmf.expectation p f = infsetsum (\<lambda>x. pmf p x * f x) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p f = (\<Sum>\<^sub>ax. pmf p x * f x)
[PROOF STEP]
unfolding infsetsum_def measure_pmf_eq_density
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (density (count_space UNIV) (\<lambda>x. ennreal (pmf p x))) f = LINT x|count_space UNIV. pmf p x * f x
[PROOF STEP]
by (subst integral_density) simp_all


[STATEMENT]
lemma Ln_series': "cmod z < 1 \<Longrightarrow> (\<lambda>n. - ((-z)^n) / of_nat n) sums ln (1 + z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod z < 1 \<Longrightarrow> (\<lambda>n. - ((- z) ^ n) / of_nat n) sums Ln (1 + z)
[PROOF STEP]
by (drule Ln_series) (simp add: power_minus')


[STATEMENT]
theorem F1map_id: "F1map id id = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F2map id = id
[PROOF STEP]
by (rule F.map_id0)


[STATEMENT]
lemma has_integral_linear_cbox:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::real_normed_vector"
  assumes f: "(f has_integral y) (cbox a b)"
    and h: "bounded_linear h"
  shows "((h \<circ> f) has_integral (h y)) (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<circ> f has_integral h y) (cbox a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (h \<circ> f has_integral h y) (cbox a b)
[PROOF STEP]
interpret bounded_linear h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear h
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
bounded_linear h

goal (1 subgoal):
 1. bounded_linear h
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (h \<circ> f has_integral h y) (cbox a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<circ> f has_integral h y) (cbox a b)
[PROOF STEP]
unfolding has_integral_cbox
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum (\<lambda>(x, k). content k *\<^sub>R (h \<circ> f) x) \<longlongrightarrow> h y) (division_filter (cbox a b))
[PROOF STEP]
using tendsto [OF f [unfolded has_integral_cbox]]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. h (\<Sum>(x, k)\<in>x. content k *\<^sub>R f x)) \<longlongrightarrow> h y) (division_filter (cbox a b))

goal (1 subgoal):
 1. (sum (\<lambda>(x, k). content k *\<^sub>R (h \<circ> f) x) \<longlongrightarrow> h y) (division_filter (cbox a b))
[PROOF STEP]
by (simp add: sum scaleR split_beta')
[PROOF STATE]
proof (state)
this:
(h \<circ> f has_integral h y) (cbox a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_wp_SetPC:
  "(\<And>x s. x \<in> supp (p s) \<Longrightarrow> determ (wp (a x))) \<Longrightarrow>
   (\<And>s. finite (supp (p s))) \<Longrightarrow>
   (\<And>s. sum (p s) (supp (p s)) = 1) \<Longrightarrow>
   determ (wp (SetPC a p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x s. x \<in> supp (p s) \<Longrightarrow> determ (wp (a x)); \<And>s. finite (supp (p s)); \<And>s. sum (p s) (supp (p s)) = 1\<rbrakk> \<Longrightarrow> determ (wp (SetPC a p))
[PROOF STEP]
by(intro determI fa_intros max_intros, auto)


[STATEMENT]
lemma ffb_diff_inv[simp]:
  "({s. I s} \<le> fb\<^sub>\<F> (x\<acute>= f & G on U S @ t\<^sub>0) {s. I s}) = diff_invariant I f U S t\<^sub>0 G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({s. I s} \<subseteq> fb\<^sub>\<F> x\<acute>=f & G on U S @ t\<^sub>0 {s. I s}) = diff_invariant I f U S t\<^sub>0 G
[PROOF STEP]
by (auto simp: diff_invariant_def ivp_sols_def ffb_eq g_orbital_eq)


[STATEMENT]
lemma [code]: "p - q = p + - q"
  for p q :: "'a::ab_group_add poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p - q = p + - q
[PROOF STEP]
by (fact diff_conv_add_uminus)


[STATEMENT]
lemma cong__acute:
  assumes "A \<noteq> B" and
    "B \<noteq> C" and
    "Cong A B A C"
  shows "Acute A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Acute A B C
[PROOF STEP]
using angle_partition assms(1) assms(2) assms(3) cong__nlt l11_46 lt_left_comm
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<noteq> ?B; ?B \<noteq> ?C\<rbrakk> \<Longrightarrow> Acute ?A ?B ?C \<or> Per ?A ?B ?C \<or> Obtuse ?A ?B ?C
A \<noteq> B
B \<noteq> C
Cong A B A C
Cong ?A ?B ?C ?D \<Longrightarrow> \<not> ?A ?B Lt ?C ?D
\<lbrakk>?A \<noteq> ?B; ?B \<noteq> ?C; Per ?A ?B ?C \<or> Obtuse ?A ?B ?C\<rbrakk> \<Longrightarrow> ?B ?A Lt ?A ?C \<and> ?B ?C Lt ?A ?C
?A ?B Lt ?C ?D \<Longrightarrow> ?B ?A Lt ?C ?D

goal (1 subgoal):
 1. Acute A B C
[PROOF STEP]
by blast