[STATEMENT]
lemma pdevs_val_permuted:
  \<open>pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)\<close> (is \<open>?r = ?s\<close>)
  if perm: \<open>p permutes {..<length xs}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
p permutes {..<length xs}
[PROOF STEP]
have \<open>image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}\<close>
[PROOF STATE]
proof (prove)
using this:
p permutes {..<length xs}

goal (1 subgoal):
 1. image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}
[PROOF STEP]
by (simp add: permutes_image_mset lessThan_atLeast0)
[PROOF STATE]
proof (state)
this:
image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}

goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}

goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
have \<open>map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] =
    map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] = map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
p permutes {..<length xs}

goal (1 subgoal):
 1. map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] = map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])
[PROOF STEP]
by (simp add: permute_list_nth)
[PROOF STATE]
proof (state)
this:
map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] = map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])

goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}
map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] = map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}
map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] = map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])

goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
image_mset p (mset_set {0..<length xs}) = mset_set {0..<length xs}
map (\<lambda>n. e (p n) *\<^sub>R permute_list p xs ! n) [0..<length xs] = map (\<lambda>n. e n *\<^sub>R xs ! n) (map p [0..<length xs])
p permutes {..<length xs}

goal (1 subgoal):
 1. pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)
[PROOF STEP]
by (simp add: pdevs_apply_pdevs_of_list pdevs_val_map
      flip: map_map sum_mset_sum_list)
[PROOF STATE]
proof (state)
this:
pdevs_val (e \<circ> p) (pdevs_of_list (permute_list p xs)) = pdevs_val e (pdevs_of_list xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma even_sign_changes_iff:
  assumes "xs \<noteq> ([] :: 'a :: linordered_idom list)" "hd xs \<noteq> 0" "last xs \<noteq> 0"
  shows   "even (sign_changes xs) \<longleftrightarrow> sgn (hd xs) = sgn (last xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)

goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
proof (induction "length xs" arbitrary: xs rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>xsa. \<lbrakk>length xsa < length xs; xsa \<noteq> []; hd xsa \<noteq> (0::'a); last xsa \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes xsa) = (sgn (hd xsa) = sgn (last xsa)); xs \<noteq> []; hd xs \<noteq> (0::'a); last xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
case (less xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length ?xs < length xs; ?xs \<noteq> []; hd ?xs \<noteq> (0::'a); last ?xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes ?xs) = (sgn (hd ?xs) = sgn (last ?xs))
xs \<noteq> []
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>xsa. \<lbrakk>length xsa < length xs; xsa \<noteq> []; hd xsa \<noteq> (0::'a); last xsa \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes xsa) = (sgn (hd xsa) = sgn (last xsa)); xs \<noteq> []; hd xs \<noteq> (0::'a); last xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
proof (cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. \<And>a list. xs = a # list \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
case (Cons x xs')
[PROOF STATE]
proof (state)
this:
xs = x # xs'

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. \<And>a list. xs = a # list \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
note x = this
[PROOF STATE]
proof (state)
this:
xs = x # xs'

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. \<And>a list. xs = a # list \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
proof (cases xs')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs' = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. \<And>a list. xs' = a # list \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
case (Cons y xs'')
[PROOF STATE]
proof (state)
this:
xs' = y # xs''

goal (2 subgoals):
 1. xs' = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. \<And>a list. xs' = a # list \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
note y = this
[PROOF STATE]
proof (state)
this:
xs' = y # xs''

goal (2 subgoals):
 1. xs' = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. \<And>a list. xs' = a # list \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
proof (rule linorder_cases[of "x*y" 0])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. x * y = (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 3. (0::'a) < x * y \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
assume xy: "x*y = 0"
[PROOF STATE]
proof (state)
this:
x * y = (0::'a)

goal (3 subgoals):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. x * y = (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 3. (0::'a) < x * y \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
with x y less(1,3,4)
[PROOF STATE]
proof (chain)
picking this:
xs = x # xs'
xs' = y # xs''
\<lbrakk>length ?xs < length xs; ?xs \<noteq> []; hd ?xs \<noteq> (0::'a); last ?xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes ?xs) = (sgn (hd ?xs) = sgn (last ?xs))
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)
x * y = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs = x # xs'
xs' = y # xs''
\<lbrakk>length ?xs < length xs; ?xs \<noteq> []; hd ?xs \<noteq> (0::'a); last ?xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes ?xs) = (sgn (hd ?xs) = sgn (last ?xs))
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)
x * y = (0::'a)

goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
by (auto simp: sign_changes_Cons_Cons_0)
[PROOF STATE]
proof (state)
this:
even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))

goal (2 subgoals):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. (0::'a) < x * y \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. (0::'a) < x * y \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
assume xy: "x*y > 0"
[PROOF STATE]
proof (state)
this:
(0::'a) < x * y

goal (2 subgoals):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
 2. (0::'a) < x * y \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
with less(1,4)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length ?xs < length xs; ?xs \<noteq> []; hd ?xs \<noteq> (0::'a); last ?xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes ?xs) = (sgn (hd ?xs) = sgn (last ?xs))
last xs \<noteq> (0::'a)
(0::'a) < x * y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?xs < length xs; ?xs \<noteq> []; hd ?xs \<noteq> (0::'a); last ?xs \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> even (sign_changes ?xs) = (sgn (hd ?xs) = sgn (last ?xs))
last xs \<noteq> (0::'a)
(0::'a) < x * y

goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
by (auto simp add: x y sign_changes_Cons_Cons_same zero_less_mult_iff)
[PROOF STATE]
proof (state)
this:
even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
assume xy: "x*y < 0"
[PROOF STATE]
proof (state)
this:
x * y < (0::'a)

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x * y < (0::'a)

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
from xy
[PROOF STATE]
proof (chain)
picking this:
x * y < (0::'a)
[PROOF STEP]
have "sgn x = - sgn y"
[PROOF STATE]
proof (prove)
using this:
x * y < (0::'a)

goal (1 subgoal):
 1. sgn x = - sgn y
[PROOF STEP]
by (auto simp: mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
sgn x = - sgn y

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgn x = - sgn y

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
have "even (sign_changes (y # xs'')) \<longleftrightarrow>
                         sgn (hd (y # xs'')) = sgn (last (y # xs''))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sign_changes (y # xs'')) = (sgn (hd (y # xs'')) = sgn (last (y # xs'')))
[PROOF STEP]
using xy less.prems
[PROOF STATE]
proof (prove)
using this:
x * y < (0::'a)
xs \<noteq> []
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)

goal (1 subgoal):
 1. even (sign_changes (y # xs'')) = (sgn (hd (y # xs'')) = sgn (last (y # xs'')))
[PROOF STEP]
by (intro less) (auto simp: x y)
[PROOF STATE]
proof (state)
this:
even (sign_changes (y # xs'')) = (sgn (hd (y # xs'')) = sgn (last (y # xs'')))

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even (sign_changes (y # xs'')) = (sgn (hd (y # xs'')) = sgn (last (y # xs'')))

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
from xy less.prems
[PROOF STATE]
proof (chain)
picking this:
x * y < (0::'a)
xs \<noteq> []
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)
[PROOF STEP]
have "sgn y = sgn (last xs) \<longleftrightarrow> -sgn y \<noteq> sgn (last xs)"
[PROOF STATE]
proof (prove)
using this:
x * y < (0::'a)
xs \<noteq> []
hd xs \<noteq> (0::'a)
last xs \<noteq> (0::'a)

goal (1 subgoal):
 1. (sgn y = sgn (last xs)) = (- sgn y \<noteq> sgn (last xs))
[PROOF STEP]
by (auto simp: sgn_if)
[PROOF STATE]
proof (state)
this:
(sgn y = sgn (last xs)) = (- sgn y \<noteq> sgn (last xs))

goal (1 subgoal):
 1. x * y < (0::'a) \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x * y < (0::'a)
sgn x = - sgn y
even (sign_changes (y # xs'')) = (sgn (hd (y # xs'')) = sgn (last (y # xs'')))
(sgn y = sgn (last xs)) = (- sgn y \<noteq> sgn (last xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x * y < (0::'a)
sgn x = - sgn y
even (sign_changes (y # xs'')) = (sgn (hd (y # xs'')) = sgn (last (y # xs'')))
(sgn y = sgn (last xs)) = (- sgn y \<noteq> sgn (last xs))

goal (1 subgoal):
 1. even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
by (auto simp: sign_changes_Cons_Cons_different x y)
[PROOF STATE]
proof (state)
this:
even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))

goal (1 subgoal):
 1. xs' = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
qed (auto simp: x)
[PROOF STATE]
proof (state)
this:
even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))

goal (1 subgoal):
 1. xs = [] \<Longrightarrow> even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))
[PROOF STEP]
qed (insert less.prems, simp_all)
[PROOF STATE]
proof (state)
this:
even (sign_changes xs) = (sgn (hd xs) = sgn (last xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in padic_integers) residue_units_card_geq_2:
  assumes "n \<ge>2"
  shows "card (Units (Zp_res_ring n)) \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
proof(cases "p = 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 2
[PROOF STEP]
have "(3::int) \<in> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
using this:
p = 2

goal (1 subgoal):
 1. 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
have "p \<ge>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> p
[PROOF STEP]
by (simp add: True)
[PROOF STATE]
proof (state)
this:
2 \<le> p

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<le> p
[PROOF STEP]
have "p^n \<ge> 2^n"
[PROOF STATE]
proof (prove)
using this:
2 \<le> p

goal (1 subgoal):
 1. 2 ^ n \<le> p ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> p
2 \<le> n

goal (1 subgoal):
 1. 2 ^ n \<le> p ^ n
[PROOF STEP]
by (simp add: True)
[PROOF STATE]
proof (state)
this:
2 ^ n \<le> p ^ n

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ n \<le> p ^ n
[PROOF STEP]
have "p^n \<ge> 4"
[PROOF STATE]
proof (prove)
using this:
2 ^ n \<le> p ^ n

goal (1 subgoal):
 1. 4 \<le> p ^ n
[PROOF STEP]
using assms   power_increasing[of 2 n 2]
[PROOF STATE]
proof (prove)
using this:
2 ^ n \<le> p ^ n
2 \<le> n
\<lbrakk>2 \<le> n; (1::?'a1) \<le> (2::?'a1)\<rbrakk> \<Longrightarrow> (2::?'a1)\<^sup>2 \<le> (2::?'a1) ^ n

goal (1 subgoal):
 1. 4 \<le> p ^ n
[PROOF STEP]
by (simp add: True)
[PROOF STATE]
proof (state)
this:
4 \<le> p ^ n

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
4 \<le> p ^ n
[PROOF STEP]
have "(3::int) < p^n"
[PROOF STATE]
proof (prove)
using this:
4 \<le> p ^ n

goal (1 subgoal):
 1. 3 < p ^ n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
3 < p ^ n

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 < p ^ n
[PROOF STEP]
have 0: "(3::int) \<in> carrier (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
using this:
3 < p ^ n

goal (1 subgoal):
 1. 3 \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by (simp add: residue_ring_def)
[PROOF STATE]
proof (state)
this:
3 \<in> carrier (residue_ring (p ^ n))

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
have 1: "coprime 3 p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 3 p
[PROOF STEP]
by (simp add: True numeral_3_eq_3)
[PROOF STATE]
proof (state)
this:
coprime 3 p

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
using residue_UnitsI[of n "3::int"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> n; 0 < 3; 3 < p ^ n; coprime 3 p\<rbrakk> \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
using "1" \<open>3 < p ^ n\<close> assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> n; 0 < 3; 3 < p ^ n; coprime 3 p\<rbrakk> \<Longrightarrow> 3 \<in> Units (residue_ring (p ^ n))
coprime 3 p
3 < p ^ n
2 \<le> n

goal (1 subgoal):
 1. 3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
3 \<in> Units (residue_ring (p ^ n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
3 \<in> Units (residue_ring (p ^ n))

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
have 0: "{(1::int), 3} \<subseteq> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
using this:
3 \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. {1, 3} \<subseteq> Units (residue_ring (p ^ n))
[PROOF STEP]
using assms padic_integers.residue_1_unit padic_integers_axioms
[PROOF STATE]
proof (prove)
using this:
3 \<in> Units (residue_ring (p ^ n))
2 \<le> n
\<lbrakk>padic_integers ?p; 0 < ?m\<rbrakk> \<Longrightarrow> 1 \<in> Units (residue_ring (?p ^ ?m))
\<lbrakk>padic_integers ?p; 0 < ?m\<rbrakk> \<Longrightarrow> \<one>\<^bsub>residue_ring (?p ^ ?m)\<^esub> \<in> Units (residue_ring (?p ^ ?m))
padic_integers p

goal (1 subgoal):
 1. {1, 3} \<subseteq> Units (residue_ring (p ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1, 3} \<subseteq> Units (residue_ring (p ^ n))

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
have 1: "finite (Units (Zp_res_ring n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Units (residue_ring (p ^ n)))
[PROOF STEP]
using assms padic_integers.p_residues padic_integers_axioms residues.finite_Units
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
\<lbrakk>padic_integers ?p; 0 < ?m\<rbrakk> \<Longrightarrow> residues (?p ^ ?m)
padic_integers p
residues ?m \<Longrightarrow> finite (Units (residue_ring ?m))

goal (1 subgoal):
 1. finite (Units (residue_ring (p ^ n)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (Units (residue_ring (p ^ n)))

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
have 2: "{(1::int),3}\<subseteq>Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1, 3} \<subseteq> Units (residue_ring (p ^ n))
[PROOF STEP]
using "0"
[PROOF STATE]
proof (prove)
using this:
{1, 3} \<subseteq> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. {1, 3} \<subseteq> Units (residue_ring (p ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1, 3} \<subseteq> Units (residue_ring (p ^ n))

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
have 3: "card {(1::int),3} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {1, 3} = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {1, 3} = 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
 2. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
using 2 1
[PROOF STATE]
proof (prove)
using this:
{1, 3} \<subseteq> Units (residue_ring (p ^ n))
finite (Units (residue_ring (p ^ n)))

goal (1 subgoal):
 1. 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
by (metis "3" card_mono)
[PROOF STATE]
proof (state)
this:
2 \<le> card (Units (residue_ring (p ^ n)))

goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 2

goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
have "1 \<in> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
using assms padic_integers.residue_1_unit padic_integers_axioms
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
\<lbrakk>padic_integers ?p; 0 < ?m\<rbrakk> \<Longrightarrow> 1 \<in> Units (residue_ring (?p ^ ?m))
\<lbrakk>padic_integers ?p; 0 < ?m\<rbrakk> \<Longrightarrow> \<one>\<^bsub>residue_ring (?p ^ ?m)\<^esub> \<in> Units (residue_ring (?p ^ ?m))
padic_integers p

goal (1 subgoal):
 1. 1 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
have "2 \<in> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
apply(rule residue_UnitsI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 1 \<le> n
 2. 0 < 2
 3. 2 < p ^ n
 4. coprime 2 p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> n

goal (4 subgoals):
 1. 1 \<le> n
 2. 0 < 2
 3. 2 < p ^ n
 4. coprime 2 p
[PROOF STEP]
apply linarith
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < 2
 2. 2 < p ^ n
 3. coprime 2 p
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 2 < p ^ n
 2. coprime 2 p
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 < p ^ n
 2. coprime 2 p
[PROOF STEP]
show "2 < p^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 < p ^ n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 < p ^ n
[PROOF STEP]
have "p^n > p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p < p ^ n
[PROOF STEP]
by (metis One_nat_def assms le_simps(3) numerals(2) power_one_right
              power_strict_increasing_iff prime prime_gt_1_int)
[PROOF STATE]
proof (state)
this:
p < p ^ n

goal (1 subgoal):
 1. 2 < p ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p < p ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p < p ^ n

goal (1 subgoal):
 1. 2 < p ^ n
[PROOF STEP]
using False  prime prime_gt_1_int[of p]
[PROOF STATE]
proof (prove)
using this:
p < p ^ n
p \<noteq> 2
prime p
prime p \<Longrightarrow> 1 < p

goal (1 subgoal):
 1. 2 < p ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 < p ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 < p ^ n

goal (1 subgoal):
 1. coprime 2 p
[PROOF STEP]
show "coprime 2 p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 2 p
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 2

goal (1 subgoal):
 1. coprime 2 p
[PROOF STEP]
by (metis of_nat_numeral prime prime_nat_int_transfer primes_coprime two_is_prime_nat)
[PROOF STATE]
proof (state)
this:
coprime 2 p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
have 0: "{(1::int), 2} \<subseteq> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
using this:
2 \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. {1, 2} \<subseteq> Units (residue_ring (p ^ n))
[PROOF STEP]
using \<open>1 \<in> Units (Zp_res_ring n)\<close>
[PROOF STATE]
proof (prove)
using this:
2 \<in> Units (residue_ring (p ^ n))
1 \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. {1, 2} \<subseteq> Units (residue_ring (p ^ n))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{1, 2} \<subseteq> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
have 1: "card {(1::int),2} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {1, 2} = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {1, 2} = 2

goal (1 subgoal):
 1. p \<noteq> 2 \<Longrightarrow> 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {1, 2} = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {1, 2} = 2

goal (1 subgoal):
 1. 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
using residues.finite_Units 0
[PROOF STATE]
proof (prove)
using this:
card {1, 2} = 2
residues ?m \<Longrightarrow> finite (Units (residue_ring ?m))
{1, 2} \<subseteq> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. 2 \<le> card (Units (residue_ring (p ^ n)))
[PROOF STEP]
by (metis One_nat_def assms card_mono dual_order.trans
          le_simps(3) one_le_numeral padic_integers.p_residues padic_integers_axioms)
[PROOF STATE]
proof (state)
this:
2 \<le> card (Units (residue_ring (p ^ n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_snd_zip: "length xs = length ys \<Longrightarrow> map snd (zip xs ys) = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> map snd (zip xs ys) = ys
[PROOF STEP]
apply (induct xs ys rule:list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map snd (zip [] []) = []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; map snd (zip xs ys) = ys\<rbrakk> \<Longrightarrow> map snd (zip (x # xs) (y # ys)) = y # ys
[PROOF STEP]
by auto


[STATEMENT]
lemma sup_less_eq_cases:
  assumes "-z \<le> -x \<squnion> -y"
      and "-z \<le> --x \<squnion> -y"
    shows "-z \<le> -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - z \<le> - y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - z \<le> - y
[PROOF STEP]
have "-z \<le> (-x \<squnion> -y) \<sqinter> (--x \<squnion> -y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - z \<le> (- x \<squnion> - y) \<sqinter> (- - x \<squnion> - y)
[PROOF STEP]
by (metis assms greatest_lower_bound sub_sup_closed)
[PROOF STATE]
proof (state)
this:
- z \<le> (- x \<squnion> - y) \<sqinter> (- - x \<squnion> - y)

goal (1 subgoal):
 1. - z \<le> - y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- z \<le> (- x \<squnion> - y) \<sqinter> (- - x \<squnion> - y)

goal (1 subgoal):
 1. - z \<le> - y
[PROOF STEP]
have "... = -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<squnion> - y) \<sqinter> (- - x \<squnion> - y) = - y
[PROOF STEP]
by (metis inf_cases sub_commutative)
[PROOF STATE]
proof (state)
this:
(- x \<squnion> - y) \<sqinter> (- - x \<squnion> - y) = - y

goal (1 subgoal):
 1. - z \<le> - y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- z \<le> - y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- z \<le> - y

goal (1 subgoal):
 1. - z \<le> - y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- z \<le> - y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma id_list_eq_aux[simp]: "(list_eq (=)) = (=)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_eq (=) = (=)
[PROOF STEP]
proof (intro ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. list_eq (=) x xa = (x = xa)
[PROOF STEP]
fix l1 l2 :: "'a list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. list_eq (=) x xa = (x = xa)
[PROOF STEP]
show "list_eq (=) l1 l2 = (l1 = l2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_eq (=) l1 l2 = (l1 = l2)
[PROOF STEP]
apply (induct "(=) :: 'a \<Rightarrow> _" l1 l2 rule: list_eq.induct)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. list_eq (=) [] [] = ([] = [])
 2. \<And>a l a' l'. (a = a' \<Longrightarrow> list_eq (=) l l' = (l = l')) \<Longrightarrow> list_eq (=) (a # l) (a' # l') = (a # l = a' # l')
 3. \<And>v va. list_eq (=) (v # va) [] = (v # va = [])
 4. \<And>v va. list_eq (=) [] (v # va) = ([] = v # va)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
list_eq (=) l1 l2 = (l1 = l2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_envelopeD1:
  assumes E: "measurable_envelope M A E" and F: "F \<in> sets M" "F \<subseteq> E - A"
  shows "emeasure M F = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
have "emeasure M F = emeasure M (F \<inter> E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M F = emeasure M (F \<inter> E)
[PROOF STEP]
using F
[PROOF STATE]
proof (prove)
using this:
F \<in> sets M
F \<subseteq> E - A

goal (1 subgoal):
 1. emeasure M F = emeasure M (F \<inter> E)
[PROOF STEP]
by (intro arg_cong2[where f=emeasure]) auto
[PROOF STATE]
proof (state)
this:
emeasure M F = emeasure M (F \<inter> E)

goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M F = emeasure M (F \<inter> E)

goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
have "\<dots> = outer_measure_of M (F \<inter> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)
[PROOF STEP]
using measurable_envelopeD[OF E] \<open>F \<in> sets M\<close>
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> E
E \<in> sets M
?F \<in> sets M \<Longrightarrow> emeasure M (?F \<inter> E) = outer_measure_of M (?F \<inter> A)
A \<subseteq> space M
F \<in> sets M

goal (1 subgoal):
 1. emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)
[PROOF STEP]
by (auto simp: measurable_envelope_def)
[PROOF STATE]
proof (state)
this:
emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)

goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (F \<inter> E) = outer_measure_of M (F \<inter> A)

goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
have "\<dots> = outer_measure_of M {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_measure_of M (F \<inter> A) = outer_measure_of M {}
[PROOF STEP]
using \<open>F \<subseteq> E - A\<close>
[PROOF STATE]
proof (prove)
using this:
F \<subseteq> E - A

goal (1 subgoal):
 1. outer_measure_of M (F \<inter> A) = outer_measure_of M {}
[PROOF STEP]
by (intro arg_cong2[where f=outer_measure_of]) auto
[PROOF STATE]
proof (state)
this:
outer_measure_of M (F \<inter> A) = outer_measure_of M {}

goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M F = outer_measure_of M {}
[PROOF STEP]
show "emeasure M F = 0"
[PROOF STATE]
proof (prove)
using this:
emeasure M F = outer_measure_of M {}

goal (1 subgoal):
 1. emeasure M F = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure M F = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_iterator_genord_filter_correct :
  fixes it :: "('a,'\<sigma>) set_iterator"
  assumes it_OK: "set_iterator_genord it S R"
  shows "set_iterator_genord (set_iterator_filter P it) {x. x \<in> S \<and> P x} R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_filter P it) {x \<in> S. P x} R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_filter P it) {x \<in> S. P x} R
[PROOF STEP]
let ?g = "\<lambda>x. if P x then Some x else None"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_filter P it) {x \<in> S. P x} R
[PROOF STEP]
have in_dom_g: "\<And>x. x \<in> dom ?g \<longleftrightarrow> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x \<in> dom (\<lambda>x. if P x then Some x else None)) = P x
[PROOF STEP]
unfolding dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x \<in> {a. (if P a then Some a else None) \<noteq> None}) = P x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(?x \<in> dom (\<lambda>x. if P x then Some x else None)) = P ?x

goal (1 subgoal):
 1. set_iterator_genord (set_iterator_filter P it) {x \<in> S. P x} R
[PROOF STEP]
from set_iterator_genord_image_filter_correct [OF it_OK, of ?g R, folded set_iterator_filter_def]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>inj_on (\<lambda>x. if P x then Some x else None) (S \<inter> dom (\<lambda>x. if P x then Some x else None)); \<And>x y x' y'. \<lbrakk>x \<in> S; (if P x then Some x else None) = Some x'; y \<in> S; (if P y then Some y else None) = Some y'; R x y\<rbrakk> \<Longrightarrow> R x' y'\<rbrakk> \<Longrightarrow> set_iterator_genord (set_iterator_filter P it) {y. \<exists>x. x \<in> S \<and> (if P x then Some x else None) = Some y} R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>inj_on (\<lambda>x. if P x then Some x else None) (S \<inter> dom (\<lambda>x. if P x then Some x else None)); \<And>x y x' y'. \<lbrakk>x \<in> S; (if P x then Some x else None) = Some x'; y \<in> S; (if P y then Some y else None) = Some y'; R x y\<rbrakk> \<Longrightarrow> R x' y'\<rbrakk> \<Longrightarrow> set_iterator_genord (set_iterator_filter P it) {y. \<exists>x. x \<in> S \<and> (if P x then Some x else None) = Some y} R

goal (1 subgoal):
 1. set_iterator_genord (set_iterator_filter P it) {x \<in> S. P x} R
[PROOF STEP]
by (simp add: if_split_eq1 inj_on_def Ball_def in_dom_g)
[PROOF STATE]
proof (state)
this:
set_iterator_genord (set_iterator_filter P it) {x \<in> S. P x} R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem card_singleton_set:
  assumes cardOne:"\<forall>x \<in> A.(card x = 1)"
  shows "card (\<Union>A) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> A) = card A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (\<Union> A) = card A
[PROOF STEP]
have "card (\<Union>A) = (\<Sum>x\<in>A. card x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> A) = sum card A
[PROOF STEP]
proof(rule card_Union_disjoint)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pairwise disjnt A
 2. \<And>Aa. Aa \<in> A \<Longrightarrow> finite Aa
[PROOF STEP]
from cardOne
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>A. card x = 1
[PROOF STEP]
show "\<And>a. a\<in>A \<Longrightarrow> finite a"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. card x = 1

goal (1 subgoal):
 1. \<And>a. a \<in> A \<Longrightarrow> finite a
[PROOF STEP]
by (auto intro: card_ge_0_finite)
[PROOF STATE]
proof (state)
this:
?a \<in> A \<Longrightarrow> finite ?a

goal (1 subgoal):
 1. pairwise disjnt A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pairwise disjnt A
[PROOF STEP]
show "pairwise disjnt A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise disjnt A
[PROOF STEP]
unfolding pairwise_def disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. x \<noteq> y \<longrightarrow> x \<inter> y = {}
[PROOF STEP]
proof(clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<inter> y = {}
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<inter> y = {}
[PROOF STEP]
assume x:"x \<in> A" and y:"y \<in> A" and "x \<noteq> y"
[PROOF STATE]
proof (state)
this:
x \<in> A
y \<in> A
x \<noteq> y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<inter> y = {}
[PROOF STEP]
with cardOne
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>A. card x = 1
x \<in> A
y \<in> A
x \<noteq> y
[PROOF STEP]
have "card x = 1" "card y = 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. card x = 1
x \<in> A
y \<in> A
x \<noteq> y

goal (1 subgoal):
 1. card x = 1 &&& card y = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card x = 1
card y = 1

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<inter> y = {}
[PROOF STEP]
with \<open>x \<noteq> y\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
card x = 1
card y = 1
[PROOF STEP]
show "x \<inter> y = {}"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
card x = 1
card y = 1

goal (1 subgoal):
 1. x \<inter> y = {}
[PROOF STEP]
by (metis singleton_intersection)
[PROOF STATE]
proof (state)
this:
x \<inter> y = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pairwise disjnt A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (\<Union> A) = sum card A

goal (1 subgoal):
 1. card (\<Union> A) = card A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (\<Union> A) = sum card A

goal (1 subgoal):
 1. card (\<Union> A) = card A
[PROOF STEP]
from cardOne
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>A. card x = 1
[PROOF STEP]
have "... = card A"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. card x = 1

goal (1 subgoal):
 1. sum card A = card A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum card A = card A

goal (1 subgoal):
 1. card (\<Union> A) = card A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (\<Union> A) = card A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (\<Union> A) = card A

goal (1 subgoal):
 1. card (\<Union> A) = card A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (\<Union> A) = card A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interior_halfspace_component_le [simp]:
     "interior {x. x$k \<le> a} = {x :: (real^'n). x$k < a}" (is "?LE")
  and interior_halfspace_component_ge [simp]:
     "interior {x. x$k \<ge> a} = {x :: (real^'n). x$k > a}" (is "?GE")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a} &&& interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a}
 2. interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
have "axis k (1::real) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis k 1 \<noteq> 0
[PROOF STEP]
by (simp add: axis_def vec_eq_iff)
[PROOF STATE]
proof (state)
this:
axis k 1 \<noteq> 0

goal (2 subgoals):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a}
 2. interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
axis k 1 \<noteq> 0

goal (2 subgoals):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a}
 2. interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
have "axis k (1::real) \<bullet> x = x$k" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. axis k 1 \<bullet> x = x $ k
[PROOF STEP]
by (simp add: cart_eq_inner_axis inner_commute)
[PROOF STATE]
proof (state)
this:
axis k 1 \<bullet> ?x = ?x $ k

goal (2 subgoals):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a}
 2. interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k
[PROOF STEP]
show ?LE ?GE
[PROOF STATE]
proof (prove)
using this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k

goal (1 subgoal):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a} &&& interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
using interior_halfspace_le [of "axis k (1::real)" a]
          interior_halfspace_ge [of "axis k (1::real)" a]
[PROOF STATE]
proof (prove)
using this:
axis k 1 \<noteq> 0
axis k 1 \<bullet> ?x = ?x $ k
axis k 1 \<noteq> 0 \<Longrightarrow> interior {x. axis k 1 \<bullet> x \<le> a} = {x. axis k 1 \<bullet> x < a}
axis k 1 \<noteq> 0 \<Longrightarrow> interior {x. a \<le> axis k 1 \<bullet> x} = {x. a < axis k 1 \<bullet> x}

goal (1 subgoal):
 1. interior {x. x $ k \<le> a} = {x. x $ k < a} &&& interior {x. a \<le> x $ k} = {x. a < x $ k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
interior {x. x $ k \<le> a} = {x. x $ k < a}
interior {x. a \<le> x $ k} = {x. a < x $ k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_minus_eq_minus:
  assumes x: "x \<in> V" and y: "y \<in> V" and xy: "x + y = 0"
  shows "x = - y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = - y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = - y
[PROOF STEP]
from x y
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
[PROOF STEP]
have "x = (- y + y) + x"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V

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

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = - y + y + x

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
from x y
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
[PROOF STEP]
have "\<dots> = - y + (x + y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V

goal (1 subgoal):
 1. - y + y + x = - y + (x + y)
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
- y + y + x = - y + (x + y)

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- y + y + x = - y + (x + y)

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
note xy
[PROOF STATE]
proof (state)
this:
x + y = (0::'a)

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + y = (0::'a)

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
from y
[PROOF STATE]
proof (chain)
picking this:
y \<in> V
[PROOF STEP]
have "- y + 0 = - y"
[PROOF STATE]
proof (prove)
using this:
y \<in> V

goal (1 subgoal):
 1. - y + (0::'a) = - y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- y + (0::'a) = - y

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = - y
[PROOF STEP]
show "x = - y"
[PROOF STATE]
proof (prove)
using this:
x = - y

goal (1 subgoal):
 1. x = - y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = - y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_component_eq_self: "connected S \<Longrightarrow> x \<in> S \<Longrightarrow> connected_component_set S x = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected S; x \<in> S\<rbrakk> \<Longrightarrow> connected_component_set S x = S
[PROOF STEP]
by (simp add: connected_iff_eq_connected_component_set)


[STATEMENT]
lemma eventually_at_right_less: "\<forall>\<^sub>F y in at_right (x::'a::{linorder_topology, no_top}). x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((<) x) (at_right x)
[PROOF STEP]
using gt_ex[of x] eventually_at_right[of x]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. x < y
x < ?y \<Longrightarrow> eventually ?P (at_right x) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> ?P y)

goal (1 subgoal):
 1. eventually ((<) x) (at_right x)
[PROOF STEP]
by auto


[STATEMENT]
lemma hereditarily_fs_implies_finite_supp:
  assumes "hereditarily_fs t\<^sub>\<alpha>"
  shows "finite (supp t\<^sub>\<alpha>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp t\<^sub>\<alpha>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
hereditarily_fs t\<^sub>\<alpha>

goal (1 subgoal):
 1. finite (supp t\<^sub>\<alpha>)
[PROOF STEP]
by (induction rule: hereditarily_fs.induct) (simp_all add: finite_supp)


[STATEMENT]
lemma bernoulli_pmf_Not:
  assumes "p \<in> {0..1}"
  shows "bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))
[PROOF STEP]
have *: "(Not -` {True}) = {False}" "(Not -` {False}) = {True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Not -` {True} = {False} &&& Not -` {False} = {True}
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
Not -` {True} = {False}
Not -` {False} = {True}

goal (1 subgoal):
 1. bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))
[PROOF STEP]
have "pmf (bernoulli_pmf p) b = pmf (map_pmf Not (bernoulli_pmf (1 - p))) b" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (bernoulli_pmf p) b = pmf (map_pmf Not (bernoulli_pmf (1 - p))) b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<in> {0..1}

goal (1 subgoal):
 1. pmf (bernoulli_pmf p) b = pmf (map_pmf Not (bernoulli_pmf (1 - p))) b
[PROOF STEP]
by (cases b) (auto simp add: pmf_map * measure_pmf_single)
[PROOF STATE]
proof (state)
this:
pmf (bernoulli_pmf p) ?b = pmf (map_pmf Not (bernoulli_pmf (1 - p))) ?b

goal (1 subgoal):
 1. bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pmf (bernoulli_pmf p) ?b = pmf (map_pmf Not (bernoulli_pmf (1 - p))) ?b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pmf (bernoulli_pmf p) ?b = pmf (map_pmf Not (bernoulli_pmf (1 - p))) ?b

goal (1 subgoal):
 1. bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))
[PROOF STEP]
by (rule pmf_eqI)
[PROOF STATE]
proof (state)
this:
bernoulli_pmf p = map_pmf Not (bernoulli_pmf (1 - p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmdom'_fmrestrict_set_fmadd:
  fixes X f g
  shows "fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)
[PROOF STEP]
have "fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g
[PROOF STEP]
using fmrestrict_set_add_distrib
[PROOF STATE]
proof (prove)
using this:
fmrestrict_set ?A (?m ++\<^sub>f ?n) = fmrestrict_set ?A ?m ++\<^sub>f fmrestrict_set ?A ?n

goal (1 subgoal):
 1. fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g

goal (1 subgoal):
 1. fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g

goal (1 subgoal):
 1. fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)
[PROOF STEP]
using fmdom'_fmrestrict_set fmdom'_add
[PROOF STATE]
proof (prove)
using this:
fmrestrict_set X (f ++\<^sub>f g) = fmrestrict_set X f ++\<^sub>f fmrestrict_set X g
fmdom' (fmrestrict_set ?X ?f) = ?X \<inter> fmdom' ?f
fmdom' (?m ++\<^sub>f ?n) = fmdom' ?m \<union> fmdom' ?n

goal (1 subgoal):
 1. fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
fmdom' (fmrestrict_set X (f ++\<^sub>f g)) = X \<inter> (fmdom' f \<union> fmdom' g)

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE added lemma.\<close>
\<comment> \<open>TODO refactor into 'Fmap\_Utils'.\<close>


[STATEMENT]
lemma nat_explode_digits: \<open>\<forall> d \<in> set (nat_explode n). d < 10\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>d\<in>set (nat_explode n). d < 10
[PROOF STEP]
using nat_explode_def set_rev
[PROOF STATE]
proof (prove)
using this:
nat_explode ?x = rev (nat_explode' ?x)
set (rev ?xs) = set ?xs

goal (1 subgoal):
 1. \<forall>d\<in>set (nat_explode n). d < 10
[PROOF STEP]
by (metis nat_explode'_digits)


[STATEMENT]
lemma inv_mult_group:
  "inv (x ** y) = inv y ** inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.inv (x ** y) = local.inv y ** local.inv x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.inv (x ** y) = local.inv y ** local.inv x
[PROOF STEP]
have "inv (x ** y) ** (x ** y) = (inv y ** inv x) ** (x ** y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.inv (x ** y) ** (x ** y) = local.inv y ** local.inv x ** (x ** y)
[PROOF STEP]
by (simp add: assoc l_inv) (simp add: assoc [symmetric])
[PROOF STATE]
proof (state)
this:
local.inv (x ** y) ** (x ** y) = local.inv y ** local.inv x ** (x ** y)

goal (1 subgoal):
 1. local.inv (x ** y) = local.inv y ** local.inv x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local.inv (x ** y) ** (x ** y) = local.inv y ** local.inv x ** (x ** y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.inv (x ** y) ** (x ** y) = local.inv y ** local.inv x ** (x ** y)

goal (1 subgoal):
 1. local.inv (x ** y) = local.inv y ** local.inv x
[PROOF STEP]
by (simp del: l_inv)
[PROOF STATE]
proof (state)
this:
local.inv (x ** y) = local.inv y ** local.inv x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_nonneg_imp_mono:
  assumes "\<And>t. t\<in>{x..y} \<Longrightarrow> (f has_field_derivative f' t) (at t)"
  assumes "\<And>t. t\<in>{x..y} \<Longrightarrow> f' t \<ge> 0"
  assumes "(x::real) \<le> y"
  shows   "(f x :: real) \<le> f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<le> f y
[PROOF STEP]
proof (cases x y rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
assume xy: "x < y"
[PROOF STATE]
proof (state)
this:
x < y

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
hence "\<exists>z. x < z \<and> z < y \<and> f y - f x = (y - x) * f' z"
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. \<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z
[PROOF STEP]
by (rule MVT2) (insert assms(1), simp)
[PROOF STATE]
proof (state)
this:
\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z
[PROOF STEP]
guess z
[PROOF STATE]
proof (prove)
using this:
\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z

goal (1 subgoal):
 1. thesis
goal instantiation:
PROP ?guess \<leadsto> thesis
[PROOF STEP]
by (elim exE conjE)
[PROOF STATE]
proof (state)
this:
x < z
z < y
f y - f x = (y - x) * f' z

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
note z = this
[PROOF STATE]
proof (state)
this:
x < z
z < y
f y - f x = (y - x) * f' z

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
from z(1,2) assms(2) xy
[PROOF STATE]
proof (chain)
picking this:
x < z
z < y
?t \<in> {x..y} \<Longrightarrow> 0 \<le> f' ?t
x < y
[PROOF STEP]
have "0 \<le> (y - x) * f' z"
[PROOF STATE]
proof (prove)
using this:
x < z
z < y
?t \<in> {x..y} \<Longrightarrow> 0 \<le> f' ?t
x < y

goal (1 subgoal):
 1. 0 \<le> (y - x) * f' z
[PROOF STEP]
by (intro mult_nonneg_nonneg) simp_all
[PROOF STATE]
proof (state)
this:
0 \<le> (y - x) * f' z

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> (y - x) * f' z

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
note z(3)[symmetric]
[PROOF STATE]
proof (state)
this:
(y - x) * f' z = f y - f x

goal (3 subgoals):
 1. x < y \<Longrightarrow> f x \<le> f y
 2. x = y \<Longrightarrow> f x \<le> f y
 3. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> f y - f x
[PROOF STEP]
show "f x \<le> f y"
[PROOF STATE]
proof (prove)
using this:
0 \<le> f y - f x

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

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x \<le> f y
 2. y < x \<Longrightarrow> f x \<le> f y
[PROOF STEP]
qed (insert assms(3), simp_all)


[STATEMENT]
theorem "\<forall>(x::int) y. 2 * x + 1 \<noteq> 2 * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. 2 * x + 1 \<noteq> 2 * y
[PROOF STEP]
by cooper


[STATEMENT]
lemma closed_union_complement_components:
  fixes S :: "'a::real_normed_vector set"
  assumes S: "closed S" and c: "c \<subseteq> components(- S)"
    shows "closed(S \<union> \<Union> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (S \<union> \<Union> c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed (S \<union> \<Union> c)
[PROOF STEP]
have "closedin (top_of_set UNIV) (S \<union> \<Union>c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set UNIV) (S \<union> \<Union> c)
[PROOF STEP]
by (metis Compl_eq_Diff_UNIV S c closed_closedin closedin_union_complement_components locally_connected_UNIV subtopology_UNIV)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set UNIV) (S \<union> \<Union> c)

goal (1 subgoal):
 1. closed (S \<union> \<Union> c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closedin (top_of_set UNIV) (S \<union> \<Union> c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set UNIV) (S \<union> \<Union> c)

goal (1 subgoal):
 1. closed (S \<union> \<Union> c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closed (S \<union> \<Union> c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_comp_insert_with_key: "rbt_comp_insert_with_key = ord.rbt_insert_with_key (lt_of_comp c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.rbt_comp_insert_with_key = ord.rbt_insert_with_key (lt_of_comp c)
[PROOF STEP]
unfolding rbt_comp_insert_with_key_def[abs_def] ord.rbt_insert_with_key_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f k v t. paint color.B (local.rbt_comp_ins f k v t)) = (\<lambda>f k v t. paint color.B (ord.rbt_ins (lt_of_comp c) f k v t))
[PROOF STEP]
unfolding rbt_comp_ins
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f k v t. paint color.B (ord.rbt_ins (lt_of_comp c) f k v t)) = (\<lambda>f k v t. paint color.B (ord.rbt_ins (lt_of_comp c) f k v t))
[PROOF STEP]
..


[STATEMENT]
lemma (in domain) nat_pow_eq_0_iff [simp]:
  "a \<in> carrier R \<Longrightarrow> (a [^] (n::nat) = \<zero>) = (a = \<zero> \<and> n \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier R \<Longrightarrow> (a [^] n = \<zero>) = (a = \<zero> \<and> n \<noteq> 0)
[PROOF STEP]
by (induct n) (auto simp add: integral_iff)


[STATEMENT]
lemma simplex_map_eq:
   "\<lbrakk>singular_simplex p X c;
     \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk>
    \<Longrightarrow> simplex_map p f c = simplex_map p g c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>singular_simplex p X c; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> simplex_map p f c = simplex_map p g c
[PROOF STEP]
by (auto simp: singular_simplex_def simplex_map_def continuous_map_def)


[STATEMENT]
lemma entailment_and_implicates:
  assumes "entails_formula S1 S2"
  shows "implicates S2 \<subseteq> implicates S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. implicates S2 \<subseteq> implicates S1
[PROOF STEP]
using assms entailed_formula_entails_implicates implicates_def
[PROOF STATE]
proof (prove)
using this:
entails_formula S1 S2
\<lbrakk>entails_formula ?S1.0 ?S2.0; entails ?S2.0 ?C\<rbrakk> \<Longrightarrow> entails ?S1.0 ?C
implicates ?S = {C. entails ?S C}

goal (1 subgoal):
 1. implicates S2 \<subseteq> implicates S1
[PROOF STEP]
by auto


[STATEMENT]
lemma linear_orderable_2_implies_1:
  "linear_orderable_2 x \<Longrightarrow> linear_orderable_1 (x \<squnion> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear_orderable_2 x \<Longrightarrow> linear_orderable_1 (x \<squnion> (1::'a))
[PROOF STEP]
using linear_strict_order_order
[PROOF STATE]
proof (prove)
using this:
linear_orderable_2 ?x \<Longrightarrow> linear_orderable_1 (?x \<squnion> (1::'a))

goal (1 subgoal):
 1. linear_orderable_2 x \<Longrightarrow> linear_orderable_1 (x \<squnion> (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma gcd_primes32: "p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535
[PROOF STEP]
have "list_all (\<lambda> p. prime p \<and> p \<le> 65535) gcd_primes32"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>p. prime p \<and> p \<le> 65535) gcd_primes32
[PROOF STEP]
by eval
[PROOF STATE]
proof (state)
this:
list_all (\<lambda>p. prime p \<and> p \<le> 65535) gcd_primes32

goal (1 subgoal):
 1. p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535
[PROOF STEP]
thus "p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535"
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>p. prime p \<and> p \<le> 65535) gcd_primes32

goal (1 subgoal):
 1. p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
p \<in> set gcd_primes32 \<Longrightarrow> prime p \<and> p \<le> 65535

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vfst_arrow_vrange: "\<R>\<^sub>\<circ> (vfst_arrow A B\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (vfst_arrow A B\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> A
[PROOF STEP]
unfolding vfst_arrow_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (VLambda (A \<times>\<^sub>\<circ> B) vfst) \<subseteq>\<^sub>\<circ> A
[PROOF STEP]
proof(intro vrange_VLambda_vsubset)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vfst x \<in>\<^sub>\<circ> A
[PROOF STEP]
fix ab
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vfst x \<in>\<^sub>\<circ> A
[PROOF STEP]
assume "ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B"
[PROOF STATE]
proof (state)
this:
ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vfst x \<in>\<^sub>\<circ> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B
[PROOF STEP]
obtain a b where ab_def: "ab = \<langle>a, b\<rangle>" and a: "a \<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>ab = \<langle>a, b\<rangle>; a \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
ab = \<langle>a, b\<rangle>
a \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vfst x \<in>\<^sub>\<circ> A
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> A
[PROOF STEP]
show "vfst ab \<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vfst ab \<in>\<^sub>\<circ> A
[PROOF STEP]
unfolding ab_def
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vfst \<langle>a, b\<rangle> \<in>\<^sub>\<circ> A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vfst ab \<in>\<^sub>\<circ> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_nth_deriv_fps_X[simp]: "fps_nth_deriv n fps_X = (if n = 0 then fps_X else if n=1 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_nth_deriv n fps_X = (if n = 0 then fps_X else if n = 1 then 1 else 0)
[PROOF STEP]
by (cases n) simp_all


[STATEMENT]
lemma group_closure_minus_iff [simp]:
  "- s \<in> group_closure S \<longleftrightarrow> s \<in> group_closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- s \<in> group_closure S) = (s \<in> group_closure S)
[PROOF STEP]
using group_closure.diff [of 0 S s] group_closure.diff [of 0 S "- s"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<in> group_closure S; s \<in> group_closure S\<rbrakk> \<Longrightarrow> (0::'a) - s \<in> group_closure S
\<lbrakk>(0::'a) \<in> group_closure S; - s \<in> group_closure S\<rbrakk> \<Longrightarrow> (0::'a) - - s \<in> group_closure S

goal (1 subgoal):
 1. (- s \<in> group_closure S) = (s \<in> group_closure S)
[PROOF STEP]
by auto


[STATEMENT]
lemma add_m_stack_nth:
 "\<lbrakk>-n \<le> a; n \<le> length stk\<rbrakk> \<Longrightarrow>
    add_m_stack n stk ms a = (if 0 \<le> a then ms a else stk ! (nat (n + a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- int n \<le> a; n \<le> length stk\<rbrakk> \<Longrightarrow> add_m_stack n stk ms a = (if 0 \<le> a then ms a else stk ! nat (int n + a))
[PROOF STEP]
by (induction n arbitrary: stk, auto intro: hd_conv_nth simp: add_m_stack_nneg
 nth_tl Suc_nat_eq_nat_zadd1 ac_simps)


[STATEMENT]
lemma graph_eq_to_snd_dom: "graph m = (\<lambda>x. (x, the (m x))) ` dom m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph m = (\<lambda>x. (x, the (m x))) ` dom m
[PROOF STEP]
unfolding graph_def dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b) |a b. m a = Some b} = (\<lambda>x. (x, the (m x))) ` {a. m a \<noteq> None}
[PROOF STEP]
by force


[STATEMENT]
lemma snd_foldl_Gauss_Jordan_column_k_eq:
"snd (foldl Gauss_Jordan_column_k_PA (mat 1, 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k]
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<0]) = foldl Gauss_Jordan_column_k (0, A) [0..<0]
 2. \<And>k. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k] \<Longrightarrow> snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<0]) = foldl Gauss_Jordan_column_k (0, A) [0..<0]
 2. \<And>k. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k] \<Longrightarrow> snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<0]) = foldl Gauss_Jordan_column_k (0, A) [0..<0]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<0]) = foldl Gauss_Jordan_column_k (0, A) [0..<0]

goal (1 subgoal):
 1. \<And>k. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k] \<Longrightarrow> snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k]

goal (1 subgoal):
 1. \<And>k. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k] \<Longrightarrow> snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]
[PROOF STEP]
have suc_rw: "[0..<Suc k] = [0..<k] @ [k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<Suc k] = [0..<k] @ [k]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[0..<Suc k] = [0..<k] @ [k]

goal (1 subgoal):
 1. \<And>k. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) = foldl Gauss_Jordan_column_k (0, A) [0..<k] \<Longrightarrow> snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]
[PROOF STEP]
unfolding suc_rw foldl_append
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl Gauss_Jordan_column_k_PA (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) [k]) = foldl Gauss_Jordan_column_k (foldl Gauss_Jordan_column_k (0, A) [0..<k]) [k]
[PROOF STEP]
unfolding List.foldl.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Gauss_Jordan_column_k_PA (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<k]) k) = Gauss_Jordan_column_k (foldl Gauss_Jordan_column_k (0, A) [0..<k]) k
[PROOF STEP]
by (metis Suc.hyps fst_snd_Gauss_Jordan_column_k_PA_eq snd_snd_Gauss_Jordan_column_k_PA_eq surjective_pairing)
[PROOF STATE]
proof (state)
this:
snd (foldl Gauss_Jordan_column_k_PA (mat (1::'a), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cartesian_power_append:
  assumes " as \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "a \<in> carrier R"
  shows "as@[a] \<in> carrier (R\<^bsup>n+1\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. as @ [a] \<in> carrier (R\<^bsup>n + 1\<^esup>)
[PROOF STEP]
apply(rule cartesian_power_car_memI'')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. length (as @ [a]) = n + 1
 2. take n (as @ [a]) \<in> carrier (R\<^bsup>n\<^esup>)
 3. drop n (as @ [a]) \<in> carrier (R\<^bsup>1\<^esup>)
[PROOF STEP]
apply (metis add.commute assms(1) cartesian_power_car_memE length_append_singleton plus_1_eq_Suc)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. take n (as @ [a]) \<in> carrier (R\<^bsup>n\<^esup>)
 2. drop n (as @ [a]) \<in> carrier (R\<^bsup>1\<^esup>)
[PROOF STEP]
apply (metis append_eq_append_conv_if assms(1) butlast_snoc cartesian_power_car_memE length_append_singleton lessI take_butlast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (as @ [a]) \<in> carrier (R\<^bsup>1\<^esup>)
[PROOF STEP]
by (metis add.commute add.right_neutral append_eq_conv_conj assms(1) assms(2) bot_least
      cartesian_power_car_memE cartesian_power_car_memI cartesian_power_cons
      list.set(1) list.size(3))


[STATEMENT]
lemma osum_Preorder: "\<lbrakk>Preorder r; Preorder r'\<rbrakk> \<Longrightarrow> Preorder (r +o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Preorder r; Preorder r'\<rbrakk> \<Longrightarrow> Preorder (r +o r')
[PROOF STEP]
unfolding preorder_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Refl r \<and> trans r; Refl r' \<and> trans r'\<rbrakk> \<Longrightarrow> Refl (r +o r') \<and> trans (r +o r')
[PROOF STEP]
using osum_Refl osum_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Refl ?r; Refl ?r'\<rbrakk> \<Longrightarrow> Refl (?r +o ?r')
\<lbrakk>trans ?r; trans ?r'\<rbrakk> \<Longrightarrow> trans (?r +o ?r')

goal (1 subgoal):
 1. \<lbrakk>Refl r \<and> trans r; Refl r' \<and> trans r'\<rbrakk> \<Longrightarrow> Refl (r +o r') \<and> trans (r +o r')
[PROOF STEP]
by blast


[STATEMENT]
lemma enumAppend_length1: "\<And>ls. ls \<in> set ((enumAppend nmax ^^ n) lss) \<Longrightarrow>
 (\<forall>l \<in> set lss. |l| = k) \<Longrightarrow> |ls| = k + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ls. \<lbrakk>ls \<in> set ((enumAppend nmax ^^ n) lss); \<forall>l\<in>set lss. |l| = k\<rbrakk> \<Longrightarrow> |ls| = k + n
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ls. \<lbrakk>ls \<in> set ((enumAppend nmax ^^ 0) lss); \<forall>l\<in>set lss. |l| = k\<rbrakk> \<Longrightarrow> |ls| = k + 0
 2. \<And>n ls. \<lbrakk>\<And>ls. \<lbrakk>ls \<in> set ((enumAppend nmax ^^ n) lss); \<forall>l\<in>set lss. |l| = k\<rbrakk> \<Longrightarrow> |ls| = k + n; ls \<in> set ((enumAppend nmax ^^ Suc n) lss); \<forall>l\<in>set lss. |l| = k\<rbrakk> \<Longrightarrow> |ls| = k + Suc n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n ls. \<lbrakk>\<And>ls. \<lbrakk>ls \<in> set ((enumAppend nmax ^^ n) lss); \<forall>l\<in>set lss. |l| = k\<rbrakk> \<Longrightarrow> |ls| = k + n; ls \<in> set ((enumAppend nmax ^^ Suc n) lss); \<forall>l\<in>set lss. |l| = k\<rbrakk> \<Longrightarrow> |ls| = k + Suc n
[PROOF STEP]
by (auto simp add:enumAppend_def split: if_split_asm)


[STATEMENT]
lemma sorted_list_app: "sorted_list xs \<Longrightarrow> (\<And>x. x \<in> set xs \<Longrightarrow> x \<le> y) \<Longrightarrow> sorted_list (xs @ [y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted_list xs; \<And>x. x \<in> set xs \<Longrightarrow> x \<le> y\<rbrakk> \<Longrightarrow> sorted_list (xs @ [y])
[PROOF STEP]
by (induction xs rule: sorted_list.induct) auto


[STATEMENT]
lemma mult_smult_right [simp]:
  fixes c :: "'a :: comm_semiring_0"
  shows "p * MPoly_Type.smult c q = MPoly_Type.smult c (p * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * MPoly_Type.smult c q = MPoly_Type.smult c (p * q)
[PROOF STEP]
by (simp add: smult_conv_mult mult_ac)


[STATEMENT]
lemma suminf_le: "(\<And>n. f n \<le> g n) \<Longrightarrow> summable f \<Longrightarrow> summable g \<Longrightarrow> suminf f \<le> suminf g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>n. f n \<le> g n; summable f; summable g\<rbrakk> \<Longrightarrow> suminf f \<le> suminf g
[PROOF STEP]
using sums_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>n. ?f n \<le> ?g n; ?f sums ?s; ?g sums ?t\<rbrakk> \<Longrightarrow> ?s \<le> ?t

goal (1 subgoal):
 1. \<lbrakk>\<And>n. f n \<le> g n; summable f; summable g\<rbrakk> \<Longrightarrow> suminf f \<le> suminf g
[PROOF STEP]
by blast


[STATEMENT]
lemma one_le_ceiling [simp]: "1 \<le> \<lceil>x\<rceil> \<longleftrightarrow> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> \<lceil>x\<rceil>) = ((0::'a) < x)
[PROOF STEP]
by (simp add: le_ceiling_iff)


[STATEMENT]
lemma path_connected_translationI:
  fixes a :: "'a :: topological_group_add"
  assumes "path_connected S" shows "path_connected ((\<lambda>x. a + x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected ((+) a ` S)
[PROOF STEP]
by (intro path_connected_continuous_image assms continuous_intros)


[STATEMENT]
lemma truncate_up_shift_int: "truncate_up p (x * 2 powr real_of_int k) = truncate_up p x * 2 powr k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. truncate_up p (x * 2 powr real_of_int k) = truncate_up p x * 2 powr real_of_int k
[PROOF STEP]
by (cases "x = 0")
    (simp_all add: algebra_simps abs_mult log_mult truncate_up_def
      round_up_shift[of _ _ k, simplified])


[STATEMENT]
lemma justified_with_sum':
  assumes "finite X" "X\<noteq>{}"
    and   "\<forall>x\<in>X. justified_with (C x) M (N x)"
    and   "\<forall>x\<in>X. justified (C x) (N x)"
    and   "\<forall>x\<in>X. \<forall>t. 0 \<le> zcount (C x) t"
  shows   "justified_with (\<Sum>x\<in>X. C x) M (\<Sum>x\<in>X. N x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. justified_with (sum C X) M (sum N X)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite X
X \<noteq> {}
\<forall>x\<in>X. justified_with (C x) M (N x)
\<forall>x\<in>X. justified (C x) (N x)
\<forall>x\<in>X. \<forall>t. 0 \<le> zcount (C x) t

goal (1 subgoal):
 1. justified_with (sum C X) M (sum N X)
[PROOF STEP]
proof (induct X rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>{} \<noteq> {}; \<forall>x\<in>{}. justified_with (C x) M (N x); \<forall>x\<in>{}. justified (C x) (N x); \<forall>x\<in>{}. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C {}) M (sum N {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>x\<in>F. justified_with (C x) M (N x); \<forall>x\<in>F. justified (C x) (N x); \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C F) M (sum N F); insert x F \<noteq> {}; \<forall>x\<in>insert x F. justified_with (C x) M (N x); \<forall>x\<in>insert x F. justified (C x) (N x); \<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
{} \<noteq> {}
\<forall>x\<in>{}. justified_with (C x) M (N x)
\<forall>x\<in>{}. justified (C x) (N x)
\<forall>x\<in>{}. \<forall>t. 0 \<le> zcount (C x) t

goal (2 subgoals):
 1. \<lbrakk>{} \<noteq> {}; \<forall>x\<in>{}. justified_with (C x) M (N x); \<forall>x\<in>{}. justified (C x) (N x); \<forall>x\<in>{}. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C {}) M (sum N {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>x\<in>F. justified_with (C x) M (N x); \<forall>x\<in>F. justified (C x) (N x); \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C F) M (sum N F); insert x F \<noteq> {}; \<forall>x\<in>insert x F. justified_with (C x) M (N x); \<forall>x\<in>insert x F. justified (C x) (N x); \<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{} \<noteq> {}
\<forall>x\<in>{}. justified_with (C x) M (N x)
\<forall>x\<in>{}. justified (C x) (N x)
\<forall>x\<in>{}. \<forall>t. 0 \<le> zcount (C x) t
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
{} \<noteq> {}
\<forall>x\<in>{}. justified_with (C x) M (N x)
\<forall>x\<in>{}. justified (C x) (N x)
\<forall>x\<in>{}. \<forall>t. 0 \<le> zcount (C x) t

goal (1 subgoal):
 1. justified_with (sum C {}) M (sum N {})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
justified_with (sum C {}) M (sum N {})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>x\<in>F. justified_with (C x) M (N x); \<forall>x\<in>F. justified (C x) (N x); \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C F) M (sum N F); insert x F \<noteq> {}; \<forall>x\<in>insert x F. justified_with (C x) M (N x); \<forall>x\<in>insert x F. justified (C x) (N x); \<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>x\<in>F. justified_with (C x) M (N x); \<forall>x\<in>F. justified (C x) (N x); \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C F) M (sum N F); insert x F \<noteq> {}; \<forall>x\<in>insert x F. justified_with (C x) M (N x); \<forall>x\<in>insert x F. justified (C x) (N x); \<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>F \<noteq> {}; \<forall>x\<in>F. justified_with (C x) M (N x); \<forall>x\<in>F. justified (C x) (N x); \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C F) M (sum N F)
insert x F \<noteq> {}
\<forall>x\<in>insert x F. justified_with (C x) M (N x)
\<forall>x\<in>insert x F. justified (C x) (N x)
\<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>x\<in>F. justified_with (C x) M (N x); \<forall>x\<in>F. justified (C x) (N x); \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C F) M (sum N F); insert x F \<noteq> {}; \<forall>x\<in>insert x F. justified_with (C x) M (N x); \<forall>x\<in>insert x F. justified (C x) (N x); \<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t\<rbrakk> \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
apply (cases "F={}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F = {} \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
 2. F \<noteq> {} \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = {} \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
using insert(5)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. justified_with (C x) M (N x)

goal (1 subgoal):
 1. F = {} \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> {} \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> {} \<Longrightarrow> justified_with (sum C (insert x F)) M (sum N (insert x F))
[PROOF STEP]
apply (subst (1 2) sum.insert_remove)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F \<noteq> {} \<Longrightarrow> finite F
 2. F \<noteq> {} \<Longrightarrow> justified_with (C x + sum C (F - {x})) M (N x + sum N (F - {x}))
[PROOF STEP]
using insert(1)
[PROOF STATE]
proof (prove)
using this:
finite F

goal (2 subgoals):
 1. F \<noteq> {} \<Longrightarrow> finite F
 2. F \<noteq> {} \<Longrightarrow> justified_with (C x + sum C (F - {x})) M (N x + sum N (F - {x}))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> {} \<Longrightarrow> justified_with (C x + sum C (F - {x})) M (N x + sum N (F - {x}))
[PROOF STEP]
using insert(2)
[PROOF STATE]
proof (prove)
using this:
x \<notin> F

goal (1 subgoal):
 1. F \<noteq> {} \<Longrightarrow> justified_with (C x + sum C (F - {x})) M (N x + sum N (F - {x}))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified_with (C x + sum C F) M (N x + sum N F)
[PROOF STEP]
apply (rule justified_with_add)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified_with (C x) M (N x)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (C x) (N x)
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (sum C F) (sum N F)
 4. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 5. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
using insert(5)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. justified_with (C x) M (N x)

goal (5 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified_with (C x) M (N x)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (C x) (N x)
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (sum C F) (sum N F)
 4. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 5. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (C x) (N x)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (sum C F) (sum N F)
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 4. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
using insert(6)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. justified (C x) (N x)

goal (4 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (C x) (N x)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (sum C F) (sum N F)
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 4. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> justified (sum C F) (sum N F)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply (rule justified_sum)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>x\<in>F. justified (C x) (N x)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 4. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
using insert(6)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. justified (C x) (N x)

goal (4 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>x\<in>F. justified (C x) (N x)
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 4. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
using insert(7)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t

goal (3 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>x\<in>F. \<forall>t. 0 \<le> zcount (C x) t
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 3. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
using insert(7)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t

goal (2 subgoals):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (C x) t
 2. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> \<forall>t. 0 \<le> zcount (sum C F) t
[PROOF STEP]
apply (intro allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> 0 \<le> zcount (sum C F) t
[PROOF STEP]
unfolding zcount_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>F \<noteq> {}; x \<notin> F\<rbrakk> \<Longrightarrow> 0 \<le> (\<Sum>M\<in>F. zcount (C M) t)
[PROOF STEP]
apply (rule sum_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t xa. \<lbrakk>F \<noteq> {}; x \<notin> F; xa \<in> F\<rbrakk> \<Longrightarrow> 0 \<le> zcount (C xa) t
[PROOF STEP]
using insert(7)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. \<forall>t. 0 \<le> zcount (C x) t

goal (1 subgoal):
 1. \<And>t xa. \<lbrakk>F \<noteq> {}; x \<notin> F; xa \<in> F\<rbrakk> \<Longrightarrow> 0 \<le> zcount (C xa) t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
justified_with (sum C (insert x F)) M (sum N (insert x F))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in aGroup) nsum_mem1Tr:" A +> J  \<Longrightarrow>
                     (\<forall>j \<le> n. f j \<in> J)  \<longrightarrow> nsum A f n \<in> J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A +> J \<Longrightarrow> (\<forall>j\<le>n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f n \<in> J
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A +> J \<Longrightarrow> (\<forall>j\<le>0. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f 0 \<in> J
 2. \<And>n. \<lbrakk>A +> J; (\<forall>j\<le>n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f n \<in> J\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f Suc n \<in> J
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>A +> J; \<forall>j\<le>0. f j \<in> J\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e A f 0 \<in> J
 2. \<And>n. \<lbrakk>A +> J; (\<forall>j\<le>n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f n \<in> J\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f Suc n \<in> J
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>A +> J; (\<forall>j\<le>n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f n \<in> J\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f Suc n \<in> J
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>A +> J; (\<forall>j\<le>n. f j \<in> J) \<longrightarrow> \<Sigma>\<^sub>e A f n \<in> J; \<forall>j\<le>Suc n. f j \<in> J\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e A f Suc n \<in> J
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>A +> J; \<Sigma>\<^sub>e A f n \<in> J; \<forall>j\<le>Suc n. f j \<in> J\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e A f n \<plusminus> f (Suc n) \<in> J
[PROOF STEP]
apply (rule asubg_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>A +> J; \<Sigma>\<^sub>e A f n \<in> J; \<forall>j\<le>Suc n. f j \<in> J\<rbrakk> \<Longrightarrow> f (Suc n) \<in> J
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma metric_LIM_D: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> 0 < r \<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> dist x a < s \<longrightarrow> dist (f x) L < r"
  for a :: "'a::metric_space" and L :: "'b::metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> L; 0 < r\<rbrakk> \<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> dist x a < s \<longrightarrow> dist (f x) L < r
[PROOF STEP]
by (simp add: LIM_def)


[STATEMENT]
lemma poly_gcd_eq_0I:
  assumes "poly p x = 0" "poly q x = 0"
  shows   "poly (gcd p q) x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (gcd p q) x = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly p x = (0::'a)
poly q x = (0::'a)

goal (1 subgoal):
 1. poly (gcd p q) x = (0::'a)
[PROOF STEP]
by (simp add: poly_eq_0_iff_dvd)