[STATEMENT]
theorem smullyan_double_fixed_point_theorem:
  assumes "recfn 2 g" and "total g" and "recfn 2 h" and "total h"
  shows "\<exists>m n.
    (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and>
    (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
obtain m where
    "recfn 1 m" and
    "total m" and
    m: "\<forall>x y. eval r_phi [the (eval m [x]), y] =
      eval r_phi [the (eval g [the (eval m [x]), x]), y]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. \<lbrakk>recfn 1 m; Partial_Recursive.total m; \<forall>x y. eval r_phi [the (eval m [x]), y] = eval r_phi [the (eval g [the (eval m [x]), x]), y]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using kleene_fixed_point_theorem_2[of g] assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>recfn 2 g; Partial_Recursive.total g\<rbrakk> \<Longrightarrow> \<exists>n. recfn 1 n \<and> Partial_Recursive.total n \<and> (\<forall>x y. eval r_phi [the (eval n [x]), y] = eval r_phi [the (eval g [the (eval n [x]), x]), y])
recfn 2 g
Partial_Recursive.total g

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>recfn 1 m; Partial_Recursive.total m; \<forall>x y. eval r_phi [the (eval m [x]), y] = eval r_phi [the (eval g [the (eval m [x]), x]), y]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
recfn 1 m
Partial_Recursive.total m
\<forall>x y. eval r_phi [the (eval m [x]), y] = eval r_phi [the (eval g [the (eval m [x]), x]), y]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
define k where "k = Cn 1 h [m, Id 1 0]"
[PROOF STATE]
proof (state)
this:
k = Cn 1 h [m, recf.Id 1 0]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Cn 1 h [m, recf.Id 1 0]
[PROOF STEP]
have "recfn 1 k"
[PROOF STATE]
proof (prove)
using this:
k = Cn 1 h [m, recf.Id 1 0]

goal (1 subgoal):
 1. recfn 1 k
[PROOF STEP]
using \<open>recfn 1 m\<close> assms(3)
[PROOF STATE]
proof (prove)
using this:
k = Cn 1 h [m, recf.Id 1 0]
recfn 1 m
recfn 2 h

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

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
have "total (Id 1 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partial_Recursive.total (recf.Id 1 0)
[PROOF STEP]
by (simp add: Mn_free_imp_total)
[PROOF STATE]
proof (state)
this:
Partial_Recursive.total (recf.Id 1 0)

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Partial_Recursive.total (recf.Id 1 0)
[PROOF STEP]
have "total k"
[PROOF STATE]
proof (prove)
using this:
Partial_Recursive.total (recf.Id 1 0)

goal (1 subgoal):
 1. Partial_Recursive.total k
[PROOF STEP]
using \<open>total m\<close> assms(4) Cn_total k_def \<open>recfn 1 k\<close>
[PROOF STATE]
proof (prove)
using this:
Partial_Recursive.total (recf.Id 1 0)
Partial_Recursive.total m
Partial_Recursive.total h
\<lbrakk>\<forall>g\<in>set ?gs. Partial_Recursive.total g; Partial_Recursive.total ?f; recfn ?n (Cn ?n ?f ?gs)\<rbrakk> \<Longrightarrow> Partial_Recursive.total (Cn ?n ?f ?gs)
k = Cn 1 h [m, recf.Id 1 0]
recfn 1 k

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

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
obtain n where n: "\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval k [n]), x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval k [n]), x] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using rogers_fixed_point_theorem[of k] \<open>recfn 1 k\<close> \<open>total k\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>recfn 1 k; Partial_Recursive.total k\<rbrakk> \<Longrightarrow> \<exists>n\<ge>?k. \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval k [n]), x]
recfn 1 k
Partial_Recursive.total k

goal (1 subgoal):
 1. (\<And>n. \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval k [n]), x] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval k [n]), x]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
obtain mm where mm: "eval m [n] \<down>= mm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>mm. eval m [n] \<down>= mm \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>total m\<close> \<open>recfn 1 m\<close>
[PROOF STATE]
proof (prove)
using this:
Partial_Recursive.total m
recfn 1 m

goal (1 subgoal):
 1. (\<And>mm. eval m [n] \<down>= mm \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
eval m [n] \<down>= mm

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eval m [n] \<down>= mm
[PROOF STEP]
have "\<forall>x. eval r_phi [mm, x] = eval r_phi [the (eval g [mm, n]), x]"
[PROOF STATE]
proof (prove)
using this:
eval m [n] \<down>= mm

goal (1 subgoal):
 1. \<forall>x. eval r_phi [mm, x] = eval r_phi [the (eval g [mm, n]), x]
[PROOF STEP]
by (metis m option.sel)
[PROOF STATE]
proof (state)
this:
\<forall>x. eval r_phi [mm, x] = eval r_phi [the (eval g [mm, n]), x]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x. eval r_phi [mm, x] = eval r_phi [the (eval g [mm, n]), x]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
have "\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [mm, n]), x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [mm, n]), x]
[PROOF STEP]
using k_def assms(3) \<open>total m\<close> \<open>recfn 1 m\<close> mm n
[PROOF STATE]
proof (prove)
using this:
k = Cn 1 h [m, recf.Id 1 0]
recfn 2 h
Partial_Recursive.total m
recfn 1 m
eval m [n] \<down>= mm
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval k [n]), x]

goal (1 subgoal):
 1. \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [mm, n]), x]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [mm, n]), x]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. eval r_phi [mm, x] = eval r_phi [the (eval g [mm, n]), x]
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [mm, n]), x]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x. eval r_phi [mm, x] = eval r_phi [the (eval g [mm, n]), x]
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [mm, n]), x]

goal (1 subgoal):
 1. \<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>m n. (\<forall>x. eval r_phi [m, x] = eval r_phi [the (eval g [m, n]), x]) \<and> (\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval h [m, n]), x])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in semiring_of_sets) generated_ring_disjoint_Union:
  assumes "finite A" shows "A \<subseteq> generated_ring \<Longrightarrow> disjoint A \<Longrightarrow> \<Union>A \<in> generated_ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> generated_ring; disjoint A\<rbrakk> \<Longrightarrow> \<Union> A \<in> generated_ring
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> generated_ring; disjoint A\<rbrakk> \<Longrightarrow> \<Union> A \<in> generated_ring
[PROOF STEP]
by (induct A) (auto simp: disjoint_def intro!: generated_ring_disjoint_Un generated_ring_empty)


[STATEMENT]
lemma aux1_1_digit_lt_linear:
  assumes "b < 2^r" "k \<ge> r"
  shows  "bin_carry (a*2^r) b k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_carry (a * 2 ^ r) b k = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bin_carry (a * 2 ^ r) b k = 0
[PROOF STEP]
have "b < 2^r \<longrightarrow>(a*2^r) \<bottom> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < 2 ^ r \<longrightarrow> a * 2 ^ r \<bottom> b
[PROOF STEP]
proof(induct a  b rule: bitAND_nat.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>uu_. uu_ < 2 ^ r \<longrightarrow> 0 * 2 ^ r \<bottom> uu_
 2. \<And>v n. n div 2 < 2 ^ r \<longrightarrow> Suc v div 2 * 2 ^ r \<bottom> n div 2 \<Longrightarrow> n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n
[PROOF STEP]
case (1 uu)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>uu_. uu_ < 2 ^ r \<longrightarrow> 0 * 2 ^ r \<bottom> uu_
 2. \<And>v n. n div 2 < 2 ^ r \<longrightarrow> Suc v div 2 * 2 ^ r \<bottom> n div 2 \<Longrightarrow> n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uu < 2 ^ r \<longrightarrow> 0 * 2 ^ r \<bottom> uu
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
uu < 2 ^ r \<longrightarrow> 0 * 2 ^ r \<bottom> uu

goal (1 subgoal):
 1. \<And>v n. n div 2 < 2 ^ r \<longrightarrow> Suc v div 2 * 2 ^ r \<bottom> n div 2 \<Longrightarrow> n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v n. n div 2 < 2 ^ r \<longrightarrow> Suc v div 2 * 2 ^ r \<bottom> n div 2 \<Longrightarrow> n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n
[PROOF STEP]
case (2 v n)
[PROOF STATE]
proof (state)
this:
n div 2 < 2 ^ r \<longrightarrow> Suc v div 2 * 2 ^ r \<bottom> n div 2

goal (1 subgoal):
 1. \<And>v n. n div 2 < 2 ^ r \<longrightarrow> Suc v div 2 * 2 ^ r \<bottom> n div 2 \<Longrightarrow> n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < 2 ^ r \<Longrightarrow> 2 ^ r + v * 2 ^ r && n = 0
[PROOF STEP]
using bitAND_linear[of n r 0 0 "Suc(v)"] bitAND_commutes
[PROOF STATE]
proof (prove)
using this:
n < 2 ^ r \<and> 0 < 2 ^ r \<Longrightarrow> 0 * 2 ^ r + n && Suc v * 2 ^ r + 0 = (0 && Suc v) * 2 ^ r + (n && 0)
?m && ?n = ?n && ?m

goal (1 subgoal):
 1. n < 2 ^ r \<Longrightarrow> 2 ^ r + v * 2 ^ r && n = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < 2 ^ r \<longrightarrow> Suc v * 2 ^ r \<bottom> n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b < 2 ^ r \<longrightarrow> a * 2 ^ r \<bottom> b

goal (1 subgoal):
 1. bin_carry (a * 2 ^ r) b k = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b < 2 ^ r \<longrightarrow> a * 2 ^ r \<bottom> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b < 2 ^ r \<longrightarrow> a * 2 ^ r \<bottom> b

goal (1 subgoal):
 1. bin_carry (a * 2 ^ r) b k = 0
[PROOF STEP]
using ortho_mult_equiv no_carry_mult_equiv assms(1)
[PROOF STATE]
proof (prove)
using this:
b < 2 ^ r \<longrightarrow> a * 2 ^ r \<bottom> b
(?a \<bottom> ?b) = (\<forall>k. ?a \<exclamdown> k * ?b \<exclamdown> k = 0)
(\<forall>k. ?a \<exclamdown> k * ?b \<exclamdown> k = 0) = (\<forall>k. bin_carry ?a ?b k = 0)
b < 2 ^ r

goal (1 subgoal):
 1. bin_carry (a * 2 ^ r) b k = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bin_carry (a * 2 ^ r) b k = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aff_dim_eq_dim:
  "aff_dim S = int (dim ((+) (- a) ` S))" if "a \<in> affine hull S"
    for S :: "'n::euclidean_space set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int (dim ((+) (- a) ` S))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim S = int (dim ((+) (- a) ` S))
[PROOF STEP]
have "0 \<in> affine hull (+) (- a) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'n) \<in> affine hull (+) (- a) ` S
[PROOF STEP]
unfolding affine_hull_translation
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'n) \<in> (+) (- a) ` (affine hull S)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in> affine hull S

goal (1 subgoal):
 1. (0::'n) \<in> (+) (- a) ` (affine hull S)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
(0::'n) \<in> affine hull (+) (- a) ` S

goal (1 subgoal):
 1. aff_dim S = int (dim ((+) (- a) ` S))
[PROOF STEP]
with aff_dim_zero
[PROOF STATE]
proof (chain)
picking this:
(0::?'n) \<in> affine hull ?S \<Longrightarrow> aff_dim ?S = int (dim ?S)
(0::'n) \<in> affine hull (+) (- a) ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::?'n) \<in> affine hull ?S \<Longrightarrow> aff_dim ?S = int (dim ?S)
(0::'n) \<in> affine hull (+) (- a) ` S

goal (1 subgoal):
 1. aff_dim S = int (dim ((+) (- a) ` S))
[PROOF STEP]
by (metis aff_dim_translation_eq)
[PROOF STATE]
proof (state)
this:
aff_dim S = int (dim ((+) (- a) ` S))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_imp_many_elems:
  "infinite A \<Longrightarrow> \<exists> xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs
[PROOF STEP]
proof (induct n arbitrary: A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = 0 \<and> distinct xs
 2. \<And>n A. \<lbrakk>\<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs; infinite A\<rbrakk> \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
infinite ?A \<Longrightarrow> \<exists>xs. set xs \<subseteq> ?A \<and> length xs = n \<and> distinct xs
infinite A

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = 0 \<and> distinct xs
 2. \<And>n A. \<lbrakk>\<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs; infinite A\<rbrakk> \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs
[PROOF STEP]
from infinite_imp_elem[OF Suc(2)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<in> A
[PROOF STEP]
obtain x where x: "x \<in> A"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<in> A

goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = 0 \<and> distinct xs
 2. \<And>n A. \<lbrakk>\<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs; infinite A\<rbrakk> \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs
[PROOF STEP]
from Suc(2)
[PROOF STATE]
proof (chain)
picking this:
infinite A
[PROOF STEP]
have "infinite (A - {x})"
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. infinite (A - {x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infinite (A - {x})

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = 0 \<and> distinct xs
 2. \<And>n A. \<lbrakk>\<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs; infinite A\<rbrakk> \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs
[PROOF STEP]
from Suc(1)[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs. set xs \<subseteq> A - {x} \<and> length xs = n \<and> distinct xs
[PROOF STEP]
obtain xs where "set xs \<subseteq> A - {x}" and "length xs = n" and "distinct xs"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs \<subseteq> A - {x} \<and> length xs = n \<and> distinct xs

goal (1 subgoal):
 1. (\<And>xs. \<lbrakk>set xs \<subseteq> A - {x}; length xs = n; distinct xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> A - {x}
length xs = n
distinct xs

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = 0 \<and> distinct xs
 2. \<And>n A. \<lbrakk>\<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = n \<and> distinct xs; infinite A\<rbrakk> \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
set xs \<subseteq> A - {x}
length xs = n
distinct xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x \<in> A
set xs \<subseteq> A - {x}
length xs = n
distinct xs

goal (1 subgoal):
 1. \<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs
[PROOF STEP]
by (intro exI[of _ "x # xs"], auto)
[PROOF STATE]
proof (state)
this:
\<exists>xs. set xs \<subseteq> A \<and> length xs = Suc n \<and> distinct xs

goal (1 subgoal):
 1. \<And>A. infinite A \<Longrightarrow> \<exists>xs. set xs \<subseteq> A \<and> length xs = 0 \<and> distinct xs
[PROOF STEP]
qed auto


[STATEMENT]
theorem Max_in_image:
  assumes "finite A" and "A \<noteq> {}"
  obtains x where "x \<in> A" and "Max (f ` A) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> A; Max (f ` A) = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> A; Max (f ` A) = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from Max_in[of "f ` A"] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite (f ` A); f ` A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (f ` A) \<in> f ` A
finite A
A \<noteq> {}
[PROOF STEP]
have "Max (f ` A) \<in> f ` A"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (f ` A); f ` A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (f ` A) \<in> f ` A
finite A
A \<noteq> {}

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

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> A; Max (f ` A) = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Max (f ` A) \<in> f ` A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Max (f ` A) \<in> f ` A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bound_of_nat_times: "bound (of_nat n * v) \<le> n * bound v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (of_nat n * v) \<le> n * bound v
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
bound (of_nat n * v) \<le> n * bound v

goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
have "bound (of_nat (Suc n) * v) = bound (v + of_nat n * v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (of_nat (Suc n) * v) = bound (v + of_nat n * v)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
bound (of_nat (Suc n) * v) = bound (v + of_nat n * v)

goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound (of_nat (Suc n) * v) = bound (v + of_nat n * v)

goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
have "\<dots> \<le> bound v + bound (of_nat n * v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (v + of_nat n * v) \<le> bound v + bound (of_nat n * v)
[PROOF STEP]
by (rule bound_plus)
[PROOF STATE]
proof (state)
this:
bound (v + of_nat n * v) \<le> bound v + bound (of_nat n * v)

goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound (v + of_nat n * v) \<le> bound v + bound (of_nat n * v)

goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
have "\<dots> \<le> bound v + n * bound v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound v + bound (of_nat n * v) \<le> bound v + n * bound v
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
bound (of_nat n * v) \<le> n * bound v

goal (1 subgoal):
 1. bound v + bound (of_nat n * v) \<le> bound v + n * bound v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bound v + bound (of_nat n * v) \<le> bound v + n * bound v

goal (2 subgoals):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
 2. \<And>n. bound (of_nat n * v) \<le> n * bound v \<Longrightarrow> bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bound (of_nat (Suc n) * v) \<le> bound v + n * bound v
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bound (of_nat (Suc n) * v) \<le> bound v + n * bound v

goal (1 subgoal):
 1. bound (of_nat (Suc n) * v) \<le> Suc n * bound v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bound (of_nat (Suc n) * v) \<le> Suc n * bound v

goal (1 subgoal):
 1. bound (of_nat 0 * v) \<le> 0 * bound v
[PROOF STEP]
qed simp


[STATEMENT]
lemma replicate_prop:
  assumes "P x"
  shows "\<forall>y\<in>set (replicate n x). P y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>set (replicate n x). P y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P x

goal (1 subgoal):
 1. \<forall>y\<in>set (replicate n x). P y
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma permutation_delete_permutes:
  assumes p: "p permutes {0 ..< Suc n}" (is "_ permutes ?N")
      and i: "i < Suc n"
  shows "permutation_delete p i permutes {0..<n}" (is "?p permutes ?N'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation_delete p i permutes {0..<n}
[PROOF STEP]
proof (rule bij_imp_permutes, rule permutation_delete_bij_betw)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. i \<in> {0..<Suc n}
 2. bij_betw p {0..<Suc n} {0..<Suc n}
 3. \<And>x. x \<notin> {0..<n} \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
have pi: "p i < Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p i < Suc n
[PROOF STEP]
using p i
[PROOF STATE]
proof (prove)
using this:
p permutes {0..<Suc n}
i < Suc n

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

goal (3 subgoals):
 1. i \<in> {0..<Suc n}
 2. bij_betw p {0..<Suc n} {0..<Suc n}
 3. \<And>x. x \<notin> {0..<n} \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
show "bij_betw p ?N ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw p {0..<Suc n} {0..<Suc n}
[PROOF STEP]
using permutes_imp_bij[OF p]
[PROOF STATE]
proof (prove)
using this:
bij_betw p {0..<Suc n} {0..<Suc n}

goal (1 subgoal):
 1. bij_betw p {0..<Suc n} {0..<Suc n}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bij_betw p {0..<Suc n} {0..<Suc n}

goal (2 subgoals):
 1. i \<in> {0..<Suc n}
 2. \<And>x. x \<notin> {0..<n} \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i \<in> {0..<Suc n}
 2. \<And>x. x \<notin> {0..<n} \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
assume "x \<notin> {0..<n}"
[PROOF STATE]
proof (state)
this:
x \<notin> {0..<n}

goal (2 subgoals):
 1. i \<in> {0..<Suc n}
 2. \<And>x. x \<notin> {0..<n} \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
hence x: "x \<ge> n"
[PROOF STATE]
proof (prove)
using this:
x \<notin> {0..<n}

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

goal (2 subgoals):
 1. i \<in> {0..<Suc n}
 2. \<And>x. x \<notin> {0..<n} \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
show "?p x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation_delete p i x = x
[PROOF STEP]
proof(cases "x < i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < i \<Longrightarrow> permutation_delete p i x = x
 2. \<not> x < i \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < i

goal (2 subgoals):
 1. x < i \<Longrightarrow> permutation_delete p i x = x
 2. \<not> x < i \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x < i

goal (1 subgoal):
 1. permutation_delete p i x = x
[PROOF STEP]
unfolding permutation_delete_def
[PROOF STATE]
proof (prove)
using this:
x < i

goal (1 subgoal):
 1. delete_ran (delete_dom p i) (p i) x = x
[PROOF STEP]
using x i
[PROOF STATE]
proof (prove)
using this:
x < i
n \<le> x
i < Suc n

goal (1 subgoal):
 1. delete_ran (delete_dom p i) (p i) x = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
permutation_delete p i x = x

goal (1 subgoal):
 1. \<not> x < i \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < i \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < i

goal (1 subgoal):
 1. \<not> x < i \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
hence "p (Suc x) = Suc x"
[PROOF STATE]
proof (prove)
using this:
\<not> x < i

goal (1 subgoal):
 1. p (Suc x) = Suc x
[PROOF STEP]
using x permutes_others[OF p]
[PROOF STATE]
proof (prove)
using this:
\<not> x < i
n \<le> x
?x \<notin> {0..<Suc n} \<Longrightarrow> p ?x = ?x

goal (1 subgoal):
 1. p (Suc x) = Suc x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p (Suc x) = Suc x

goal (1 subgoal):
 1. \<not> x < i \<Longrightarrow> permutation_delete p i x = x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p (Suc x) = Suc x

goal (1 subgoal):
 1. permutation_delete p i x = x
[PROOF STEP]
unfolding permutation_delete_expand
[PROOF STATE]
proof (prove)
using this:
p (Suc x) = Suc x

goal (1 subgoal):
 1. (if p (if x < i then x else Suc x) < p i then p (if x < i then x else Suc x) else p (if x < i then x else Suc x) - Suc 0) = x
[PROOF STEP]
using False pi x
[PROOF STATE]
proof (prove)
using this:
p (Suc x) = Suc x
\<not> x < i
p i < Suc n
n \<le> x

goal (1 subgoal):
 1. (if p (if x < i then x else Suc x) < p i then p (if x < i then x else Suc x) else p (if x < i then x else Suc x) - Suc 0) = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
permutation_delete p i x = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
permutation_delete p i x = x

goal (1 subgoal):
 1. i \<in> {0..<Suc n}
[PROOF STEP]
qed (insert i,auto)


[STATEMENT]
lemma "(a - b) + (b - c) = a - (c::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b + (b - c) = a - c
[PROOF STEP]
by arith


[STATEMENT]
lemma refl_on_trancl:
  assumes "refl_on A r"
  shows "refl_on A (r^+)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on A (r\<^sup>+)
[PROOF STEP]
proof(rule refl_onI, safe del: conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> r\<^sup>+ \<Longrightarrow> a \<in> A \<and> b \<in> A
 2. \<And>x. x \<in> A \<Longrightarrow> (x, x) \<in> r\<^sup>+
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> r\<^sup>+ \<Longrightarrow> a \<in> A \<and> b \<in> A
 2. \<And>x. x \<in> A \<Longrightarrow> (x, x) \<in> r\<^sup>+
[PROOF STEP]
assume "(a, b) \<in> r^+"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> r\<^sup>+

goal (2 subgoals):
 1. \<And>a b. (a, b) \<in> r\<^sup>+ \<Longrightarrow> a \<in> A \<and> b \<in> A
 2. \<And>x. x \<in> A \<Longrightarrow> (x, x) \<in> r\<^sup>+
[PROOF STEP]
thus "a \<in> A \<and> b \<in> A"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> r\<^sup>+

goal (1 subgoal):
 1. a \<in> A \<and> b \<in> A
[PROOF STEP]
by induct(blast intro: refl_onD1[OF assms] refl_onD2[OF assms])+
[PROOF STATE]
proof (state)
this:
a \<in> A \<and> b \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> (x, x) \<in> r\<^sup>+
[PROOF STEP]
qed(blast dest: refl_onD[OF assms])


[STATEMENT]
lemma real_0[simp]: "real_of 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
have "real_of 0 = real_of (0+0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of (0::'a) = real_of ((0::'a) + (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of (0::'a) = real_of ((0::'a) + (0::'a))

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

goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
have "... = real_of 0 + real_of 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of ((0::'a) + (0::'a)) = real_of (0::'a) + real_of (0::'a)
[PROOF STEP]
unfolding real_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of (0::'a) + real_of (0::'a) = real_of (0::'a) + real_of (0::'a)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
real_of ((0::'a) + (0::'a)) = real_of (0::'a) + real_of (0::'a)

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

goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
have "... = 2*(real_of 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of (0::'a) + real_of (0::'a) = 2 * real_of (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of (0::'a) + real_of (0::'a) = 2 * real_of (0::'a)

goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of (0::'a) = 2 * real_of (0::'a)
[PROOF STEP]
have "real_of 0 = 2* real_of 0"
[PROOF STATE]
proof (prove)
using this:
real_of (0::'a) = 2 * real_of (0::'a)

goal (1 subgoal):
 1. real_of (0::'a) = 2 * real_of (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of (0::'a) = 2 * real_of (0::'a)

goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of (0::'a) = 2 * real_of (0::'a)

goal (1 subgoal):
 1. real_of (0::'a) = 0
[PROOF STEP]
by (auto simp add: two_not_one)
[PROOF STATE]
proof (state)
this:
real_of (0::'a) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma incratseq_lb [simp]: "x - 1/(Suc n) < real_of_rat (incratseq x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - 1 / real (Suc n) < real_of_rat (incratseq x n)
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x - 1 / real (Suc 0) < real_of_rat (incratseq x 0)
 2. \<And>n. x - 1 / real (Suc n) < real_of_rat (incratseq x n) \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. x - 1 / real (Suc 0) < real_of_rat (incratseq x 0)
 2. \<And>n. x - 1 / real (Suc n) < real_of_rat (incratseq x n) \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - 1 / real (Suc 0) < real_of_rat (incratseq x 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc 0) < real_of_rat (incratseq x 0)

goal (1 subgoal):
 1. \<And>n. x - 1 / real (Suc n) < real_of_rat (incratseq x n) \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. x - 1 / real (Suc n) < real_of_rat (incratseq x n) \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc n) < real_of_rat (incratseq x n)

goal (1 subgoal):
 1. \<And>n. x - 1 / real (Suc n) < real_of_rat (incratseq x n) \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - 1 / real (Suc n) < real_of_rat (incratseq x n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x - 1 / real (Suc n) < real_of_rat (incratseq x n)

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
proof (cases "real_of_rat (incratseq x n) \<le> x - 1/Suc(Suc n)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
 2. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))

goal (2 subgoals):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
 2. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))
[PROOF STEP]
have " 1 / Suc(Suc n) < 1 / Suc n"
[PROOF STATE]
proof (prove)
using this:
real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))

goal (1 subgoal):
 1. 1 / real (Suc (Suc n)) < 1 / real (Suc n)
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))
x - 1 / real (Suc n) < real_of_rat (incratseq x n)

goal (1 subgoal):
 1. 1 / real (Suc (Suc n)) < 1 / real (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / real (Suc (Suc n)) < 1 / real (Suc n)

goal (2 subgoals):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
 2. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
have "x - 1/Suc(Suc n) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc (Suc n)) < x

goal (2 subgoals):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
 2. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - 1 / real (Suc (Suc n)) < x
[PROOF STEP]
have "\<exists>a. x - 1 /Suc(Suc n) < real_of_rat a \<and> real_of_rat a < x"
[PROOF STATE]
proof (prove)
using this:
x - 1 / real (Suc (Suc n)) < x

goal (1 subgoal):
 1. \<exists>a. x - 1 / real (Suc (Suc n)) < real_of_rat a \<and> real_of_rat a < x
[PROOF STEP]
using of_rat_dense
[PROOF STATE]
proof (prove)
using this:
x - 1 / real (Suc (Suc n)) < x
?x < ?y \<Longrightarrow> \<exists>q. ?x < real_of_rat q \<and> real_of_rat q < ?y

goal (1 subgoal):
 1. \<exists>a. x - 1 / real (Suc (Suc n)) < real_of_rat a \<and> real_of_rat a < x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. x - 1 / real (Suc (Suc n)) < real_of_rat a \<and> real_of_rat a < x

goal (2 subgoals):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
 2. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. x - 1 / real (Suc (Suc n)) < real_of_rat a \<and> real_of_rat a < x
[PROOF STEP]
have "x - 1 / real (Suc (Suc n))
             < real_of_rat
                (SOME q.
                    (if real_of_rat (incratseq x n) \<le> x - 1 / Suc(Suc n)
                     then x - 1 / Suc(Suc n) else real_of_rat (incratseq x n))
                    < real_of_rat q \<and>
                    real_of_rat q < x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. x - 1 / real (Suc (Suc n)) < real_of_rat a \<and> real_of_rat a < x

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (SOME q. (if real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n)) then x - 1 / real (Suc (Suc n)) else real_of_rat (incratseq x n)) < real_of_rat q \<and> real_of_rat q < x)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<exists>a. x - 1 / real (Suc (Suc n)) < real_of_rat a \<and> real_of_rat a < x
real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (SOME q. (if real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n)) then x - 1 / real (Suc (Suc n)) else real_of_rat (incratseq x n)) < real_of_rat q \<and> real_of_rat q < x)
[PROOF STEP]
by (auto intro: someI2_ex)
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc (Suc n)) < real_of_rat (SOME q. (if real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n)) then x - 1 / real (Suc (Suc n)) else real_of_rat (incratseq x n)) < real_of_rat q \<and> real_of_rat q < x)

goal (2 subgoals):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
 2. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - 1 / real (Suc (Suc n)) < real_of_rat (SOME q. (if real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n)) then x - 1 / real (Suc (Suc n)) else real_of_rat (incratseq x n)) < real_of_rat q \<and> real_of_rat q < x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x - 1 / real (Suc (Suc n)) < real_of_rat (SOME q. (if real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n)) then x - 1 / real (Suc (Suc n)) else real_of_rat (incratseq x n)) < real_of_rat q \<and> real_of_rat q < x)

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
x - 1 / real (Suc (Suc n)) < real_of_rat (SOME q. (if real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n)) then x - 1 / real (Suc (Suc n)) else real_of_rat (incratseq x n)) < real_of_rat q \<and> real_of_rat q < x)
real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
by (auto simp add: incratseq.simps(2) max_def)
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))

goal (1 subgoal):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))

goal (1 subgoal):
 1. \<lbrakk>x - 1 / real (Suc n) < real_of_rat (incratseq x n); \<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))\<rbrakk> \<Longrightarrow> x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
using incratseq_incseq
[PROOF STATE]
proof (prove)
using this:
\<not> real_of_rat (incratseq x n) \<le> x - 1 / real (Suc (Suc n))
incratseq ?x ?n < incratseq ?x (Suc ?n)

goal (1 subgoal):
 1. x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))
[PROOF STEP]
by (meson less_trans not_less of_rat_less)
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x - 1 / real (Suc (Suc n)) < real_of_rat (incratseq x (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gauss_int_norm_pos_iff [simp]: "gauss_int_norm z > 0 \<longleftrightarrow> z \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < gauss_int_norm z) = (z \<noteq> 0)
[PROOF STEP]
using gauss_int_norm_eq_0_iff[of z]
[PROOF STATE]
proof (prove)
using this:
(gauss_int_norm z = 0) = (z = 0)

goal (1 subgoal):
 1. (0 < gauss_int_norm z) = (z \<noteq> 0)
[PROOF STEP]
by (auto intro: Nat.gr0I)


[STATEMENT]
lemma pair_complete_imp_directed:
  assumes comp: "pair_complete A (\<sqsubseteq>)" shows "directed A (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed A (\<sqsubseteq>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> \<exists>z\<in>A. x \<sqsubseteq> z \<and> y \<sqsubseteq> z
[PROOF STEP]
fix x y :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> \<exists>z\<in>A. x \<sqsubseteq> z \<and> y \<sqsubseteq> z
[PROOF STEP]
assume "x \<in> A" "y \<in> A"
[PROOF STATE]
proof (state)
this:
x \<in> A
y \<in> A

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> \<exists>z\<in>A. x \<sqsubseteq> z \<and> y \<sqsubseteq> z
[PROOF STEP]
with pair_completeD[OF comp this]
[PROOF STATE]
proof (chain)
picking this:
Ex (extreme_bound A (\<sqsubseteq>) {x, y})
x \<in> A
y \<in> A
[PROOF STEP]
show "\<exists>z \<in> A. x \<sqsubseteq> z \<and> y \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
using this:
Ex (extreme_bound A (\<sqsubseteq>) {x, y})
x \<in> A
y \<in> A

goal (1 subgoal):
 1. \<exists>z\<in>A. x \<sqsubseteq> z \<and> y \<sqsubseteq> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z\<in>A. x \<sqsubseteq> z \<and> y \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_fun_is_Fun:
  assumes "x \<in> carrier P"
  shows "to_fun x \<in> carrier (Fun R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun x \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
apply(rule ring_functions.function_ring_car_memI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ring_functions R
 2. \<And>a. a \<in> carrier R \<Longrightarrow> to_fun x a \<in> carrier R
 3. \<And>a. a \<notin> carrier R \<Longrightarrow> to_fun x a = undefined
[PROOF STEP]
unfolding ring_functions_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ring R
 2. \<And>a. a \<in> carrier R \<Longrightarrow> to_fun x a \<in> carrier R
 3. \<And>a. a \<notin> carrier R \<Longrightarrow> to_fun x a = undefined
[PROOF STEP]
apply(simp add: R.ring_axioms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. a \<in> carrier R \<Longrightarrow> to_fun x a \<in> carrier R
 2. \<And>a. a \<notin> carrier R \<Longrightarrow> to_fun x a = undefined
[PROOF STEP]
using to_fun_closed assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f \<in> carrier P; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun ?f ?x \<in> carrier R
x \<in> carrier P

goal (2 subgoals):
 1. \<And>a. a \<in> carrier R \<Longrightarrow> to_fun x a \<in> carrier R
 2. \<And>a. a \<notin> carrier R \<Longrightarrow> to_fun x a = undefined
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<notin> carrier R \<Longrightarrow> to_fun x a = undefined
[PROOF STEP]
unfolding to_function_def to_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<notin> carrier R \<Longrightarrow> (\<lambda>s\<in>carrier R. eval R R (\<lambda>x. x) s x) a = undefined
[PROOF STEP]
by auto


[STATEMENT]
lemma (in group) get_exp_self_fulfills:
  assumes "a \<in> carrier G"
  shows "a = a [^] get_exp a a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = a [^] get_exp a a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = a [^] get_exp a a
[PROOF STEP]
have "a = a [^] (1::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = a [^] 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G

goal (1 subgoal):
 1. a = a [^] 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = a [^] 1

goal (1 subgoal):
 1. a = a [^] get_exp a a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a = a [^] 1

goal (1 subgoal):
 1. a = a [^] get_exp a a
[PROOF STEP]
have "a [^] (1::int) = a [^] (SOME x::int. a [^] (1::int) = a [^] x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] 1 = a [^] (SOME x. a [^] 1 = a [^] x)
[PROOF STEP]
by (intro someI_ex[of "\<lambda>x::int. a [^] (1::int) = a [^] x"]; blast)
[PROOF STATE]
proof (state)
this:
a [^] 1 = a [^] (SOME x. a [^] 1 = a [^] x)

goal (1 subgoal):
 1. a = a [^] get_exp a a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = a [^] 1
a [^] 1 = a [^] (SOME x. a [^] 1 = a [^] x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = a [^] 1
a [^] 1 = a [^] (SOME x. a [^] 1 = a [^] x)

goal (1 subgoal):
 1. a = a [^] get_exp a a
[PROOF STEP]
unfolding get_exp_def
[PROOF STATE]
proof (prove)
using this:
a = a [^] 1
a [^] 1 = a [^] (SOME x. a [^] 1 = a [^] x)

goal (1 subgoal):
 1. a = a [^] (SOME k. a = a [^] k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = a [^] get_exp a a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_sin [simp]:
  fixes a::real
  assumes "a \<le> b" shows "integral {a..b} sin = cos a - cos b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..b} sin = cos a - cos b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {a..b} sin = cos a - cos b
[PROOF STEP]
have "(sin has_integral (- cos b - - cos a)) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin has_integral - cos b - - cos a) {a..b}
[PROOF STEP]
proof (rule fundamental_theorem_of_calculus)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b
 2. \<And>x. x \<in> {a..b} \<Longrightarrow> ((\<lambda>a. - cos a) has_vector_derivative sin x) (at x within {a..b})
[PROOF STEP]
show "((\<lambda>a. - cos a) has_vector_derivative sin x) (at x within {a..b})" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>a. - cos a) has_vector_derivative sin x) (at x within {a..b})
[PROOF STEP]
unfolding has_real_derivative_iff_has_vector_derivative [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>a. - cos a) has_real_derivative sin x) (at x within {a..b})
[PROOF STEP]
by (rule derivative_eq_intros | force)+
[PROOF STATE]
proof (state)
this:
((\<lambda>a. - cos a) has_vector_derivative sin ?x) (at ?x within {a..b})

goal (1 subgoal):
 1. a \<le> b
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
(sin has_integral - cos b - - cos a) {a..b}

goal (1 subgoal):
 1. integral {a..b} sin = cos a - cos b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(sin has_integral - cos b - - cos a) {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sin has_integral - cos b - - cos a) {a..b}

goal (1 subgoal):
 1. integral {a..b} sin = cos a - cos b
[PROOF STEP]
by (simp add: integral_unique)
[PROOF STATE]
proof (state)
this:
integral {a..b} sin = cos a - cos b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem sigma_UNIV: "UNIV \<in> sigma A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
have "{} \<in> sigma A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<in> sigma A
[PROOF STEP]
by (rule sigma.empty)
[PROOF STATE]
proof (state)
this:
{} \<in> sigma A

goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
hence "-{} \<in> sigma A"
[PROOF STATE]
proof (prove)
using this:
{} \<in> sigma A

goal (1 subgoal):
 1. - {} \<in> sigma A
[PROOF STEP]
by (rule sigma.complement)
[PROOF STATE]
proof (state)
this:
- {} \<in> sigma A

goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- {} \<in> sigma A

goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
have "-{} = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - {} = UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- {} = UNIV

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

goal (1 subgoal):
 1. UNIV \<in> sigma A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
UNIV \<in> sigma A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma \<Sigma>_\<Delta>:
  "\<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)
[PROOF STEP]
from \<Delta>_\<Sigma>
[PROOF STATE]
proof (chain)
picking this:
\<Delta> (\<Sigma> ?f ?j) = ?f
[PROOF STEP]
have "\<Delta> (\<Sigma> (\<Delta> f) j) = \<Delta> f"
[PROOF STATE]
proof (prove)
using this:
\<Delta> (\<Sigma> ?f ?j) = ?f

goal (1 subgoal):
 1. \<Delta> (\<Sigma> (\<Delta> f) j) = \<Delta> f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Delta> (\<Sigma> (\<Delta> f) j) = \<Delta> f

goal (1 subgoal):
 1. \<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Delta> (\<Sigma> (\<Delta> f) j) = \<Delta> f
[PROOF STEP]
obtain k where "plus k \<circ> \<Sigma> (\<Delta> f) j \<circ> of_int = f \<circ> of_int"
[PROOF STATE]
proof (prove)
using this:
\<Delta> (\<Sigma> (\<Delta> f) j) = \<Delta> f

goal (1 subgoal):
 1. (\<And>k. (+) k \<circ> \<Sigma> (\<Delta> f) j \<circ> of_int = f \<circ> of_int \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast dest: \<Delta>_same_shift)
[PROOF STATE]
proof (state)
this:
(+) k \<circ> \<Sigma> (\<Delta> f) j \<circ> of_int = f \<circ> of_int

goal (1 subgoal):
 1. \<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(+) k \<circ> \<Sigma> (\<Delta> f) j \<circ> of_int = f \<circ> of_int
[PROOF STEP]
have "\<And>q. f (of_int q) = k + \<Sigma> (\<Delta> f) j q"
[PROOF STATE]
proof (prove)
using this:
(+) k \<circ> \<Sigma> (\<Delta> f) j \<circ> of_int = f \<circ> of_int

goal (1 subgoal):
 1. \<And>q. f (of_int q) = k + \<Sigma> (\<Delta> f) j q
[PROOF STEP]
by (simp add: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
f (of_int ?q) = k + \<Sigma> (\<Delta> f) j ?q

goal (1 subgoal):
 1. \<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f (of_int ?q) = k + \<Sigma> (\<Delta> f) j ?q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (of_int ?q) = k + \<Sigma> (\<Delta> f) j ?q

goal (1 subgoal):
 1. \<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Sigma> (\<Delta> f) j l = f (of_int l) - f (of_int j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma additive_tagged_division_1:
  fixes f :: "real \<Rightarrow> 'a::real_normed_vector"
  assumes "a \<le> b"
    and "p tagged_division_of {a..b}"
  shows "sum (\<lambda>(x,k). f(Sup k) - f(Inf k)) p = f b - f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
let ?f = "(\<lambda>k::(real) set. if k = {} then 0 else f(interval_upperbound k) - f(interval_lowerbound k))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
interpret operative_real plus 0 ?f
    rewrites "comm_monoid_set.F (+) 0 = sum"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. operative_real (+) (0::'a) (\<lambda>k. if k = {} then 0::'a else f (interval_upperbound k) - f (interval_lowerbound k)) &&& comm_monoid_set.F (+) (0::?'c) = sum
[PROOF STEP]
by standard[1] (auto simp add: sum_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
have p_td: "p tagged_division_of cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p tagged_division_of cbox a b
[PROOF STEP]
using assms(2) box_real(2)
[PROOF STATE]
proof (prove)
using this:
p tagged_division_of {a..b}
cbox ?a ?b = {?a..?b}

goal (1 subgoal):
 1. p tagged_division_of cbox a b
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
p tagged_division_of cbox a b

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
have **: "cbox a b \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b \<noteq> {}
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. cbox a b \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cbox a b \<noteq> {}

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cbox a b \<noteq> {}
[PROOF STEP]
have "f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0 else f (interval_upperbound l) - f (interval_lowerbound l))"
[PROOF STATE]
proof (prove)
using this:
cbox a b \<noteq> {}

goal (1 subgoal):
 1. f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cbox a b \<noteq> {} \<Longrightarrow> f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
[PROOF STEP]
have "(if cbox a b = {} then 0 else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if cbox a b = {} then 0::'a else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
p tagged_division_of {a..b}

goal (1 subgoal):
 1. (if cbox a b = {} then 0::'a else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if cbox a b = {} then 0::'a else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a

goal (1 subgoal):
 1. cbox a b \<noteq> {} \<Longrightarrow> f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if cbox a b = {} then 0::'a else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if cbox a b = {} then 0::'a else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a

goal (1 subgoal):
 1. f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
[PROOF STEP]
using p_td assms
[PROOF STATE]
proof (prove)
using this:
(if cbox a b = {} then 0::'a else f (interval_upperbound (cbox a b)) - f (interval_lowerbound (cbox a b))) = f b - f a
p tagged_division_of cbox a b
a \<le> b
p tagged_division_of {a..b}

goal (1 subgoal):
 1. f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
[PROOF STEP]
by (simp add: tagged_division)
[PROOF STATE]
proof (state)
this:
f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f b - f a = (\<Sum>(x, l)\<in>p. if l = {} then 0::'a else f (interval_upperbound l) - f (interval_lowerbound l))
a \<le> b
p tagged_division_of {a..b}

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a
[PROOF STEP]
by (auto intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>(x, k)\<in>p. f (Sup k) - f (Inf k)) = f b - f a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enat_less_induct:
  assumes prem: "\<And>n. \<forall>m::enat. m < n \<longrightarrow> P m \<Longrightarrow> P n" shows "P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P n
[PROOF STEP]
have P_enat: "\<And>k. P (enat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. P (enat k)
[PROOF STEP]
apply (rule nat_less_induct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. \<forall>m<n. P (enat m) \<Longrightarrow> P (enat n)
[PROOF STEP]
apply (rule prem, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<forall>m<n. P (enat m); m < enat n\<rbrakk> \<Longrightarrow> P m
[PROOF STEP]
apply (erule less_enatE, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
P (enat ?k)

goal (1 subgoal):
 1. P n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>nat. P (enat nat)
 2. P \<infinity>
[PROOF STEP]
fix nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>nat. P (enat nat)
 2. P \<infinity>
[PROOF STEP]
show "P (enat nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (enat nat)
[PROOF STEP]
by (rule P_enat)
[PROOF STATE]
proof (state)
this:
P (enat nat)

goal (1 subgoal):
 1. P \<infinity>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<infinity>
[PROOF STEP]
show "P \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<infinity>
[PROOF STEP]
apply (rule prem, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. m < \<infinity> \<Longrightarrow> P m
[PROOF STEP]
apply (erule less_infinityE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m k. m = enat k \<Longrightarrow> P m
[PROOF STEP]
apply (simp add: P_enat)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
P \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positive_close_under_left_right_mult_adjoint:
  fixes M A :: "complex mat"
  assumes dM: "M \<in> carrier_mat n n" and dA: "A \<in> carrier_mat n n"
    and pA: "positive A"
  shows "positive (M * A * adjoint M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive (M * A * adjoint M)
[PROOF STEP]
unfolding positive_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M * A * adjoint M \<in> carrier_mat (dim_col (M * A * adjoint M)) (dim_col (M * A * adjoint M)) \<and> (\<forall>v. dim_vec v = dim_col (M * A * adjoint M) \<longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v))
[PROOF STEP]
proof (rule, simp add: mult_carrier_mat[OF mult_carrier_mat[OF dM dA] adjoint_dim[OF dM]] carrier_matD[OF dM], rule, rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
have daM: "adjoint M \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint M \<in> carrier_mat n n
[PROOF STEP]
using dM
[PROOF STATE]
proof (prove)
using this:
M \<in> carrier_mat n n

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

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
fix v::"complex vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
assume "dim_vec v = dim_col (M * A * adjoint M)"
[PROOF STATE]
proof (state)
this:
dim_vec v = dim_col (M * A * adjoint M)

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_vec v = dim_col (M * A * adjoint M)
[PROOF STEP]
have dv: "v \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
dim_vec v = dim_col (M * A * adjoint M)

goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_vec v = dim_col (M * A * adjoint M)
M \<in> carrier_mat n n
A \<in> carrier_mat n n
positive A

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

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
[PROOF STEP]
have "adjoint M *\<^sub>v v \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. adjoint M *\<^sub>v v \<in> carrier_vec n
[PROOF STEP]
using daM
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
adjoint M \<in> carrier_mat n n

goal (1 subgoal):
 1. adjoint M *\<^sub>v v \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjoint M *\<^sub>v v \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
have assoc: "M * A * adjoint M *\<^sub>v v = M *\<^sub>v (A *\<^sub>v (adjoint M *\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M * A * adjoint M *\<^sub>v v = M *\<^sub>v (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
using dA dM daM dv
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
M \<in> carrier_mat n n
adjoint M \<in> carrier_mat n n
v \<in> carrier_vec n

goal (1 subgoal):
 1. M * A * adjoint M *\<^sub>v v = M *\<^sub>v (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
by (auto simp add: assoc_mult_mat_vec[of _ n n _ n])
[PROOF STATE]
proof (state)
this:
M * A * adjoint M *\<^sub>v v = M *\<^sub>v (A *\<^sub>v (adjoint M *\<^sub>v v))

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
have "inner_prod v (M * A * adjoint M *\<^sub>v v) = inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v (M * A * adjoint M *\<^sub>v v) = inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
apply (subst assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v (M *\<^sub>v (A *\<^sub>v (adjoint M *\<^sub>v v))) = inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
apply (subst adjoint_def_alter[where ?A = "M"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. v \<in> carrier_vec ?n
 2. A *\<^sub>v (adjoint M *\<^sub>v v) \<in> carrier_vec ?m
 3. M \<in> carrier_mat ?n ?m
 4. inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v)) = inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
by (auto simp add: dv dA daM dM carrier_matD[OF dM] mult_mat_vec_carrier[of _ n n])
[PROOF STATE]
proof (state)
this:
inner_prod v (M * A * adjoint M *\<^sub>v v) = inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod v (M * A * adjoint M *\<^sub>v v) = inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
have "\<dots> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
using dA dv daM pA positive_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
v \<in> carrier_vec n
adjoint M \<in> carrier_mat n n
positive A
positive ?A = (?A \<in> carrier_mat (dim_col ?A) (dim_col ?A) \<and> (\<forall>v. dim_vec v = dim_col ?A \<longrightarrow> 0 \<le> inner_prod v (?A *\<^sub>v v)))

goal (1 subgoal):
 1. 0 \<le> inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod (adjoint M *\<^sub>v v) (A *\<^sub>v (adjoint M *\<^sub>v v))

goal (1 subgoal):
 1. \<And>v. dim_vec v = dim_col (M * A * adjoint M) \<Longrightarrow> 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
show "inner_prod v (M * A * adjoint M *\<^sub>v v) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)

goal (1 subgoal):
 1. 0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod v (M * A * adjoint M *\<^sub>v v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Min_snd_alist_of:
  assumes "\<not> is_empty q"
  shows "Min (snd ` set (alist_of q)) = snd (hd (alist_of q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> is_empty q
[PROOF STEP]
obtain ps p where q: "map snd (alist_of q) = p # ps"
[PROOF STATE]
proof (prove)
using this:
\<not> is_empty q

goal (1 subgoal):
 1. (\<And>p ps. map snd (alist_of q) = p # ps \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "map snd (alist_of q)") auto
[PROOF STATE]
proof (state)
this:
map snd (alist_of q) = p # ps

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map snd (alist_of q) = p # ps
[PROOF STEP]
have "hd (map snd (alist_of q)) = p"
[PROOF STATE]
proof (prove)
using this:
map snd (alist_of q) = p # ps

goal (1 subgoal):
 1. hd (map snd (alist_of q)) = p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hd (map snd (alist_of q)) = p

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<not> is_empty q
hd (map snd (alist_of q)) = p
[PROOF STEP]
have p: "snd (hd (alist_of q)) = p"
[PROOF STATE]
proof (prove)
using this:
\<not> is_empty q
hd (map snd (alist_of q)) = p

goal (1 subgoal):
 1. snd (hd (alist_of q)) = p
[PROOF STEP]
by (auto simp add: hd_map)
[PROOF STATE]
proof (state)
this:
snd (hd (alist_of q)) = p

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
have "sorted (map snd (alist_of q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (map snd (alist_of q))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sorted (map snd (alist_of q))

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
with q
[PROOF STATE]
proof (chain)
picking this:
map snd (alist_of q) = p # ps
sorted (map snd (alist_of q))
[PROOF STEP]
have "sorted (p # ps)"
[PROOF STATE]
proof (prove)
using this:
map snd (alist_of q) = p # ps
sorted (map snd (alist_of q))

goal (1 subgoal):
 1. sorted (p # ps)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sorted (p # ps)

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sorted (p # ps)
[PROOF STEP]
have "\<forall>p'\<in>set ps. p' \<ge> p"
[PROOF STATE]
proof (prove)
using this:
sorted (p # ps)

goal (1 subgoal):
 1. \<forall>p'\<in>set ps. p \<le> p'
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
\<forall>p'\<in>set ps. p \<le> p'

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>p'\<in>set ps. p \<le> p'
[PROOF STEP]
have "Min (set (p # ps)) = p"
[PROOF STATE]
proof (prove)
using this:
\<forall>p'\<in>set ps. p \<le> p'

goal (1 subgoal):
 1. Min (set (p # ps)) = p
[PROOF STEP]
by (auto intro: Min_eqI)
[PROOF STATE]
proof (state)
this:
Min (set (p # ps)) = p

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
with p q
[PROOF STATE]
proof (chain)
picking this:
snd (hd (alist_of q)) = p
map snd (alist_of q) = p # ps
Min (set (p # ps)) = p
[PROOF STEP]
have "Min (set (map snd (alist_of q))) = snd (hd (alist_of q))"
[PROOF STATE]
proof (prove)
using this:
snd (hd (alist_of q)) = p
map snd (alist_of q) = p # ps
Min (set (p # ps)) = p

goal (1 subgoal):
 1. Min (set (map snd (alist_of q))) = snd (hd (alist_of q))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Min (set (map snd (alist_of q))) = snd (hd (alist_of q))

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Min (set (map snd (alist_of q))) = snd (hd (alist_of q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Min (set (map snd (alist_of q))) = snd (hd (alist_of q))

goal (1 subgoal):
 1. Min (snd ` set (alist_of q)) = snd (hd (alist_of q))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Min (snd ` set (alist_of q)) = snd (hd (alist_of q))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insert_uconnectedV_per':
  assumes  inV: "x\<in>verts" "y\<in>verts" and subE: "F\<subseteq>E"
  shows "uconnectedV (insert (Upair x y) F) = per_union (uconnectedV F) x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
apply(cases "x=y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x = y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
 2. x \<noteq> y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
using assms insert_uconnectedV_per_eq
[PROOF STATE]
proof (prove)
using this:
x \<in> verts
y \<in> verts
F \<subseteq> E
\<lbrakk>?x \<in> verts; ?F \<subseteq> E\<rbrakk> \<Longrightarrow> Restr (uconnected (insert (Upair ?x ?x) ?F)) verts = per_union (Restr (uconnected ?F) verts) ?x ?x

goal (1 subgoal):
 1. x = y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
using assms insert_uconnectedV_per
[PROOF STATE]
proof (prove)
using this:
x \<in> verts
y \<in> verts
F \<subseteq> E
\<lbrakk>?x \<noteq> ?y; ?x \<in> verts; ?y \<in> verts; ?F \<subseteq> E\<rbrakk> \<Longrightarrow> Restr (uconnected (insert (Upair ?x ?y) ?F)) verts = per_union (Restr (uconnected ?F) verts) ?x ?y

goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> Restr (uconnected (insert (Upair x y) F)) verts = per_union (Restr (uconnected F) verts) x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cong_aux_eq_1: "odd p \<Longrightarrow> [(p - 1) div 2 - p div 4 = (p^2 - 1) div 8] (mod 2)" for p :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd p \<Longrightarrow> [(p - 1) div 2 - p div 4 = (p\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
proof (induction p rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. odd m \<longrightarrow> [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2); odd n\<rbrakk> \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:
\<forall>m<n. odd m \<longrightarrow> [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2)
odd n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. odd m \<longrightarrow> [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2); odd n\<rbrakk> \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
consider "n = 1" | "n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n = 1 \<Longrightarrow> thesis; 1 < n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using odd_pos[OF \<open>odd n\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. \<lbrakk>n = 1 \<Longrightarrow> thesis; 1 < n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = 1 \<Longrightarrow> ?thesis; 1 < n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. odd m \<longrightarrow> [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2); odd n\<rbrakk> \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = 1 \<Longrightarrow> ?thesis; 1 < n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = 1 \<Longrightarrow> ?thesis; 1 < n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
assume "n > 1"
[PROOF STATE]
proof (state)
this:
1 < n

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
obtain m where m: "m = n - 2" and m': "odd m" "m < n"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m = n - 2; odd m; m < n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>odd n\<close>
[PROOF STATE]
proof (prove)
using this:
1 < n
odd n

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m = n - 2; odd m; m < n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = n - 2
odd m
m < n

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = n - 2
odd m
m < n
[PROOF STEP]
obtain b where b: "m = 2 * b + 1"
[PROOF STATE]
proof (prove)
using this:
m = n - 2
odd m
m < n

goal (1 subgoal):
 1. (\<And>b. m = 2 * b + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using oddE
[PROOF STATE]
proof (prove)
using this:
m = n - 2
odd m
m < n
\<lbrakk>odd ?a; \<And>b. ?a = (2::?'a) * b + (1::?'a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>b. m = 2 * b + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m = 2 * b + 1

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
have IH: "[(m - 1) div 2 - m div 4 = (m^2 - 1) div 8] (mod 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
using "1.IH" m'
[PROOF STATE]
proof (prove)
using this:
\<forall>m<n. odd m \<longrightarrow> [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2)
odd m
m < n

goal (1 subgoal):
 1. [(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
have [simp]: "n = 2 * b + 1 + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 2 * b + 1 + 2
[PROOF STEP]
using m \<open>n > 1\<close> b
[PROOF STATE]
proof (prove)
using this:
m = n - 2
1 < n
m = 2 * b + 1

goal (1 subgoal):
 1. n = 2 * b + 1 + 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = 2 * b + 1 + 2

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
have *: "(n\<^sup>2 - 1) div 8 = ((n - 2)\<^sup>2 - 1) div 8 + (n - 1) div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n\<^sup>2 - 1) div 8 = ((n - 2)\<^sup>2 - 1) div 8 + (n - 1) div 2
[PROOF STEP]
unfolding  power2_sum power2_eq_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n * n - 1) div 8 = ((n - 2) * (n - 2) - 1) div 8 + (n - 1) div 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(n\<^sup>2 - 1) div 8 = ((n - 2)\<^sup>2 - 1) div 8 + (n - 1) div 2

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
have "[(n - 1) div 2 - n div 4 = (n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2] (mod 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(n - 1) div 2 - n div 4 = (n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2] (mod 2)
[PROOF STEP]
by (rule cong_sym, cases "even b") (auto simp: cong_altdef_nat div_cancel_Suc elim: oddE)
[PROOF STATE]
proof (state)
this:
[(n - 1) div 2 - n div 4 = (n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2] (mod 2)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[(n - 1) div 2 - n div 4 = (n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2] (mod 2)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
have "[(n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2 = (n\<^sup>2 - 1) div 8] (mod 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
using IH cong_add_rcancel_nat
[PROOF STATE]
proof (prove)
using this:
[(m - 1) div 2 - m div 4 = (m\<^sup>2 - 1) div 8] (mod 2)
[?x + ?a = ?y + ?a] (mod ?n) = [?x = ?y] (mod ?n)

goal (1 subgoal):
 1. [(n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
unfolding * m
[PROOF STATE]
proof (prove)
using this:
[(n - 2 - 1) div 2 - (n - 2) div 4 = ((n - 2)\<^sup>2 - 1) div 8] (mod 2)
[?x + ?a = ?y + ?a] (mod ?n) = [?x = ?y] (mod ?n)

goal (1 subgoal):
 1. [(n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2 = ((n - 2)\<^sup>2 - 1) div 8 + (n - 1) div 2] (mod 2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
[(n - 2 - 1) div 2 - (n - 2) div 4 + (n - 1) div 2 = (n\<^sup>2 - 1) div 8] (mod 2)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
 2. 1 < n \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)

goal (1 subgoal):
 1. [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
[(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> [(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
[(n - 1) div 2 - n div 4 = (n\<^sup>2 - 1) div 8] (mod 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma oexp_mult_commute:
  fixes j::nat
  assumes "Ord \<alpha>"
  shows "(\<alpha> \<up> j) * \<alpha> = \<alpha> * (\<alpha> \<up> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
have "(\<alpha> \<up> j) * \<alpha> = \<alpha> \<up> (1 + ord_of_nat j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> \<up> (1 + ord_of_nat j)
[PROOF STEP]
by (simp add: one_V_def)
[PROOF STATE]
proof (state)
this:
\<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> \<up> (1 + ord_of_nat j)

goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> \<up> (1 + ord_of_nat j)

goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
have "... = \<alpha> * (\<alpha> \<up> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<up> (1 + ord_of_nat j) = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
by (simp add: assms oexp_add)
[PROOF STATE]
proof (state)
this:
\<alpha> \<up> (1 + ord_of_nat j) = \<alpha> * \<alpha> \<up> ord_of_nat j

goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j

goal (1 subgoal):
 1. \<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<alpha> \<up> ord_of_nat j * \<alpha> = \<alpha> * \<alpha> \<up> ord_of_nat j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_over_fact_tendsto_0':
  "(\<lambda>n. c * (x :: real) ^ n / fact n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. c * x ^ n / fact n) \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_mult[OF tendsto_const[of c] power_over_fact_tendsto_0[of x]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. c * (x ^ xa / fact xa)) \<longlonglongrightarrow> c * 0

goal (1 subgoal):
 1. (\<lambda>n. c * x ^ n / fact n) \<longlonglongrightarrow> 0
[PROOF STEP]
by simp


[STATEMENT]
lemma tripleI:
  fixes T U
  assumes "fst3 T = fst3 U"
      and "snd3 T = snd3 U"
      and "thd3 T = thd3 U"
  shows "T = U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T = U
[PROOF STEP]
by (metis assms fst3_def snd3_def thd3_def o_def surjective_pairing)


[STATEMENT]
lemma greater_Card:
  assumes "Card \<kappa>" shows "\<kappa> < vcard (VPow \<kappa>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
have "\<kappa> = vcard \<kappa>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> = vcard \<kappa>
[PROOF STEP]
using Card_def assms
[PROOF STATE]
proof (prove)
using this:
Card ?i \<equiv> ?i = vcard ?i
Card \<kappa>

goal (1 subgoal):
 1. \<kappa> = vcard \<kappa>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<kappa> = vcard \<kappa>

goal (1 subgoal):
 1. \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<kappa> = vcard \<kappa>

goal (1 subgoal):
 1. \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
have "\<dots> < vcard (VPow \<kappa>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
proof (rule lesspoll_imp_Card_less)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. elts \<kappa> \<prec> elts (VPow \<kappa>)
[PROOF STEP]
show "elts \<kappa> \<prec> elts (VPow \<kappa>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts \<kappa> \<prec> elts (VPow \<kappa>)
[PROOF STEP]
by (simp add: elts_VPow down inj_on_def lesspoll_Pow_self)
[PROOF STATE]
proof (state)
this:
elts \<kappa> \<prec> elts (VPow \<kappa>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vcard \<kappa> < vcard (VPow \<kappa>)

goal (1 subgoal):
 1. \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<kappa> < vcard (VPow \<kappa>)

goal (1 subgoal):
 1. \<kappa> < vcard (VPow \<kappa>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<kappa> < vcard (VPow \<kappa>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_gcd:
  fixes a b :: nat
  obtains q where "a * (b div gcd a b) = b*q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. a * (b div gcd a b) = b * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>q. a * (b div gcd a b) = b * q \<Longrightarrow> thesis) \<Longrightarrow> a * (b div gcd a b) = b * ?q2
[PROOF STEP]
have "a * (b div gcd a b) = (a div gcd a b) * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (b div gcd a b) = a div gcd a b * b
[PROOF STEP]
by (simp add:  div_mult_swap dvd_div_mult)
[PROOF STATE]
proof (state)
this:
a * (b div gcd a b) = a div gcd a b * b

goal (1 subgoal):
 1. (\<And>q. a * (b div gcd a b) = b * q \<Longrightarrow> thesis) \<Longrightarrow> a * (b div gcd a b) = b * ?q2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * (b div gcd a b) = a div gcd a b * b

goal (1 subgoal):
 1. (\<And>q. a * (b div gcd a b) = b * q \<Longrightarrow> thesis) \<Longrightarrow> a * (b div gcd a b) = b * ?q2
[PROOF STEP]
have "\<dots> = b * (a div gcd a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a div gcd a b * b = b * (a div gcd a b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a div gcd a b * b = b * (a div gcd a b)

goal (1 subgoal):
 1. (\<And>q. a * (b div gcd a b) = b * q \<Longrightarrow> thesis) \<Longrightarrow> a * (b div gcd a b) = b * ?q2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a * (b div gcd a b) = b * (a div gcd a b)
[PROOF STEP]
show "a * (b div gcd a b) = b * (a div gcd a b) "
[PROOF STATE]
proof (prove)
using this:
a * (b div gcd a b) = b * (a div gcd a b)

goal (1 subgoal):
 1. a * (b div gcd a b) = b * (a div gcd a b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a * (b div gcd a b) = b * (a div gcd a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem invariance_of_domain:
  fixes f :: "'a \<Rightarrow> 'a::euclidean_space"
  assumes "continuous_on S f" "open S" "inj_on f S"
    shows "open(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` S)
[PROOF STEP]
unfolding open_subopen [of "f`S"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>f ` S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> f ` S
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> S \<Longrightarrow> \<exists>T. open T \<and> f xa \<in> T \<and> T \<subseteq> f ` S
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> S \<Longrightarrow> \<exists>T. open T \<and> f xa \<in> T \<and> T \<subseteq> f ` S
[PROOF STEP]
assume "a \<in> S"
[PROOF STATE]
proof (state)
this:
a \<in> S

goal (1 subgoal):
 1. \<And>x xa. xa \<in> S \<Longrightarrow> \<exists>T. open T \<and> f xa \<in> T \<and> T \<subseteq> f ` S
[PROOF STEP]
obtain \<delta> where "\<delta> > 0" and \<delta>: "cball a \<delta> \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; cball a \<delta> \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>open S\<close> \<open>a \<in> S\<close> open_contains_cball_eq
[PROOF STATE]
proof (prove)
using this:
open S
a \<in> S
open ?S \<Longrightarrow> \<forall>x. (x \<in> ?S) = (\<exists>e>0. cball x e \<subseteq> ?S)

goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; cball a \<delta> \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < \<delta>
cball a \<delta> \<subseteq> S

goal (1 subgoal):
 1. \<And>x xa. xa \<in> S \<Longrightarrow> \<exists>T. open T \<and> f xa \<in> T \<and> T \<subseteq> f ` S
[PROOF STEP]
show "\<exists>T. open T \<and> f a \<in> T \<and> T \<subseteq> f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>T. open T \<and> f a \<in> T \<and> T \<subseteq> f ` S
[PROOF STEP]
proof (intro exI conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open ?T
 2. f a \<in> ?T
 3. ?T \<subseteq> f ` S
[PROOF STEP]
show "open (f ` (ball a \<delta>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` ball a \<delta>)
[PROOF STEP]
by (meson \<delta> \<open>0 < \<delta>\<close> assms continuous_on_subset inj_on_subset invariance_of_domain_ball)
[PROOF STATE]
proof (state)
this:
open (f ` ball a \<delta>)

goal (2 subgoals):
 1. f a \<in> f ` ball a \<delta>
 2. f ` ball a \<delta> \<subseteq> f ` S
[PROOF STEP]
show "f a \<in> f ` ball a \<delta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<in> f ` ball a \<delta>
[PROOF STEP]
by (simp add: \<open>0 < \<delta>\<close>)
[PROOF STATE]
proof (state)
this:
f a \<in> f ` ball a \<delta>

goal (1 subgoal):
 1. f ` ball a \<delta> \<subseteq> f ` S
[PROOF STEP]
show "f ` ball a \<delta> \<subseteq> f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` ball a \<delta> \<subseteq> f ` S
[PROOF STEP]
using \<delta> ball_subset_cball
[PROOF STATE]
proof (prove)
using this:
cball a \<delta> \<subseteq> S
ball ?x ?e \<subseteq> cball ?x ?e

goal (1 subgoal):
 1. f ` ball a \<delta> \<subseteq> f ` S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ` ball a \<delta> \<subseteq> f ` S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>T. open T \<and> f a \<in> T \<and> T \<subseteq> f ` S

goal:
No subgoals!
[PROOF STEP]
qed