[STATEMENT]
lemma perp_up_at_end:
  assumes "a \<in> hyp2" and "b \<in> hyp2" and "proj2_incident b l"
  shows "B\<^sub>\<real> (cart2_pt (perp_foot a l)) (cart2_pt a) (cart2_pt (perp_up a l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
 2. \<not> ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
assume "proj2_incident a l"
[PROOF STATE]
proof (state)
this:
proj2_incident a l

goal (2 subgoals):
 1. ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
 2. \<not> ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
with \<open>a \<in> hyp2\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<in> hyp2
proj2_incident a l
[PROOF STEP]
have "perp_foot a l = a"
[PROOF STATE]
proof (prove)
using this:
a \<in> hyp2
proj2_incident a l

goal (1 subgoal):
 1. perp_foot a l = a
[PROOF STEP]
by (rule hyp2_incident_perp_foot_same_point)
[PROOF STATE]
proof (state)
this:
perp_foot a l = a

goal (2 subgoals):
 1. ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
 2. \<not> ?P \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
thus "B\<^sub>\<real> (cart2_pt (perp_foot a l)) (cart2_pt a) (cart2_pt (perp_up a l))"
[PROOF STATE]
proof (prove)
using this:
perp_foot a l = a

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
by (simp add: real_euclid.th3_1 real_euclid.th3_2)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)

goal (1 subgoal):
 1. \<not> proj2_incident a l \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> proj2_incident a l \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
assume "\<not> proj2_incident a l"
[PROOF STATE]
proof (state)
this:
\<not> proj2_incident a l

goal (1 subgoal):
 1. \<not> proj2_incident a l \<Longrightarrow> B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l
\<not> proj2_incident a l
[PROOF STEP]
show "B\<^sub>\<real> (cart2_pt (perp_foot a l)) (cart2_pt a) (cart2_pt (perp_up a l))"
[PROOF STATE]
proof (prove)
using this:
a \<in> hyp2
b \<in> hyp2
proj2_incident b l
\<not> proj2_incident a l

goal (1 subgoal):
 1. B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)
[PROOF STEP]
by (rule perp_up_non_degenerate_in_S_at_end)
[PROOF STATE]
proof (state)
this:
B\<^sub>\<real> cart2_pt (perp_foot a l) cart2_pt a cart2_pt (perp_up a l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_pcompose_linear:
  "coeff (pcompose p [:0, a :: 'a :: comm_semiring_1:]) i = a ^ i * coeff p i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0::'a, a:]) i = a ^ i * coeff p i
[PROOF STEP]
by (induction p arbitrary: i) (auto simp: pcompose_pCons coeff_pCons mult_ac split: nat.splits)


[STATEMENT]
lemma (in padic_integers) residue_of_sum':
 "(a \<oplus> b) k = ((a k) + (b k)) mod p^k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<oplus> b) k = (a k + b k) mod p ^ k
[PROOF STEP]
using residue_add residue_of_sum
[PROOF STATE]
proof (prove)
using this:
?x \<oplus>\<^bsub>residue_ring (p ^ ?k)\<^esub> ?y = (?x + ?y) mod p ^ ?k
(?a \<oplus> ?b) ?k = ?a ?k \<oplus>\<^bsub>residue_ring (p ^ ?k)\<^esub> ?b ?k

goal (1 subgoal):
 1. (a \<oplus> b) k = (a k + b k) mod p ^ k
[PROOF STEP]
by auto


[STATEMENT]
lemma R_lin_independent_obtain_unique_scalars :
  "\<lbrakk> set ms \<subseteq> M; R_lin_independent ms; n \<in> RSpan ms \<rbrakk>
        \<Longrightarrow> (\<exists>! rs. set rs \<subseteq> R \<and> length rs = length ms \<and> n = rs \<bullet>\<cdot> ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set ms \<subseteq> M; R_lin_independent ms; n \<in> RSpan ms\<rbrakk> \<Longrightarrow> \<exists>!rs. set rs \<subseteq> R \<and> length rs = length ms \<and> n = rs \<bullet>\<cdot> ms
[PROOF STEP]
using in_RSpan_obtain_same_length_coeffs[of n ms]
        R_lin_independent_imp_same_scalars[of _ _ ms]
[PROOF STATE]
proof (prove)
using this:
n \<in> RSpan ms \<Longrightarrow> \<exists>rs. set rs \<subseteq> R \<and> length rs = length ms \<and> n = rs \<bullet>\<cdot> ms
\<lbrakk>length ?rs = length ?ss; length ?rs \<le> length ms; set ?rs \<subseteq> R; set ?ss \<subseteq> R; set ms \<subseteq> M; R_lin_independent ms; ?rs \<bullet>\<cdot> ms = ?ss \<bullet>\<cdot> ms\<rbrakk> \<Longrightarrow> ?rs = ?ss

goal (1 subgoal):
 1. \<lbrakk>set ms \<subseteq> M; R_lin_independent ms; n \<in> RSpan ms\<rbrakk> \<Longrightarrow> \<exists>!rs. set rs \<subseteq> R \<and> length rs = length ms \<and> n = rs \<bullet>\<cdot> ms
[PROOF STEP]
by    auto


[STATEMENT]
lemma ennreal_add_left_cancel_le: "a + b \<le> a + c \<longleftrightarrow> a = (\<infinity>::ennreal) \<or> b \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b \<le> a + c) = (a = \<infinity> \<or> b \<le> c)
[PROOF STEP]
unfolding infinity_ennreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b \<le> a + c) = (a = top \<or> b \<le> c)
[PROOF STEP]
by transfer (simp add: ereal_add_le_add_iff top_ereal_def disj_commute)


[STATEMENT]
lemma aligned_mask_disjoint:
  "\<lbrakk> is_aligned (a :: 'a :: len word) n; b \<le> mask n \<rbrakk> \<Longrightarrow> a AND b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_aligned a n; b \<le> mask n\<rbrakk> \<Longrightarrow> a AND b = 0
[PROOF STEP]
by (metis and_zero_eq is_aligned_mask le_mask_imp_and_mask word_bw_lcs(1))


[STATEMENT]
lemma plusl_infty_zero: "\<infinity>\<^sub>1 +\<^sub>1 [0]\<^sub>1 = \<infinity>\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity>\<^sub>1 +\<^sub>1 [0]\<^sub>1 = \<infinity>\<^sub>1
[PROOF STEP]
by (simp)


[STATEMENT]
lemma val_ultrametric_noteq'':
  assumes "x \<in> carrier Q\<^sub>p"
  assumes "y \<in> carrier Q\<^sub>p"
  assumes "val x > val y"
  shows "val (y \<ominus> x) = val y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (y \<ominus> x) = val y
[PROOF STEP]
by (metis Qp.minus_a_inv Qp.minus_closed assms(1) assms(2) assms(3) val_minus val_ultrametric_noteq')


[STATEMENT]
lemma le_transitivity:
  assumes "A B Le C D" and
    "C D Le E F"
  shows "A B Le E F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B Le E F
[PROOF STEP]
by (meson assms(1) assms(2) between_exchange4 cong_reflexivity l5_5_1 l5_5_2 l5_6 le_bet)


[STATEMENT]
lemma integrable_on_subinterval:
  fixes f :: "'n::ordered_euclidean_space \<Rightarrow> 'a::banach"
  assumes "f integrable_on S" "{a..b} \<subseteq> S"
  shows "f integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on {a..b}
[PROOF STEP]
using integrable_on_subcbox[of f S a b] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f integrable_on S; cbox a b \<subseteq> S\<rbrakk> \<Longrightarrow> f integrable_on cbox a b
f integrable_on S
{a..b} \<subseteq> S

goal (1 subgoal):
 1. f integrable_on {a..b}
[PROOF STEP]
by (simp add: cbox_interval)


[STATEMENT]
lemma integral_mono_lebesgue_on_AE:
  fixes f::"_ \<Rightarrow> real"
  assumes f: "integrable (lebesgue_on T) f"
    and gf: "AE x in (lebesgue_on S). g x \<le> f x"
    and f0: "AE x in (lebesgue_on T). 0 \<le> f x"
    and "S \<subseteq> T" and S: "S \<in> sets lebesgue" and T: "T \<in> sets lebesgue"
  shows "(\<integral>x. g x \<partial>(lebesgue_on S)) \<le> (\<integral>x. f x \<partial>(lebesgue_on T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
have "(\<integral>x. g x \<partial>(lebesgue_on S)) = (\<integral>x. (if x \<in> S then g x else 0) \<partial>lebesgue)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g = LINT x|lebesgue. (if x \<in> S then g x else 0)
[PROOF STEP]
by (simp add: Lebesgue_Measure.integral_restrict_UNIV S)
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (lebesgue_on S) g = LINT x|lebesgue. (if x \<in> S then g x else 0)

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (lebesgue_on S) g = LINT x|lebesgue. (if x \<in> S then g x else 0)

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
have "\<dots> \<le> (\<integral>x. (if x \<in> T then f x else 0) \<partial>lebesgue)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue. (if x \<in> S then g x else 0) \<le> LINT x|lebesgue. (if x \<in> T then f x else 0)
[PROOF STEP]
proof (rule Bochner_Integration.integral_mono_AE')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable lebesgue (\<lambda>x. if x \<in> T then f x else 0)
 2. AE x in lebesgue. (if x \<in> S then g x else 0) \<le> (if x \<in> T then f x else 0)
 3. AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
show "integrable lebesgue (\<lambda>x. if x \<in> T then f x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. if x \<in> T then f x else 0)
[PROOF STEP]
by (simp add: integrable_restrict_UNIV T f)
[PROOF STATE]
proof (state)
this:
integrable lebesgue (\<lambda>x. if x \<in> T then f x else 0)

goal (2 subgoals):
 1. AE x in lebesgue. (if x \<in> S then g x else 0) \<le> (if x \<in> T then f x else 0)
 2. AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
show "AE x in lebesgue. (if x \<in> S then g x else 0) \<le> (if x \<in> T then f x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in lebesgue. (if x \<in> S then g x else 0) \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on T) f
AE x in lebesgue_on S. g x \<le> f x
AE x in lebesgue_on T. 0 \<le> f x
S \<subseteq> T
S \<in> sets lebesgue
T \<in> sets lebesgue

goal (1 subgoal):
 1. AE x in lebesgue. (if x \<in> S then g x else 0) \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
by (auto simp: AE_restrict_space_iff)
[PROOF STATE]
proof (state)
this:
AE x in lebesgue. (if x \<in> S then g x else 0) \<le> (if x \<in> T then f x else 0)

goal (1 subgoal):
 1. AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
show "AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
using f0
[PROOF STATE]
proof (prove)
using this:
AE x in lebesgue_on T. 0 \<le> f x

goal (1 subgoal):
 1. AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)
[PROOF STEP]
by (simp add: AE_restrict_space_iff T)
[PROOF STATE]
proof (state)
this:
AE x in lebesgue. 0 \<le> (if x \<in> T then f x else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue. (if x \<in> S then g x else 0) \<le> LINT x|lebesgue. (if x \<in> T then f x else 0)

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue. (if x \<in> S then g x else 0) \<le> LINT x|lebesgue. (if x \<in> T then f x else 0)

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
have "\<dots> = (\<integral>x. f x \<partial>(lebesgue_on T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue. (if x \<in> T then f x else 0) = integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
using Lebesgue_Measure.integral_restrict_UNIV T
[PROOF STATE]
proof (prove)
using this:
?S \<in> sets lebesgue \<Longrightarrow> LINT x|lebesgue. (if x \<in> ?S then ?f x else (0::?'b)) = integral\<^sup>L (lebesgue_on ?S) ?f
T \<in> sets lebesgue

goal (1 subgoal):
 1. LINT x|lebesgue. (if x \<in> T then f x else 0) = integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue. (if x \<in> T then f x else 0) = integral\<^sup>L (lebesgue_on T) f

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (lebesgue_on S) g \<le> integral\<^sup>L (lebesgue_on T) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma consistentPrefix:
  assumes "isPrefix valuation1 valuation2" and "consistent valuation2"
  shows "consistent valuation1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent valuation1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isPrefix valuation1 valuation2
consistent valuation2

goal (1 subgoal):
 1. consistent valuation1
[PROOF STEP]
by (auto simp add:inconsistentCharacterization isPrefix_def)


[STATEMENT]
lemma poly_poly_poly_x_minus_y[simp]:
  fixes p :: "'a :: comm_ring_1 poly"
  shows "poly (poly (poly_x_minus_y p) q) x = poly p (x - poly q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly (poly_x_minus_y p) q) x = poly p (x - poly q x)
[PROOF STEP]
by (induct p; simp add: ring_distribs x_y_def)


[STATEMENT]
lemma YFtorMor: "\<lbrakk>LSCategory C ; f \<in> Mor C\<rbrakk> \<Longrightarrow> (YFtor C) ## f = YFtorNT C f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LSCategory C; f \<in> mor\<^bsub>C\<^esub>\<rbrakk> \<Longrightarrow> YFtor C ## f = YFtorNT C f
[PROOF STEP]
by (simp add: YFtor_defs MakeFtorMor)


[STATEMENT]
lemma fps_mult_nth_conv_upto_subdegree_left:
  fixes f g :: "('a :: {mult_zero,comm_monoid_add}) fps"
  shows "(f * g) $ n = (\<Sum>i=subdegree f..n. f $ i * g $ (n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
proof (cases "subdegree f \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
 2. \<not> subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
subdegree f \<le> n

goal (2 subgoals):
 1. subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
 2. \<not> subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
hence "{0..n} = {0..<subdegree f} \<union> {subdegree f..n}"
[PROOF STATE]
proof (prove)
using this:
subdegree f \<le> n

goal (1 subgoal):
 1. {0..n} = {0..<subdegree f} \<union> {subdegree f..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..n} = {0..<subdegree f} \<union> {subdegree f..n}

goal (2 subgoals):
 1. subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
 2. \<not> subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{0..n} = {0..<subdegree f} \<union> {subdegree f..n}

goal (2 subgoals):
 1. subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
 2. \<not> subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
have "{0..<subdegree f} \<inter> {subdegree f..n} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<subdegree f} \<inter> {subdegree f..n} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<subdegree f} \<inter> {subdegree f..n} = {}

goal (2 subgoals):
 1. subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
 2. \<not> subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{0..n} = {0..<subdegree f} \<union> {subdegree f..n}
{0..<subdegree f} \<inter> {subdegree f..n} = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{0..n} = {0..<subdegree f} \<union> {subdegree f..n}
{0..<subdegree f} \<inter> {subdegree f..n} = {}

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
using nth_less_subdegree_zero[of _ f]
[PROOF STATE]
proof (prove)
using this:
{0..n} = {0..<subdegree f} \<union> {subdegree f..n}
{0..<subdegree f} \<inter> {subdegree f..n} = {}
?n < subdegree f \<Longrightarrow> f $ ?n = (0::'a)

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
by    (simp add: fps_mult_nth sum.union_disjoint)
[PROOF STATE]
proof (state)
this:
(f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))

goal (1 subgoal):
 1. \<not> subdegree f \<le> n \<Longrightarrow> (f * g) $ n = (\<Sum>i = subdegree f..n. f $ i * g $ (n - i))
[PROOF STEP]
qed (simp add: fps_mult_nth nth_less_subdegree_zero)


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

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

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


[STATEMENT]
lemma existence_ivl_eq_rev0: "existence_ivl0 y = uminus ` rev.existence_ivl0 y" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. existence_ivl0 y = uminus ` rev.existence_ivl0 y
[PROOF STEP]
by (auto simp: existence_ivl_eq_rev rev.existence_ivl0_def preflect_def)


[STATEMENT]
lemma mult_bot_add_omega:
  "(x \<squnion> y * bot)\<^sup>\<omega> = x\<^sup>\<omega> \<squnion> x\<^sup>\<star> * y * bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y * bot)\<^sup>\<omega> = x\<^sup>\<omega> \<squnion> x\<^sup>\<star> * y * bot
[PROOF STEP]
by (metis mult_left_zero sup_commute mult_assoc mult_bot_omega omega_decompose omega_loop_fixpoint)


[STATEMENT]
lemma equiv_eq_nextl: "equiv UNIV eq_nextl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv UNIV eq_nextl
[PROOF STEP]
by (simp add: equivI refl_on_def sym_def trans_def eq_nextl_def)


[STATEMENT]
lemma integral_empty:
  assumes "space M = {}"
  shows "integral\<^sup>L M f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M f = (0::'b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>L M f = (0::'b)
[PROOF STEP]
have "(\<integral> x. f x \<partial>M) = (\<integral> x. 0 \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M f = LINT x|M. (0::'b)
[PROOF STEP]
by(rule integral_cong)(simp_all add: assms)
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M f = LINT x|M. (0::'b)

goal (1 subgoal):
 1. integral\<^sup>L M f = (0::'b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L M f = LINT x|M. (0::'b)

goal (1 subgoal):
 1. integral\<^sup>L M f = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M f = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_is_pr: "g \<in> PrimRec1 \<Longrightarrow> (\<lambda> u. sum g (nat_to_set u)) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
assume g_is_pr: "g \<in> PrimRec1"
[PROOF STATE]
proof (state)
this:
g \<in> PrimRec1

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
define g1 where "g1 x u = (if (c_in x u = 1) then (g x) else 0)" for x u
[PROOF STATE]
proof (state)
this:
g1 ?x ?u = (if c_in ?x ?u = 1 then g ?x else 0)

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
have g1_is_pr: "g1 \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g1 \<in> PrimRec2
[PROOF STEP]
proof (unfold g1_def, rule if_eq_is_pr2)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. c_in \<in> PrimRec2
 2. (\<lambda>x y. 1) \<in> PrimRec2
 3. (\<lambda>x y. g x) \<in> PrimRec2
 4. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
show "c_in \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_in \<in> PrimRec2
[PROOF STEP]
by (rule c_in_is_pr)
[PROOF STATE]
proof (state)
this:
c_in \<in> PrimRec2

goal (3 subgoals):
 1. (\<lambda>x y. 1) \<in> PrimRec2
 2. (\<lambda>x y. g x) \<in> PrimRec2
 3. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x y. 1) \<in> PrimRec2
 2. (\<lambda>x y. g x) \<in> PrimRec2
 3. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. 1) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. 1) \<in> PrimRec2
[PROOF STEP]
by (rule const_is_pr_2 [where ?n=1])
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. 1) \<in> PrimRec2

goal (2 subgoals):
 1. (\<lambda>x y. g x) \<in> PrimRec2
 2. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x y. g x) \<in> PrimRec2
 2. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
from g_is_pr
[PROOF STATE]
proof (chain)
picking this:
g \<in> PrimRec1
[PROOF STEP]
show "(\<lambda>x y. g x) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
g \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>x y. g x) \<in> PrimRec2
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. g x) \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. 0) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
by (rule const_is_pr_2 [where ?n=0])
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. 0) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g1 \<in> PrimRec2

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
define f where "f u = sum (\<lambda> x. g1 x u) {i. (i::nat) < u}" for u
[PROOF STATE]
proof (state)
this:
f ?u = (\<Sum>x\<in>{i. i < ?u}. g1 x ?u)

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
define f1 where "f1 u v = sum (\<lambda> x. g1 x v) {i. (i::nat) < u}"  for u v
[PROOF STATE]
proof (state)
this:
f1 ?u ?v = (\<Sum>x\<in>{i. i < ?u}. g1 x ?v)

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
from g1_is_pr
[PROOF STATE]
proof (chain)
picking this:
g1 \<in> PrimRec2
[PROOF STEP]
have "(\<lambda> (u::nat) v. sum (\<lambda> x. g1 x v) {i. (i::nat) < u}) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
g1 \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>u v. \<Sum>x\<in>{i. i < u}. g1 x v) \<in> PrimRec2
[PROOF STEP]
by (rule sum_of_pr_is_pr2)
[PROOF STATE]
proof (state)
this:
(\<lambda>u v. \<Sum>x\<in>{i. i < u}. g1 x v) \<in> PrimRec2

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
with f1_def [abs_def]
[PROOF STATE]
proof (chain)
picking this:
f1 \<equiv> \<lambda>u v. \<Sum>x\<in>{i. i < u}. g1 x v
(\<lambda>u v. \<Sum>x\<in>{i. i < u}. g1 x v) \<in> PrimRec2
[PROOF STEP]
have f1_is_pr: "f1 \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
f1 \<equiv> \<lambda>u v. \<Sum>x\<in>{i. i < u}. g1 x v
(\<lambda>u v. \<Sum>x\<in>{i. i < u}. g1 x v) \<in> PrimRec2

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

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
from f_def f1_def
[PROOF STATE]
proof (chain)
picking this:
f ?u = (\<Sum>x\<in>{i. i < ?u}. g1 x ?u)
f1 ?u ?v = (\<Sum>x\<in>{i. i < ?u}. g1 x ?v)
[PROOF STEP]
have f_f1: "f = (\<lambda> u. f1 u u)"
[PROOF STATE]
proof (prove)
using this:
f ?u = (\<Sum>x\<in>{i. i < ?u}. g1 x ?u)
f1 ?u ?v = (\<Sum>x\<in>{i. i < ?u}. g1 x ?v)

goal (1 subgoal):
 1. f = (\<lambda>u. f1 u u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = (\<lambda>u. f1 u u)

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
from f1_is_pr
[PROOF STATE]
proof (chain)
picking this:
f1 \<in> PrimRec2
[PROOF STEP]
have "(\<lambda> u. f1 u u) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
f1 \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>u. f1 u u) \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>u. f1 u u) \<in> PrimRec1

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
with f_f1
[PROOF STATE]
proof (chain)
picking this:
f = (\<lambda>u. f1 u u)
(\<lambda>u. f1 u u) \<in> PrimRec1
[PROOF STEP]
have f_is_pr: "f \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>u. f1 u u)
(\<lambda>u. f1 u u) \<in> PrimRec1

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

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
have f_is_result: "f = (\<lambda> u. sum g (nat_to_set u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>u. sum g (nat_to_set u))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. f u = sum g (nat_to_set u)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. f u = sum g (nat_to_set u)
[PROOF STEP]
show "f u = sum g (nat_to_set u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
define U where "U = {i. i < u}"
[PROOF STATE]
proof (state)
this:
U = {i. i < u}

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
define A where "A = {x \<in> U. c_in x u = 1}"
[PROOF STATE]
proof (state)
this:
A = {x \<in> U. c_in x u = 1}

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
define B where "B = {x \<in> U. c_in x u \<noteq> 1}"
[PROOF STATE]
proof (state)
this:
B = {x \<in> U. c_in x u \<noteq> 1}

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
have U_finite: "finite U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite U
[PROOF STEP]
by (unfold U_def, rule finite_interval)
[PROOF STATE]
proof (state)
this:
finite U

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from A_def U_finite
[PROOF STATE]
proof (chain)
picking this:
A = {x \<in> U. c_in x u = 1}
finite U
[PROOF STEP]
have A_finite: "finite A"
[PROOF STATE]
proof (prove)
using this:
A = {x \<in> U. c_in x u = 1}
finite U

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

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from B_def U_finite
[PROOF STATE]
proof (chain)
picking this:
B = {x \<in> U. c_in x u \<noteq> 1}
finite U
[PROOF STEP]
have B_finite: "finite B"
[PROOF STATE]
proof (prove)
using this:
B = {x \<in> U. c_in x u \<noteq> 1}
finite U

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

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from U_def A_def B_def
[PROOF STATE]
proof (chain)
picking this:
U = {i. i < u}
A = {x \<in> U. c_in x u = 1}
B = {x \<in> U. c_in x u \<noteq> 1}
[PROOF STEP]
have U_A_B: "U = A \<union> B"
[PROOF STATE]
proof (prove)
using this:
U = {i. i < u}
A = {x \<in> U. c_in x u = 1}
B = {x \<in> U. c_in x u \<noteq> 1}

goal (1 subgoal):
 1. U = A \<union> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U = A \<union> B

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from U_def A_def B_def
[PROOF STATE]
proof (chain)
picking this:
U = {i. i < u}
A = {x \<in> U. c_in x u = 1}
B = {x \<in> U. c_in x u \<noteq> 1}
[PROOF STEP]
have A_B: "A \<inter> B = {}"
[PROOF STATE]
proof (prove)
using this:
U = {i. i < u}
A = {x \<in> U. c_in x u = 1}
B = {x \<in> U. c_in x u \<noteq> 1}

goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<inter> B = {}

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from B_def g1_def
[PROOF STATE]
proof (chain)
picking this:
B = {x \<in> U. c_in x u \<noteq> 1}
g1 ?x ?u = (if c_in ?x ?u = 1 then g ?x else 0)
[PROOF STEP]
have B_z: "sum (\<lambda> x. g1 x u) B = 0"
[PROOF STATE]
proof (prove)
using this:
B = {x \<in> U. c_in x u \<noteq> 1}
g1 ?x ?u = (if c_in ?x ?u = 1 then g ?x else 0)

goal (1 subgoal):
 1. (\<Sum>x\<in>B. g1 x u) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>B. g1 x u) = 0

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
have u_in_U: "nat_to_set u \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u \<subseteq> U
[PROOF STEP]
by (unfold U_def, rule nat_to_set_upper_bound2)
[PROOF STATE]
proof (state)
this:
nat_to_set u \<subseteq> U

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from u_in_U x_in_u_eq A_def
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u \<subseteq> U
(?x \<in> nat_to_set ?u) = (c_in ?x ?u = 1)
A = {x \<in> U. c_in x u = 1}
[PROOF STEP]
have A_u: "A = nat_to_set u"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u \<subseteq> U
(?x \<in> nat_to_set ?u) = (c_in ?x ?u = 1)
A = {x \<in> U. c_in x u = 1}

goal (1 subgoal):
 1. A = nat_to_set u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = nat_to_set u

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from A_u x_in_u_eq g1_def
[PROOF STATE]
proof (chain)
picking this:
A = nat_to_set u
(?x \<in> nat_to_set ?u) = (c_in ?x ?u = 1)
g1 ?x ?u = (if c_in ?x ?u = 1 then g ?x else 0)
[PROOF STEP]
have A_res: "sum (\<lambda> x. g1 x u) A = sum g (nat_to_set u)"
[PROOF STATE]
proof (prove)
using this:
A = nat_to_set u
(?x \<in> nat_to_set ?u) = (c_in ?x ?u = 1)
g1 ?x ?u = (if c_in ?x ?u = 1 then g ?x else 0)

goal (1 subgoal):
 1. (\<Sum>x\<in>A. g1 x u) = sum g (nat_to_set u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. g1 x u) = sum g (nat_to_set u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from f_def
[PROOF STATE]
proof (chain)
picking this:
f ?u = (\<Sum>x\<in>{i. i < ?u}. g1 x ?u)
[PROOF STEP]
have "f u = sum (\<lambda> x. g1 x u) {i. (i::nat) < u}"
[PROOF STATE]
proof (prove)
using this:
f ?u = (\<Sum>x\<in>{i. i < ?u}. g1 x ?u)

goal (1 subgoal):
 1. f u = (\<Sum>x\<in>{i. i < u}. g1 x u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f u = (\<Sum>x\<in>{i. i < u}. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f u = (\<Sum>x\<in>{i. i < u}. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from U_def
[PROOF STATE]
proof (chain)
picking this:
U = {i. i < u}
[PROOF STEP]
have "\<dots> = sum (\<lambda> x. g1 x u) U"
[PROOF STATE]
proof (prove)
using this:
U = {i. i < u}

goal (1 subgoal):
 1. (\<Sum>x\<in>{i. i < u}. g1 x u) = (\<Sum>x\<in>U. g1 x u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{i. i < u}. g1 x u) = (\<Sum>x\<in>U. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{i. i < u}. g1 x u) = (\<Sum>x\<in>U. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from U_A_B
[PROOF STATE]
proof (chain)
picking this:
U = A \<union> B
[PROOF STEP]
have "\<dots> = sum (\<lambda> x. g1 x u) (A \<union> B)"
[PROOF STATE]
proof (prove)
using this:
U = A \<union> B

goal (1 subgoal):
 1. (\<Sum>x\<in>U. g1 x u) = (\<Sum>x\<in>A \<union> B. g1 x u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>U. g1 x u) = (\<Sum>x\<in>A \<union> B. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>U. g1 x u) = (\<Sum>x\<in>A \<union> B. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from A_finite B_finite A_B
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
A \<inter> B = {}
[PROOF STEP]
have "\<dots> = sum (\<lambda> x. g1 x u) A + sum (\<lambda> x. g1 x u) B"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
A \<inter> B = {}

goal (1 subgoal):
 1. (\<Sum>x\<in>A \<union> B. g1 x u) = (\<Sum>x\<in>A. g1 x u) + (\<Sum>x\<in>B. g1 x u)
[PROOF STEP]
by (rule sum.union_disjoint)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A \<union> B. g1 x u) = (\<Sum>x\<in>A. g1 x u) + (\<Sum>x\<in>B. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A \<union> B. g1 x u) = (\<Sum>x\<in>A. g1 x u) + (\<Sum>x\<in>B. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from B_z
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>B. g1 x u) = 0
[PROOF STEP]
have "\<dots> = sum (\<lambda> x. g1 x u) A"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>B. g1 x u) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>A. g1 x u) + (\<Sum>x\<in>B. g1 x u) = (\<Sum>x\<in>A. g1 x u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. g1 x u) + (\<Sum>x\<in>B. g1 x u) = (\<Sum>x\<in>A. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. g1 x u) + (\<Sum>x\<in>B. g1 x u) = (\<Sum>x\<in>A. g1 x u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
from A_res
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>A. g1 x u) = sum g (nat_to_set u)
[PROOF STEP]
have "\<dots> = sum g (nat_to_set u)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>A. g1 x u) = sum g (nat_to_set u)

goal (1 subgoal):
 1. (\<Sum>x\<in>A. g1 x u) = sum g (nat_to_set u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. g1 x u) = sum g (nat_to_set u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f u = sum g (nat_to_set u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f u = sum g (nat_to_set u)

goal (1 subgoal):
 1. f u = sum g (nat_to_set u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f u = sum g (nat_to_set u)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f u = sum g (nat_to_set u)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f = (\<lambda>u. sum g (nat_to_set u))

goal (1 subgoal):
 1. g \<in> PrimRec1 \<Longrightarrow> (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
with f_is_pr
[PROOF STATE]
proof (chain)
picking this:
f \<in> PrimRec1
f = (\<lambda>u. sum g (nat_to_set u))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> PrimRec1
f = (\<lambda>u. sum g (nat_to_set u))

goal (1 subgoal):
 1. (\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. sum g (nat_to_set u)) \<in> PrimRec1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_subset_less:
  "\<lbrakk> {x .. x + r - 1} \<subseteq> {y .. y + s - 1};
     x \<le> x + r - 1; y \<le> y + (s :: 'a :: len word) - 1;
     s \<noteq> 0 \<rbrakk>
     \<Longrightarrow> r \<le> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{x..x + r - 1} \<subseteq> {y..y + s - 1}; x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply (frule subsetD[where c=x])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>{x..x + r - 1} \<subseteq> {y..y + s - 1}; x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0\<rbrakk> \<Longrightarrow> x \<in> {x..x + r - 1}
 2. \<lbrakk>{x..x + r - 1} \<subseteq> {y..y + s - 1}; x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0; x \<in> {y..y + s - 1}\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{x..x + r - 1} \<subseteq> {y..y + s - 1}; x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0; x \<in> {y..y + s - 1}\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply (drule subsetD[where c="x + r - 1"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0; x \<in> {y..y + s - 1}\<rbrakk> \<Longrightarrow> x + r - 1 \<in> {x..x + r - 1}
 2. \<lbrakk>x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0; x \<in> {y..y + s - 1}; x + r - 1 \<in> {y..y + s - 1}\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x + r - 1; y \<le> y + s - 1; s \<noteq> 0; x \<in> {y..y + s - 1}; x + r - 1 \<in> {y..y + s - 1}\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply (clarsimp simp: add_diff_eq[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1); x + (r - 1) \<le> y + (s - 1)\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply (drule(1) word_sub_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1)\<rbrakk> \<Longrightarrow> r - 1 \<le> x + (r - 1)
 2. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1)\<rbrakk> \<Longrightarrow> s - 1 \<le> y + (s - 1)
 3. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1); r - 1 \<le> s - 1\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply (simp_all add: olen_add_eqv[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1); r - 1 \<le> s - 1\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
apply (erule word_le_minus_cancel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1)\<rbrakk> \<Longrightarrow> 1 \<le> s
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x + (r - 1); y \<le> y + (s - 1); s \<noteq> 0; y \<le> x; x \<le> y + (s - 1); y \<le> x + (r - 1); \<not> 1 \<le> s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: word_not_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prob_space_normal_density:
  "prob_space (density lborel (normal_density \<mu> \<sigma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (density lborel (\<lambda>x. ennreal (normal_density \<mu> \<sigma> x)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (density lborel (\<lambda>x. ennreal (normal_density \<mu> \<sigma> x))) (space (density lborel (\<lambda>x. ennreal (normal_density \<mu> \<sigma> x)))) = 1
[PROOF STEP]
qed (simp add: emeasure_density nn_integral_eq_integral normal_density_nonneg)


[STATEMENT]
lemma (in group) normal_generateI:
  assumes "H \<subseteq> carrier G" and "\<And>h g. \<lbrakk> h \<in> H; g \<in> carrier G \<rbrakk> \<Longrightarrow> g \<otimes> h \<otimes> (inv g) \<in> H"
  shows "generate G H \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate G H \<lhd> G
[PROOF STEP]
proof (rule normal_invI[OF generate_is_subgroup[OF assms(1)]])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x h. \<lbrakk>x \<in> carrier G; h \<in> generate G H\<rbrakk> \<Longrightarrow> x \<otimes> h \<otimes> inv x \<in> generate G H
[PROOF STEP]
fix g h
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x h. \<lbrakk>x \<in> carrier G; h \<in> generate G H\<rbrakk> \<Longrightarrow> x \<otimes> h \<otimes> inv x \<in> generate G H
[PROOF STEP]
assume g: "g \<in> carrier G"
[PROOF STATE]
proof (state)
this:
g \<in> carrier G

goal (1 subgoal):
 1. \<And>x h. \<lbrakk>x \<in> carrier G; h \<in> generate G H\<rbrakk> \<Longrightarrow> x \<otimes> h \<otimes> inv x \<in> generate G H
[PROOF STEP]
show "h \<in> generate G H \<Longrightarrow> g \<otimes> h \<otimes> (inv g) \<in> generate G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> generate G H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H
[PROOF STEP]
proof (induct h rule: generate.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. g \<otimes> \<one> \<otimes> inv g \<in> generate G H
 2. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H
 3. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 4. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
case one
[PROOF STATE]
proof (state)
this:

goal (4 subgoals):
 1. g \<otimes> \<one> \<otimes> inv g \<in> generate G H
 2. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H
 3. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 4. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<otimes> \<one> \<otimes> inv g \<in> generate G H
[PROOF STEP]
using g generate.one
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G
\<one>\<^bsub>?G\<^esub> \<in> generate ?G ?H

goal (1 subgoal):
 1. g \<otimes> \<one> \<otimes> inv g \<in> generate G H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g \<otimes> \<one> \<otimes> inv g \<in> generate G H

goal (3 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H
 2. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 3. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H
 2. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 3. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
case incl
[PROOF STATE]
proof (state)
this:
h_ \<in> H

goal (3 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H
 2. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 3. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<otimes> h_ \<otimes> inv g \<in> generate G H
[PROOF STEP]
using generate.incl[OF assms(2)[OF incl g]]
[PROOF STATE]
proof (prove)
using this:
g \<otimes> h_ \<otimes> inv g \<in> generate ?G H

goal (1 subgoal):
 1. g \<otimes> h_ \<otimes> inv g \<in> generate G H
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g \<otimes> h_ \<otimes> inv g \<in> generate G H

goal (2 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 2. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 2. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
case (inv h)
[PROOF STATE]
proof (state)
this:
h \<in> H

goal (2 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 2. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
hence h: "h \<in> carrier G"
[PROOF STATE]
proof (prove)
using this:
h \<in> H

goal (1 subgoal):
 1. h \<in> carrier G
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
h \<in> H
H \<subseteq> carrier G

goal (1 subgoal):
 1. h \<in> carrier G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> carrier G

goal (2 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 2. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
hence "inv (g \<otimes> h \<otimes> (inv g)) = g \<otimes> (inv h) \<otimes> (inv g)"
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier G

goal (1 subgoal):
 1. inv (g \<otimes> h \<otimes> inv g) = g \<otimes> inv h \<otimes> inv g
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier G
g \<in> carrier G

goal (1 subgoal):
 1. inv (g \<otimes> h \<otimes> inv g) = g \<otimes> inv h \<otimes> inv g
[PROOF STEP]
by (simp add: inv_mult_group m_assoc)
[PROOF STATE]
proof (state)
this:
inv (g \<otimes> h \<otimes> inv g) = g \<otimes> inv h \<otimes> inv g

goal (2 subgoals):
 1. \<And>h. h \<in> H \<Longrightarrow> g \<otimes> inv h \<otimes> inv g \<in> generate G H
 2. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
inv (g \<otimes> h \<otimes> inv g) = g \<otimes> inv h \<otimes> inv g

goal (1 subgoal):
 1. g \<otimes> inv h \<otimes> inv g \<in> generate G H
[PROOF STEP]
using generate_m_inv_closed[OF assms(1) generate.incl[OF assms(2)[OF inv g]]]
[PROOF STATE]
proof (prove)
using this:
inv (g \<otimes> h \<otimes> inv g) = g \<otimes> inv h \<otimes> inv g
inv (g \<otimes> h \<otimes> inv g) \<in> generate G H

goal (1 subgoal):
 1. g \<otimes> inv h \<otimes> inv g \<in> generate G H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g \<otimes> inv h \<otimes> inv g \<in> generate G H

goal (1 subgoal):
 1. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
case (eng h1 h2)
[PROOF STATE]
proof (state)
this:
h1 \<in> generate G H
g \<otimes> h1 \<otimes> inv g \<in> generate G H
h2 \<in> generate G H
g \<otimes> h2 \<otimes> inv g \<in> generate G H

goal (1 subgoal):
 1. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
note in_carrier = eng(1,3)[THEN generate_in_carrier[OF assms(1)]]
[PROOF STATE]
proof (state)
this:
h1 \<in> carrier G
h2 \<in> carrier G

goal (1 subgoal):
 1. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
have "g \<otimes> (h1 \<otimes> h2) \<otimes> inv g = (g \<otimes> h1 \<otimes> inv g) \<otimes> (g \<otimes> h2 \<otimes> inv g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<otimes> (h1 \<otimes> h2) \<otimes> inv g = g \<otimes> h1 \<otimes> inv g \<otimes> (g \<otimes> h2 \<otimes> inv g)
[PROOF STEP]
using in_carrier g
[PROOF STATE]
proof (prove)
using this:
h1 \<in> carrier G
h2 \<in> carrier G
g \<in> carrier G

goal (1 subgoal):
 1. g \<otimes> (h1 \<otimes> h2) \<otimes> inv g = g \<otimes> h1 \<otimes> inv g \<otimes> (g \<otimes> h2 \<otimes> inv g)
[PROOF STEP]
by (simp add: inv_solve_left m_assoc)
[PROOF STATE]
proof (state)
this:
g \<otimes> (h1 \<otimes> h2) \<otimes> inv g = g \<otimes> h1 \<otimes> inv g \<otimes> (g \<otimes> h2 \<otimes> inv g)

goal (1 subgoal):
 1. \<And>h1 h2. \<lbrakk>h1 \<in> generate G H; g \<otimes> h1 \<otimes> inv g \<in> generate G H; h2 \<in> generate G H; g \<otimes> h2 \<otimes> inv g \<in> generate G H\<rbrakk> \<Longrightarrow> g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
g \<otimes> (h1 \<otimes> h2) \<otimes> inv g = g \<otimes> h1 \<otimes> inv g \<otimes> (g \<otimes> h2 \<otimes> inv g)

goal (1 subgoal):
 1. g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
using generate.eng[OF eng(2,4)]
[PROOF STATE]
proof (prove)
using this:
g \<otimes> (h1 \<otimes> h2) \<otimes> inv g = g \<otimes> h1 \<otimes> inv g \<otimes> (g \<otimes> h2 \<otimes> inv g)
g \<otimes> h1 \<otimes> inv g \<otimes> (g \<otimes> h2 \<otimes> inv g) \<in> generate G H

goal (1 subgoal):
 1. g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g \<otimes> (h1 \<otimes> h2) \<otimes> inv g \<in> generate G H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h \<in> generate G H \<Longrightarrow> g \<otimes> h \<otimes> inv g \<in> generate G H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma non_zero_neighbour_pole:
  assumes "is_pole f z"
  shows "\<forall>\<^sub>F w in (at z). f w\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. f w \<noteq> (0::'b)
[PROOF STEP]
using assms filterlim_at_infinity_imp_eventually_ne[of f "at z" 0]
[PROOF STATE]
proof (prove)
using this:
is_pole f z
filterlim f at_infinity (at z) \<Longrightarrow> \<forall>\<^sub>F z in at z. f z \<noteq> (0::'b)

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. f w \<noteq> (0::'b)
[PROOF STEP]
unfolding is_pole_def
[PROOF STATE]
proof (prove)
using this:
filterlim f at_infinity (at z)
filterlim f at_infinity (at z) \<Longrightarrow> \<forall>\<^sub>F z in at z. f z \<noteq> (0::'b)

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. f w \<noteq> (0::'b)
[PROOF STEP]
by auto


[STATEMENT]
lemma ordermap_mono_le:
  assumes "(w, x) \<in> r \<or> w=x"
      and "wf r" "trans r"
      and "w \<in> A" "x \<in> A"
      and "small A"
    shows "ordermap A r w \<le> ordermap A r x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordermap A r w \<le> ordermap A r x
[PROOF STEP]
by (metis assms dual_order.strict_implies_order eq_refl ordermap_mono_less)


[STATEMENT]
lemma FIN_E[simp, intro!]: "finite E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite E
[PROOF STEP]
using E_ss_VxV
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> V \<times> V

goal (1 subgoal):
 1. finite E
[PROOF STEP]
by simp


[STATEMENT]
lemma list_all_mp: "list_all P xs \<Longrightarrow> (\<And>x. x \<in> set xs \<Longrightarrow> P x \<Longrightarrow> Q x) \<Longrightarrow> list_all Q xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all P xs; \<And>x. \<lbrakk>x \<in> set xs; P x\<rbrakk> \<Longrightarrow> Q x\<rbrakk> \<Longrightarrow> list_all Q xs
[PROOF STEP]
by (auto simp: list_all_iff)


[STATEMENT]
lemma real_le_intI: "x \<le> y" if "floor x \<le> floor y" "x \<in> \<int>" for x y::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y
[PROOF STEP]
using that(2,1)
[PROOF STATE]
proof (prove)
using this:
x \<in> \<int>
\<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>

goal (1 subgoal):
 1. x \<le> y
[PROOF STEP]
by (induction rule: Ints_induct) (auto elim!: Ints_induct simp: le_floor_iff)


[STATEMENT]
lemma plusl_infty_top: "\<infinity>\<^sub>1 +\<^sub>1 \<top>\<^sub>1  = \<top>\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity>\<^sub>1 +\<^sub>1 \<top>\<^sub>1 = \<top>\<^sub>1
[PROOF STEP]
by (simp)


[STATEMENT]
lemma pre_post_left_dist_sup:
  "-p\<squnion>-q\<stileturn>-r = (-p\<stileturn>-r) \<squnion> (-q\<stileturn>-r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p \<squnion> - q \<stileturn> - r = (- p \<stileturn> - r) \<squnion> (- q \<stileturn> - r)
[PROOF STEP]
by (metis mult_right_dist_sup tests_dual.inf_closed pre_post_export)


[STATEMENT]
lemma fst_snd_linear: "linear (\<lambda>(x,y). x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (\<lambda>(x, y). x + y)
[PROOF STEP]
unfolding linear_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. (case x + y of (x, xa) \<Rightarrow> x + xa) = (case x of (x, xa) \<Rightarrow> x + xa) + (case y of (x, xa) \<Rightarrow> x + xa)) \<and> (\<forall>c x. (case c *\<^sub>R x of (x, xa) \<Rightarrow> x + xa) = c *\<^sub>R (case x of (x, xa) \<Rightarrow> x + xa))
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma zeros_rone: "zeros (Suc n) v = zeros n v @ zeros 1 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zeros (Suc n) v = zeros n v @ zeros 1 v
[PROOF STEP]
by (simp add: zeros_def replicate_append_same)


[STATEMENT]
lemma finished_succ_impl_path_in_tree:
    assumes f:  "v \<in> dom (finished s)"
    and s: "w \<in> succ v"
    and \<delta>: "\<delta> s v < \<delta> s w"
    shows "(v,w) \<in> (tree_edges s)\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v, w) \<in> (tree_edges s)\<^sup>+
[PROOF STEP]
using no_pending_succ_impl_path_in_tree finished_no_pending finished_discovered
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> dom (discovered s); pending s `` {?v} = {}; ?w \<in> E `` {?v}; \<delta> s ?v < \<delta> s ?w\<rbrakk> \<Longrightarrow> (?v, ?w) \<in> (tree_edges s)\<^sup>+
?v \<in> dom (finished s) \<Longrightarrow> pending s `` {?v} = {}
dom (finished s) \<subseteq> dom (discovered s)

goal (1 subgoal):
 1. (v, w) \<in> (tree_edges s)\<^sup>+
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> dom (discovered s); pending s `` {?v} = {}; ?w \<in> E `` {?v}; \<delta> s ?v < \<delta> s ?w\<rbrakk> \<Longrightarrow> (?v, ?w) \<in> (tree_edges s)\<^sup>+
?v \<in> dom (finished s) \<Longrightarrow> pending s `` {?v} = {}
dom (finished s) \<subseteq> dom (discovered s)
v \<in> dom (finished s)
w \<in> E `` {v}
\<delta> s v < \<delta> s w

goal (1 subgoal):
 1. (v, w) \<in> (tree_edges s)\<^sup>+
[PROOF STEP]
by blast


[STATEMENT]
lemma (in inj_idom_hom) reflect_poly_hom:
  "reflect_poly (map_poly hom p) = map_poly hom (reflect_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflect_poly (map_poly hom p) = map_poly hom (reflect_poly p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. reflect_poly (map_poly hom p) = map_poly hom (reflect_poly p)
[PROOF STEP]
obtain xs where xs: "rev (coeffs p) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs. rev (coeffs p) = xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rev (coeffs p) = xs

goal (1 subgoal):
 1. reflect_poly (map_poly hom p) = map_poly hom (reflect_poly p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflect_poly (map_poly hom p) = map_poly hom (reflect_poly p)
[PROOF STEP]
unfolding reflect_poly_def coeffs_map_poly_hom rev_map
    xs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (map hom xs) = map_poly hom (Poly xs)
[PROOF STEP]
by (induct xs, auto simp: hom_distribs)
[PROOF STATE]
proof (state)
this:
reflect_poly (map_poly hom p) = map_poly hom (reflect_poly p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prob_space) indep_setsI:
  assumes "\<And>i. i \<in> I \<Longrightarrow> F i \<subseteq> events"
    and "\<And>A J. J \<noteq> {} \<Longrightarrow> J \<subseteq> I \<Longrightarrow> finite J \<Longrightarrow> (\<forall>j\<in>J. A j \<in> F j) \<Longrightarrow> prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))"
  shows "indep_sets F I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets F I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i5 \<in> I \<Longrightarrow> F ?i5 \<subseteq> events
\<lbrakk>?J5 \<noteq> {}; ?J5 \<subseteq> I; finite ?J5; \<forall>j\<in>?J5. ?A5 j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (?A5 ` ?J5)) = (\<Prod>j\<in>?J5. prob (?A5 j))

goal (1 subgoal):
 1. indep_sets F I
[PROOF STEP]
unfolding indep_sets_def
[PROOF STATE]
proof (prove)
using this:
?i5 \<in> I \<Longrightarrow> F ?i5 \<subseteq> events
\<lbrakk>?J5 \<noteq> {}; ?J5 \<subseteq> I; finite ?J5; \<forall>j\<in>?J5. ?A5 j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (?A5 ` ?J5)) = (\<Prod>j\<in>?J5. prob (?A5 j))

goal (1 subgoal):
 1. (\<forall>i\<in>I. F i \<subseteq> events) \<and> (\<forall>J\<subseteq>I. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> (\<forall>A\<in>Pi J F. prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))))
[PROOF STEP]
by (auto simp: Pi_iff)


[STATEMENT]
lemma prefers_asym: "P \<turnstile> x < y \<Longrightarrow> \<not> P \<turnstile> y < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<turnstile> x < y \<Longrightarrow> \<not> P \<turnstile> y < x
[PROOF STEP]
by(simp add: prefers_def)


[STATEMENT]
lemma diamond_right_mult:
  "|x>(y * z) = |x>|y>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. | x > (y * z) = | x > | y > z
[PROOF STEP]
using diamond_associative diamond_left_mult
[PROOF STATE]
proof (prove)
using this:
| ?x * ?y > ?z = | ?x > (?y * ?z)
| ?x * ?y > ?z = | ?x > | ?y > ?z

goal (1 subgoal):
 1. | x > (y * z) = | x > | y > z
[PROOF STEP]
by force


[STATEMENT]
lemma less_imp_not_equiv: "x < y \<Longrightarrow> \<not> x \<approx> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> \<not> x \<approx> y
[PROOF STEP]
by (simp add: less_le)


[STATEMENT]
lemma varInClauseVars:
  fixes variable :: Variable and clause :: Clause
  shows "variable \<in> vars clause = (\<exists> literal. literal el clause \<and> var literal = variable)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (variable \<in> vars clause) = (\<exists>literal. literal el clause \<and> var literal = variable)
[PROOF STEP]
by (induct clause) auto


[STATEMENT]
lemma iprev_atLeast: "n < t  \<Longrightarrow> iprev t {n..} = t - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < t \<Longrightarrow> iprev t {n..} = t - Suc 0
[PROOF STEP]
by (insert iprev_atLeast'[of n "t - Suc 0"], simp)


[STATEMENT]
lemma (in vbrelation) vconverse_vconverse[simp]: "(r\<inverse>\<^sub>\<circ>)\<inverse>\<^sub>\<circ> = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r\<inverse>\<^sub>\<circ>)\<inverse>\<^sub>\<circ> = r
[PROOF STEP]
using vbrelation_axioms
[PROOF STATE]
proof (prove)
using this:
vbrelation r

goal (1 subgoal):
 1. (r\<inverse>\<^sub>\<circ>)\<inverse>\<^sub>\<circ> = r
[PROOF STEP]
by auto


[STATEMENT]
theorem lang_prefix_rexp [simp]:
  "lang (prefix_rexp r) = Prefixes (lang r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lang (prefix_rexp r) = Prefixes (lang r)
[PROOF STEP]
by (induction r) (auto simp: rexp_empty_iff)


[STATEMENT]
lemma add_diff_assoc2_enat: "m \<ge> n \<Longrightarrow> m - n + p = m + p - n" for m n p :: enat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m \<Longrightarrow> m - n + p = m + p - n
[PROOF STEP]
by (cases m; cases n; cases p; auto)


[STATEMENT]
lemma bl2nat_cons_oc:
  "bl2nat (ks @ [Oc]) 0 =  bl2nat ks 0 + 2 ^ length ks"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl2nat (ks @ [Oc]) 0 = bl2nat ks 0 + 2 ^ length ks
[PROOF STEP]
proof(induct ks)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bl2nat ([] @ [Oc]) 0 = bl2nat [] 0 + 2 ^ length []
 2. \<And>a ks. bl2nat (ks @ [Oc]) 0 = bl2nat ks 0 + 2 ^ length ks \<Longrightarrow> bl2nat ((a # ks) @ [Oc]) 0 = bl2nat (a # ks) 0 + 2 ^ length (a # ks)
[PROOF STEP]
case (Cons a ks)
[PROOF STATE]
proof (state)
this:
bl2nat (ks @ [Oc]) 0 = bl2nat ks 0 + 2 ^ length ks

goal (2 subgoals):
 1. bl2nat ([] @ [Oc]) 0 = bl2nat [] 0 + 2 ^ length []
 2. \<And>a ks. bl2nat (ks @ [Oc]) 0 = bl2nat ks 0 + 2 ^ length ks \<Longrightarrow> bl2nat ((a # ks) @ [Oc]) 0 = bl2nat (a # ks) 0 + 2 ^ length (a # ks)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bl2nat (ks @ [Oc]) 0 = bl2nat ks 0 + 2 ^ length ks
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bl2nat (ks @ [Oc]) 0 = bl2nat ks 0 + 2 ^ length ks

goal (1 subgoal):
 1. bl2nat ((a # ks) @ [Oc]) 0 = bl2nat (a # ks) 0 + 2 ^ length (a # ks)
[PROOF STEP]
by(cases a, auto simp: bl2nat.simps bl2nat_double)
[PROOF STATE]
proof (state)
this:
bl2nat ((a # ks) @ [Oc]) 0 = bl2nat (a # ks) 0 + 2 ^ length (a # ks)

goal (1 subgoal):
 1. bl2nat ([] @ [Oc]) 0 = bl2nat [] 0 + 2 ^ length []
[PROOF STEP]
qed (auto simp: bl2nat.simps)


[STATEMENT]
lemma (in PolynRg) P_mod_mult2l:"\<lbrakk>ideal S I; p \<in> carrier R; q \<in> carrier R;
      P_mod R S X I p\<rbrakk>  \<Longrightarrow> P_mod R S X I (p \<cdot>\<^sub>r q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; p \<in> carrier R; q \<in> carrier R; P_mod R S X I p\<rbrakk> \<Longrightarrow> P_mod R S X I (p \<cdot>\<^sub>r q)
[PROOF STEP]
apply (cut_tac subring, frule subring_Ring[of S],
       frule Ring.whole_ideal[of S])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; p \<in> carrier R; q \<in> carrier R; P_mod R S X I p; Subring R S; Ring S; ideal S (carrier S)\<rbrakk> \<Longrightarrow> P_mod R S X I (p \<cdot>\<^sub>r q)
[PROOF STEP]
apply (frule P_mod_whole[of q])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; p \<in> carrier R; q \<in> carrier R; P_mod R S X I p; Subring R S; Ring S; ideal S (carrier S); P_mod R S X (carrier S) q\<rbrakk> \<Longrightarrow> P_mod R S X I (p \<cdot>\<^sub>r q)
[PROOF STEP]
apply (frule P_mod_mult1[of I "carrier S" p q], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; p \<in> carrier R; q \<in> carrier R; P_mod R S X I p; Subring R S; Ring S; ideal S (carrier S); P_mod R S X (carrier S) q; P_mod R S X (I \<diamondsuit>\<^sub>r\<^bsub>S\<^esub> carrier S) (p \<cdot>\<^sub>r q)\<rbrakk> \<Longrightarrow> P_mod R S X I (p \<cdot>\<^sub>r q)
[PROOF STEP]
apply (simp add:Ring.idealprod_whole_r)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_zip_map_fst_snd:
  assumes "(u,x) \<in> set (zip us (map snd txs))"
    and "(t,u) \<in> set (zip (map fst txs) us)"
    and "distinct (map snd txs)"
    and "distinct us" and "length us = length txs"
  shows "(t, x) \<in> set txs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t, x) \<in> set txs
[PROOF STEP]
using assms(5,1-4)
[PROOF STATE]
proof (prove)
using this:
length us = length txs
(u, x) \<in> set (zip us (map snd txs))
(t, u) \<in> set (zip (map fst txs) us)
distinct (map snd txs)
distinct us

goal (1 subgoal):
 1. (t, x) \<in> set txs
[PROOF STEP]
by (induct us txs arbitrary: u x t rule: list_induct2)
    (auto dest: set_zip_leftD set_zip_rightD)


[STATEMENT]
lemma list_insert:
assumes A: "finite A" and b: "b \<notin> A"
shows
"\<exists> al1 al2.
   A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and>
   list (insert b A) = al1 @ [b] @ al2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
have "b \<in> set (list (insert b A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> set (list (insert b A))
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. b \<in> set (list (insert b A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> set (list (insert b A))

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> set (list (insert b A))
[PROOF STEP]
obtain al1 al2 where 0: "list (insert b A) = al1 @ [b] @ al2"
[PROOF STATE]
proof (prove)
using this:
b \<in> set (list (insert b A))

goal (1 subgoal):
 1. (\<And>al1 al2. list (insert b A) = al1 @ [b] @ al2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis append_Cons eq_Nil_appendI split_list_last)
[PROOF STATE]
proof (state)
this:
list (insert b A) = al1 @ [b] @ al2

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
hence 1: "distinct (al1 @ [b] @ al2)"
[PROOF STATE]
proof (prove)
using this:
list (insert b A) = al1 @ [b] @ al2

goal (1 subgoal):
 1. distinct (al1 @ [b] @ al2)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
list (insert b A) = al1 @ [b] @ al2
finite A

goal (1 subgoal):
 1. distinct (al1 @ [b] @ al2)
[PROOF STEP]
by (metis distinct_set_list finite_insert)
[PROOF STATE]
proof (state)
this:
distinct (al1 @ [b] @ al2)

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
hence "b \<notin> set (al1 @ al2)"
[PROOF STATE]
proof (prove)
using this:
distinct (al1 @ [b] @ al2)

goal (1 subgoal):
 1. b \<notin> set (al1 @ al2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b \<notin> set (al1 @ al2)

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
b \<notin> set (al1 @ al2)

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
have "insert b A = insert b (set (al1 @ al2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert b A = insert b (set (al1 @ al2))
[PROOF STEP]
using 0 set_list[OF finite.insertI[OF A, of b]]
[PROOF STATE]
proof (prove)
using this:
list (insert b A) = al1 @ [b] @ al2
set (list (insert b A)) = insert b A

goal (1 subgoal):
 1. insert b A = insert b (set (al1 @ al2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert b A = insert b (set (al1 @ al2))

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
b \<notin> set (al1 @ al2)
insert b A = insert b (set (al1 @ al2))
[PROOF STEP]
have "A = set (al1 @ al2)"
[PROOF STATE]
proof (prove)
using this:
b \<notin> set (al1 @ al2)
insert b A = insert b (set (al1 @ al2))

goal (1 subgoal):
 1. A = set (al1 @ al2)
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<notin> set (al1 @ al2)
insert b A = insert b (set (al1 @ al2))
b \<notin> A

goal (1 subgoal):
 1. A = set (al1 @ al2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = set (al1 @ al2)

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A = set (al1 @ al2)

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
using 0 1
[PROOF STATE]
proof (prove)
using this:
A = set (al1 @ al2)
list (insert b A) = al1 @ [b] @ al2
distinct (al1 @ [b] @ al2)

goal (1 subgoal):
 1. \<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>al1 al2. A = set (al1 @ al2) \<and> distinct (al1 @ [b] @ al2) \<and> list (insert b A) = al1 @ [b] @ al2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma csum_czero1: "Card_order r \<Longrightarrow> r +c czero =o r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order r \<Longrightarrow> r +c czero =o r
[PROOF STEP]
unfolding czero_def csum_def Field_card_of
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order r \<Longrightarrow> |Field r <+> {}| =o r
[PROOF STEP]
by (rule ordIso_transitive[OF ordIso_symmetric[OF card_of_Plus_empty1] card_of_Field_ordIso])


[STATEMENT]
lemma inv2_rbt_baldL_inv1: "inv2 l \<Longrightarrow> inv2 r \<Longrightarrow> bheight l + 1 = bheight r \<Longrightarrow> inv1 r \<Longrightarrow>
  inv2 (rbt_baldL l a b r) \<and> bheight (rbt_baldL l a b r) = bheight r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inv2 l; inv2 r; bheight l + 1 = bheight r; inv1 r\<rbrakk> \<Longrightarrow> inv2 (rbt_baldL l a b r) \<and> bheight (rbt_baldL l a b r) = bheight r
[PROOF STEP]
by (induct l a b r rule: rbt_baldL.induct) (auto simp: inv2_rbt_baliR rbt_bheight_rbt_baliR)


[STATEMENT]
lemma bex_subst: "
  \<forall>x\<in>A. P x \<longrightarrow> (Q x = Q' x) \<Longrightarrow>
  (\<exists>x\<in>A. P x \<and> Q x) = (\<exists>x\<in>A. P x \<and> Q' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. P x \<longrightarrow> Q x = Q' x \<Longrightarrow> (\<exists>x\<in>A. P x \<and> Q x) = (\<exists>x\<in>A. P x \<and> Q' x)
[PROOF STEP]
by blast


[STATEMENT]
lemma vimage_vrestriction[simp]: "(r \<restriction>\<^sub>\<circ> A) `\<^sub>\<circ> B = A \<inter>\<^sub>\<circ> (r `\<^sub>\<circ> (A \<inter>\<^sub>\<circ> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r \<restriction>\<^sub>\<circ> A) `\<^sub>\<circ> B = A \<inter>\<^sub>\<circ> r `\<^sub>\<circ> (A \<inter>\<^sub>\<circ> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma int_mult_le1:"\<lbrakk>i \<le> j; (0::int) \<le> k\<rbrakk> \<Longrightarrow> i * k \<le> j * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; 0 \<le> k\<rbrakk> \<Longrightarrow> i * k \<le> j * k
[PROOF STEP]
apply (simp add:mult.commute[of _ "k"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; 0 \<le> k\<rbrakk> \<Longrightarrow> k * i \<le> k * j
[PROOF STEP]
apply (simp add:int_mult_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prodag_sameTr0:"\<lbrakk>\<forall>k\<in>I. aGroup (A k); \<forall>k\<in>I. A k = B k\<rbrakk>
                               \<Longrightarrow> Un_carrier I A = Un_carrier I B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>k\<in>I. aGroup (A k); \<forall>k\<in>I. A k = B k\<rbrakk> \<Longrightarrow> Un_carrier I A = Un_carrier I B
[PROOF STEP]
apply (simp add:Un_carrier_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma splitTree_correctE:
  assumes inv: "ft_invar (s:: ('e,'a::monoid_add) FingerTreeStruc)"
  assumes mono: "\<forall>a b. p a \<longrightarrow> p (a + b)"
  assumes init_ff: "\<not> p i"
  assumes sum_tt: "p (i + annot s)"
  obtains l e a r where
    "(splitTree p i s) = (l, (e,a), r)" and
    "(toList s) = (toList l) @ (e,a) # (toList r)" and
    "\<not> p (i + annot l)" and
    "p (i + annot l + a)" and
    "ft_invar l" and "ft_invar r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l e a r. \<lbrakk>splitTree p i s = (l, (e, a), r); toList s = toList l @ (e, a) # toList r; \<not> p (i + annot l); p (i + annot l + a); ft_invar l; ft_invar r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>l e a r. \<lbrakk>splitTree p i s = (l, (e, a), r); toList s = toList l @ (e, a) # toList r; \<not> p (i + annot l); p (i + annot l + a); ft_invar l; ft_invar r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain l e a r where fmt: "(splitTree p i s) = (l, (e,a), r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l e a r. splitTree p i s = (l, (e, a), r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "(splitTree p i s)") auto
[PROOF STATE]
proof (state)
this:
splitTree p i s = (l, (e, a), r)

goal (1 subgoal):
 1. (\<And>l e a r. \<lbrakk>splitTree p i s = (l, (e, a), r); toList s = toList l @ (e, a) # toList r; \<not> p (i + annot l); p (i + annot l + a); ft_invar l; ft_invar r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from splitTree_correct[of s p, OF assms fmt] fmt
[PROOF STATE]
proof (chain)
picking this:
toList s = toList l @ (e, a) # toList r
\<not> p (i + annot l)
p (i + annot l + a)
ft_invar l
ft_invar r
splitTree p i s = (l, (e, a), r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
toList s = toList l @ (e, a) # toList r
\<not> p (i + annot l)
p (i + annot l + a)
ft_invar l
ft_invar r
splitTree p i s = (l, (e, a), r)

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

goal:
No subgoals!
[PROOF STEP]
qed