[STATEMENT]
lemma ccard_mono:
  assumes "n'\<ge>n"
  shows "n''\<ge>n' \<Longrightarrow> ccard n (n''::nat) p \<ge> ccard n n' p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' \<le> n'' \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}
[PROOF STEP]
proof (induction n'' rule: dec_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n' \<and> p i}
 2. \<And>na. \<lbrakk>n' \<le> na; na < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> na \<and> p i}\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc na \<and> p i}
[PROOF STEP]
case base
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n' \<and> p i}
 2. \<And>na. \<lbrakk>n' \<le> na; na < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> na \<and> p i}\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc na \<and> p i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n' \<and> p i}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n' \<and> p i}

goal (1 subgoal):
 1. \<And>na. \<lbrakk>n' \<le> na; na < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> na \<and> p i}\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc na \<and> p i}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>n' \<le> na; na < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> na \<and> p i}\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc na \<and> p i}
[PROOF STEP]
case (step n'')
[PROOF STATE]
proof (state)
this:
n' \<le> n''
n'' < n''
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. \<And>na. \<lbrakk>n' \<le> na; na < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> na \<and> p i}\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc na \<and> p i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n' \<le> n''
n'' < n''
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
n' \<le> n''
n'' < n''
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
assume "p (Suc n'')"
[PROOF STATE]
proof (state)
this:
p (Suc n'')

goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p (Suc n'')

goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
from step.hyps assms
[PROOF STATE]
proof (chain)
picking this:
n' \<le> n''
n'' < n''
n \<le> n'
[PROOF STEP]
have "n\<le>n''"
[PROOF STATE]
proof (prove)
using this:
n' \<le> n''
n'' < n''
n \<le> n'

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

goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p (Suc n'')
n \<le> n''
[PROOF STEP]
have "ccard n (Suc n'') p = Suc (ccard n n'' p)"
[PROOF STATE]
proof (prove)
using this:
p (Suc n'')
n \<le> n''

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})
[PROOF STEP]
using ccard_inc[of p n'' n]
[PROOF STATE]
proof (prove)
using this:
p (Suc n'')
n \<le> n''
\<lbrakk>p (Suc n''); n \<le> n''\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})

goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})

goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
have "\<dots> \<ge> ccard n n' p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})
[PROOF STEP]
using step.IH
[PROOF STATE]
proof (prove)
using this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> Suc (card {i. n < i \<and> i \<le> n'' \<and> p i})

goal (2 subgoals):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
 2. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> ?P3\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
assume "\<not> p (Suc n'')"
[PROOF STATE]
proof (state)
this:
\<not> p (Suc n'')

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> p (Suc n'')

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
from step.hyps assms
[PROOF STATE]
proof (chain)
picking this:
n' \<le> n''
n'' < n''
n \<le> n'
[PROOF STEP]
have "n\<le>n''"
[PROOF STATE]
proof (prove)
using this:
n' \<le> n''
n'' < n''
n \<le> n'

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

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> p (Suc n'')
n \<le> n''
[PROOF STEP]
have "ccard n (Suc n'') p = ccard n n'' p"
[PROOF STATE]
proof (prove)
using this:
\<not> p (Suc n'')
n \<le> n''

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = card {i. n < i \<and> i \<le> n'' \<and> p i}
[PROOF STEP]
using ccard_same[of p n'' n]
[PROOF STATE]
proof (prove)
using this:
\<not> p (Suc n'')
n \<le> n''
\<not> p (Suc n'') \<Longrightarrow> card {i. n < i \<and> i \<le> n'' \<and> p i} = card {i. n < i \<and> i \<le> Suc n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = card {i. n < i \<and> i \<le> n'' \<and> p i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> Suc n'' \<and> p i} = card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
have "\<dots> \<ge> ccard n n' p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}
[PROOF STEP]
using step.IH
[PROOF STATE]
proof (prove)
using this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}

goal (1 subgoal):
 1. \<lbrakk>n' \<le> n''; n'' < n''; card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> n'' \<and> p i}; \<not> p (Suc n'')\<rbrakk> \<Longrightarrow> card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p i} \<le> card {i. n < i \<and> i \<le> Suc n'' \<and> p i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homology_exactness_axiom_2:
   "exact_seq ([homology_group (p-1) X, homology_group (p-1) (subtopology X S), relative_homology_group p X S],
              [hom_induced (p-1) (subtopology X S) {} X {} id, hom_boundary p X S])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])
[PROOF STEP]
consider (neg) "p \<le> 0" | (int) n where "p = int (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<le> 0 \<Longrightarrow> thesis; \<And>n. p = int (Suc n) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (metis linear not0_implies_Suc of_nat_0 zero_le_imp_eq_int)
[PROOF STATE]
proof (state)
this:
\<lbrakk>p \<le> 0 \<Longrightarrow> ?thesis; \<And>n. p = int (Suc n) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>p \<le> 0 \<Longrightarrow> ?thesis; \<And>n. p = int (Suc n) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
have "kernel (relative_homology_group (p - 1) (subtopology X S) {})
                     (relative_homology_group (p - 1) X {})
                     (hom_induced (p - 1) (subtopology X S) {} X {} id)
            = hom_boundary p X S ` carrier (relative_homology_group p X S)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<le> 0 \<Longrightarrow> ?thesis; \<And>n. p = int (Suc n) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<le> 0 \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
 2. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
case neg
[PROOF STATE]
proof (state)
this:
p \<le> 0

goal (2 subgoals):
 1. p \<le> 0 \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
 2. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
obtain x where "x \<in> carrier (relative_homology_group p X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> carrier (relative_homology_group p X S) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using group_relative_homology_group group.is_monoid
[PROOF STATE]
proof (prove)
using this:
Group.group (relative_homology_group ?p ?X ?S)
Group.group ?G \<Longrightarrow> Group.monoid ?G

goal (1 subgoal):
 1. (\<And>x. x \<in> carrier (relative_homology_group p X S) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> carrier (relative_homology_group p X S)

goal (2 subgoals):
 1. p \<le> 0 \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
 2. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
with neg
[PROOF STATE]
proof (chain)
picking this:
p \<le> 0
x \<in> carrier (relative_homology_group p X S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<le> 0
x \<in> carrier (relative_homology_group p X S)

goal (1 subgoal):
 1. kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
unfolding kernel_def singleton_group_def relative_homology_group_def
[PROOF STATE]
proof (prove)
using this:
p \<le> 0
x \<in> carrier (if p < 0 then \<lparr>carrier = {undefined}, mult = \<lambda>x y. undefined, one = undefined\<rparr> else relcycle_group (nat p) X S Mod singular_relboundary_set (nat p) X S)

goal (1 subgoal):
 1. {x \<in> carrier (if p - 1 < 0 then \<lparr>carrier = {undefined}, mult = \<lambda>x y. undefined, one = undefined\<rparr> else relcycle_group (nat (p - 1)) (subtopology X S) {} Mod singular_relboundary_set (nat (p - 1)) (subtopology X S) {}). hom_induced (p - 1) (subtopology X S) {} X {} id x = \<one>\<^bsub>if p - 1 < 0 then \<lparr>carrier = {undefined}, mult = \<lambda>x y. undefined, one = undefined\<rparr> else relcycle_group (nat (p - 1)) X {} Mod singular_relboundary_set (nat (p - 1)) X {}\<^esub>} = hom_boundary p X S ` carrier (if p < 0 then \<lparr>carrier = {undefined}, mult = \<lambda>x y. undefined, one = undefined\<rparr> else relcycle_group (nat p) X S Mod singular_relboundary_set (nat p) X S)
[PROOF STEP]
by (force simp: hom_induced_trivial hom_boundary_trivial)
[PROOF STATE]
proof (state)
this:
kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)

goal (1 subgoal):
 1. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
case int
[PROOF STATE]
proof (state)
this:
p = int (Suc n)

goal (1 subgoal):
 1. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
have "hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S)
        = carrier (relative_homology_group n (subtopology X S) {}) \<inter>
          {c. hom_induced n (subtopology X S) {} X {} id c =
           \<one>\<^bsub>relative_homology_group n X {}\<^esub>}"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
have 1: "(\<And>x. x \<in> A \<Longrightarrow> x \<in> B \<longleftrightarrow> x \<in> C) \<Longrightarrow> f ` (A \<inter> B) = f ` (A \<inter> C)" for f A B C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> (x \<in> B) = (x \<in> C)) \<Longrightarrow> f ` (A \<inter> B) = f ` (A \<inter> C)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> ?A1 \<Longrightarrow> (x \<in> ?B1) = (x \<in> ?C1)) \<Longrightarrow> ?f1 ` (?A1 \<inter> ?B1) = ?f1 ` (?A1 \<inter> ?C1)

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
have 2: "(\<And>x. x \<in> A \<Longrightarrow> x \<in> B \<longleftrightarrow> x \<in> f -` C) \<Longrightarrow> f ` (A \<inter> B) = f ` A \<inter> C" for f A B C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> (x \<in> B) = (x \<in> f -` C)) \<Longrightarrow> f ` (A \<inter> B) = f ` A \<inter> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> ?A2 \<Longrightarrow> (x \<in> ?B2) = (x \<in> ?f2 -` ?C2)) \<Longrightarrow> ?f2 ` (?A2 \<inter> ?B2) = ?f2 ` ?A2 \<inter> ?C2

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
have "?lhs = homologous_rel_set n (subtopology X S) {}
                   ` (chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = homologous_rel_set n (subtopology X S) {} ` chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S
[PROOF STEP]
unfolding carrier_relative_homology_group image_comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hom_boundary (int (Suc n)) X S \<circ> homologous_rel_set (Suc n) X S) ` singular_relcycle_set (Suc n) X S = (homologous_rel_set n (subtopology X S) {} \<circ> chain_boundary (Suc n)) ` singular_relcycle_set (Suc n) X S
[PROOF STEP]
by (rule image_cong [OF refl]) (simp add: o_def hom_boundary_chain_boundary del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = homologous_rel_set n (subtopology X S) {} ` chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = homologous_rel_set n (subtopology X S) {} ` chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
have "\<dots> = homologous_rel_set n (subtopology X S) {} `
                       (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homologous_rel_set n (subtopology X S) {} ` chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S = homologous_rel_set n (subtopology X S) {} ` (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {})
[PROOF STEP]
by (force simp: singular_relcycle singular_boundary chain_boundary_boundary_alt)
[PROOF STATE]
proof (state)
this:
homologous_rel_set n (subtopology X S) {} ` chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S = homologous_rel_set n (subtopology X S) {} ` (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {})

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homologous_rel_set n (subtopology X S) {} ` chain_boundary (Suc n) ` singular_relcycle_set (Suc n) X S = homologous_rel_set n (subtopology X S) {} ` (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {})

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homologous_rel_set n (subtopology X S) {} ` (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {}) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
unfolding carrier_relative_homology_group vimage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homologous_rel_set n (subtopology X S) {} ` (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {}) = homologous_rel_set n (subtopology X S) {} ` singular_relcycle_set n (subtopology X S) {} \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
apply (rule 2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> singular_relcycle_set n (subtopology X S) {} \<Longrightarrow> (x \<in> singular_relboundary_set n X {}) = (x \<in> homologous_rel_set n (subtopology X S) {} -` {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>})
[PROOF STEP]
apply (auto simp: hom_induced_chain_map chain_map_ident homologous_rel_set_eq_relboundary singular_relcycle)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
homologous_rel_set n (subtopology X S) {} ` (singular_relcycle_set n (subtopology X S) {} \<inter> singular_relboundary_set n X {}) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}

goal (1 subgoal):
 1. hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}

goal (1 subgoal):
 1. \<And>n. p = int (Suc n) \<Longrightarrow> kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hom_boundary (int (Suc n)) X S ` carrier (relative_homology_group (int (Suc n)) X S) = carrier (homology_group (int n) (subtopology X S)) \<inter> {c. hom_induced (int n) (subtopology X S) {} X {} id c = \<one>\<^bsub>homology_group (int n) X\<^esub>}

goal (1 subgoal):
 1. kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
by (auto simp: kernel_def int)
[PROOF STATE]
proof (state)
this:
kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)

goal (1 subgoal):
 1. exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)

goal (1 subgoal):
 1. exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])
[PROOF STEP]
using hom_boundary_hom hom_induced_hom
[PROOF STATE]
proof (prove)
using this:
kernel (homology_group (p - 1) (subtopology X S)) (homology_group (p - 1) X) (hom_induced (p - 1) (subtopology X S) {} X {} id) = hom_boundary p X S ` carrier (relative_homology_group p X S)
hom_boundary ?p ?X ?S \<in> hom (relative_homology_group ?p ?X ?S) (homology_group (?p - 1) (subtopology ?X ?S))
hom_induced ?p ?X ?S ?Y ?T ?f \<in> hom (relative_homology_group ?p ?X ?S) (relative_homology_group ?p ?Y ?T)

goal (1 subgoal):
 1. exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])
[PROOF STEP]
by (force simp: group_hom_def group_hom_axioms_def)
[PROOF STATE]
proof (state)
this:
exact_seq ([homology_group (p - 1) X, homology_group (p - 1) (subtopology X S), relative_homology_group p X S], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lconcat_llist_of:
  "lconcat (llist_of (map llist_of xs)) = llist_of (concat xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lconcat (llist_of (map llist_of xs)) = llist_of (concat xs)
[PROOF STEP]
by(induct xs)(simp_all add: lappend_llist_of_llist_of)


[STATEMENT]
lemma in_set_spmf_iff_spmf: "x \<in> set_spmf p \<longleftrightarrow> spmf p x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set_spmf p) = (spmf p x \<noteq> 0)
[PROOF STEP]
by(auto simp add: set_spmf_def set_pmf_iff intro: rev_image_eqI)


[STATEMENT]
lemma cf_bcomp_Hom_ArrMap_app[cat_cs_simps]:
  assumes "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "[f, g]\<^sub>\<circ> \<in>\<^sub>\<circ> (op_cat \<AA> \<times>\<^sub>C \<BB>)\<lparr>Arr\<rparr>"
  shows
    "Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,\<GG>-)\<lparr>ArrMap\<rparr>\<lparr>f, g\<rparr>\<^sub>\<bullet> =
      Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-)\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr>, \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>\<rparr>\<^sub>\<bullet>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,\<GG>-)\<^esub> g = \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr> \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-)\<^esub> \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[f, g]\<^sub>\<circ> \<in>\<^sub>\<circ> (op_cat \<AA> \<times>\<^sub>C \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,\<GG>-)\<^esub> g = \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr> \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-)\<^esub> \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>
[PROOF STEP]
unfolding cf_bcomp_Hom_def
[PROOF STATE]
proof (prove)
using this:
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[f, g]\<^sub>\<circ> \<in>\<^sub>\<circ> (op_cat \<AA> \<times>\<^sub>C \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_cn_cov_bcomp Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-) \<FF> \<GG>\<^esub> g = \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr> \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-)\<^esub> \<GG>\<lparr>ArrMap\<rparr>\<lparr>g\<rparr>
[PROOF STEP]
by (rule cf_cn_cov_bcomp_ArrMap_app)


[STATEMENT]
lemma LFP_lemma3:
  assumes "Mono f" "f \<in> carrier L \<rightarrow> carrier L"
  shows "LFP f \<sqsubseteq> f (LFP f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LFP f \<sqsubseteq> f (LFP f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Mono f
f \<in> carrier L \<rightarrow> carrier L

goal (1 subgoal):
 1. LFP f \<sqsubseteq> f (LFP f)
[PROOF STEP]
by (simp add: Pi_def) (metis LFP_closed LFP_lemma2 LFP_lowerbound assms(2) use_iso2)


[STATEMENT]
lemma ZfunI: "(\<And>r. 0 < r \<Longrightarrow> eventually (\<lambda>x. norm (f x) < r) F) \<Longrightarrow> Zfun f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. 0 < r \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) < r) \<Longrightarrow> Zfun f F
[PROOF STEP]
by (simp add: Zfun_def)


[STATEMENT]
lemma times_divide_eq_left [simp]:
  "a \<in> carrier R \<Longrightarrow> b \<in> carrier R \<Longrightarrow> c \<in> carrier R \<Longrightarrow> c \<noteq> \<zero> \<Longrightarrow>
    (b \<oslash> c) \<otimes> a = b \<otimes> a \<oslash> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>\<rbrakk> \<Longrightarrow> b \<oslash> c \<otimes> a = b \<otimes> a \<oslash> c
[PROOF STEP]
by (simp add: m_div_def m_ac)


[STATEMENT]
lemma sorted_wrt_map_mono:
  assumes "sorted_wrt Q xs"
    and "\<And>x y. Q x y \<Longrightarrow> P (f x) (f y)"
  shows "sorted_wrt P (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt P (map f xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted_wrt Q xs
Q ?x ?y \<Longrightarrow> P (f ?x) (f ?y)

goal (1 subgoal):
 1. sorted_wrt P (map f xs)
[PROOF STEP]
by (induct xs) (auto)


[STATEMENT]
lemma Fvars_scnj[simp]:
  "F \<subseteq> fmla \<Longrightarrow> finite F \<Longrightarrow>Fvars (scnj F) = \<Union> (Fvars ` F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<subseteq> fmla; finite F\<rbrakk> \<Longrightarrow> Fvars (scnj F) = \<Union> (Fvars ` F)
[PROOF STEP]
unfolding scnj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<subseteq> fmla; finite F\<rbrakk> \<Longrightarrow> Fvars (lcnj (asList F)) = \<Union> (Fvars ` F)
[PROOF STEP]
by auto


[STATEMENT]
lemma abs_conv_abscissa_scaleR: "abs_conv_abscissa (scaleR c f) \<le> abs_conv_abscissa f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa (c *\<^sub>R f) \<le> abs_conv_abscissa f
[PROOF STEP]
by (rule abs_conv_abscissa_mono) auto


[STATEMENT]
lemma prime_factorization_prime_power:
  "prime p \<Longrightarrow> prime_factorization (p ^ n) = replicate_mset n p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> prime_factorization (p ^ n) = replicate_mset n p
[PROOF STEP]
by (induction n)
     (simp_all add: prime_factorization_mult prime_factorization_prime Multiset.union_commute)


[STATEMENT]
lemma join_return:
  assumes "sets M = sets N" and "subprob_space M"
  shows "join (return (subprob_algebra N) M) = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. join (return (subprob_algebra N) M) = M
[PROOF STEP]
by (rule measure_eqI)
     (simp_all add: emeasure_join space_subprob_algebra
                    measurable_emeasure_subprob_algebra nn_integral_return assms)


[STATEMENT]
lemma NSsummable_NSLIMSEQ_zero: "NSsummable f \<Longrightarrow> f \<longlonglongrightarrow>\<^sub>N\<^sub>S 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSsummable f \<Longrightarrow> f \<longlonglongrightarrow>\<^sub>N\<^sub>S 0
[PROOF STEP]
by (metis HNatInfinite_add NSLIMSEQ_def NSsummable_NSCauchy approx_hrabs_zero_cancel star_of_zero sumhr_Suc)


[STATEMENT]
lemma coeffs_Const: "coeffs (Const c) = (if c = 0 then {} else {c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeffs (Const c) = (if c = (0::'a) then {} else {c})
[PROOF STEP]
unfolding Const_def Const\<^sub>0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeffs (map_fun id MPoly (Poly_Mapping.single 0) c) = (if c = (0::'a) then {} else {c})
[PROOF STEP]
by transfer' auto


[STATEMENT]
lemma eval_ternary_simps_2:
      "eval_ternary_And (bool_to_ternary P) T = TernaryTrue \<longleftrightarrow> P \<and> T = TernaryTrue"
      "eval_ternary_And T (bool_to_ternary P) = TernaryTrue \<longleftrightarrow> P \<and> T = TernaryTrue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval_ternary_And (bool_to_ternary P) T = TernaryTrue) = (P \<and> T = TernaryTrue) &&& (eval_ternary_And T (bool_to_ternary P) = TernaryTrue) = (P \<and> T = TernaryTrue)
[PROOF STEP]
apply(case_tac [!] P)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. P \<Longrightarrow> (eval_ternary_And (bool_to_ternary P) T = TernaryTrue) = (P \<and> T = TernaryTrue)
 2. \<not> P \<Longrightarrow> (eval_ternary_And (bool_to_ternary P) T = TernaryTrue) = (P \<and> T = TernaryTrue)
 3. P \<Longrightarrow> (eval_ternary_And T (bool_to_ternary P) = TernaryTrue) = (P \<and> T = TernaryTrue)
 4. \<not> P \<Longrightarrow> (eval_ternary_And T (bool_to_ternary P) = TernaryTrue) = (P \<and> T = TernaryTrue)
[PROOF STEP]
apply(simp_all add: eval_ternary_simps_simple)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma char_poly_transpose_mat[simp]: assumes A: "A \<in> carrier_mat n n"
  shows "char_poly (transpose_mat A) = char_poly A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly A\<^sup>T = char_poly A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char_poly A\<^sup>T = char_poly A
[PROOF STEP]
let ?A = "[:0, 1:] \<cdot>\<^sub>m 1\<^sub>m (dim_row A) + map_mat (\<lambda>a. [:- a:]) A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char_poly A\<^sup>T = char_poly A
[PROOF STEP]
have A': "?A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (dim_row A) + map_mat (\<lambda>a. [:- a:]) A \<in> carrier_mat n n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. [:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (dim_row A) + map_mat (\<lambda>a. [:- a:]) A \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (dim_row A) + map_mat (\<lambda>a. [:- a:]) A \<in> carrier_mat n n

goal (1 subgoal):
 1. char_poly A\<^sup>T = char_poly A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly A\<^sup>T = char_poly A
[PROOF STEP]
unfolding char_poly_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (dim_row A\<^sup>T) + map_mat (\<lambda>a. [:- a:]) A\<^sup>T) = det ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (dim_row A) + map_mat (\<lambda>a. [:- a:]) A)
[PROOF STEP]
by (subst det_transpose[symmetric, OF A'], rule arg_cong[of _ _ det],
    insert A, auto)
[PROOF STATE]
proof (state)
this:
char_poly A\<^sup>T = char_poly A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_mult_inner: "(A *v v) \<bullet> w = v \<bullet> (transpose A *v w)" for A :: "real ^'n^'n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *v v) \<bullet> w = v \<bullet> (Finite_Cartesian_Product.transpose A *v w)
[PROOF STEP]
unfolding matrix_vector_mult_def transpose_def inner_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * v $ j) $ i \<bullet> w $ i) = (\<Sum>i\<in>UNIV. v $ i \<bullet> (\<chi>i. \<Sum>j\<in>UNIV. (\<chi>i j. A $ j $ i) $ i $ j * w $ j) $ i)
[PROOF STEP]
apply(simp add: sum_distrib_right sum_distrib_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. A $ i $ n * v $ n * w $ i) = (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. v $ i * (A $ n $ i * w $ n))
[PROOF STEP]
apply(subst sum.swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. \<Sum>i\<in>UNIV. A $ i $ j * v $ j * w $ i) = (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. v $ i * (A $ n $ i * w $ n))
[PROOF STEP]
apply(subgoal_tac "\<forall>i j. A $ i $ j * v $ j * w $ i = v $ j * (A $ i $ j * w $ i)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>i j. A $ i $ j * v $ j * w $ i = v $ j * (A $ i $ j * w $ i) \<Longrightarrow> (\<Sum>j\<in>UNIV. \<Sum>i\<in>UNIV. A $ i $ j * v $ j * w $ i) = (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. v $ i * (A $ n $ i * w $ n))
 2. \<forall>i j. A $ i $ j * v $ j * w $ i = v $ j * (A $ i $ j * w $ i)
[PROOF STEP]
by presburger simp


[STATEMENT]
lemma E_cong:
  fixes f::"'a \<Rightarrow> real"
  shows "finite (set_pmf X) \<Longrightarrow> (\<forall>x\<in> set_pmf X. (f x) = (u x)) \<Longrightarrow> E (map_pmf f X) = E (map_pmf u X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (set_pmf X); \<forall>x\<in>set_pmf X. f x = u x\<rbrakk> \<Longrightarrow> E (map_pmf f X) = E (map_pmf u X)
[PROOF STEP]
unfolding E_def integral_map_pmf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (set_pmf X); \<forall>x\<in>set_pmf X. f x = u x\<rbrakk> \<Longrightarrow> measure_pmf.expectation X f = measure_pmf.expectation X u
[PROOF STEP]
apply(rule integral_cong_AE)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>finite (set_pmf X); \<forall>x\<in>set_pmf X. f x = u x\<rbrakk> \<Longrightarrow> measure_pmf.random_variable X borel f
 2. \<lbrakk>finite (set_pmf X); \<forall>x\<in>set_pmf X. f x = u x\<rbrakk> \<Longrightarrow> measure_pmf.random_variable X borel u
 3. \<lbrakk>finite (set_pmf X); \<forall>x\<in>set_pmf X. f x = u x\<rbrakk> \<Longrightarrow> AE x in measure_pmf X. f x = u x
[PROOF STEP]
apply(simp add: integrable_measure_pmf_finite)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (set_pmf X); \<forall>x\<in>set_pmf X. f x = u x\<rbrakk> \<Longrightarrow> AE x in measure_pmf X. f x = u x
[PROOF STEP]
by (simp add: AE_measure_pmf_iff)


[STATEMENT]
lemma sum_supp:
  fixes f::"'a::finite \<Rightarrow> real"
  shows "sum f (supp f) = sum f UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (supp f) = sum f UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f (supp f) = sum f UNIV
[PROOF STEP]
have "sum f (UNIV - supp f) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (UNIV - supp f) = 0
[PROOF STEP]
by(simp add:supp_def)
[PROOF STATE]
proof (state)
this:
sum f (UNIV - supp f) = 0

goal (1 subgoal):
 1. sum f (supp f) = sum f UNIV
[PROOF STEP]
hence "sum f (supp f) = sum f (UNIV - supp f) + sum f (supp f)"
[PROOF STATE]
proof (prove)
using this:
sum f (UNIV - supp f) = 0

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

goal (1 subgoal):
 1. sum f (supp f) = sum f UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f (supp f) = sum f (UNIV - supp f) + sum f (supp f)

goal (1 subgoal):
 1. sum f (supp f) = sum f UNIV
[PROOF STEP]
have "... = sum f UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (UNIV - supp f) + sum f (supp f) = sum f UNIV
[PROOF STEP]
by(simp add:sum.subset_diff[symmetric])
[PROOF STATE]
proof (state)
this:
sum f (UNIV - supp f) + sum f (supp f) = sum f UNIV

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

goal (1 subgoal):
 1. sum f (supp f) = sum f UNIV
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f (supp f) = sum f UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_set_lebesgue_integral_at_left:
  fixes a b :: real and f :: "real \<Rightarrow> 'a :: {banach,second_countable_topology}"
  assumes "a < b" and sets: "\<And>b'. b' \<in> {a..<b} \<Longrightarrow> {a..b'} \<in> sets M"
      and "set_integrable M {a..<b} f"
  shows   "((\<lambda>b'. set_lebesgue_integral M {a..b'} f) \<longlongrightarrow>
             set_lebesgue_integral M {a..<b} f) (at_left b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>b'. set_lebesgue_integral M {a..b'} f) \<longlongrightarrow> set_lebesgue_integral M {a..<b} f) (at_left b)
[PROOF STEP]
proof (rule tendsto_at_left_sequentially[OF assms(1)], goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < b; \<And>n. a < S n; incseq S; S \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> (\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M {a..<b} f
[PROOF STEP]
case (1 S)
[PROOF STATE]
proof (state)
this:
S ?n < b
a < S ?n
incseq S
S \<longlonglongrightarrow> b

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < b; \<And>n. a < S n; incseq S; S \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> (\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M {a..<b} f
[PROOF STEP]
have eq: "(\<Union>n. {a..S n}) = {a..<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. {a..S n}) = {a..<b}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x n. \<lbrakk>n \<in> UNIV; x \<in> {a..S n}\<rbrakk> \<Longrightarrow> x \<in> {a..<b}
 2. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
fix x n
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x n. \<lbrakk>n \<in> UNIV; x \<in> {a..S n}\<rbrakk> \<Longrightarrow> x \<in> {a..<b}
 2. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
assume "x \<in> {a..S n}"
[PROOF STATE]
proof (state)
this:
x \<in> {a..S n}

goal (2 subgoals):
 1. \<And>x n. \<lbrakk>n \<in> UNIV; x \<in> {a..S n}\<rbrakk> \<Longrightarrow> x \<in> {a..<b}
 2. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
with 1(1,2)[of n]
[PROOF STATE]
proof (chain)
picking this:
S n < b
a < S n
x \<in> {a..S n}
[PROOF STEP]
show "x \<in> {a..<b}"
[PROOF STATE]
proof (prove)
using this:
S n < b
a < S n
x \<in> {a..S n}

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

goal (1 subgoal):
 1. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
assume "x \<in> {a..<b}"
[PROOF STATE]
proof (state)
this:
x \<in> {a..<b}

goal (1 subgoal):
 1. \<And>x. x \<in> {a..<b} \<Longrightarrow> x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
with order_tendstoD[OF \<open>S \<longlonglongrightarrow> b\<close>, of x]
[PROOF STATE]
proof (chain)
picking this:
x < b \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. x < S xa
b < x \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. S xa < x
x \<in> {a..<b}
[PROOF STEP]
show "x \<in> (\<Union>n. {a..S n})"
[PROOF STATE]
proof (prove)
using this:
x < b \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. x < S xa
b < x \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. S xa < x
x \<in> {a..<b}

goal (1 subgoal):
 1. x \<in> (\<Union>n. {a..S n})
[PROOF STEP]
by (force simp: eventually_at_top_linorder dest: less_imp_le)
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>n. {a..S n})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>n. {a..S n}) = {a..<b}

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < b; \<And>n. a < S n; incseq S; S \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> (\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M {a..<b} f
[PROOF STEP]
have "(\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M (\<Union>n. {a..S n}) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M (\<Union>n. {a..S n}) f
[PROOF STEP]
by (rule set_integral_cont_up) (insert assms 1, auto simp: eq incseq_def decseq_def less_imp_le)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M (\<Union>n. {a..S n}) f

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < b; \<And>n. a < S n; incseq S; S \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> (\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M {a..<b} f
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
(\<Union>n. {a..S n}) = {a..<b}
(\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M (\<Union>n. {a..S n}) f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Union>n. {a..S n}) = {a..<b}
(\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M (\<Union>n. {a..S n}) f

goal (1 subgoal):
 1. (\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M {a..<b} f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. set_lebesgue_integral M {a..S n} f) \<longlonglongrightarrow> set_lebesgue_integral M {a..<b} f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lead_coeff_sym_mpoly_powerprod:
  assumes "finite A" "\<And>x. x \<in> X \<Longrightarrow> f x \<in> {1..card A}"
  shows   "lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f (x::'a)) ^ g x) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
have eq: "lead_coeff (sym_mpoly A (f x) ^ g x :: 'b mpoly) = 1" if "x \<in> X" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
x \<in> X
finite A
?x \<in> X \<Longrightarrow> f ?x \<in> {1..card A}

goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
by (subst lead_coeff_power) (auto simp: lead_coeff_sym_mpoly assms)
[PROOF STATE]
proof (state)
this:
?x \<in> X \<Longrightarrow> Symmetric_Polynomials.lead_coeff (sym_mpoly A (f ?x) ^ g ?x) = (1::'b)

goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
hence "(\<Prod>x\<in>X. lead_coeff (sym_mpoly A (f x) ^ g x :: 'b mpoly)) = (\<Prod>x\<in>X. 1)"
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> Symmetric_Polynomials.lead_coeff (sym_mpoly A (f ?x) ^ g ?x) = (1::'b)

goal (1 subgoal):
 1. (\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (\<Prod>x\<in>X. (1::'b))
[PROOF STEP]
by (intro prod.cong eq refl)
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (\<Prod>x\<in>X. (1::'b))

goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (\<Prod>x\<in>X. (1::'b))

goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>X. (1::'b)) = (1::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>X. (1::'b)) = (1::'b)

goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (1::'b)
[PROOF STEP]
have eq': "(\<Prod>x\<in>X. lead_coeff (sym_mpoly A (f x) ^ g x :: 'b mpoly)) = 1"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (1::'b)

goal (1 subgoal):
 1. (\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (1::'b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>X. Symmetric_Polynomials.lead_coeff (sym_mpoly A (f x) ^ g x)) = (1::'b)

goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)
[PROOF STEP]
by (subst lead_coeff_prod) (auto simp: eq eq')
[PROOF STATE]
proof (state)
this:
Symmetric_Polynomials.lead_coeff (\<Prod>x\<in>X. sym_mpoly A (f x) ^ g x) = (1::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma char_power [simp]: "a \<in> carrier G \<Longrightarrow> \<chi> (a [^] k) = \<chi> a ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier G \<Longrightarrow> \<chi> (a [^] k) = \<chi> a ^ k
[PROOF STEP]
by (induction k) auto


[STATEMENT]
lemma iT_Plus_iRelease_conv: "(P t1. t1 \<R> t2 (I \<oplus> k). Q t2) = (P (t1 + k). t1 \<R> t2 I. Q (t2 + k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t1. t1 \<R> t2 I \<oplus> k. Q t2) = (P (t1 + k). t1 \<R> t2 I. Q (t2 + k))
[PROOF STEP]
by (simp add: iRelease_iWeakUntil_conv iT_Plus_iWeakUntil_conv)


[STATEMENT]
lemma "(cl, f) \<in> CLF \<Longrightarrow> CLF = (SIGMA cl: CL.{f. f \<in> pset cl}) \<Longrightarrow> f \<in> pset cl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(cl, f) \<in> CLF; CLF = (SIGMA cl:CL. {f. f \<in> pset cl})\<rbrakk> \<Longrightarrow> f \<in> pset cl
[PROOF STEP]
by (metis Collect_mem_eq SigmaD2)


[STATEMENT]
lemma rank_less_imp_inconsistent:
  fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
  assumes inc: "rank A < (if (\<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> 0) then (to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> 0) + 1) else 0)"
  shows "inconsistent A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inconsistent A b
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
define i where "i = (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
i = (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a))

goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
define j where "j = (GREATEST a. \<not> is_zero_row a (Gauss_Jordan A))"
[PROOF STATE]
proof (state)
this:
j = (GREATEST a. \<not> is_zero_row a (Gauss_Jordan A))

goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
assume "\<not> inconsistent A b"
[PROOF STATE]
proof (state)
this:
\<not> inconsistent A b

goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
hence ex_solution: "\<exists>x. is_solution x A b"
[PROOF STATE]
proof (prove)
using this:
\<not> inconsistent A b

goal (1 subgoal):
 1. \<exists>x. is_solution x A b
[PROOF STEP]
unfolding inconsistent_def consistent_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<nexists>x. is_solution x A b)

goal (1 subgoal):
 1. \<exists>x. is_solution x A b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. is_solution x A b

goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. is_solution x A b
[PROOF STEP]
obtain x where "is_solution x A b"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. is_solution x A b

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

goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
hence is_solution_solve: "is_solution x (Gauss_Jordan A) (P_Gauss_Jordan A *v b)"
[PROOF STATE]
proof (prove)
using this:
is_solution x A b

goal (1 subgoal):
 1. is_solution x (Gauss_Jordan A) (P_Gauss_Jordan A *v b)
[PROOF STEP]
using is_solution_solve_system
[PROOF STATE]
proof (prove)
using this:
is_solution x A b
is_solution ?x ?A ?b = is_solution ?x (fst (solve_system ?A ?b)) (snd (solve_system ?A ?b))

goal (1 subgoal):
 1. is_solution x (Gauss_Jordan A) (P_Gauss_Jordan A *v b)
[PROOF STEP]
by (metis Gauss_Jordan_PA_eq P_Gauss_Jordan_def fst_conv snd_conv solve_system_def)
[PROOF STATE]
proof (state)
this:
is_solution x (Gauss_Jordan A) (P_Gauss_Jordan A *v b)

goal (1 subgoal):
 1. \<not> inconsistent A b \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases "A=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = 0 \<Longrightarrow> False
 2. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = 0

goal (2 subgoals):
 1. A = 0 \<Longrightarrow> False
 2. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence rank_eq_0: "rank A = 0"
[PROOF STATE]
proof (prove)
using this:
A = 0

goal (1 subgoal):
 1. rank A = 0
[PROOF STEP]
using rank_0
[PROOF STATE]
proof (prove)
using this:
A = 0
rank 0 = 0

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

goal (2 subgoals):
 1. A = 0 \<Longrightarrow> False
 2. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence exists_not_0:"(\<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> 0)"
[PROOF STATE]
proof (prove)
using this:
rank A = 0

goal (1 subgoal):
 1. \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)
[PROOF STEP]
using inc
[PROOF STATE]
proof (prove)
using this:
rank A = 0
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)

goal (1 subgoal):
 1. \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)
[PROOF STEP]
unfolding inconsistent
[PROOF STATE]
proof (prove)
using this:
rank A = 0
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)

goal (1 subgoal):
 1. \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)
[PROOF STEP]
using to_nat_plus_1_set[of "(GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> 0)"]
[PROOF STATE]
proof (prove)
using this:
rank A = 0
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)
mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 \<in> {1..<CARD('rows) + 1}

goal (1 subgoal):
 1. \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)

goal (2 subgoals):
 1. A = 0 \<Longrightarrow> False
 2. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using True \<open>is_solution x A b\<close> exists_not_0 is_solution_def
[PROOF STATE]
proof (prove)
using this:
A = 0
is_solution x A b
\<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)
is_solution ?x ?A ?b = (?A *v ?x = ?b)

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

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A \<noteq> 0

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have j_less_i: "j<i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j < i
[PROOF STEP]
have rank_less_greatest_i: "rank A < to_nat i + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A < mod_type_class.to_nat i + 1
[PROOF STEP]
using inc
[PROOF STATE]
proof (prove)
using this:
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)

goal (1 subgoal):
 1. rank A < mod_type_class.to_nat i + 1
[PROOF STEP]
unfolding i_def inconsistent
[PROOF STATE]
proof (prove)
using this:
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)

goal (1 subgoal):
 1. rank A < mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
rank A < mod_type_class.to_nat i + 1

goal (1 subgoal):
 1. j < i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rank A < mod_type_class.to_nat i + 1

goal (1 subgoal):
 1. j < i
[PROOF STEP]
have rank_eq_greatest_A: "rank A = to_nat j + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = mod_type_class.to_nat j + 1
[PROOF STEP]
unfolding j_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = mod_type_class.to_nat (GREATEST a. \<not> is_zero_row a (Gauss_Jordan A)) + 1
[PROOF STEP]
by (rule rank_eq_suc_to_nat_greatest[OF False])
[PROOF STATE]
proof (state)
this:
rank A = mod_type_class.to_nat j + 1

goal (1 subgoal):
 1. j < i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rank A < mod_type_class.to_nat i + 1
rank A = mod_type_class.to_nat j + 1
[PROOF STEP]
have "to_nat j + 1 < to_nat i + 1"
[PROOF STATE]
proof (prove)
using this:
rank A < mod_type_class.to_nat i + 1
rank A = mod_type_class.to_nat j + 1

goal (1 subgoal):
 1. mod_type_class.to_nat j + 1 < mod_type_class.to_nat i + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat j + 1 < mod_type_class.to_nat i + 1

goal (1 subgoal):
 1. j < i
[PROOF STEP]
hence "to_nat j < to_nat i"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat j + 1 < mod_type_class.to_nat i + 1

goal (1 subgoal):
 1. mod_type_class.to_nat j < mod_type_class.to_nat i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat j < mod_type_class.to_nat i

goal (1 subgoal):
 1. j < i
[PROOF STEP]
thus "j<i"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat j < mod_type_class.to_nat i

goal (1 subgoal):
 1. j < i
[PROOF STEP]
by (metis (full_types) not_le to_nat_mono')
[PROOF STATE]
proof (state)
this:
j < i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
j < i

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have is_zero_i: "is_zero_row i (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row i (Gauss_Jordan A)
[PROOF STEP]
by (metis (full_types) j_def j_less_i not_greater_Greatest)
[PROOF STATE]
proof (state)
this:
is_zero_row i (Gauss_Jordan A)

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "(Gauss_Jordan A *v x) $ i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i = (0::'a)
[PROOF STEP]
proof (unfold matrix_vector_mult_def, auto, rule sum.neutral,clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> UNIV \<Longrightarrow> Gauss_Jordan A $ i $ xa * x $ xa = (0::'a)
[PROOF STEP]
fix a::'cols
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> UNIV \<Longrightarrow> Gauss_Jordan A $ i $ xa * x $ xa = (0::'a)
[PROOF STEP]
show "Gauss_Jordan A $ i $ a * x $ a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan A $ i $ a * x $ a = (0::'a)
[PROOF STEP]
using is_zero_i
[PROOF STATE]
proof (prove)
using this:
is_zero_row i (Gauss_Jordan A)

goal (1 subgoal):
 1. Gauss_Jordan A $ i $ a * x $ a = (0::'a)
[PROOF STEP]
unfolding is_zero_row_def'
[PROOF STATE]
proof (prove)
using this:
\<forall>j. Gauss_Jordan A $ i $ j = (0::'a)

goal (1 subgoal):
 1. Gauss_Jordan A $ i $ a * x $ a = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Gauss_Jordan A $ i $ a * x $ a = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Gauss_Jordan A *v x) $ i = (0::'a)

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(Gauss_Jordan A *v x) $ i = (0::'a)

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "(Gauss_Jordan A *v x) $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
have "Gauss_Jordan A *v x = P_Gauss_Jordan A *v b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan A *v x = P_Gauss_Jordan A *v b
[PROOF STEP]
using is_solution_def is_solution_solve
[PROOF STATE]
proof (prove)
using this:
is_solution ?x ?A ?b = (?A *v ?x = ?b)
is_solution x (Gauss_Jordan A) (P_Gauss_Jordan A *v b)

goal (1 subgoal):
 1. Gauss_Jordan A *v x = P_Gauss_Jordan A *v b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Gauss_Jordan A *v x = P_Gauss_Jordan A *v b

goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Gauss_Jordan A *v x = P_Gauss_Jordan A *v b

goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
have "... $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P_Gauss_Jordan A *v b) $ i \<noteq> (0::'a)
[PROOF STEP]
unfolding i_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P_Gauss_Jordan A *v b) $ (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) \<noteq> (0::'a)
[PROOF STEP]
proof (rule GreatestI_ex)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. (P_Gauss_Jordan A *v b) $ x \<noteq> (0::'a)
[PROOF STEP]
show "\<exists>x. (P_Gauss_Jordan A *v b) $ x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (P_Gauss_Jordan A *v b) $ x \<noteq> (0::'a)
[PROOF STEP]
using inc
[PROOF STATE]
proof (prove)
using this:
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)

goal (1 subgoal):
 1. \<exists>x. (P_Gauss_Jordan A *v b) $ x \<noteq> (0::'a)
[PROOF STEP]
unfolding i_def inconsistent
[PROOF STATE]
proof (prove)
using this:
rank A < (if \<exists>a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (P_Gauss_Jordan A *v b) $ a \<noteq> (0::'a)) + 1 else 0)

goal (1 subgoal):
 1. \<exists>x. (P_Gauss_Jordan A *v b) $ x \<noteq> (0::'a)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<exists>x. (P_Gauss_Jordan A *v b) $ x \<noteq> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(P_Gauss_Jordan A *v b) $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(Gauss_Jordan A *v x) $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. (Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(Gauss_Jordan A *v x) $ i \<noteq> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Gauss_Jordan A *v x) $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(Gauss_Jordan A *v x) $ i = (0::'a)
(Gauss_Jordan A *v x) $ i \<noteq> (0::'a)
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
(Gauss_Jordan A *v x) $ i = (0::'a)
(Gauss_Jordan A *v x) $ i \<noteq> (0::'a)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aboveS_AboveS_trans:
assumes TRANS: "trans r" and ANTISYM: "antisym r" and
        IN1: "a \<in> aboveS r b" and IN2: "b \<in> AboveS r C"
shows "a \<in> AboveS r C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> AboveS r C
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> AboveS r C
[PROOF STEP]
from IN2
[PROOF STATE]
proof (chain)
picking this:
b \<in> AboveS r C
[PROOF STEP]
have "b \<in> Above r C"
[PROOF STATE]
proof (prove)
using this:
b \<in> AboveS r C

goal (1 subgoal):
 1. b \<in> Above r C
[PROOF STEP]
using AboveS_subset_Above[of r C]
[PROOF STATE]
proof (prove)
using this:
b \<in> AboveS r C
AboveS r C \<subseteq> Above r C

goal (1 subgoal):
 1. b \<in> Above r C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<in> Above r C

goal (1 subgoal):
 1. a \<in> AboveS r C
[PROOF STEP]
with aboveS_Above_trans assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>trans ?r; antisym ?r; ?a \<in> aboveS ?r ?b; ?b \<in> Above ?r ?C\<rbrakk> \<Longrightarrow> ?a \<in> AboveS ?r ?C
trans r
antisym r
a \<in> aboveS r b
b \<in> AboveS r C
b \<in> Above r C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>trans ?r; antisym ?r; ?a \<in> aboveS ?r ?b; ?b \<in> Above ?r ?C\<rbrakk> \<Longrightarrow> ?a \<in> AboveS ?r ?C
trans r
antisym r
a \<in> aboveS r b
b \<in> AboveS r C
b \<in> Above r C

goal (1 subgoal):
 1. a \<in> AboveS r C
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<in> AboveS r C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma theorem24xxiv_pp:
  "-(x * y) \<squnion> --(x * z) = -(x * (y \<sqinter> -z)) \<squnion> --(x * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x * y) \<squnion> - - (x * z) = - (x * (y \<sqinter> - z)) \<squnion> - - (x * z)
[PROOF STEP]
by (metis p_dist_inf theorem24xxiii)


[STATEMENT]
lemma distinct_adj_Cons: "distinct_adj (x # xs) \<longleftrightarrow> xs = [] \<or> x \<noteq> hd xs \<and> distinct_adj xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_adj (x # xs) = (xs = [] \<or> x \<noteq> hd xs \<and> distinct_adj xs)
[PROOF STEP]
by (cases xs) auto


[STATEMENT]
lemma int_lsb_numeral [simp]:
  "lsb (0 :: int) = False"
  "lsb (1 :: int) = True"
  "lsb (Numeral1 :: int) = True"
  "lsb (- 1 :: int) = True"
  "lsb (- Numeral1 :: int) = True"
  "lsb (numeral (num.Bit0 w) :: int) = False"
  "lsb (numeral (num.Bit1 w) :: int) = True"
  "lsb (- numeral (num.Bit0 w) :: int) = False"
  "lsb (- numeral (num.Bit1 w) :: int) = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((lsb 0 = False &&& lsb 1 = True) &&& lsb Numeral1 = True &&& lsb (- 1) = True) &&& (lsb (- Numeral1) = True &&& lsb (numeral (num.Bit0 w)) = False) &&& lsb (numeral (num.Bit1 w)) = True &&& lsb (- numeral (num.Bit0 w)) = False &&& lsb (- numeral (num.Bit1 w)) = True
[PROOF STEP]
by (simp_all add: lsb_int_def bit_0)


[STATEMENT]
lemma frechet_derivative_scaleR_fun:
  "y differentiable at a \<Longrightarrow>
  frechet_derivative (x *\<^sub>R y) (at a) =
    x *\<^sub>R frechet_derivative y (at a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y differentiable at a \<Longrightarrow> frechet_derivative (x *\<^sub>R y) (at a) = x *\<^sub>R frechet_derivative y (at a)
[PROOF STEP]
by (rule frechet_derivative_at')
    (auto intro!: derivative_eq_intros frechet_derivative_worksI)


[STATEMENT]
lemma ord_option_Some2_iff: "ord_option R x (Some b) \<longleftrightarrow> (\<forall>a. x = Some a \<longrightarrow> R a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_option R x (Some b) = (\<forall>a. x = Some a \<longrightarrow> R a b)
[PROOF STEP]
by (cases x; auto)


[STATEMENT]
lemma inf_transitive:
  "transitive x \<Longrightarrow> transitive y \<Longrightarrow> transitive (x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>transitive x; transitive y\<rbrakk> \<Longrightarrow> transitive (x \<sqinter> y)
[PROOF STEP]
by (meson inf_mono order_trans mult_left_sub_dist_inf_left mult_left_sub_dist_inf_right mult_right_sub_dist_inf)


[STATEMENT]
lemma Nats_mult_nonpos_Ints: "x \<in> \<nat> \<Longrightarrow> y \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> x * y \<in> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<nat>; y \<in> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> x * y \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using Nats_mult[of x "-y"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> \<nat>; - y \<in> \<nat>\<rbrakk> \<Longrightarrow> x * - y \<in> \<nat>

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<nat>; y \<in> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> x * y \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (simp add: uminus_in_Nats_iff)


[STATEMENT]
lemma supp_distinguishing_weak_formula:
    assumes "\<not> (P \<equiv>\<cdot> Q)"
    shows "supp (distinguishing_weak_formula P Q) \<subseteq> supp P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
let ?some = "\<lambda>p. (\<some>x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
let ?B = "{- p \<bullet> ?some p|p. True}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> P \<equiv>\<cdot> Q
[PROOF STEP]
have "supp (Abs_bset ?B :: _ set['idx]) \<subseteq> supp P"
[PROOF STATE]
proof (prove)
using this:
\<not> P \<equiv>\<cdot> Q

goal (1 subgoal):
 1. supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P
[PROOF STEP]
by (rule distinguishing_weak_formula_supp_aux)
[PROOF STATE]
proof (state)
this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P

goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P

goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P
[PROOF STEP]
have "finite (supp (Abs_bset ?B :: _ set['idx]))"
[PROOF STATE]
proof (prove)
using this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P

goal (1 subgoal):
 1. finite (supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}))
[PROOF STEP]
using finite_supp rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P
finite (supp ?x)
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}))

goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P
finite (supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P
finite (supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}))

goal (1 subgoal):
 1. supp (distinguishing_weak_formula P Q) \<subseteq> supp P
[PROOF STEP]
unfolding distinguishing_weak_formula_def
[PROOF STATE]
proof (prove)
using this:
supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}) \<subseteq> supp P
finite (supp (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True}))

goal (1 subgoal):
 1. supp (Conj (Abs_bset {- p \<bullet> (SOME x. weak_formula x \<and> supp x \<subseteq> supp (p \<bullet> P) \<and> x distinguishes (p \<bullet> P) from (p \<bullet> Q)) |p. True})) \<subseteq> supp P
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
supp (distinguishing_weak_formula P Q) \<subseteq> supp P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma w1_lower:
  assumes s: "s < 1 / a" "0 < s"
  shows "f s (w1 s) < w1' s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
define smax where "smax \<equiv> 1 / (2 * a)"
[PROOF STATE]
proof (state)
this:
smax \<equiv> 1 / (2 * a)

goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
have "a - 1 > (1 - a * s)\<^sup>2 * s\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
have "sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) = (1 - a * s) * s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) = (1 - a * s) * s
[PROOF STEP]
using a s
[PROOF STATE]
proof (prove)
using this:
1 < a
s < 1 / a
0 < s

goal (1 subgoal):
 1. sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) = (1 - a * s) * s
[PROOF STEP]
by (auto simp: power_mult_distrib[symmetric] algebra_simps divide_simps
        split: if_split_asm)
[PROOF STATE]
proof (state)
this:
sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) = (1 - a * s) * s

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) = (1 - a * s) * s

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
have "\<dots> = (- a) * s\<^sup>2 + 1 * s + 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - a * s) * s = - a * s\<^sup>2 + 1 * s + 0
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(1 - a * s) * s = - a * s\<^sup>2 + 1 * s + 0

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - a * s) * s = - a * s\<^sup>2 + 1 * s + 0

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
have "\<dots> \<le> (1 - a * smax) * smax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a * s\<^sup>2 + 1 * s + 0 \<le> (1 - a * smax) * smax
[PROOF STEP]
apply (rule order_trans[OF quadratic_real_max_eq])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - a < 0
 2. - a * (- 1 / (2 * - a))\<^sup>2 + 1 * (- 1 / (2 * - a)) + 0 \<le> (1 - a * smax) * smax
[PROOF STEP]
using a s
[PROOF STATE]
proof (prove)
using this:
1 < a
s < 1 / a
0 < s

goal (2 subgoals):
 1. - a < 0
 2. - a * (- 1 / (2 * - a))\<^sup>2 + 1 * (- 1 / (2 * - a)) + 0 \<le> (1 - a * smax) * smax
[PROOF STEP]
by (auto simp: smax_def divide_simps algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
- a * s\<^sup>2 + 1 * s + 0 \<le> (1 - a * smax) * smax

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) \<le> (1 - a * smax) * smax
[PROOF STEP]
have "((1 - a * s)\<^sup>2 * s\<^sup>2) \<le> (1 - a * smax)\<^sup>2 * smax\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
sqrt ((1 - a * s)\<^sup>2 * s\<^sup>2) \<le> (1 - a * smax) * smax

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 \<le> (1 - a * smax)\<^sup>2 * smax\<^sup>2
[PROOF STEP]
unfolding power_mult_distrib[symmetric]
[PROOF STATE]
proof (prove)
using this:
sqrt (((1 - a * s) * s)\<^sup>2) \<le> (1 - a * smax) * smax

goal (1 subgoal):
 1. ((1 - a * s) * s)\<^sup>2 \<le> ((1 - a * smax) * smax)\<^sup>2
[PROOF STEP]
by (simp add: sqrt_le_D)
[PROOF STATE]
proof (state)
this:
(1 - a * s)\<^sup>2 * s\<^sup>2 \<le> (1 - a * smax)\<^sup>2 * smax\<^sup>2

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - a * s)\<^sup>2 * s\<^sup>2 \<le> (1 - a * smax)\<^sup>2 * smax\<^sup>2

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
have "\<dots> < a - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - a * smax)\<^sup>2 * smax\<^sup>2 < a - 1
[PROOF STEP]
using a s cond
[PROOF STATE]
proof (prove)
using this:
1 < a
s < 1 / a
0 < s
1 < 16 * a\<^sup>2 * (a - 1)

goal (1 subgoal):
 1. (1 - a * smax)\<^sup>2 * smax\<^sup>2 < a - 1
[PROOF STEP]
by (auto simp add: smax_def power2_eq_square algebra_simps  divide_simps split: if_splits)
[PROOF STATE]
proof (state)
this:
(1 - a * smax)\<^sup>2 * smax\<^sup>2 < a - 1

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1

goal (1 subgoal):
 1. (1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1

goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
[PROOF STEP]
have "s\<^sup>2 < (a - 1) / (1 - a * s)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1

goal (1 subgoal):
 1. s\<^sup>2 < (a - 1) / (1 - a * s)\<^sup>2
[PROOF STEP]
using a s
[PROOF STATE]
proof (prove)
using this:
(1 - a * s)\<^sup>2 * s\<^sup>2 < a - 1
1 < a
s < 1 / a
0 < s

goal (1 subgoal):
 1. s\<^sup>2 < (a - 1) / (1 - a * s)\<^sup>2
[PROOF STEP]
by (auto simp: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
s\<^sup>2 < (a - 1) / (1 - a * s)\<^sup>2

goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s\<^sup>2 < (a - 1) / (1 - a * s)\<^sup>2
[PROOF STEP]
have "s\<^sup>2 + (1 / (1 - a * s))\<^sup>2 < a / (1 - a * s)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
s\<^sup>2 < (a - 1) / (1 - a * s)\<^sup>2

goal (1 subgoal):
 1. s\<^sup>2 + (1 / (1 - a * s))\<^sup>2 < a / (1 - a * s)\<^sup>2
[PROOF STEP]
by (simp add: diff_divide_distrib algebra_simps power_one_over)
[PROOF STATE]
proof (state)
this:
s\<^sup>2 + (1 / (1 - a * s))\<^sup>2 < a / (1 - a * s)\<^sup>2

goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s\<^sup>2 + (1 / (1 - a * s))\<^sup>2 < a / (1 - a * s)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s\<^sup>2 + (1 / (1 - a * s))\<^sup>2 < a / (1 - a * s)\<^sup>2

goal (1 subgoal):
 1. f s (w1 s) < w1' s
[PROOF STEP]
by (simp add: w1_def w1'_def f_def)
[PROOF STATE]
proof (state)
this:
f s (w1 s) < w1' s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma algebraic_0[simp]: "algebraic 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic (0::'a)
[PROOF STEP]
unfolding algebraic_altdef_ipoly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. ipoly p (0::'a) = (0::'a) \<and> p \<noteq> 0
[PROOF STEP]
by (intro exI[of _ "[:0,1:]"], auto)


[STATEMENT]
lemma autodiff_first_derivative:
  assumes "f field_differentiable (at x)"
  shows "(f has_field_derivative First (autodiff f x)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative First (autodiff f x)) (at x)
[PROOF STEP]
by (simp add: autodiff_extract_first DERIV_deriv_iff_field_differentiable assms)


[STATEMENT]
lemma pnorm_pnorm_alt: "pnorm (pnorm_alt r) = pnorm r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pnorm (pnorm_alt r) = pnorm r
[PROOF STEP]
by (induct r) (auto simp: pnorm_def pset_pnPlus pset_pnTimes pset_pnorm_alt pnorm_alt_image_pset)


[STATEMENT]
lemma ZfunI: "(\<And>r. 0 < r \<Longrightarrow> eventually (\<lambda>x. norm (f x) < r) F) \<Longrightarrow> Zfun f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. 0 < r \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) < r) \<Longrightarrow> Zfun f F
[PROOF STEP]
by (simp add: Zfun_def)


[STATEMENT]
lemma rrb_DISJ[simp]: "finite \<Q> \<Longrightarrow> (\<forall>Q \<in> \<Q>. rrb Q) \<Longrightarrow> rrb (DISJ \<Q>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite \<Q>; \<forall>Q\<in>\<Q>. rrb Q\<rbrakk> \<Longrightarrow> rrb (DISJ \<Q>)
[PROOF STEP]
by (auto simp: rrb_def dest!: Exists_in_sub_DISJ)


[STATEMENT]
lemma focus_prod: "focus X (prod f I) = (\<Prod>i\<in>I. focus X (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. focus X (prod f I) = (\<Prod>i\<in>I. focus X (f i))
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (simp_all add: focus_times)


[STATEMENT]
lemma [simp]: "a * (1::'a N) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * 1 = a
[PROOF STEP]
by (simp add: one_N_def times_N_def Abs_N_inverse Rep_N_inverse)


[STATEMENT]
lemma dom_lookup_keys: "dom (DAList.lookup al) = keys al"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom (DAList.lookup al) = keys al
[PROOF STEP]
by transfer(simp add: dom_map_of_conv_image_fst)


[STATEMENT]
lemma (in Corps) Vr_exp_mem:"\<lbrakk>valuation K v; x \<in> carrier (Vr K v)\<rbrakk>
      \<Longrightarrow>  x^\<^bsup>K n\<^esup> \<in> carrier (Vr K v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier (Vr K v)\<rbrakk> \<Longrightarrow> x^\<^bsup>K n\<^esup> \<in> carrier (Vr K v)
[PROOF STEP]
by (frule Vr_ring[of v],
       induct_tac n, simp add:Vr_one,
       simp add:Vr_tOp_f_tOp[THEN sym, of v],
       simp add:Ring.ring_tOp_closed)


[STATEMENT]
lemma efficient_power_code:
  "efficient_power y x n =
     (if n = 0 then y
      else if n = 1 then f x y
      else if even n then efficient_power y (f x x) (n div 2)
      else efficient_power (f x y) (f x x) (n div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.efficient_power y x n = (if n = 0 then y else if n = 1 then f x y else if even n then local.efficient_power y (f x x) (n div 2) else local.efficient_power (f x y) (f x x) (n div 2))
[PROOF STEP]
by (induction y x n rule: efficient_power.induct) auto


[STATEMENT]
lemma Gromov_product_at_diff1:
  "\<bar>Gromov_product_at a x y - Gromov_product_at b x y\<bar> \<le> dist a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Gromov_product_at a x y - Gromov_product_at b x y\<bar> \<le> dist a b
[PROOF STEP]
using Gromov_product_at_diff[of a x y b x y]
[PROOF STATE]
proof (prove)
using this:
\<bar>Gromov_product_at a x y - Gromov_product_at b x y\<bar> \<le> dist a b + dist x x + dist y y

goal (1 subgoal):
 1. \<bar>Gromov_product_at a x y - Gromov_product_at b x y\<bar> \<le> dist a b
[PROOF STEP]
by auto