[STATEMENT]
lemma plus_ms_aux_MSLCons:
  "plus_ms_aux (MSLCons x xs) (MSLCons y ys) =
     (if snd x > snd y then MSLCons x (plus_ms_aux xs (MSLCons y ys))
      else if snd x < snd y then MSLCons y (plus_ms_aux (MSLCons x xs) ys)
      else MSLCons (fst x + fst y, snd x) (plus_ms_aux xs ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. plus_ms_aux (MSLCons x xs) (MSLCons y ys) = (if snd y < snd x then MSLCons x (plus_ms_aux xs (MSLCons y ys)) else if snd x < snd y then MSLCons y (plus_ms_aux (MSLCons x xs) ys) else MSLCons (fst x + fst y, snd x) (plus_ms_aux xs ys))
[PROOF STEP]
by (subst plus_ms_aux.code) simp


[STATEMENT]
theorem strong_duality_theorem_primal_sat_bounded:
  fixes bound :: "'a :: trivial_conjugatable_linordered_field"
  assumes A: "A \<in> carrier_mat nr nc"
    and b: "b \<in> carrier_vec nr"
    and c: "c \<in> carrier_vec nc"
    and sat: "\<exists> x \<in> carrier_vec nc. A *\<^sub>v x \<le> b"
    and bounded: "\<forall> x \<in> carrier_vec nc. A *\<^sub>v x \<le> b \<longrightarrow> c \<bullet> x \<le> bound"
  shows "\<exists> x y.
       x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and>
       y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = c \<and>
       c \<bullet> x = b \<bullet> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
proof (rule strong_duality_theorem_both_sat[OF A b c sat])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c
[PROOF STEP]
show "\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
hence "\<exists>y. y \<in> carrier_vec nc \<and> 0\<^sub>v nr \<le> A *\<^sub>v y \<and> 0 > y \<bullet> c"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c)

goal (1 subgoal):
 1. \<exists>y. y \<in> carrier_vec nc \<and> 0\<^sub>v nr \<le> A *\<^sub>v y \<and> y \<bullet> c < (0::'a)
[PROOF STEP]
by (subst (asm) gram_schmidt.Farkas_Lemma[OF _ c], insert A, auto)
[PROOF STATE]
proof (state)
this:
\<exists>y. y \<in> carrier_vec nc \<and> 0\<^sub>v nr \<le> A *\<^sub>v y \<and> y \<bullet> c < (0::'a)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. y \<in> carrier_vec nc \<and> 0\<^sub>v nr \<le> A *\<^sub>v y \<and> y \<bullet> c < (0::'a)
[PROOF STEP]
obtain y where y: "y \<in> carrier_vec nc"
      and Ay0: "A *\<^sub>v y \<ge> 0\<^sub>v nr" and yc0: "y \<bullet> c < 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. y \<in> carrier_vec nc \<and> 0\<^sub>v nr \<le> A *\<^sub>v y \<and> y \<bullet> c < (0::'a)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> carrier_vec nc; 0\<^sub>v nr \<le> A *\<^sub>v y; y \<bullet> c < (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec nc
0\<^sub>v nr \<le> A *\<^sub>v y
y \<bullet> c < (0::'a)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
from sat
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
obtain x where x: "x \<in> carrier_vec nc"
      and Axb: "A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> carrier_vec nc; A *\<^sub>v x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec nc
A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
define diff where "diff = bound + 1 - c \<bullet> x"
[PROOF STATE]
proof (state)
this:
diff = bound + (1::'a) - c \<bullet> x

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
from x Axb bounded
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier_vec nc
A *\<^sub>v x \<le> b
\<forall>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<longrightarrow> c \<bullet> x \<le> bound
[PROOF STEP]
have "c \<bullet> x < bound + 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc
A *\<^sub>v x \<le> b
\<forall>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<longrightarrow> c \<bullet> x \<le> bound

goal (1 subgoal):
 1. c \<bullet> x < bound + (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<bullet> x < bound + (1::'a)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
hence diff: "diff > 0"
[PROOF STATE]
proof (prove)
using this:
c \<bullet> x < bound + (1::'a)

goal (1 subgoal):
 1. (0::'a) < diff
[PROOF STEP]
unfolding diff_def
[PROOF STATE]
proof (prove)
using this:
c \<bullet> x < bound + (1::'a)

goal (1 subgoal):
 1. (0::'a) < bound + (1::'a) - c \<bullet> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) < diff

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
from yc0
[PROOF STATE]
proof (chain)
picking this:
y \<bullet> c < (0::'a)
[PROOF STEP]
have inv: "inverse (- (y \<bullet> c)) > 0"
[PROOF STATE]
proof (prove)
using this:
y \<bullet> c < (0::'a)

goal (1 subgoal):
 1. (0::'a) < inverse (- (y \<bullet> c))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) < inverse (- (y \<bullet> c))

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
define fact where "fact = diff * (inverse (- (y \<bullet> c)))"
[PROOF STATE]
proof (state)
this:
fact = diff * inverse (- (y \<bullet> c))

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have fact: "fact > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < fact
[PROOF STEP]
unfolding fact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < diff * inverse (- (y \<bullet> c))
[PROOF STEP]
using diff inv
[PROOF STATE]
proof (prove)
using this:
(0::'a) < diff
(0::'a) < inverse (- (y \<bullet> c))

goal (1 subgoal):
 1. (0::'a) < diff * inverse (- (y \<bullet> c))
[PROOF STEP]
by (metis mult_pos_pos)
[PROOF STATE]
proof (state)
this:
(0::'a) < fact

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
define z where "z = x - fact \<cdot>\<^sub>v y"
[PROOF STATE]
proof (state)
this:
z = x - fact \<cdot>\<^sub>v y

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "A *\<^sub>v z = A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v z = A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y)
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (x - fact \<cdot>\<^sub>v y) = A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y)
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v (x - fact \<cdot>\<^sub>v y) = A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y)
[PROOF STEP]
by (meson mult_minus_distrib_mat_vec smult_carrier_vec)
[PROOF STATE]
proof (state)
this:
A *\<^sub>v z = A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v z = A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y) = A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)
[PROOF STEP]
using A y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y) = A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y) = A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x - A *\<^sub>v (fact \<cdot>\<^sub>v y) = A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<le> b
[PROOF STEP]
proof (intro lesseq_vecI[OF _ b])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<in> carrier_vec nr
 2. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
show "A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<in> carrier_vec nr
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<in> carrier_vec nr

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
assume i: "i < nr"
[PROOF STATE]
proof (state)
this:
i < nr

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
have "(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i
        = (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i = (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i
[PROOF STEP]
using i A x y
[PROOF STATE]
proof (prove)
using this:
i < nr
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i = (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i = (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i = (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
have "\<dots> \<le> b $ i - fact * (A *\<^sub>v y) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - fact * (A *\<^sub>v y) $ i
[PROOF STEP]
using lesseq_vecD[OF b Axb i]
[PROOF STATE]
proof (prove)
using this:
(A *\<^sub>v x) $ i \<le> b $ i

goal (1 subgoal):
 1. (A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - fact * (A *\<^sub>v y) $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - fact * (A *\<^sub>v y) $ i

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x) $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - fact * (A *\<^sub>v y) $ i

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
have "\<dots> \<le> b $ i - 0 * 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - (0::'a) * (0::'a)
[PROOF STEP]
using lesseq_vecD[OF _ Ay0 i] fact A y i
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v y \<in> carrier_vec nr \<Longrightarrow> 0\<^sub>v nr $ i \<le> (A *\<^sub>v y) $ i
(0::'a) < fact
A \<in> carrier_mat nr nc
y \<in> carrier_vec nc
i < nr

goal (1 subgoal):
 1. b $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - (0::'a) * (0::'a)
[PROOF STEP]
by (intro diff_left_mono mult_monom, auto)
[PROOF STATE]
proof (state)
this:
b $ i - fact * (A *\<^sub>v y) $ i \<le> b $ i - (0::'a) * (0::'a)

goal (1 subgoal):
 1. \<And>i. i < nr \<Longrightarrow> (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i - (0::'a) * (0::'a)
[PROOF STEP]
show "(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i"
[PROOF STATE]
proof (prove)
using this:
(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i - (0::'a) * (0::'a)

goal (1 subgoal):
 1. (A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y)) $ i \<le> b $ i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x - fact \<cdot>\<^sub>v (A *\<^sub>v y) \<le> b

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v z \<le> b
[PROOF STEP]
have Azb: "A *\<^sub>v z \<le> b"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v z \<le> b

goal (1 subgoal):
 1. A *\<^sub>v z \<le> b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A *\<^sub>v z \<le> b

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have z: "z \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> carrier_vec nc
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. z \<in> carrier_vec nc
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. x - fact \<cdot>\<^sub>v y \<in> carrier_vec nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> carrier_vec nc

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "c \<bullet> z = c \<bullet> x - fact * (c \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> z = c \<bullet> x - fact * (c \<bullet> y)
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> (x - fact \<cdot>\<^sub>v y) = c \<bullet> x - fact * (c \<bullet> y)
[PROOF STEP]
using c x y
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc
x \<in> carrier_vec nc
y \<in> carrier_vec nc

goal (1 subgoal):
 1. c \<bullet> (x - fact \<cdot>\<^sub>v y) = c \<bullet> x - fact * (c \<bullet> y)
[PROOF STEP]
by (simp add: scalar_prod_minus_distrib)
[PROOF STATE]
proof (state)
this:
c \<bullet> z = c \<bullet> x - fact * (c \<bullet> y)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c \<bullet> z = c \<bullet> x - fact * (c \<bullet> y)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = c \<bullet> x + diff"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> x - fact * (c \<bullet> y) = c \<bullet> x + diff
[PROOF STEP]
unfolding comm_scalar_prod[OF c y] fact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> x - diff * inverse (- (y \<bullet> c)) * (y \<bullet> c) = c \<bullet> x + diff
[PROOF STEP]
using yc0
[PROOF STATE]
proof (prove)
using this:
y \<bullet> c < (0::'a)

goal (1 subgoal):
 1. c \<bullet> x - diff * inverse (- (y \<bullet> c)) * (y \<bullet> c) = c \<bullet> x + diff
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c \<bullet> x - fact * (c \<bullet> y) = c \<bullet> x + diff

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c \<bullet> x - fact * (c \<bullet> y) = c \<bullet> x + diff

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = bound + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> x + diff = bound + (1::'a)
[PROOF STEP]
unfolding diff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> x + (bound + (1::'a) - c \<bullet> x) = bound + (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c \<bullet> x + diff = bound + (1::'a)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c \<bullet> x + diff = bound + (1::'a)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> > c \<bullet> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> z < bound + (1::'a)
[PROOF STEP]
using bounded Azb z
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<longrightarrow> c \<bullet> x \<le> bound
A *\<^sub>v z \<le> b
z \<in> carrier_vec nc

goal (1 subgoal):
 1. c \<bullet> z < bound + (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<bullet> z < bound + (1::'a)

goal (1 subgoal):
 1. \<not> (\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
c \<bullet> z < c \<bullet> z
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
c \<bullet> z < c \<bullet> z

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma design_iso_points_index_eq:
  assumes "ps \<subseteq> \<V>"
  shows "\<B> index ps = \<B>' index (\<pi> ` ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B> index ps = \<B>' index \<pi> ` ps
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<B> index ps = \<B>' index \<pi> ` ps
[PROOF STEP]
have "\<And> b . b \<in># \<B> \<Longrightarrow> ((ps \<subseteq> b) = ((\<pi> ` ps) \<subseteq> \<pi> ` b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in># \<B> \<Longrightarrow> (ps \<subseteq> b) = (\<pi> ` ps \<subseteq> \<pi> ` b)
[PROOF STEP]
using iso_point_subset_block_iff assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<subseteq> \<V>; ?bl \<in># \<B>\<rbrakk> \<Longrightarrow> (?p \<subseteq> ?bl) = (\<pi> ` ?p \<subseteq> \<pi> ` ?bl)
ps \<subseteq> \<V>

goal (1 subgoal):
 1. \<And>b. b \<in># \<B> \<Longrightarrow> (ps \<subseteq> b) = (\<pi> ` ps \<subseteq> \<pi> ` b)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?b \<in># \<B> \<Longrightarrow> (ps \<subseteq> ?b) = (\<pi> ` ps \<subseteq> \<pi> ` ?b)

goal (1 subgoal):
 1. \<B> index ps = \<B>' index \<pi> ` ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?b \<in># \<B> \<Longrightarrow> (ps \<subseteq> ?b) = (\<pi> ` ps \<subseteq> \<pi> ` ?b)
[PROOF STEP]
have "{#b \<in># \<B> . ps \<subseteq> b#} = {#b \<in># \<B> . (\<pi> ` ps) \<subseteq> (\<pi> ` b)#}"
[PROOF STATE]
proof (prove)
using this:
?b \<in># \<B> \<Longrightarrow> (ps \<subseteq> ?b) = (\<pi> ` ps \<subseteq> \<pi> ` ?b)

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) ps) \<B> = {#b \<in># \<B>. \<pi> ` ps \<subseteq> \<pi> ` b#}
[PROOF STEP]
using assms filter_mset_cong
[PROOF STATE]
proof (prove)
using this:
?b \<in># \<B> \<Longrightarrow> (ps \<subseteq> ?b) = (\<pi> ` ps \<subseteq> \<pi> ` ?b)
ps \<subseteq> \<V>
\<lbrakk>?M = ?M'; \<And>a. a \<in># ?M \<Longrightarrow> ?P a = ?Q a\<rbrakk> \<Longrightarrow> filter_mset ?P ?M = filter_mset ?Q ?M

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) ps) \<B> = {#b \<in># \<B>. \<pi> ` ps \<subseteq> \<pi> ` b#}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
filter_mset ((\<subseteq>) ps) \<B> = {#b \<in># \<B>. \<pi> ` ps \<subseteq> \<pi> ` b#}

goal (1 subgoal):
 1. \<B> index ps = \<B>' index \<pi> ` ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filter_mset ((\<subseteq>) ps) \<B> = {#b \<in># \<B>. \<pi> ` ps \<subseteq> \<pi> ` b#}
[PROOF STEP]
have "{#b \<in># \<B>' . \<pi> ` ps \<subseteq> b#} = image_mset ((`) \<pi>) {#b \<in># \<B> . ps \<subseteq> b#}"
[PROOF STATE]
proof (prove)
using this:
filter_mset ((\<subseteq>) ps) \<B> = {#b \<in># \<B>. \<pi> ` ps \<subseteq> \<pi> ` b#}

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) (\<pi> ` ps)) \<B>' = image_mset ((`) \<pi>) (filter_mset ((\<subseteq>) ps) \<B>)
[PROOF STEP]
by (simp add: image_mset_filter_swap block_img)
[PROOF STATE]
proof (state)
this:
filter_mset ((\<subseteq>) (\<pi> ` ps)) \<B>' = image_mset ((`) \<pi>) (filter_mset ((\<subseteq>) ps) \<B>)

goal (1 subgoal):
 1. \<B> index ps = \<B>' index \<pi> ` ps
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
filter_mset ((\<subseteq>) (\<pi> ` ps)) \<B>' = image_mset ((`) \<pi>) (filter_mset ((\<subseteq>) ps) \<B>)

goal (1 subgoal):
 1. \<B> index ps = \<B>' index \<pi> ` ps
[PROOF STEP]
by (simp add: points_index_def)
[PROOF STATE]
proof (state)
this:
\<B> index ps = \<B>' index \<pi> ` ps

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_col_of_dagger [simp]:
  "dim_col (M\<^sup>\<dagger>) = dim_row M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col M\<^sup>\<dagger> = dim_row M
[PROOF STEP]
using dagger_def
[PROOF STATE]
proof (prove)
using this:
?M\<^sup>\<dagger> \<equiv> mat (dim_col ?M) (dim_row ?M) (\<lambda>(i, j). cnj (?M $$ (j, i)))

goal (1 subgoal):
 1. dim_col M\<^sup>\<dagger> = dim_row M
[PROOF STEP]
by simp


[STATEMENT]
lemma (in Module) mr_cos_sprod_assoc:"\<lbrakk>submodule R M H; a \<in> carrier R;
 b \<in> carrier R; X \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow> mr_cos_sprod  M H (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) X =
                           mr_cos_sprod M H a (mr_cos_sprod M H b X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; a \<in> carrier R; b \<in> carrier R; X \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow> mr_cos_sprod M H (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) X = mr_cos_sprod M H a (mr_cos_sprod M H b X)
[PROOF STEP]
apply (simp add:set_mr_cos_def, erule bexE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>submodule R M H; a \<in> carrier R; b \<in> carrier R; aa \<in> carrier M; X = aa \<uplus>\<^bsub>M\<^esub> H\<rbrakk> \<Longrightarrow> mr_cos_sprod M H (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) (aa \<uplus>\<^bsub>M\<^esub> H) = mr_cos_sprod M H a (mr_cos_sprod M H b (aa \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (frule_tac m = aa in sc_mem [of b], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>submodule R M H; a \<in> carrier R; b \<in> carrier R; aa \<in> carrier M; X = aa \<uplus>\<^bsub>M\<^esub> H; b \<cdot>\<^sub>s aa \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) (aa \<uplus>\<^bsub>M\<^esub> H) = mr_cos_sprod M H a (mr_cos_sprod M H b (aa \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (cut_tac sc_Ring,
        frule Ring.ring_tOp_closed [of "R" "a" "b"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>submodule R M H; a \<in> carrier R; b \<in> carrier R; aa \<in> carrier M; X = aa \<uplus>\<^bsub>M\<^esub> H; b \<cdot>\<^sub>s aa \<in> carrier M; Ring R; a \<cdot>\<^sub>r\<^bsub>R\<^esub> b \<in> carrier R\<rbrakk> \<Longrightarrow> mr_cos_sprod M H (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) (aa \<uplus>\<^bsub>M\<^esub> H) = mr_cos_sprod M H a (mr_cos_sprod M H b (aa \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (subst mr_cos_sprodTr, assumption+)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>submodule R M H; a \<in> carrier R; b \<in> carrier R; aa \<in> carrier M; X = aa \<uplus>\<^bsub>M\<^esub> H; b \<cdot>\<^sub>s aa \<in> carrier M; Ring R; a \<cdot>\<^sub>r\<^bsub>R\<^esub> b \<in> carrier R\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>r\<^bsub>R\<^esub> b) \<cdot>\<^sub>s aa \<uplus>\<^bsub>M\<^esub> H = a \<cdot>\<^sub>s (b \<cdot>\<^sub>s aa) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add: sc_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma multiplicity_prime_1_plus_i_aux: "multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
proof (cases "c = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
case [simp]: False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
have "2 * multiplicity 2 c = multiplicity 2 (c ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * multiplicity 2 c = multiplicity 2 (c\<^sup>2)
[PROOF STEP]
by (simp add: prime_elem_multiplicity_power_distrib)
[PROOF STATE]
proof (state)
this:
2 * multiplicity 2 c = multiplicity 2 (c\<^sup>2)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * multiplicity 2 c = multiplicity 2 (c\<^sup>2)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
have "multiplicity 2 (c ^ 2) = multiplicity (of_nat 2) (of_nat c ^ 2 :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity 2 (c\<^sup>2) = multiplicity (of_nat 2) ((of_nat c)\<^sup>2)
[PROOF STEP]
by (simp flip: multiplicity_gauss_int_of_nat)
[PROOF STATE]
proof (state)
this:
multiplicity 2 (c\<^sup>2) = multiplicity (of_nat 2) ((of_nat c)\<^sup>2)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity 2 (c\<^sup>2) = multiplicity (of_nat 2) ((of_nat c)\<^sup>2)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
have "of_nat 2 = (-\<i>\<^sub>\<int>) * (1 + \<i>\<^sub>\<int>) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat 2 = - \<i>\<^sub>\<int> * (1 + \<i>\<^sub>\<int>)\<^sup>2
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
of_nat 2 = - \<i>\<^sub>\<int> * (1 + \<i>\<^sub>\<int>)\<^sup>2

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat 2 = - \<i>\<^sub>\<int> * (1 + \<i>\<^sub>\<int>)\<^sup>2

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
have "multiplicity \<dots> (of_nat c ^ 2) = multiplicity ((1 + \<i>\<^sub>\<int>) ^ 2) (of_nat c ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity (- \<i>\<^sub>\<int> * (1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2) = multiplicity ((1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2)
[PROOF STEP]
by (subst multiplicity_times_unit_left) auto
[PROOF STATE]
proof (state)
this:
multiplicity (- \<i>\<^sub>\<int> * (1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2) = multiplicity ((1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity (- \<i>\<^sub>\<int> * (1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2) = multiplicity ((1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
have "\<dots> = multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity ((1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2) = multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c)
[PROOF STEP]
by (subst multiplicity_power_power) auto
[PROOF STATE]
proof (state)
this:
multiplicity ((1 + \<i>\<^sub>\<int>)\<^sup>2) ((of_nat c)\<^sup>2) = multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c)

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
 2. c \<noteq> 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * multiplicity 2 c = multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * multiplicity 2 c = multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c)

goal (1 subgoal):
 1. multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c

goal (1 subgoal):
 1. c = 0 \<Longrightarrow> multiplicity (1 + \<i>\<^sub>\<int>) (of_nat c) = 2 * multiplicity 2 c
[PROOF STEP]
qed auto


[STATEMENT]
lemma abs_div_2_less: "a \<noteq> 0 \<Longrightarrow> a \<noteq> -1 \<Longrightarrow> \<bar>(a::int) div 2\<bar> < \<bar>a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> 0; a \<noteq> - 1\<rbrakk> \<Longrightarrow> \<bar>a div 2\<bar> < \<bar>a\<bar>
[PROOF STEP]
by arith


[STATEMENT]
lemma lstrict_prefix_lfinite1: "lstrict_prefix xs ys \<Longrightarrow> lfinite xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lstrict_prefix xs ys \<Longrightarrow> lfinite xs
[PROOF STEP]
by (metis lstrict_prefix_def not_lfinite_lprefix_conv_eq)


[STATEMENT]
lemma monomials_liftPoly: "monomials (liftPoly b i mp) = lowerPowers b i ` (monomials mp) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomials (liftPoly b i mp) = lowerPowers b i ` monomials mp
[PROOF STEP]
using keys_higherPoly\<^sub>0
[PROOF STATE]
proof (prove)
using this:
keys (higherPoly\<^sub>0 ?b ?i ?mp) = lowerPowers ?b ?i ` keys ?mp

goal (1 subgoal):
 1. monomials (liftPoly b i mp) = lowerPowers b i ` monomials mp
[PROOF STEP]
by (simp add: keys_higherPoly\<^sub>0 liftPoly.rep_eq monomials.rep_eq)


[STATEMENT]
lemma path_image_part_circlepath_same_Re:
  assumes "0 \<le> b" "b \<le> pi" "a = -b" "r \<ge> 0"
  shows   "path_image (part_circlepath c r a b) = sphere c r \<inter> {s. Re s \<ge> Re c + r * cos a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (part_circlepath c r a b) = sphere c r \<inter> {s. Re c + r * cos a \<le> Re s}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> x \<in> sphere c r
 2. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> Re c + r * cos a \<le> Re x
 3. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> x \<in> sphere c r
 2. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> Re c + r * cos a \<le> Re x
 3. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
assume "z \<in> path_image (part_circlepath c r a b)"
[PROOF STATE]
proof (state)
this:
z \<in> path_image (part_circlepath c r a b)

goal (3 subgoals):
 1. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> x \<in> sphere c r
 2. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> Re c + r * cos a \<le> Re x
 3. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
obtain t where t: "t \<in> {a..b}" "z = c + of_real r * cis t"
[PROOF STATE]
proof (prove)
using this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
z \<in> path_image (part_circlepath c r a b)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> {a..b}; z = c + complex_of_real r * cis t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: path_image_part_circlepath exp_eq_polar)
[PROOF STATE]
proof (state)
this:
t \<in> {a..b}
z = c + complex_of_real r * cis t

goal (3 subgoals):
 1. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> x \<in> sphere c r
 2. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> Re c + r * cos a \<le> Re x
 3. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
from t and assms
[PROOF STATE]
proof (chain)
picking this:
t \<in> {a..b}
z = c + complex_of_real r * cis t
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
[PROOF STEP]
show "z \<in> sphere c r"
[PROOF STATE]
proof (prove)
using this:
t \<in> {a..b}
z = c + complex_of_real r * cis t
0 \<le> b
b \<le> pi
a = - b
0 \<le> r

goal (1 subgoal):
 1. z \<in> sphere c r
[PROOF STEP]
by (auto simp: dist_norm norm_mult)
[PROOF STATE]
proof (state)
this:
z \<in> sphere c r

goal (2 subgoals):
 1. \<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> Re c + r * cos a \<le> Re x
 2. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
from t and assms
[PROOF STATE]
proof (chain)
picking this:
t \<in> {a..b}
z = c + complex_of_real r * cis t
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
[PROOF STEP]
show "Re z \<ge> Re c + r * cos a"
[PROOF STATE]
proof (prove)
using this:
t \<in> {a..b}
z = c + complex_of_real r * cis t
0 \<le> b
b \<le> pi
a = - b
0 \<le> r

goal (1 subgoal):
 1. Re c + r * cos a \<le> Re z
[PROOF STEP]
using cos_monotone_0_pi_le[of t b] cos_monotone_minus_pi_0'[of a t]
[PROOF STATE]
proof (prove)
using this:
t \<in> {a..b}
z = c + complex_of_real r * cis t
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
\<lbrakk>0 \<le> t; t \<le> b; b \<le> pi\<rbrakk> \<Longrightarrow> cos b \<le> cos t
\<lbrakk>- pi \<le> a; a \<le> t; t \<le> 0\<rbrakk> \<Longrightarrow> cos a \<le> cos t

goal (1 subgoal):
 1. Re c + r * cos a \<le> Re z
[PROOF STEP]
by (cases "t \<ge> 0") (auto intro!: mult_left_mono)
[PROOF STATE]
proof (state)
this:
Re c + r * cos a \<le> Re z

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
assume z: "z \<in> sphere c r" "Re z \<ge> Re c + r * cos a"
[PROOF STATE]
proof (state)
this:
z \<in> sphere c r
Re c + r * cos a \<le> Re z

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> sphere c r; Re c + r * cos a \<le> Re x\<rbrakk> \<Longrightarrow> x \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
show "z \<in> path_image (part_circlepath c r a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
proof (cases "r = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<noteq> 0

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
r \<noteq> 0
[PROOF STEP]
have r: "r > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
r \<noteq> 0

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

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
with z
[PROOF STATE]
proof (chain)
picking this:
z \<in> sphere c r
Re c + r * cos a \<le> Re z
0 < r
[PROOF STEP]
have z_eq: "z = c + r * cis (Arg (z - c))"
[PROOF STATE]
proof (prove)
using this:
z \<in> sphere c r
Re c + r * cos a \<le> Re z
0 < r

goal (1 subgoal):
 1. z = c + complex_of_real r * cis (Arg (z - c))
[PROOF STEP]
using Arg_eq[of "z - c"]
[PROOF STATE]
proof (prove)
using this:
z \<in> sphere c r
Re c + r * cos a \<le> Re z
0 < r
z - c \<noteq> 0 \<Longrightarrow> z - c = complex_of_real (cmod (z - c)) * exp (\<i> * complex_of_real (Arg (z - c)))

goal (1 subgoal):
 1. z = c + complex_of_real r * cis (Arg (z - c))
[PROOF STEP]
by (auto simp: dist_norm exp_eq_polar norm_minus_commute)
[PROOF STATE]
proof (state)
this:
z = c + complex_of_real r * cis (Arg (z - c))

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z = c + complex_of_real r * cis (Arg (z - c))

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
from z(2) r assms
[PROOF STATE]
proof (chain)
picking this:
Re c + r * cos a \<le> Re z
0 < r
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
[PROOF STEP]
have "cos b \<le> cos (Arg (z - c))"
[PROOF STATE]
proof (prove)
using this:
Re c + r * cos a \<le> Re z
0 < r
0 \<le> b
b \<le> pi
a = - b
0 \<le> r

goal (1 subgoal):
 1. cos b \<le> cos (Arg (z - c))
[PROOF STEP]
by (subst (asm) z_eq) auto
[PROOF STATE]
proof (state)
this:
cos b \<le> cos (Arg (z - c))

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
cos b \<le> cos (Arg (z - c))
[PROOF STEP]
have "Arg (z - c) \<in> {-b..b}"
[PROOF STATE]
proof (prove)
using this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
cos b \<le> cos (Arg (z - c))

goal (1 subgoal):
 1. Arg (z - c) \<in> {- b..b}
[PROOF STEP]
using Arg_le_pi[of "z - c"] mpi_less_Arg[of "z - c"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> b
b \<le> pi
a = - b
0 \<le> r
cos b \<le> cos (Arg (z - c))
Arg (z - c) \<le> pi
- pi < Arg (z - c)

goal (1 subgoal):
 1. Arg (z - c) \<in> {- b..b}
[PROOF STEP]
by (intro cos_geD) auto
[PROOF STATE]
proof (state)
this:
Arg (z - c) \<in> {- b..b}

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
 2. r \<noteq> 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z = c + complex_of_real r * cis (Arg (z - c))
Arg (z - c) \<in> {- b..b}
[PROOF STEP]
show "z \<in> path_image (part_circlepath c r a b)"
[PROOF STATE]
proof (prove)
using this:
z = c + complex_of_real r * cis (Arg (z - c))
Arg (z - c) \<in> {- b..b}

goal (1 subgoal):
 1. z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z = c + complex_of_real r * cis (Arg (z - c))
Arg (z - c) \<in> {- b..b}
0 \<le> b
b \<le> pi
a = - b
0 \<le> r

goal (1 subgoal):
 1. z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
by (subst path_image_part_circlepath) (auto simp: exp_eq_polar)
[PROOF STATE]
proof (state)
this:
z \<in> path_image (part_circlepath c r a b)

goal (1 subgoal):
 1. r = 0 \<Longrightarrow> z \<in> path_image (part_circlepath c r a b)
[PROOF STEP]
qed (insert assms z, auto simp: path_image_part_circlepath)
[PROOF STATE]
proof (state)
this:
z \<in> path_image (part_circlepath c r a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_uminus_mat[simp]: "- (- (A::'a:: group_add mat)) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- A) = A
[PROOF STEP]
by auto


[STATEMENT]
lemma square_integrable_trigonometric_set:
   "(trigonometric_set i) square_integrable {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trigonometric_set i square_integrable {- pi..pi}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trigonometric_set i square_integrable {- pi..pi}
[PROOF STEP]
have "continuous_on {-pi..pi} (\<lambda>x. sin ((1 + real n) * x) / sqrt pi)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {- pi..pi} (\<lambda>x. sin ((1 + real n) * x) / sqrt pi)
[PROOF STEP]
by (intro continuous_intros) auto
[PROOF STATE]
proof (state)
this:
continuous_on {- pi..pi} (\<lambda>x. sin ((1 + real ?n) * x) / sqrt pi)

goal (1 subgoal):
 1. trigonometric_set i square_integrable {- pi..pi}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on {- pi..pi} (\<lambda>x. sin ((1 + real ?n) * x) / sqrt pi)

goal (1 subgoal):
 1. trigonometric_set i square_integrable {- pi..pi}
[PROOF STEP]
have "continuous_on {-pi..pi} (\<lambda>x. cos (real i * x / 2) / sqrt pi) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {- pi..pi} (\<lambda>x. cos (real i * x / 2) / sqrt pi)
[PROOF STEP]
by (intro continuous_intros) auto
[PROOF STATE]
proof (state)
this:
continuous_on {- pi..pi} (\<lambda>x. cos (real i * x / 2) / sqrt pi)

goal (1 subgoal):
 1. trigonometric_set i square_integrable {- pi..pi}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on {- pi..pi} (\<lambda>x. sin ((1 + real ?n) * x) / sqrt pi)
continuous_on {- pi..pi} (\<lambda>x. cos (real i * x / 2) / sqrt pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on {- pi..pi} (\<lambda>x. sin ((1 + real ?n) * x) / sqrt pi)
continuous_on {- pi..pi} (\<lambda>x. cos (real i * x / 2) / sqrt pi)

goal (1 subgoal):
 1. trigonometric_set i square_integrable {- pi..pi}
[PROOF STEP]
by (simp add: trigonometric_set_def)
[PROOF STATE]
proof (state)
this:
trigonometric_set i square_integrable {- pi..pi}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subseteq_union_transl [trans]: "\<lbrakk>A \<subseteq> B; B \<union> C \<subseteq> D\<rbrakk> \<Longrightarrow> A \<union> C \<subseteq> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; B \<union> C \<subseteq> D\<rbrakk> \<Longrightarrow> A \<union> C \<subseteq> D
[PROOF STEP]
by blast


[STATEMENT]
lemma intersection_is_univ_semialgebraic:
  assumes "is_univ_semialgebraic A"
  assumes "is_univ_semialgebraic B"
  shows "is_univ_semialgebraic (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_univ_semialgebraic (A \<inter> B)
[PROOF STEP]
using assms intersection_is_semialg[of 1 "((\<lambda>a. [a]) ` A)" "((\<lambda>a. [a]) ` B)"]
[PROOF STATE]
proof (prove)
using this:
is_univ_semialgebraic A
is_univ_semialgebraic B
\<lbrakk>is_semialgebraic 1 ((\<lambda>a. [a]) ` A); is_semialgebraic 1 ((\<lambda>a. [a]) ` B)\<rbrakk> \<Longrightarrow> is_semialgebraic 1 ((\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B)

goal (1 subgoal):
 1. is_univ_semialgebraic (A \<inter> B)
[PROOF STEP]
unfolding is_univ_semialgebraic_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier Q\<^sub>p \<and> is_semialgebraic 1 ((\<lambda>a. [a]) ` A)
B \<subseteq> carrier Q\<^sub>p \<and> is_semialgebraic 1 ((\<lambda>a. [a]) ` B)
\<lbrakk>is_semialgebraic 1 ((\<lambda>a. [a]) ` A); is_semialgebraic 1 ((\<lambda>a. [a]) ` B)\<rbrakk> \<Longrightarrow> is_semialgebraic 1 ((\<lambda>a. [a]) ` A \<inter> (\<lambda>a. [a]) ` B)

goal (1 subgoal):
 1. A \<inter> B \<subseteq> carrier Q\<^sub>p \<and> is_semialgebraic 1 ((\<lambda>a. [a]) ` (A \<inter> B))
[PROOF STEP]
by (metis le_infI1 Qp.to_R1_intersection)


[STATEMENT]
lemma lm004:
  assumes "\<forall>x \<in> X. f x \<in> x"
  shows "isChoice (graph X f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isChoice (graph X f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>X. f x \<in> x

goal (1 subgoal):
 1. isChoice (graph X f)
[PROOF STEP]
by (metis Image_within_domain' empty_subsetI insert_subset graphEqImage domainOfGraph
            runiq_wrt_eval_rel subset_trans)


[STATEMENT]
lemma PiE_fun_upd: "y \<in> T x \<Longrightarrow> f \<in> Pi\<^sub>E S T \<Longrightarrow> f(x := y) \<in> Pi\<^sub>E (insert x S) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> T x; f \<in> Pi\<^sub>E S T\<rbrakk> \<Longrightarrow> f(x := y) \<in> Pi\<^sub>E (insert x S) T
[PROOF STEP]
unfolding PiE_def extensional_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> T x; f \<in> Pi S T \<inter> {f. \<forall>x. x \<notin> S \<longrightarrow> f x = undefined}\<rbrakk> \<Longrightarrow> f(x := y) \<in> Pi (insert x S) T \<inter> {f. \<forall>xa. xa \<notin> insert x S \<longrightarrow> f xa = undefined}
[PROOF STEP]
by auto


[STATEMENT]
lemma evimage_Un [simp]: "f \<inverse>\<^bsub>n\<^esub> (A \<union> B) = (f \<inverse>\<^bsub>n\<^esub> A) \<union> (f \<inverse>\<^bsub>n\<^esub> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<inverse>\<^bsub>n\<^esub> (A \<union> B) = f \<inverse>\<^bsub>n\<^esub> A \<union> f \<inverse>\<^bsub>n\<^esub> B
[PROOF STEP]
unfolding evimage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` (A \<union> B) \<inter> carrier (R\<^bsup>n\<^esup>) = f -` A \<inter> carrier (R\<^bsup>n\<^esup>) \<union> f -` B \<inter> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma ereal_SUP_not_infty:
  fixes f :: "_ \<Rightarrow> ereal"
  shows "A \<noteq> {} \<Longrightarrow> l \<noteq> -\<infinity> \<Longrightarrow> u \<noteq> \<infinity> \<Longrightarrow> \<forall>a\<in>A. l \<le> f a \<and> f a \<le> u \<Longrightarrow> \<bar>Sup (f ` A)\<bar> \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; l \<noteq> - \<infinity>; u \<noteq> \<infinity>; \<forall>a\<in>A. l \<le> f a \<and> f a \<le> u\<rbrakk> \<Longrightarrow> \<bar>Sup (f ` A)\<bar> \<noteq> \<infinity>
[PROOF STEP]
using SUP_upper2[of _ A l f] SUP_least[of A f u]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> A; l \<le> f ?i\<rbrakk> \<Longrightarrow> l \<le> Sup (f ` A)
(\<And>i. i \<in> A \<Longrightarrow> f i \<le> u) \<Longrightarrow> Sup (f ` A) \<le> u

goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; l \<noteq> - \<infinity>; u \<noteq> \<infinity>; \<forall>a\<in>A. l \<le> f a \<and> f a \<le> u\<rbrakk> \<Longrightarrow> \<bar>Sup (f ` A)\<bar> \<noteq> \<infinity>
[PROOF STEP]
by (cases "Sup (f ` A)") auto


[STATEMENT]
lemma ge_game_eq: "ge_game (G, H) = (\<forall> x. (zin x (right_options G) \<longrightarrow> \<not> ge_game (H, x)) \<and> (zin x (left_options H) \<longrightarrow> \<not> ge_game (x, G)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ge_game (G, H) = (\<forall>x. (zin x (right_options G) \<longrightarrow> \<not> ge_game (H, x)) \<and> (zin x (left_options H) \<longrightarrow> \<not> ge_game (x, G)))
[PROOF STEP]
apply (subst ge_game.simps[where G=G and H=H])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. if zin x (right_options G) then if zin x (left_options H) then \<not> (ge_game (H, x) \<or> ge_game (x, G)) else \<not> ge_game (H, x) else if zin x (left_options H) then \<not> ge_game (x, G) else True) = (\<forall>x. (zin x (right_options G) \<longrightarrow> \<not> ge_game (H, x)) \<and> (zin x (left_options H) \<longrightarrow> \<not> ge_game (x, G)))
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma at_map_inf_pres: "at_map (x \<sqinter> y) = at_map x \<sqinter> at_map y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_map (x \<sqinter> y) = at_map x \<sqinter> at_map y
[PROOF STEP]
unfolding at_map_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_atoms (atom_map (x \<sqinter> y)) = Abs_atoms (atom_map x) \<sqinter> Abs_atoms (atom_map y)
[PROOF STEP]
by (metis (mono_tags, lifting) Abs_atoms_inverse atom_map_inf_pres inf_atoms.transfer rangeI)


[STATEMENT]
lemma real_root_pos_unique: "0 < n \<Longrightarrow> 0 \<le> y \<Longrightarrow> y ^ n = x \<Longrightarrow> root n x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; 0 \<le> y; y ^ n = x\<rbrakk> \<Longrightarrow> root n x = y
[PROOF STEP]
using root_sgn_power[of n y]
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> root n (sgn y * \<bar>y\<bar> ^ n) = y

goal (1 subgoal):
 1. \<lbrakk>0 < n; 0 \<le> y; y ^ n = x\<rbrakk> \<Longrightarrow> root n x = y
[PROOF STEP]
by (auto simp add: le_less power_0_left)


[STATEMENT]
lemma mat_arc_pos_mat_default:
  assumes n0: "n > 0" shows "mat_arc_pos (mat_default default n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_arc_pos (default\<^sub>m default n)
[PROOF STEP]
unfolding mat_arc_posI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc_pos (default\<^sub>m default n $$ (0, 0))
[PROOF STEP]
unfolding mat_default_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc_pos (mat n n (\<lambda>(i, j). if i = j then default else (0::'a)) $$ (0, 0))
[PROOF STEP]
unfolding index_mat(1)[OF n0 n0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc_pos (case (0, 0) of (i, j) \<Rightarrow> if i = j then default else (0::'a))
[PROOF STEP]
using arc_pos_default
[PROOF STATE]
proof (prove)
using this:
arc_pos default

goal (1 subgoal):
 1. arc_pos (case (0, 0) of (i, j) \<Rightarrow> if i = j then default else (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
theorem sum_over_product:
    "O y z \<Longrightarrow> x \<oplus> (y \<otimes> z) = (x \<oplus> y) \<otimes> (x \<oplus> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O y z \<Longrightarrow> x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. O y z \<Longrightarrow> x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
assume "O y z"
[PROOF STATE]
proof (state)
this:
O y z

goal (1 subgoal):
 1. O y z \<Longrightarrow> x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
hence "P (x \<oplus> (y \<otimes> z)) ((x \<oplus> y) \<otimes> (x \<oplus> z))"
[PROOF STATE]
proof (prove)
using this:
O y z

goal (1 subgoal):
 1. P (x \<oplus> y \<otimes> z) ((x \<oplus> y) \<otimes> (x \<oplus> z))
[PROOF STEP]
by (rule sum_over_product_left)
[PROOF STATE]
proof (state)
this:
P (x \<oplus> y \<otimes> z) ((x \<oplus> y) \<otimes> (x \<oplus> z))

goal (1 subgoal):
 1. O y z \<Longrightarrow> x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P (x \<oplus> y \<otimes> z) ((x \<oplus> y) \<otimes> (x \<oplus> z))

goal (1 subgoal):
 1. O y z \<Longrightarrow> x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
have "P ((x \<oplus> y) \<otimes> (x \<oplus> z)) (x \<oplus> (y \<otimes> z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((x \<oplus> y) \<otimes> (x \<oplus> z)) (x \<oplus> y \<otimes> z)
[PROOF STEP]
using \<open>O y z\<close>
[PROOF STATE]
proof (prove)
using this:
O y z

goal (1 subgoal):
 1. P ((x \<oplus> y) \<otimes> (x \<oplus> z)) (x \<oplus> y \<otimes> z)
[PROOF STEP]
by (rule sum_over_product_right)
[PROOF STATE]
proof (state)
this:
P ((x \<oplus> y) \<otimes> (x \<oplus> z)) (x \<oplus> y \<otimes> z)

goal (1 subgoal):
 1. O y z \<Longrightarrow> x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
P (x \<oplus> y \<otimes> z) ((x \<oplus> y) \<otimes> (x \<oplus> z))
P ((x \<oplus> y) \<otimes> (x \<oplus> z)) (x \<oplus> y \<otimes> z)
[PROOF STEP]
show "x \<oplus> (y \<otimes> z) = (x \<oplus> y) \<otimes> (x \<oplus> z)"
[PROOF STATE]
proof (prove)
using this:
P (x \<oplus> y \<otimes> z) ((x \<oplus> y) \<otimes> (x \<oplus> z))
P ((x \<oplus> y) \<otimes> (x \<oplus> z)) (x \<oplus> y \<otimes> z)

goal (1 subgoal):
 1. x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)
[PROOF STEP]
by (rule part_antisymmetry)
[PROOF STATE]
proof (state)
this:
x \<oplus> y \<otimes> z = (x \<oplus> y) \<otimes> (x \<oplus> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_le_imp_eq_int:
  fixes k::int
  shows "0 < k \<Longrightarrow> \<exists>n > 0. k = of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> \<exists>n>0. k = of_nat n
[PROOF STEP]
unfolding less_int_def int_of_nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> k \<and> 0 \<noteq> k \<Longrightarrow> \<exists>n>0. k = int_of_nat n
[PROOF STEP]
by (descending) (rule zero_le_imp_eq_int_raw)


[STATEMENT]
lemma abs_rat [simp, code]: "\<bar>Fract a b\<bar> = Fract \<bar>a\<bar> \<bar>b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Fract a b\<bar> = Fract \<bar>a\<bar> \<bar>b\<bar>
[PROOF STEP]
by (auto simp add: abs_rat_def zabs_def Zero_rat_def not_less le_less eq_rat zero_less_mult_iff)


[STATEMENT]
lemma sum_pmf_util_commute:
  "(\<Sum>a\<in>outcomes. pmf p a * u a) = (\<Sum>a\<in>outcomes. u a * pmf p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>outcomes. pmf p a * u a) = (\<Sum>a\<in>outcomes. u a * pmf p a)
[PROOF STEP]
by (simp add: mult.commute)


[STATEMENT]
theorem gt_proper_sub: "proper_sub s t \<Longrightarrow> t >\<^sub>t s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_sub s t \<Longrightarrow> t >\<^sub>t s
[PROOF STEP]
unfolding basic_gt_iff_gt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_sub s t \<Longrightarrow> local.kbo_std.gt t s
[PROOF STEP]
by (rule kbo_std.gt_proper_sub[simplified])


[STATEMENT]
lemma is_algebraicE:
  assumes "is_algebraic R n S"
  obtains ps where  "finite ps" "ps \<subseteq> carrier (R[\<X>\<^bsub>n\<^esub>])" "S = affine_alg_set R n ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ps. \<lbrakk>finite ps; ps \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>]); S = affine_alg_set R n ps\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_algebraic R n S

goal (1 subgoal):
 1. (\<And>ps. \<lbrakk>finite ps; ps \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>]); S = affine_alg_set R n ps\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson is_algebraic_def)


[STATEMENT]
lemma delete_text: "get_text (delete b)
    = take (get_pos b-1) (get_text b)@drop (get_pos b) (get_text b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_text (delete b) = take (get_pos b - 1) (get_text b) @ drop (get_pos b) (get_text b)
[PROOF STEP]
by (cases b) auto


[STATEMENT]
lemma subset_imp_Int_subset1: "A \<subseteq> C \<Longrightarrow> A \<inter> B \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> C \<Longrightarrow> A \<inter> B \<subseteq> C
[PROOF STEP]
by (rule subset_trans[of _ "C \<inter> B", OF Int_mono, OF _ subset_refl Int_lower1])


[STATEMENT]
lemma Lim_transform_bound:
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
    and g :: "'a \<Rightarrow> 'c::real_normed_vector"
  assumes "eventually (\<lambda>n. norm (f n) \<le> norm (g n)) net"
    and "(g \<longlongrightarrow> 0) net"
  shows "(f \<longlongrightarrow> 0) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'b)) net
[PROOF STEP]
using assms(1) tendsto_norm_zero [OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in net. norm (f n) \<le> norm (g n)
((\<lambda>x. norm (g x)) \<longlongrightarrow> 0) net

goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'b)) net
[PROOF STEP]
by (rule Lim_null_comparison)


[STATEMENT]
lemma euclid_B_cart2_common_line:
  assumes "z_non_zero p" and "z_non_zero q" and "z_non_zero r"
  and "B\<^sub>\<real> (cart2_pt p) (cart2_pt q) (cart2_pt r)"
  (is "B\<^sub>\<real> ?cp ?cq ?cr")
  shows "\<exists> l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l
[PROOF STEP]
from \<open>z_non_zero p\<close> and \<open>z_non_zero q\<close> and \<open>z_non_zero r\<close>
    and \<open>B\<^sub>\<real> ?cp ?cq ?cr\<close> and proj2_Col_iff_euclid_cart2
[PROOF STATE]
proof (chain)
picking this:
z_non_zero p
z_non_zero q
z_non_zero r
B\<^sub>\<real> cart2_pt p cart2_pt q cart2_pt r
\<lbrakk>z_non_zero ?p; z_non_zero ?q; z_non_zero ?r\<rbrakk> \<Longrightarrow> proj2_Col ?p ?q ?r = real_euclid.Col (cart2_pt ?p) (cart2_pt ?q) (cart2_pt ?r)
[PROOF STEP]
have "proj2_Col p q r"
[PROOF STATE]
proof (prove)
using this:
z_non_zero p
z_non_zero q
z_non_zero r
B\<^sub>\<real> cart2_pt p cart2_pt q cart2_pt r
\<lbrakk>z_non_zero ?p; z_non_zero ?q; z_non_zero ?r\<rbrakk> \<Longrightarrow> proj2_Col ?p ?q ?r = real_euclid.Col (cart2_pt ?p) (cart2_pt ?q) (cart2_pt ?r)

goal (1 subgoal):
 1. proj2_Col p q r
[PROOF STEP]
by (unfold real_euclid.Col_def) simp
[PROOF STATE]
proof (state)
this:
proj2_Col p q r

goal (1 subgoal):
 1. \<exists>l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l
[PROOF STEP]
hence "proj2_set_Col {p,q,r}"
[PROOF STATE]
proof (prove)
using this:
proj2_Col p q r

goal (1 subgoal):
 1. proj2_set_Col {p, q, r}
[PROOF STEP]
by (simp add: proj2_Col_iff_set_Col)
[PROOF STATE]
proof (state)
this:
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. \<exists>l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l
[PROOF STEP]
thus "\<exists> l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l"
[PROOF STATE]
proof (prove)
using this:
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. \<exists>l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l
[PROOF STEP]
by (unfold proj2_set_Col_def) simp
[PROOF STATE]
proof (state)
this:
\<exists>l. proj2_incident p l \<and> proj2_incident q l \<and> proj2_incident r l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suff_finpref_iff:
  "\<lbrakk> r\<in>A\<^sup>\<star>; t\<in>A\<^sup>\<infinity> \<rbrakk> \<Longrightarrow> (r \<in> finpref A t) = (t \<in> suff A r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<in> A\<^sup>\<star>; t \<in> A\<^sup>\<infinity>\<rbrakk> \<Longrightarrow> (r \<in> finpref A t) = (t \<in> suff A r)
[PROOF STEP]
by (auto simp: finpref_def suff_def)


[STATEMENT]
lemma pos_imp_inverse_pos: "\<forall>x::real. f x > 0 \<longrightarrow> inverse (f x) > (0::real)"
  and neg_imp_inverse_neg: "\<forall>x::real. f x < 0 \<longrightarrow> inverse (f x) < (0::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 < f x \<longrightarrow> 0 < inverse (f x) &&& \<forall>x. f x < 0 \<longrightarrow> inverse (f x) < 0
[PROOF STEP]
by auto


[STATEMENT]
lemma closure_rationals_in_convex_set:
   "\<lbrakk>convex S; interior S \<noteq> {}\<rbrakk>
    \<Longrightarrow> closure(S \<inter> (\<Union>f \<in> Basis \<rightarrow> \<rat>. { \<Sum>i :: 'a :: euclidean_space \<in> Basis. f i *\<^sub>R i })) =
        closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>convex S; interior S \<noteq> {}\<rbrakk> \<Longrightarrow> closure (S \<inter> (\<Union>f\<in>Basis \<rightarrow> \<rat>. {\<Sum>i\<in>Basis. f i *\<^sub>R i})) = closure S
[PROOF STEP]
by (simp add: closure_rational_coordinates closure_convex_Int_superset)


[STATEMENT]
lemma convex_hull_insert_alt:
   "convex hull (insert a S) =
     (if S = {} then {a}
      else {(1 - u) *\<^sub>R a + u *\<^sub>R x |x u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> convex hull S})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull insert a S = (if S = {} then {a} else {(1 - u) *\<^sub>R a + u *\<^sub>R x |x u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> convex hull S})
[PROOF STEP]
apply (auto simp: convex_hull_insert)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x u v b. \<lbrakk>x \<in> S; 0 \<le> u; 0 \<le> v; u + v = 1; b \<in> convex hull S\<rbrakk> \<Longrightarrow> \<exists>x ua. u *\<^sub>R a + v *\<^sub>R b = (1 - ua) *\<^sub>R a + ua *\<^sub>R x \<and> 0 \<le> ua \<and> ua \<le> 1 \<and> x \<in> convex hull S
 2. \<And>x xb u. \<lbrakk>x \<in> S; 0 \<le> u; u \<le> 1; xb \<in> convex hull S\<rbrakk> \<Longrightarrow> \<exists>ua\<ge>0. \<exists>v\<ge>0. ua + v = 1 \<and> (\<exists>b. b \<in> convex hull S \<and> (1 - u) *\<^sub>R a + u *\<^sub>R xb = ua *\<^sub>R a + v *\<^sub>R b)
[PROOF STEP]
using diff_eq_eq
[PROOF STATE]
proof (prove)
using this:
(?a - ?b = ?c) = (?a = ?c + ?b)

goal (2 subgoals):
 1. \<And>x u v b. \<lbrakk>x \<in> S; 0 \<le> u; 0 \<le> v; u + v = 1; b \<in> convex hull S\<rbrakk> \<Longrightarrow> \<exists>x ua. u *\<^sub>R a + v *\<^sub>R b = (1 - ua) *\<^sub>R a + ua *\<^sub>R x \<and> 0 \<le> ua \<and> ua \<le> 1 \<and> x \<in> convex hull S
 2. \<And>x xb u. \<lbrakk>x \<in> S; 0 \<le> u; u \<le> 1; xb \<in> convex hull S\<rbrakk> \<Longrightarrow> \<exists>ua\<ge>0. \<exists>v\<ge>0. ua + v = 1 \<and> (\<exists>b. b \<in> convex hull S \<and> (1 - u) *\<^sub>R a + u *\<^sub>R xb = ua *\<^sub>R a + v *\<^sub>R b)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xb u. \<lbrakk>x \<in> S; 0 \<le> u; u \<le> 1; xb \<in> convex hull S\<rbrakk> \<Longrightarrow> \<exists>ua\<ge>0. \<exists>v\<ge>0. ua + v = 1 \<and> (\<exists>b. b \<in> convex hull S \<and> (1 - u) *\<^sub>R a + u *\<^sub>R xb = ua *\<^sub>R a + v *\<^sub>R b)
[PROOF STEP]
using diff_add_cancel diff_ge_0_iff_ge
[PROOF STATE]
proof (prove)
using this:
?a - ?b + ?b = ?a
((0::?'a) \<le> ?a - ?b) = (?b \<le> ?a)

goal (1 subgoal):
 1. \<And>x xb u. \<lbrakk>x \<in> S; 0 \<le> u; u \<le> 1; xb \<in> convex hull S\<rbrakk> \<Longrightarrow> \<exists>ua\<ge>0. \<exists>v\<ge>0. ua + v = 1 \<and> (\<exists>b. b \<in> convex hull S \<and> (1 - u) *\<^sub>R a + u *\<^sub>R xb = ua *\<^sub>R a + v *\<^sub>R b)
[PROOF STEP]
by blast


[STATEMENT]
lemma lm162:
  fixes a::real
  fixes b c
  shows "a*b - c*b=(a-c)*b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b - c * b = (a - c) * b
[PROOF STEP]
using lm161
[PROOF STATE]
proof (prove)
using this:
?a * ?b - ?a * ?c = ?a * (?b - ?c)

goal (1 subgoal):
 1. a * b - c * b = (a - c) * b
[PROOF STEP]
by (metis mult.commute)


[STATEMENT]
lemma expectation_gpv_lift_spmf [simp]:
  "expectation_gpv (lift_spmf p) = (\<integral>\<^sup>+ x. f x \<partial>measure_spmf p) + fail * pmf p None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.expectation_gpv (lift_spmf p) = integral\<^sup>N (measure_spmf p) f + fail * ennreal (pmf p None)
[PROOF STEP]
by(subst expectation_gpv.simps)(auto simp add: o_def pmf_map vimage_def measure_pmf_single)


[STATEMENT]
lemma opp_chambers_bij: "bij_betw ((`) f) (\<C>-(f\<turnstile>\<C>)) (f\<turnstile>\<C>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw ((`) f) (\<C> - f \<turnstile> \<C>) (f \<turnstile> \<C>)
[PROOF STEP]
using inj_on_opp_chambers opp_chambers_surj bij_betw_def[of "(`) f"]
[PROOF STATE]
proof (prove)
using this:
inj_on ((`) f) (\<C> - f \<turnstile> \<C>)
f \<turnstile> (\<C> - f \<turnstile> \<C>) = f \<turnstile> \<C>
bij_betw ((`) f) ?A ?B = (inj_on ((`) f) ?A \<and> f \<turnstile> ?A = ?B)

goal (1 subgoal):
 1. bij_betw ((`) f) (\<C> - f \<turnstile> \<C>) (f \<turnstile> \<C>)
[PROOF STEP]
by auto


[STATEMENT]
lemma circline_ex_circle:
  assumes "A \<noteq> 0" and "A * D \<le> (cmod BC)\<^sup>2" and "cl = circline A BC D"
  shows "\<exists> \<mu> r. cl = circle \<mu> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<mu> r. cl = circle \<mu> r
[PROOF STEP]
using circline_circle[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<mu> = - BC / cor A; ?r2.0 = ((cmod BC)\<^sup>2 - A * D) / A\<^sup>2; ?r = sqrt ?r2.0\<rbrakk> \<Longrightarrow> cl = circle ?\<mu> ?r

goal (1 subgoal):
 1. \<exists>\<mu> r. cl = circle \<mu> r
[PROOF STEP]
by auto


[STATEMENT]
lemma greaterThanAtMost_nat_numeral:
  "{(m::nat)<..numeral k} =
     (if m < numeral k then insert (numeral k) {m<..pred_numeral k} else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m<..numeral k} = (if m < numeral k then insert (numeral k) {m<..pred_numeral k} else {})
[PROOF STEP]
by (auto simp: numeral_eq_Suc)


[STATEMENT]
lemma INFM_const [simp]: "(INFM x::'a. P) \<longleftrightarrow> P \<and> infinite (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>x. P) = (P \<and> infinite UNIV)
[PROOF STEP]
by (simp add: frequently_const_iff)


[STATEMENT]
lemma replace6: "distinct oldfs \<Longrightarrow> x \<in> set (replace oldF newfs oldfs) =
  ((x \<noteq> oldF \<or> oldF \<in> set newfs) \<and> ((oldF \<in> set oldfs \<and> x \<in> set newfs) \<or> x \<in> set oldfs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct oldfs \<Longrightarrow> (x \<in> set (replace oldF newfs oldfs)) = ((x \<noteq> oldF \<or> oldF \<in> set newfs) \<and> (oldF \<in> set oldfs \<and> x \<in> set newfs \<or> x \<in> set oldfs))
[PROOF STEP]
by (induct oldfs) auto


[STATEMENT]
lemma inext_UNIV: "inext n UNIV = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inext n UNIV = Suc n
[PROOF STEP]
apply (simp add: inext_def cut_greater_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. n < x \<Longrightarrow> iMin {x. n < x} = Suc n
 2. \<exists>x. n < x
[PROOF STEP]
apply (rule iMin_equality)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. n < x \<Longrightarrow> Suc n \<in> {x. n < x}
 2. \<And>x xa. \<lbrakk>n < x; xa \<in> {x. n < x}\<rbrakk> \<Longrightarrow> Suc n \<le> xa
 3. \<exists>x. n < x
[PROOF STEP]
apply fastforce+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma uints_num: "uints n = {i. 0 \<le> i \<and> i < 2 ^ n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uints n = {i. 0 \<le> i \<and> i < 2 ^ n}
[PROOF STEP]
by (simp add: uints_def range_bintrunc)


[STATEMENT]
lemma subset_closed_segment:
    "closed_segment a b \<subseteq> closed_segment c d \<longleftrightarrow>
     a \<in> closed_segment c d \<and> b \<in> closed_segment c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closed_segment a b \<subseteq> closed_segment c d) = (a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
by auto (meson contra_subsetD convex_closed_segment convex_contains_segment)


[STATEMENT]
lemma image_le_pred[simp]: "(\<P> f A \<subseteq> {s. G s}) = (\<forall>x\<in>A. G (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<P> f A \<subseteq> {s. G s}) = (\<forall>x\<in>A. G (f x))
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({y. \<exists>x\<in>A. y = f x} \<subseteq> {s. G s}) = (\<forall>x\<in>A. G (f x))
[PROOF STEP]
by force


[STATEMENT]
lemma ord: "[a^(ord n a) = 1] (mod n)"
  for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a ^ ord n a = 1] (mod n)
[PROOF STEP]
using ord_works
[PROOF STATE]
proof (prove)
using this:
[?a ^ ord ?n ?a = 1] (mod ?n) \<and> (\<forall>m. 0 < m \<and> m < ord ?n ?a \<longrightarrow> [?a ^ m \<noteq> 1] (mod ?n))

goal (1 subgoal):
 1. [a ^ ord n a = 1] (mod n)
[PROOF STEP]
by blast


[STATEMENT]
lemma tau_meet [simp]: "\<tau> (x \<sqinter> y) = \<tau> x \<sqinter> \<tau> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (x \<sqinter> y) = \<tau> x \<sqinter> \<tau> y
[PROOF STEP]
using tau_def x_zero_meet_closed
[PROOF STATE]
proof (prove)
using this:
\<tau> ?x = ?x \<cdot> (0::'a)
?x \<cdot> (0::'a) \<sqinter> ?y \<cdot> (0::'a) = (?x \<sqinter> ?y) \<cdot> (0::'a)

goal (1 subgoal):
 1. \<tau> (x \<sqinter> y) = \<tau> x \<sqinter> \<tau> y
[PROOF STEP]
by auto


[STATEMENT]
lemma cont_f: "continuous_on S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
unfolding f_def[abs_def] continuous_on
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. ((\<lambda>v. (1 / norm1 (B *v v)) *\<^sub>R (B *v v)) \<longlongrightarrow> (1 / norm1 (B *v x)) *\<^sub>R (B *v x)) (at x within S)
[PROOF STEP]
using normB_S
[PROOF STATE]
proof (prove)
using this:
?v \<in> S \<Longrightarrow> norm1 (B *v ?v) \<noteq> 0

goal (1 subgoal):
 1. \<forall>x\<in>S. ((\<lambda>v. (1 / norm1 (B *v v)) *\<^sub>R (B *v v)) \<longlongrightarrow> (1 / norm1 (B *v x)) *\<^sub>R (B *v x)) (at x within S)
[PROOF STEP]
unfolding norm1_def
[PROOF STATE]
proof (prove)
using this:
?v \<in> S \<Longrightarrow> (\<Sum>i\<in>UNIV. norm ((B *v ?v) $h i)) \<noteq> 0

goal (1 subgoal):
 1. \<forall>x\<in>S. ((\<lambda>v. (1 / (\<Sum>i\<in>UNIV. norm ((B *v v) $h i))) *\<^sub>R (B *v v)) \<longlongrightarrow> (1 / (\<Sum>i\<in>UNIV. norm ((B *v x) $h i))) *\<^sub>R (B *v x)) (at x within S)
[PROOF STEP]
by (auto intro!: tendsto_eq_intros)


[STATEMENT]
lemma expands_to_exp_zero:
  "(g expands_to MS xs f) basis \<Longrightarrow> eventually (\<lambda>x. f x = 0) at_top \<Longrightarrow> basis_wf basis \<Longrightarrow>
     length basis = expansion_level TYPE('a :: multiseries) \<Longrightarrow>
     ((\<lambda>x. exp (g x)) expands_to (const_expansion 1 :: 'a)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(g expands_to MS xs f) basis; \<forall>\<^sub>F x in at_top. f x = 0; basis_wf basis; length basis = expansion_level TYPE('a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. exp (g x)) expands_to const_expansion 1) basis
[PROOF STEP]
by (auto simp: expands_to.simps intro!: is_expansion_const elim: eventually_elim2)


[STATEMENT]
lemma Limsup_const_add:
  fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}"
  shows "F \<noteq> bot \<Longrightarrow> Limsup F (\<lambda>x. c + f x) = c + Limsup F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> bot \<Longrightarrow> Limsup F (\<lambda>x. c + f x) = c + Limsup F f
[PROOF STEP]
by (rule Limsup_compose_continuous_mono)
     (auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const)


[STATEMENT]
lemma vec_cnj_mult_mv:
  shows "vec_cnj (A *\<^sub>m\<^sub>v x) =  (mat_cnj A) *\<^sub>m\<^sub>v (vec_cnj x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_cnj (A *\<^sub>m\<^sub>v x) = mat_cnj A *\<^sub>m\<^sub>v vec_cnj x
[PROOF STEP]
by (cases A, cases x) (auto simp add: vec_cnj_def mat_cnj_def)


[STATEMENT]
theorem Center_Selection_r:
  "VARS (S' :: ('a :: metric_space) set) (C :: ('a :: metric_space) set) (r :: real) (s :: 'a)
  {True}
  S' := S;
  C := {};
  WHILE S' \<noteq> {} INV {inv S' C r} DO
    s := (SOME s. s \<in> S');
    C := C \<union> {s};
    S' := S' - {s' . s' \<in> S' \<and> dist s s' \<le> 2*r}
    OD
  {(card C \<le> k \<longrightarrow> radius C \<le> 2*r) \<and> (card C > k \<longrightarrow> (\<forall>C'. card C' > 0 \<and> card C' \<le> k \<longrightarrow> radius C' > r))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {True}
S' := S; C := {}; WHILE S' \<noteq> {} INV {local.inv S' C r}  VAR {0}
DO s := (SOME s. s \<in> S'); C := C \<union> {s}; S' := S' - {s' \<in> S'. dist s s' \<le> 2 * r} OD
{(card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))}
[PROOF STEP]
proof (vcg, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>S' C r s. True \<Longrightarrow> local.inv S {} r
 2. \<And>S' C r s. local.inv S' C r \<and> S' \<noteq> {} \<Longrightarrow> local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
 3. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
case (1 S' C r)
[PROOF STATE]
proof (state)
this:
True

goal (3 subgoals):
 1. \<And>S' C r s. True \<Longrightarrow> local.inv S {} r
 2. \<And>S' C r s. local.inv S' C r \<and> S' \<noteq> {} \<Longrightarrow> local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
 3. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
True
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
True

goal (1 subgoal):
 1. local.inv S {} r
[PROOF STEP]
using inv_init
[PROOF STATE]
proof (prove)
using this:
True
local.inv S {} ?r

goal (1 subgoal):
 1. local.inv S {} r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.inv S {} r

goal (2 subgoals):
 1. \<And>S' C r s. local.inv S' C r \<and> S' \<noteq> {} \<Longrightarrow> local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
 2. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S' C r s. local.inv S' C r \<and> S' \<noteq> {} \<Longrightarrow> local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
 2. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
case (2 S' C r)
[PROOF STATE]
proof (state)
this:
local.inv S' C r \<and> S' \<noteq> {}

goal (2 subgoals):
 1. \<And>S' C r s. local.inv S' C r \<and> S' \<noteq> {} \<Longrightarrow> local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
 2. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local.inv S' C r \<and> S' \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.inv S' C r \<and> S' \<noteq> {}

goal (1 subgoal):
 1. local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
[PROOF STEP]
using inv_step
[PROOF STATE]
proof (prove)
using this:
local.inv S' C r \<and> S' \<noteq> {}
\<lbrakk>?S' \<noteq> {}; local.inv ?S' ?C ?r\<rbrakk> \<Longrightarrow> local.inv (?S' - {s' \<in> ?S'. dist (SOME s. s \<in> ?S') s' \<le> 2 * ?r}) (?C \<union> {SOME s. s \<in> ?S'}) ?r

goal (1 subgoal):
 1. local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.inv (S' - {s' \<in> S'. dist (SOME s. s \<in> S') s' \<le> 2 * r}) (C \<union> {SOME s. s \<in> S'}) r

goal (1 subgoal):
 1. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
case (3 S' C r)
[PROOF STATE]
proof (state)
this:
local.inv S' C r \<and> \<not> S' \<noteq> {}

goal (1 subgoal):
 1. \<And>S' C r s. local.inv S' C r \<and> \<not> S' \<noteq> {} \<Longrightarrow> (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local.inv S' C r \<and> \<not> S' \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.inv S' C r \<and> \<not> S' \<noteq> {}

goal (1 subgoal):
 1. (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
using inv_last
[PROOF STATE]
proof (prove)
using this:
local.inv S' C r \<and> \<not> S' \<noteq> {}
local.inv {} ?C ?r \<Longrightarrow> (card ?C \<le> k \<longrightarrow> radius ?C \<le> 2 * ?r) \<and> (k < card ?C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> ?r < radius C'))

goal (1 subgoal):
 1. (card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(card C \<le> k \<longrightarrow> radius C \<le> 2 * r) \<and> (k < card C \<longrightarrow> (\<forall>C'. 0 < card C' \<and> card C' \<le> k \<longrightarrow> r < radius C'))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_filter_eq_P_forall:"\<forall> x \<in> X . P x \<Longrightarrow> Set.filter P X = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>X. P x \<Longrightarrow> Set.filter P X = X
[PROOF STEP]
by (simp add: Collect_conj_eq Int_absorb2 Set.filter_def subsetI)


[STATEMENT]
lemma impl_prop [simp]: "\<lceil>P\<rceil> \<subseteq> \<lceil>Q\<rceil> \<longleftrightarrow> (\<forall>s. P s \<longrightarrow>  Q s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>P\<rceil> \<subseteq> \<lceil>Q\<rceil>) = (\<forall>s. P s \<longrightarrow> Q s)
[PROOF STEP]
by (auto simp: p2r_def)


[STATEMENT]
lemma expands_to_real_compose:
  assumes "(f expands_to (c::real)) bs"
  shows   "((\<lambda>x. g (f x)) expands_to g c) bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g (f x)) expands_to g c) bs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f expands_to c) bs

goal (1 subgoal):
 1. ((\<lambda>x. g (f x)) expands_to g c) bs
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_real.simps elim: eventually_mono)


[STATEMENT]
lemma finite_seqs [intro]: "finite (seqs n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (seqs n)
[PROOF STEP]
by (induction n) (auto simp: seqs_Suc)


[STATEMENT]
lemma "a < 3 \<Longrightarrow> (7::nat) > 2 * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < 3 \<Longrightarrow> 2 * a < 7
[PROOF STEP]
by smt


[STATEMENT]
lemma prim_pyth_tripleI2:
  assumes "0 < v" "v < u" "coprime u v" "\<not>(odd u \<and> odd v)"
  shows   "prim_pyth_triple (u\<^sup>2 - v\<^sup>2) (2 * u * v) (u\<^sup>2 + v\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prim_pyth_triple (u\<^sup>2 - v\<^sup>2) (2 * u * v) (u\<^sup>2 + v\<^sup>2)
[PROOF STEP]
using prim_pyth_tripleI1[OF assms]
[PROOF STATE]
proof (prove)
using this:
prim_pyth_triple (2 * u * v) (u\<^sup>2 - v\<^sup>2) (u\<^sup>2 + v\<^sup>2)

goal (1 subgoal):
 1. prim_pyth_triple (u\<^sup>2 - v\<^sup>2) (2 * u * v) (u\<^sup>2 + v\<^sup>2)
[PROOF STEP]
by (simp add: prim_pyth_triple_commute)


[STATEMENT]
lemma "\<bar> sqrt 2 - 1.4142135623730951 \<bar> < inverse 10 ^ 16"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sqrt 2 - 14142135623730951 / 10 ^ 16\<bar> < inverse 10 ^ 16
[PROOF STEP]
by (approximation 60)