[STATEMENT]
lemma prod_chart_compat:
  "k-smooth_compat (prod_chart c1 c2) (prod_chart d1 d2)"
  if compat1: "k-smooth_compat c1 d1" and compat2: "k-smooth_compat c2 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_compat (prod_chart c1 c2) (prod_chart d1 d2)
[PROOF STEP]
unfolding smooth_compat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on (apply_chart (prod_chart c1 c2) ` (domain (prod_chart c1 c2) \<inter> domain (prod_chart d1 d2))) (apply_chart (prod_chart d1 d2) \<circ> inv_chart (prod_chart c1 c2)) \<and> k-smooth_on (apply_chart (prod_chart d1 d2) ` (domain (prod_chart c1 c2) \<inter> domain (prod_chart d1 d2))) (apply_chart (prod_chart c1 c2) \<circ> inv_chart (prod_chart d1 d2))
[PROOF STEP]
apply (auto simp add: comp_def case_prod_beta cong del: image_cong_simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k-smooth_on ((\<lambda>(x, y). (apply_chart c1 x, apply_chart c2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart d1 (inv_chart c1 (fst x)), apply_chart d2 (inv_chart c2 (snd x))))
 2. k-smooth_on ((\<lambda>(x, y). (apply_chart d1 x, apply_chart d2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (simp add: Times_Int_Times image_prod)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k-smooth_on (apply_chart c1 ` (domain c1 \<inter> domain d1) \<times> apply_chart c2 ` (domain c2 \<inter> domain d2)) (\<lambda>x. (apply_chart d1 (inv_chart c1 (fst x)), apply_chart d2 (inv_chart c2 (snd x))))
 2. k-smooth_on ((\<lambda>(x, y). (apply_chart d1 x, apply_chart d2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (rule smooth_on_Pair')
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. open (apply_chart c1 ` (domain c1 \<inter> domain d1))
 2. open (apply_chart c2 ` (domain c2 \<inter> domain d2))
 3. k-smooth_on (apply_chart c1 ` (domain c1 \<inter> domain d1)) (\<lambda>a. apply_chart d1 (inv_chart c1 a))
 4. k-smooth_on (apply_chart c2 ` (domain c2 \<inter> domain d2)) (\<lambda>a. apply_chart d2 (inv_chart c2 a))
 5. k-smooth_on ((\<lambda>(x, y). (apply_chart d1 x, apply_chart d2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (auto intro!: continuous_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. k-smooth_on (apply_chart c1 ` (domain c1 \<inter> domain d1)) (\<lambda>a. apply_chart d1 (inv_chart c1 a))
 2. k-smooth_on (apply_chart c2 ` (domain c2 \<inter> domain d2)) (\<lambda>a. apply_chart d2 (inv_chart c2 a))
 3. k-smooth_on ((\<lambda>x. case x of (x, y) \<Rightarrow> (apply_chart d1 x, apply_chart d2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (auto simp: compat1[unfolded smooth_compat_def comp_def])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k-smooth_on (apply_chart c2 ` (domain c2 \<inter> domain d2)) (\<lambda>a. apply_chart d2 (inv_chart c2 a))
 2. k-smooth_on ((\<lambda>x. case x of (x, y) \<Rightarrow> (apply_chart d1 x, apply_chart d2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (auto simp: compat2[unfolded smooth_compat_def comp_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on ((\<lambda>x. case x of (x, y) \<Rightarrow> (apply_chart d1 x, apply_chart d2 y)) ` (domain c1 \<times> domain c2 \<inter> domain d1 \<times> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (simp add: Times_Int_Times image_prod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on (apply_chart d1 ` (domain c1 \<inter> domain d1) \<times> apply_chart d2 ` (domain c2 \<inter> domain d2)) (\<lambda>x. (apply_chart c1 (inv_chart d1 (fst x)), apply_chart c2 (inv_chart d2 (snd x))))
[PROOF STEP]
apply (rule smooth_on_Pair')
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. open (apply_chart d1 ` (domain c1 \<inter> domain d1))
 2. open (apply_chart d2 ` (domain c2 \<inter> domain d2))
 3. k-smooth_on (apply_chart d1 ` (domain c1 \<inter> domain d1)) (\<lambda>a. apply_chart c1 (inv_chart d1 a))
 4. k-smooth_on (apply_chart d2 ` (domain c2 \<inter> domain d2)) (\<lambda>a. apply_chart c2 (inv_chart d2 a))
[PROOF STEP]
apply (auto intro!: continuous_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k-smooth_on (apply_chart d1 ` (domain c1 \<inter> domain d1)) (\<lambda>a. apply_chart c1 (inv_chart d1 a))
 2. k-smooth_on (apply_chart d2 ` (domain c2 \<inter> domain d2)) (\<lambda>a. apply_chart c2 (inv_chart d2 a))
[PROOF STEP]
apply (auto simp: compat2[unfolded smooth_compat_def comp_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on (apply_chart d1 ` (domain c1 \<inter> domain d1)) (\<lambda>a. apply_chart c1 (inv_chart d1 a))
[PROOF STEP]
apply (auto simp: compat1[unfolded smooth_compat_def comp_def])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mask_inj_hlp1: "inj_on (mask :: nat \<Rightarrow> 16 word) {0..16}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on mask {0..16}
[PROOF STEP]
proof(intro inj_onI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..16}; y \<in> {0..16}; mask x = mask y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
case (1 x y)
[PROOF STATE]
proof (state)
this:
x \<in> {0..16}
y \<in> {0..16}
mask x = mask y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..16}; y \<in> {0..16}; mask x = mask y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from 1(3)
[PROOF STATE]
proof (chain)
picking this:
mask x = mask y
[PROOF STEP]
have oe: "of_bl (replicate (16 - x) False @ replicate x True) = (of_bl (replicate (16 - y) False @ replicate y True) :: 16 word)"
[PROOF STATE]
proof (prove)
using this:
mask x = mask y

goal (1 subgoal):
 1. of_bl (replicate (16 - x) False @ replicate x True) = of_bl (replicate (16 - y) False @ replicate y True)
[PROOF STEP]
unfolding mask_bl of_bl_rep_False
[PROOF STATE]
proof (prove)
using this:
of_bl (replicate x True) = of_bl (replicate y True)

goal (1 subgoal):
 1. of_bl (replicate x True) = of_bl (replicate y True)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
of_bl (replicate (16 - x) False @ replicate x True) = of_bl (replicate (16 - y) False @ replicate y True)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..16}; y \<in> {0..16}; mask x = mask y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "\<And>z. z \<le> 16 \<Longrightarrow> length (replicate (16 - z) False @ replicate z True) = 16"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. z \<le> 16 \<Longrightarrow> length (replicate (16 - z) False @ replicate z True) = 16
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?z \<le> 16 \<Longrightarrow> length (replicate (16 - ?z) False @ replicate ?z True) = 16

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..16}; y \<in> {0..16}; mask x = mask y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with 1(1,2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> {0..16}
y \<in> {0..16}
?z \<le> 16 \<Longrightarrow> length (replicate (16 - ?z) False @ replicate ?z True) = 16
[PROOF STEP]
have ps: "replicate (16 - x) False @ replicate x True \<in> {bl. length bl = LENGTH(16)}" " replicate (16 - y) False @ replicate y True \<in> {bl. length bl = LENGTH(16)}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..16}
y \<in> {0..16}
?z \<le> 16 \<Longrightarrow> length (replicate (16 - ?z) False @ replicate ?z True) = 16

goal (1 subgoal):
 1. replicate (16 - x) False @ replicate x True \<in> {bl. length bl = LENGTH(16)} &&& replicate (16 - y) False @ replicate y True \<in> {bl. length bl = LENGTH(16)}
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
replicate (16 - x) False @ replicate x True \<in> {bl. length bl = LENGTH(16)}
replicate (16 - y) False @ replicate y True \<in> {bl. length bl = LENGTH(16)}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..16}; y \<in> {0..16}; mask x = mask y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from inj_onD[OF word_bl.Abs_inj_on, OF oe ps]
[PROOF STATE]
proof (chain)
picking this:
replicate (16 - x) False @ replicate x True = replicate (16 - y) False @ replicate y True
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
replicate (16 - x) False @ replicate x True = replicate (16 - y) False @ replicate y True

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using 1(1,2)
[PROOF STATE]
proof (prove)
using this:
replicate (16 - x) False @ replicate x True = replicate (16 - y) False @ replicate y True
x \<in> {0..16}
y \<in> {0..16}

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by(fastforce intro: replicate_FT_hlp)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powsum_ext: "x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup>
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc 0\<^esup>
 2. \<And>n. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup> \<Longrightarrow> x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc 0\<^esup>
 2. \<And>n. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup> \<Longrightarrow> x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc 0\<^esup>
[PROOF STEP]
by (metis One_nat_def local.join.sup_ge2 powsum_01)
[PROOF STATE]
proof (state)
this:
x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc 0\<^esup>

goal (1 subgoal):
 1. \<And>n. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup> \<Longrightarrow> x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup> \<Longrightarrow> x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup>

goal (1 subgoal):
 1. \<And>n. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup> \<Longrightarrow> x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc n\<^esup>

goal (1 subgoal):
 1. x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>
[PROOF STEP]
by (auto simp add:less_eq_def powsum_simps, metis (lifting, no_types) add.left_commute)
[PROOF STATE]
proof (state)
this:
x \<le> x\<^bsub>0\<^esub>\<^bsup>Suc (Suc n)\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring_closed) coeff_power_closed:
  "(\<And>m. coeff p m \<in> A) \<Longrightarrow> coeff (p ^ n) m \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. MPoly_Type.coeff p m \<in> A) \<Longrightarrow> MPoly_Type.coeff (p ^ n) m \<in> A
[PROOF STEP]
by (induction n arbitrary: m)
     (auto simp: mpoly_coeff_1 coeff_mpoly_times intro!: prod_fun_closed)


[STATEMENT]
theorem plus1:
fixes f :: "real \<Rightarrow> real"
assumes 0: "f 0 = 1" and f_add: "\<And>x y. f(x+y+1) = f x + f y"

assumes "r : \<rat>" shows "f(r) = r + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "f(of_int i) = of_int i + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int i) = real_of_int i + 1
[PROOF STEP]
proof (induct i rule: int_induct [where k=0])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f (real_of_int 0) = real_of_int 0 + 1
 2. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 3. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
case base
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. f (real_of_int 0) = real_of_int 0 + 1
 2. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 3. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int 0) = real_of_int 0 + 1
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
f 0 = 1

goal (1 subgoal):
 1. f (real_of_int 0) = real_of_int 0 + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int 0) = real_of_int 0 + 1

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
case (step1 i)
[PROOF STATE]
proof (state)
this:
0 \<le> i
f (real_of_int i) = real_of_int i + 1

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
have "f(of_int (i+1)) = f(of_int i + 0 + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (i + 1)) = f (real_of_int i + 0 + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int (i + 1)) = f (real_of_int i + 0 + 1)

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int (i + 1)) = f (real_of_int i + 0 + 1)

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
have "\<dots> = f(of_int i) + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int i + 0 + 1) = f (real_of_int i) + f 0
[PROOF STEP]
by(rule f_add)
[PROOF STATE]
proof (state)
this:
f (real_of_int i + 0 + 1) = f (real_of_int i) + f 0

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int i + 0 + 1) = f (real_of_int i) + f 0

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
have "\<dots> = of_int (i+1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int i) + f 0 = real_of_int (i + 1) + 1
[PROOF STEP]
using step1 0
[PROOF STATE]
proof (prove)
using this:
0 \<le> i
f (real_of_int i) = real_of_int i + 1
f 0 = 1

goal (1 subgoal):
 1. f (real_of_int i) + f 0 = real_of_int (i + 1) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int i) + f 0 = real_of_int (i + 1) + 1

goal (2 subgoals):
 1. \<And>i. \<lbrakk>0 \<le> i; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
 2. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f (real_of_int (i + 1)) = real_of_int (i + 1) + 1

goal (1 subgoal):
 1. f (real_of_int (i + 1)) = real_of_int (i + 1) + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f (real_of_int (i + 1)) = real_of_int (i + 1) + 1

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
case (step2 i)
[PROOF STATE]
proof (state)
this:
i \<le> 0
f (real_of_int i) = real_of_int i + 1

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
have "f(of_int i) = f(of_int (i - 1) + 0 + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int i) = f (real_of_int (i - 1) + 0 + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int i) = f (real_of_int (i - 1) + 0 + 1)

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int i) = f (real_of_int (i - 1) + 0 + 1)

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
have "\<dots> = f(of_int (i - 1)) + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (i - 1) + 0 + 1) = f (real_of_int (i - 1)) + f 0
[PROOF STEP]
by(rule f_add)
[PROOF STATE]
proof (state)
this:
f (real_of_int (i - 1) + 0 + 1) = f (real_of_int (i - 1)) + f 0

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int (i - 1) + 0 + 1) = f (real_of_int (i - 1)) + f 0

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
have "\<dots> = f(of_int (i - 1)) + 1 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (i - 1)) + f 0 = f (real_of_int (i - 1)) + 1
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
f 0 = 1

goal (1 subgoal):
 1. f (real_of_int (i - 1)) + f 0 = f (real_of_int (i - 1)) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int (i - 1)) + f 0 = f (real_of_int (i - 1)) + 1

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> 0; f (real_of_int i) = real_of_int i + 1\<rbrakk> \<Longrightarrow> f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (real_of_int i) = f (real_of_int (i - 1)) + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f (real_of_int i) = f (real_of_int (i - 1)) + 1

goal (1 subgoal):
 1. f (real_of_int (i - 1)) = real_of_int (i - 1) + 1
[PROOF STEP]
using step2
[PROOF STATE]
proof (prove)
using this:
f (real_of_int i) = f (real_of_int (i - 1)) + 1
i \<le> 0
f (real_of_int i) = real_of_int i + 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (real_of_int i) = real_of_int i + 1

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
f (real_of_int ?i2) = real_of_int ?i2 + 1

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
note f_int = this
[PROOF STATE]
proof (state)
this:
f (real_of_int ?i2) = real_of_int ?i2 + 1

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f (real_of_int ?i2) = real_of_int ?i2 + 1

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
fix n r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "f(of_int (Suc n)*r + of_int n) = of_int (Suc n) * f r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r
[PROOF STEP]
proof(induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f (real_of_int (int (Suc 0)) * r + real_of_int (int 0)) = real_of_int (int (Suc 0)) * f r
 2. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. f (real_of_int (int (Suc 0)) * r + real_of_int (int 0)) = real_of_int (int (Suc 0)) * f r
 2. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (int (Suc 0)) * r + real_of_int (int 0)) = real_of_int (int (Suc 0)) * f r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc 0)) * r + real_of_int (int 0)) = real_of_int (int (Suc 0)) * f r

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
have "of_int (Suc(Suc n))*r + of_int (Suc n) =
            r + (of_int (Suc n)*r + of_int n) + 1" (is "?a = ?b")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n)) = r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n)) = r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
hence "f ?a = f ?b"
[PROOF STATE]
proof (prove)
using this:
real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n)) = r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1

goal (1 subgoal):
 1. f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = f (r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = f (r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1)

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = f (r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1)

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
have "\<dots> = f r + f(of_int (Suc n)*r + of_int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1) = f r + f (real_of_int (int (Suc n)) * r + real_of_int (int n))
[PROOF STEP]
by(rule f_add)
[PROOF STATE]
proof (state)
this:
f (r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1) = f r + f (real_of_int (int (Suc n)) * r + real_of_int (int n))

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (r + (real_of_int (int (Suc n)) * r + real_of_int (int n)) + 1) = f r + f (real_of_int (int (Suc n)) * r + real_of_int (int n))

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
have "\<dots> = f r + of_int (Suc n) * f r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f r + f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = f r + real_of_int (int (Suc n)) * f r
[PROOF STEP]
by(simp only:Suc)
[PROOF STATE]
proof (state)
this:
f r + f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = f r + real_of_int (int (Suc n)) * f r

goal (1 subgoal):
 1. \<And>n. f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r \<Longrightarrow> f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = f r + real_of_int (int (Suc n)) * f r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = f r + real_of_int (int (Suc n)) * f r

goal (1 subgoal):
 1. f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc (Suc n))) * r + real_of_int (int (Suc n))) = real_of_int (int (Suc (Suc n))) * f r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc n)) * r + real_of_int (int n)) = real_of_int (int (Suc n)) * f r

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc ?n2)) * ?ra2 + real_of_int (int ?n2)) = real_of_int (int (Suc ?n2)) * f ?ra2

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
note 1 = this
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc ?n2)) * ?ra2 + real_of_int (int ?n2)) = real_of_int (int (Suc ?n2)) * f ?ra2

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f (real_of_int (int (Suc ?n2)) * ?ra2 + real_of_int (int ?n2)) = real_of_int (int (Suc ?n2)) * f ?ra2

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
fix n::nat and r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
assume "n\<noteq>0"
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "f(of_int (n)*r + of_int (n - 1)) = of_int (n) * f r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
proof(cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
 2. \<And>nat. n = Suc nat \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
 2. \<And>nat. n = Suc nat \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
using \<open>n\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
n = 0
n \<noteq> 0

goal (1 subgoal):
 1. f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
n = Suc nat_

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc nat_

goal (1 subgoal):
 1. f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
using \<open>n\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
n = Suc nat_
n \<noteq> 0

goal (1 subgoal):
 1. f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
using "1"
[PROOF STATE]
proof (prove)
using this:
n = Suc nat_
n \<noteq> 0
f (real_of_int (int (Suc ?n2)) * ?ra2 + real_of_int (int ?n2)) = real_of_int (int (Suc ?n2)) * f ?ra2

goal (1 subgoal):
 1. f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (real_of_int (int n) * r + real_of_int (int (n - 1))) = real_of_int (int n) * f r

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?n2 \<noteq> 0 \<Longrightarrow> f (real_of_int (int ?n2) * ?ra2 + real_of_int (int (?n2 - 1))) = real_of_int (int ?n2) * f ?ra2

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
note f_mult = this
[PROOF STATE]
proof (state)
this:
?n2 \<noteq> 0 \<Longrightarrow> f (real_of_int (int ?n2) * ?ra2 + real_of_int (int (?n2 - 1))) = real_of_int (int ?n2) * f ?ra2

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
from \<open>r:\<rat>\<close>
[PROOF STATE]
proof (chain)
picking this:
r \<in> \<rat>
[PROOF STEP]
obtain i::int and n::nat where r: "r = of_int i/of_int n" and "n\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
r \<in> \<rat>

goal (1 subgoal):
 1. (\<And>i n. \<lbrakk>r = real_of_int i / real_of_int (int n); n \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(fastforce simp:Rats_eq_int_div_nat)
[PROOF STATE]
proof (state)
this:
r = real_of_int i / real_of_int (int n)
n \<noteq> 0

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "of_int (n) * f(of_int i / of_int n) = f(of_int i + of_int (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = f (real_of_int i + real_of_int (int (n - 1)))
[PROOF STEP]
using \<open>n\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = f (real_of_int i + real_of_int (int (n - 1)))
[PROOF STEP]
by (metis (no_types, opaque_lifting) f_mult mult.commute nonzero_divide_eq_eq of_int_of_nat_eq of_nat_0_eq_iff)
[PROOF STATE]
proof (state)
this:
real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = f (real_of_int i + real_of_int (int (n - 1)))

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = f (real_of_int i + real_of_int (int (n - 1)))

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "\<dots> = f(of_int (i + int n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int i + real_of_int (int (n - 1))) = f (real_of_int (i + int n - 1))
[PROOF STEP]
using \<open>n\<noteq>0\<close>[simplified]
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. f (real_of_int i + real_of_int (int (n - 1))) = f (real_of_int (i + int n - 1))
[PROOF STEP]
by (metis One_nat_def Suc_leI of_nat_1 add_diff_eq of_int_add of_nat_diff)
[PROOF STATE]
proof (state)
this:
f (real_of_int i + real_of_int (int (n - 1))) = f (real_of_int (i + int n - 1))

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int i + real_of_int (int (n - 1))) = f (real_of_int (i + int n - 1))

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "\<dots> = of_int (i + int n - 1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (real_of_int (i + int n - 1)) = real_of_int (i + int n - 1) + 1
[PROOF STEP]
by(rule f_int)
[PROOF STATE]
proof (state)
this:
f (real_of_int (i + int n - 1)) = real_of_int (i + int n - 1) + 1

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (real_of_int (i + int n - 1)) = real_of_int (i + int n - 1) + 1

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
have "\<dots> = of_int i + of_int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (i + int n - 1) + 1 = real_of_int i + real_of_int (int n)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
real_of_int (i + int n - 1) + 1 = real_of_int i + real_of_int (int n)

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = real_of_int i + real_of_int (int n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = real_of_int i + real_of_int (int n)

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
using \<open>n\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = real_of_int i + real_of_int (int n)
n \<noteq> 0

goal (1 subgoal):
 1. f r = r + 1
[PROOF STEP]
unfolding r
[PROOF STATE]
proof (prove)
using this:
real_of_int (int n) * f (real_of_int i / real_of_int (int n)) = real_of_int i + real_of_int (int n)
n \<noteq> 0

goal (1 subgoal):
 1. f (real_of_int i / real_of_int (int n)) = real_of_int i / real_of_int (int n) + 1
[PROOF STEP]
by (simp add:field_simps)
[PROOF STATE]
proof (state)
this:
f r = r + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma keys_focus: "keys (focus X p) = (\<lambda>t. except t (- X)) ` keys p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (focus X p) = (\<lambda>t. except t (- X)) ` keys p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
 2. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
have "keys (focus X p) \<subseteq> (\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (focus X p) \<subseteq> (\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X))))
[PROOF STEP]
unfolding focus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (\<Sum>t\<in>keys p. monomial (monomial (lookup p t) (except t X)) (except t (- X))) \<subseteq> (\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X))))
[PROOF STEP]
by (rule keys_sum_subset)
[PROOF STATE]
proof (state)
this:
keys (focus X p) \<subseteq> (\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X))))

goal (2 subgoals):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
 2. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
keys (focus X p) \<subseteq> (\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X))))

goal (2 subgoals):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
 2. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
have "\<dots> \<subseteq> (\<Union>t\<in>keys p. {except t (- X)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X)))) \<subseteq> (\<Union>t\<in>keys p. {except t (- X)})
[PROOF STEP]
by (intro UN_mono subset_refl) simp
[PROOF STATE]
proof (state)
this:
(\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X)))) \<subseteq> (\<Union>t\<in>keys p. {except t (- X)})

goal (2 subgoals):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
 2. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>t\<in>keys p. keys (monomial (monomial (lookup p t) (except t X)) (except t (- X)))) \<subseteq> (\<Union>t\<in>keys p. {except t (- X)})

goal (2 subgoals):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
 2. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
have "\<dots> = (\<lambda>t. except t (- X)) ` keys p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>t\<in>keys p. {except t (- X)}) = (\<lambda>t. except t (- X)) ` keys p
[PROOF STEP]
by (rule UNION_singleton_eq_range)
[PROOF STATE]
proof (state)
this:
(\<Union>t\<in>keys p. {except t (- X)}) = (\<lambda>t. except t (- X)) ` keys p

goal (2 subgoals):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
 2. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
[PROOF STEP]
show "keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p"
[PROOF STATE]
proof (prove)
using this:
keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p

goal (1 subgoal):
 1. keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
keys (focus X p) \<subseteq> (\<lambda>t. except t (- X)) ` keys p

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
assume "s \<in> keys p"
[PROOF STATE]
proof (state)
this:
s \<in> keys p

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
have "lookup (focus X p) (except s (- X)) =
              (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))"
      (is "_ = ?p")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (focus X p) (except s (- X)) = (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))
[PROOF STEP]
by (simp only: focus_def lookup_sum lookup_single)
[PROOF STATE]
proof (state)
this:
lookup (focus X p) (except s (- X)) = (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (focus X p) (except s (- X)) = (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
have "\<dots> \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) \<noteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
have "lookup ?p (except s X) =
              (\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) (except s X) = (\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X))
[PROOF STEP]
by (simp add: lookup_sum lookup_single when_def if_distrib if_distribR)
            (metis (no_types, opaque_lifting) lookup_single_eq lookup_single_not_eq lookup_zero)
[PROOF STATE]
proof (state)
this:
lookup (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) (except s X) = (\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X))

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) (except s X) = (\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X))

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (\<Sum>t\<in>{s}. lookup p t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X)) = sum (lookup p) {s}
[PROOF STEP]
proof (intro sum.mono_neutral_cong_right ballI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>i. i \<in> keys p - {s} \<Longrightarrow> (lookup p i when except i X = except s X \<and> except i (- X) = except s (- X)) = (0::'b)
 4. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>i. i \<in> keys p - {s} \<Longrightarrow> (lookup p i when except i X = except s X \<and> except i (- X) = except s (- X)) = (0::'b)
 4. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
assume "t \<in> keys p - {s}"
[PROOF STATE]
proof (state)
this:
t \<in> keys p - {s}

goal (4 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>i. i \<in> keys p - {s} \<Longrightarrow> (lookup p i when except i X = except s X \<and> except i (- X) = except s (- X)) = (0::'b)
 4. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
hence "t \<noteq> s"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p - {s}

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

goal (4 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>i. i \<in> keys p - {s} \<Longrightarrow> (lookup p i when except i X = except s X \<and> except i (- X) = except s (- X)) = (0::'b)
 4. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
hence "except t X + except t (- X) \<noteq> except s X + except s (- X)"
[PROOF STATE]
proof (prove)
using this:
t \<noteq> s

goal (1 subgoal):
 1. except t X + except t (- X) \<noteq> except s X + except s (- X)
[PROOF STEP]
by (simp flip: except_decomp)
[PROOF STATE]
proof (state)
this:
except t X + except t (- X) \<noteq> except s X + except s (- X)

goal (4 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>i. i \<in> keys p - {s} \<Longrightarrow> (lookup p i when except i X = except s X \<and> except i (- X) = except s (- X)) = (0::'b)
 4. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
thus "(lookup p t when except t X = except s X \<and> except t (- X) = except s (- X)) = 0"
[PROOF STATE]
proof (prove)
using this:
except t X + except t (- X) \<noteq> except s X + except s (- X)

goal (1 subgoal):
 1. (lookup p t when except t X = except s X \<and> except t (- X) = except s (- X)) = (0::'b)
[PROOF STEP]
by (auto simp: when_def)
[PROOF STATE]
proof (state)
this:
(lookup p t when except t X = except s X \<and> except t (- X) = except s (- X)) = (0::'b)

goal (3 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite (keys p)
 2. {s} \<subseteq> keys p
 3. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
from \<open>s \<in> keys p\<close>
[PROOF STATE]
proof (chain)
picking this:
s \<in> keys p
[PROOF STEP]
show "{s} \<subseteq> keys p"
[PROOF STATE]
proof (prove)
using this:
s \<in> keys p

goal (1 subgoal):
 1. {s} \<subseteq> keys p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{s} \<subseteq> keys p

goal (2 subgoals):
 1. finite (keys p)
 2. \<And>x. x \<in> {s} \<Longrightarrow> (lookup p x when except x X = except s X \<and> except x (- X) = except s (- X)) = lookup p x
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X)) = sum (lookup p) {s}

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>keys p. lookup p t when except t X = except s X \<and> except t (- X) = except s (- X)) = sum (lookup p) {s}

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
from \<open>s \<in> keys p\<close>
[PROOF STATE]
proof (chain)
picking this:
s \<in> keys p
[PROOF STEP]
have "\<dots> \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
s \<in> keys p

goal (1 subgoal):
 1. sum (lookup p) {s} \<noteq> (0::'b)
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
sum (lookup p) {s} \<noteq> (0::'b)

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) (except s X) \<noteq> (0::'b)
[PROOF STEP]
have "except s X \<in> keys ?p"
[PROOF STATE]
proof (prove)
using this:
lookup (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) (except s X) \<noteq> (0::'b)

goal (1 subgoal):
 1. except s X \<in> keys (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
except s X \<in> keys (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
except s X \<in> keys (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
assume "?p = 0"
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0

goal (1 subgoal):
 1. (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
except s X \<in> keys (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))
(\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
except s X \<in> keys (\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X))
(\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>keys p. monomial (lookup p t) (except t X) when except t (- X) = except s (- X)) \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup (focus X p) (except s (- X)) \<noteq> 0
[PROOF STEP]
have "except s (- X) \<in> keys (focus X p)"
[PROOF STATE]
proof (prove)
using this:
lookup (focus X p) (except s (- X)) \<noteq> 0

goal (1 subgoal):
 1. except s (- X) \<in> keys (focus X p)
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
except s (- X) \<in> keys (focus X p)

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?s2 \<in> keys p \<Longrightarrow> except ?s2 (- X) \<in> keys (focus X p)

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
thus "(\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)"
[PROOF STATE]
proof (prove)
using this:
?s2 \<in> keys p \<Longrightarrow> except ?s2 (- X) \<in> keys (focus X p)

goal (1 subgoal):
 1. (\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>t. except t (- X)) ` keys p \<subseteq> keys (focus X p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemLineContainsBasepoint:
    shows "inLine p (line joining p to q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
define linePQ where "linePQ = line joining p to q"
[PROOF STATE]
proof (state)
this:
linePQ = line joining p to q

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
have bp: "basepoint linePQ = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basepoint linePQ = p
[PROOF STEP]
by (simp add: linePQ_def)
[PROOF STATE]
proof (state)
this:
basepoint linePQ = p

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
have dir: "direction linePQ = from p to q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. direction linePQ = from p to q
[PROOF STEP]
by (simp add: linePQ_def)
[PROOF STATE]
proof (state)
this:
direction linePQ = from p to q

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
have endq: "basepoint linePQ \<leadsto> direction linePQ = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basepoint linePQ \<leadsto> direction linePQ = q
[PROOF STEP]
by (metis bp dir lemLineEndpoint)
[PROOF STATE]
proof (state)
this:
basepoint linePQ \<leadsto> direction linePQ = q

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
have "(1 + 0 = 1)  \<and> (positionVector p = 1**(positionVector p) \<oplus> 0**(positionVector q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + (0::'a) = (1::'a) \<and> positionVector p = (1::'a) ** positionVector p \<oplus> (0::'a) ** positionVector q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) + (0::'a) = (1::'a) \<and> positionVector p = (1::'a) ** positionVector p \<oplus> (0::'a) ** positionVector q

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
hence "collinear p p q"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + (0::'a) = (1::'a) \<and> positionVector p = (1::'a) ** positionVector p \<oplus> (0::'a) ** positionVector q

goal (1 subgoal):
 1. collinear p p q
[PROOF STEP]
by (metis collinear.simps)
[PROOF STATE]
proof (state)
this:
collinear p p q

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
hence "collinear p (basepoint linePQ) (basepoint linePQ \<leadsto> direction linePQ)"
[PROOF STATE]
proof (prove)
using this:
collinear p p q

goal (1 subgoal):
 1. collinear p (basepoint linePQ) (basepoint linePQ \<leadsto> direction linePQ)
[PROOF STEP]
by (metis bp endq)
[PROOF STATE]
proof (state)
this:
collinear p (basepoint linePQ) (basepoint linePQ \<leadsto> direction linePQ)

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
collinear p (basepoint linePQ) (basepoint linePQ \<leadsto> direction linePQ)

goal (1 subgoal):
 1. inLine p line joining p to q
[PROOF STEP]
by (simp add: linePQ_def)
[PROOF STATE]
proof (state)
this:
inLine p line joining p to q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dropWhile_eq_hd_conv: "dropWhile P xs = hd xs # rest \<longleftrightarrow> xs \<noteq> [] \<and> rest = tl xs \<and> \<not> P (hd xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dropWhile P xs = hd xs # rest) = (xs \<noteq> [] \<and> rest = tl xs \<and> \<not> P (hd xs))
[PROOF STEP]
by (metis append_Nil dropWhile_eq_Cons_conv list.sel(1) neq_Nil_conv takeWhile_dropWhile_id takeWhile_eq_Nil_iff list.sel(3))


[STATEMENT]
lemma pointwise_simp:
  assumes f: "pointwise f"
  shows "f X =  \<Union> { f {x} | x. x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f X = \<Union> {f {x} |x. x \<in> X}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f X = \<Union> {f {x} |x. x \<in> X}
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
pointwise f
[PROOF STEP]
have "\<forall> X. f X = \<Union> { f {x} | x. x \<in> X}"
[PROOF STATE]
proof (prove)
using this:
pointwise f

goal (1 subgoal):
 1. \<forall>X. f X = \<Union> {f {x} |x. x \<in> X}
[PROOF STEP]
by (rule iffD1[OF pointwise_def[where f=f]])
[PROOF STATE]
proof (state)
this:
\<forall>X. f X = \<Union> {f {x} |x. x \<in> X}

goal (1 subgoal):
 1. f X = \<Union> {f {x} |x. x \<in> X}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>X. f X = \<Union> {f {x} |x. x \<in> X}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>X. f X = \<Union> {f {x} |x. x \<in> X}

goal (1 subgoal):
 1. f X = \<Union> {f {x} |x. x \<in> X}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f X = \<Union> {f {x} |x. x \<in> X}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem alternating_harmonic_series_sums: "(\<lambda>k. (-1)^k / real_of_nat (Suc k)) sums ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
let ?f = "\<lambda>n. harm n - ln (real_of_nat n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
let ?g = "\<lambda>n. if even n then 0 else (2::real)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
let ?em = "\<lambda>n. harm n - ln (real_of_nat n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
have "eventually (\<lambda>n. ?em (2*n) - ?em n + ln 2 = (\<Sum>k<2*n. (-1)^k / real_of_nat (Suc k))) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
using eventually_gt_at_top[of "0::nat"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
assume n: "n > 0"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "(\<Sum>k<2*n. (-1)^k / real_of_nat (Suc k)) =
              (\<Sum>k<2*n. ((-1)^k + ?g k) / of_nat (Suc k)) - (\<Sum>k<2*n. ?g k / of_nat (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) = (\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) - (\<Sum>k<2 * n. (if even k then 0 else 2) / real (Suc k))
[PROOF STEP]
by (simp add: sum.distrib algebra_simps divide_inverse)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) = (\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) - (\<Sum>k<2 * n. (if even k then 0 else 2) / real (Suc k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) = (\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) - (\<Sum>k<2 * n. (if even k then 0 else 2) / real (Suc k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "(\<Sum>k<2*n. ((-1)^k + ?g k) / real_of_nat (Suc k)) = harm (2*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) = harm (2 * n)
[PROOF STEP]
unfolding harm_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) = (\<Sum>k<2 * n. inverse (real (Suc k)))
[PROOF STEP]
by (intro sum.cong) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) = harm (2 * n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<2 * n. ((- 1) ^ k + (if even k then 0 else 2)) / real (Suc k)) = harm (2 * n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "(\<Sum>k<2*n. ?g k / real_of_nat (Suc k)) = (\<Sum>k|k<2*n \<and> odd k. ?g k / of_nat (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<2 * n. (if even k then 0 else 2) / real (Suc k)) = (\<Sum>k | k < 2 * n \<and> odd k. (if even k then 0 else 2) / real (Suc k))
[PROOF STEP]
by (intro sum.mono_neutral_right) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k<2 * n. (if even k then 0 else 2) / real (Suc k)) = (\<Sum>k | k < 2 * n \<and> odd k. (if even k then 0 else 2) / real (Suc k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<2 * n. (if even k then 0 else 2) / real (Suc k)) = (\<Sum>k | k < 2 * n \<and> odd k. (if even k then 0 else 2) / real (Suc k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "\<dots> = (\<Sum>k|k<2*n \<and> odd k. 2 / (real_of_nat (Suc k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k | k < 2 * n \<and> odd k. (if even k then 0 else 2) / real (Suc k)) = (\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k))
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k | k < 2 * n \<and> odd k. (if even k then 0 else 2) / real (Suc k)) = (\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k | k < 2 * n \<and> odd k. (if even k then 0 else 2) / real (Suc k)) = (\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "(\<Sum>k|k<2*n \<and> odd k. 2 / (real_of_nat (Suc k))) = harm n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k)) = harm n
[PROOF STEP]
unfolding harm_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k)) = (\<Sum>k<n. inverse (real (Suc k)))
[PROOF STEP]
by (intro sum.reindex_cong[of "\<lambda>n. 2*n+1"]) (auto simp: inj_on_def field_simps elim!: oddE)
[PROOF STATE]
proof (state)
this:
(\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k)) = harm n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k | k < 2 * n \<and> odd k. 2 / real (Suc k)) = harm n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "harm (2*n) - harm n = ?em (2*n) - ?em n + ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm (2 * n) - harm n = harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. harm (2 * n) - harm n = harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2
[PROOF STEP]
by (simp_all add: algebra_simps ln_mult)
[PROOF STATE]
proof (state)
this:
harm (2 * n) - harm n = harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) = harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2
[PROOF STEP]
show "?em (2*n) - ?em n + ln 2 = (\<Sum>k<2*n. (-1)^k / real_of_nat (Suc k))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) = harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2

goal (1 subgoal):
 1. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
have "(\<lambda>n. ?em (2*n) - ?em n + ln (2::real))
                     \<longlonglongrightarrow> euler_mascheroni - euler_mascheroni + ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> euler_mascheroni - euler_mascheroni + ln 2
[PROOF STEP]
by (intro tendsto_intros euler_mascheroni_LIMSEQ filterlim_compose[OF euler_mascheroni_LIMSEQ]
              filterlim_subseq) (auto simp: strict_mono_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> euler_mascheroni - euler_mascheroni + ln 2

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
hence "(\<lambda>n. ?em (2*n) - ?em n + ln (2::real)) \<longlonglongrightarrow> ln 2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> euler_mascheroni - euler_mascheroni + ln 2

goal (1 subgoal):
 1. (\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> ln 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> ln 2

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
(\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> ln 2
[PROOF STEP]
have "(\<lambda>n. (\<Sum>k<2*n. (-1)^k / real_of_nat (Suc k))) \<longlonglongrightarrow> ln 2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2 = (\<Sum>k<2 * n. (- 1) ^ k / real (Suc k))
(\<lambda>n. harm (2 * n) - ln (real (2 * n)) - (harm n - ln (real n)) + ln 2) \<longlonglongrightarrow> ln 2

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> ln 2
[PROOF STEP]
by (blast intro: Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> ln 2

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> ln 2

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
have "summable (\<lambda>k. (-1)^k * inverse (real_of_nat (Suc k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. (- 1) ^ k * inverse (real (Suc k)))
[PROOF STEP]
using LIMSEQ_inverse_real_of_nat
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (real (Suc n))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. summable (\<lambda>k. (- 1) ^ k * inverse (real (Suc k)))
[PROOF STEP]
by (intro summable_Leibniz(1) decseq_imp_monoseq decseq_SucI) simp_all
[PROOF STATE]
proof (state)
this:
summable (\<lambda>k. (- 1) ^ k * inverse (real (Suc k)))

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
hence A: "(\<lambda>n. \<Sum>k<n. (-1)^k / real_of_nat (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (-1)^k / real_of_nat (Suc k))"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>k. (- 1) ^ k * inverse (real (Suc k)))

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k<n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))
[PROOF STEP]
by (simp add: summable_sums_iff divide_inverse sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
from filterlim_compose[OF this filterlim_subseq[of "(*) (2::nat)"]]
[PROOF STATE]
proof (chain)
picking this:
strict_mono ((*) 2) \<Longrightarrow> (\<lambda>x. \<Sum>k<2 * x. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "(\<lambda>n. \<Sum>k<2*n. (-1)^k / real_of_nat (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (-1)^k / real_of_nat (Suc k))"
[PROOF STATE]
proof (prove)
using this:
strict_mono ((*) 2) \<Longrightarrow> (\<lambda>x. \<Sum>k<2 * x. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))
[PROOF STEP]
by (simp add: strict_mono_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> ln 2
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))
[PROOF STEP]
have "(\<Sum>k. (- 1) ^ k / real_of_nat (Suc k)) = ln 2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> ln 2
(\<lambda>n. \<Sum>k<2 * n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))

goal (1 subgoal):
 1. (\<Sum>k. (- 1) ^ k / real (Suc k)) = ln 2
[PROOF STEP]
by (intro LIMSEQ_unique)
[PROOF STATE]
proof (state)
this:
(\<Sum>k. (- 1) ^ k / real (Suc k)) = ln 2

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>k<n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))
(\<Sum>k. (- 1) ^ k / real (Suc k)) = ln 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>k<n. (- 1) ^ k / real (Suc k)) \<longlonglongrightarrow> (\<Sum>k. (- 1) ^ k / real (Suc k))
(\<Sum>k. (- 1) ^ k / real (Suc k)) = ln 2

goal (1 subgoal):
 1. (\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2
[PROOF STEP]
by (simp add: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. (- 1) ^ k / real (Suc k)) sums ln 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_cone:
  "convex s \<and> cone s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. (x + y) \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. (c *\<^sub>R x) \<in> s)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
assume "x\<in>s" "y\<in>s" and ?lhs
[PROOF STATE]
proof (state)
this:
x \<in> s
y \<in> s
convex s \<and> cone s

goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> s
y \<in> s
convex s \<and> cone s
[PROOF STEP]
have "2 *\<^sub>R x \<in>s" "2 *\<^sub>R y \<in> s"
[PROOF STATE]
proof (prove)
using this:
x \<in> s
y \<in> s
convex s \<and> cone s

goal (1 subgoal):
 1. 2 *\<^sub>R x \<in> s &&& 2 *\<^sub>R y \<in> s
[PROOF STEP]
unfolding cone_def
[PROOF STATE]
proof (prove)
using this:
x \<in> s
y \<in> s
convex s \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s)

goal (1 subgoal):
 1. 2 *\<^sub>R x \<in> s &&& 2 *\<^sub>R y \<in> s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 *\<^sub>R x \<in> s
2 *\<^sub>R y \<in> s

goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 *\<^sub>R x \<in> s
2 *\<^sub>R y \<in> s
[PROOF STEP]
have "x + y \<in> s"
[PROOF STATE]
proof (prove)
using this:
2 *\<^sub>R x \<in> s
2 *\<^sub>R y \<in> s

goal (1 subgoal):
 1. x + y \<in> s
[PROOF STEP]
using \<open>?lhs\<close>[unfolded convex_def, THEN conjunct1]
[PROOF STATE]
proof (prove)
using this:
2 *\<^sub>R x \<in> s
2 *\<^sub>R y \<in> s
\<forall>x\<in>s. \<forall>y\<in>s. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> s

goal (1 subgoal):
 1. x + y \<in> s
[PROOF STEP]
apply (erule_tac x="2*\<^sub>R x" in ballE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; \<forall>y\<in>s. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> u *\<^sub>R 2 *\<^sub>R x + v *\<^sub>R y \<in> s\<rbrakk> \<Longrightarrow> x + y \<in> s
 2. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; 2 *\<^sub>R x \<notin> s\<rbrakk> \<Longrightarrow> x + y \<in> s
[PROOF STEP]
apply (erule_tac x="2*\<^sub>R y" in ballE)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> u *\<^sub>R 2 *\<^sub>R x + v *\<^sub>R 2 *\<^sub>R y \<in> s\<rbrakk> \<Longrightarrow> x + y \<in> s
 2. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; 2 *\<^sub>R y \<notin> s\<rbrakk> \<Longrightarrow> x + y \<in> s
 3. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; 2 *\<^sub>R x \<notin> s\<rbrakk> \<Longrightarrow> x + y \<in> s
[PROOF STEP]
apply (erule_tac x="1/2" in allE, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; \<forall>v\<ge>0. 1 / 2 + v = 1 \<longrightarrow> x + (v * 2) *\<^sub>R y \<in> s\<rbrakk> \<Longrightarrow> x + y \<in> s
 2. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; 2 *\<^sub>R y \<notin> s\<rbrakk> \<Longrightarrow> x + y \<in> s
 3. \<lbrakk>2 *\<^sub>R x \<in> s; 2 *\<^sub>R y \<in> s; 2 *\<^sub>R x \<notin> s\<rbrakk> \<Longrightarrow> x + y \<in> s
[PROOF STEP]
apply (erule_tac x="1/2" in allE, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
x + y \<in> s

goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s; convex s \<and> cone s\<rbrakk> \<Longrightarrow> ?x2 + ?y2 \<in> s

goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s; convex s \<and> cone s\<rbrakk> \<Longrightarrow> ?x2 + ?y2 \<in> s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s; convex s \<and> cone s\<rbrakk> \<Longrightarrow> ?x2 + ?y2 \<in> s

goal (1 subgoal):
 1. (convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
unfolding convex_def cone_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s; (\<forall>x\<in>s. \<forall>y\<in>s. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s)\<rbrakk> \<Longrightarrow> ?x2 + ?y2 \<in> s

goal (1 subgoal):
 1. ((\<forall>x\<in>s. \<forall>y\<in>s. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s)) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(convex s \<and> cone s) = ((\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_induct2_rev[consumes 1]: "length xs = length ys \<Longrightarrow> (P [] []) \<Longrightarrow>
  (\<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])) \<Longrightarrow> P xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys
[PROOF STEP]
proof (induction "length xs" arbitrary: xs ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs ys. \<lbrakk>0 = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys
 2. \<And>x xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>x = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys; Suc x = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = length ?xs; length ?xs = length ?ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P ?xs ?ys
Suc n = length xs
length xs = length ys
P [] []
P ?xs ?ys \<Longrightarrow> P (?xs @ [?x]) (?ys @ [?y])

goal (2 subgoals):
 1. \<And>xs ys. \<lbrakk>0 = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys
 2. \<And>x xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>x = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys; Suc x = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = length ?xs; length ?xs = length ?ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P ?xs ?ys
Suc n = length xs
length xs = length ys
P [] []
P ?xs ?ys \<Longrightarrow> P (?xs @ [?x]) (?ys @ [?y])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?xs; length ?xs = length ?ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P ?xs ?ys
Suc n = length xs
length xs = length ys
P [] []
P ?xs ?ys \<Longrightarrow> P (?xs @ [?x]) (?ys @ [?y])

goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
by (cases xs rule: rev_cases; cases ys rule: rev_cases) auto
[PROOF STATE]
proof (state)
this:
P xs ys

goal (1 subgoal):
 1. \<And>xs ys. \<lbrakk>0 = length xs; length xs = length ys; P [] []; \<And>x y xs ys. P xs ys \<Longrightarrow> P (xs @ [x]) (ys @ [y])\<rbrakk> \<Longrightarrow> P xs ys
[PROOF STEP]
qed auto


[STATEMENT]
theorem rbt_delete_is_rbt [simp]: assumes "is_rbt t" shows "is_rbt (rbt_delete k t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_rbt (rbt_delete k t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_rbt (rbt_delete k t)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_rbt t
[PROOF STEP]
have "inv2 t" and "inv1 t"
[PROOF STATE]
proof (prove)
using this:
is_rbt t

goal (1 subgoal):
 1. inv2 t &&& inv1 t
[PROOF STEP]
unfolding is_rbt_def
[PROOF STATE]
proof (prove)
using this:
inv1 t \<and> inv2 t \<and> color_of t = B \<and> rbt_sorted t

goal (1 subgoal):
 1. inv2 t &&& inv1 t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv2 t
inv1 t

goal (1 subgoal):
 1. is_rbt (rbt_delete k t)
[PROOF STEP]
hence "inv2 (rbt_del k t) \<and> (color_of t = R \<and> bheight (rbt_del k t) = bheight t \<and> inv1 (rbt_del k t) \<or> color_of t = B \<and> bheight (rbt_del k t) = bheight t - 1 \<and> inv1l (rbt_del k t))"
[PROOF STATE]
proof (prove)
using this:
inv2 t
inv1 t

goal (1 subgoal):
 1. inv2 (rbt_del k t) \<and> (color_of t = R \<and> bheight (rbt_del k t) = bheight t \<and> inv1 (rbt_del k t) \<or> color_of t = B \<and> bheight (rbt_del k t) = bheight t - 1 \<and> inv1l (rbt_del k t))
[PROOF STEP]
by (rule rbt_del_inv1_inv2)
[PROOF STATE]
proof (state)
this:
inv2 (rbt_del k t) \<and> (color_of t = R \<and> bheight (rbt_del k t) = bheight t \<and> inv1 (rbt_del k t) \<or> color_of t = B \<and> bheight (rbt_del k t) = bheight t - 1 \<and> inv1l (rbt_del k t))

goal (1 subgoal):
 1. is_rbt (rbt_delete k t)
[PROOF STEP]
hence "inv2 (rbt_del k t) \<and> inv1l (rbt_del k t)"
[PROOF STATE]
proof (prove)
using this:
inv2 (rbt_del k t) \<and> (color_of t = R \<and> bheight (rbt_del k t) = bheight t \<and> inv1 (rbt_del k t) \<or> color_of t = B \<and> bheight (rbt_del k t) = bheight t - 1 \<and> inv1l (rbt_del k t))

goal (1 subgoal):
 1. inv2 (rbt_del k t) \<and> inv1l (rbt_del k t)
[PROOF STEP]
by (cases "color_of t") auto
[PROOF STATE]
proof (state)
this:
inv2 (rbt_del k t) \<and> inv1l (rbt_del k t)

goal (1 subgoal):
 1. is_rbt (rbt_delete k t)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
is_rbt t
inv2 (rbt_del k t) \<and> inv1l (rbt_del k t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_rbt t
inv2 (rbt_del k t) \<and> inv1l (rbt_del k t)

goal (1 subgoal):
 1. is_rbt (rbt_delete k t)
[PROOF STEP]
unfolding is_rbt_def rbt_delete_def
[PROOF STATE]
proof (prove)
using this:
inv1 t \<and> inv2 t \<and> color_of t = B \<and> rbt_sorted t
inv2 (rbt_del k t) \<and> inv1l (rbt_del k t)

goal (1 subgoal):
 1. inv1 (paint B (rbt_del k t)) \<and> inv2 (paint B (rbt_del k t)) \<and> color_of (paint B (rbt_del k t)) = B \<and> rbt_sorted (paint B (rbt_del k t))
[PROOF STEP]
by (auto intro: paint_rbt_sorted rbt_del_rbt_sorted)
[PROOF STATE]
proof (state)
this:
is_rbt (rbt_delete k t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_def_1: "((a::'a G) l\<rightarrow> b) * a = Abs_G (inf (Rep_G a) (Rep_G b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a l\<rightarrow> b) * a = Abs_G (Rep_G a \<sqinter> Rep_G b)
[PROOF STEP]
apply (simp add: times_def impl_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_G (Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)) = Abs_G (Rep_G a \<sqinter> Rep_G b)
[PROOF STEP]
apply (subgoal_tac "sup (inf (Rep_G b) (Rep_G a)) 0 = inf (Rep_G a) (Rep_G b)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a) = Rep_G a \<sqinter> Rep_G b \<Longrightarrow> Abs_G (Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)) = Abs_G (Rep_G a \<sqinter> Rep_G b)
 2. Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a) = Rep_G a \<sqinter> Rep_G b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a) = Rep_G a \<sqinter> Rep_G b
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a) \<le> Rep_G a \<sqinter> Rep_G b
 2. Rep_G a \<sqinter> Rep_G b \<le> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)
[PROOF STEP]
apply (cut_tac x = "a" in Rep_G)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_G a \<in> G \<Longrightarrow> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a) \<le> Rep_G a \<sqinter> Rep_G b
 2. Rep_G a \<sqinter> Rep_G b \<le> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)
[PROOF STEP]
apply (cut_tac x = "b" in Rep_G)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Rep_G a \<in> G; Rep_G b \<in> G\<rbrakk> \<Longrightarrow> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a) \<le> Rep_G a \<sqinter> Rep_G b
 2. Rep_G a \<sqinter> Rep_G b \<le> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)
[PROOF STEP]
apply (simp add: G_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_G a \<sqinter> Rep_G b \<le> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)
[PROOF STEP]
apply (subgoal_tac "inf (Rep_G a) (Rep_G b) = inf (Rep_G b) (Rep_G a)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_G a \<sqinter> Rep_G b = Rep_G b \<sqinter> Rep_G a \<Longrightarrow> Rep_G a \<sqinter> Rep_G b \<le> Rep_G b \<sqinter> Rep_G a \<squnion> (0::'a)
 2. Rep_G a \<sqinter> Rep_G b = Rep_G b \<sqinter> Rep_G a
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_G a \<sqinter> Rep_G b = Rep_G b \<sqinter> Rep_G a
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_G a \<sqinter> Rep_G b \<le> Rep_G b \<sqinter> Rep_G a
 2. Rep_G b \<sqinter> Rep_G a \<le> Rep_G a \<sqinter> Rep_G b
[PROOF STEP]
by simp_all