[STATEMENT]
lemma divisor_sigma_prime_power_nat:
  assumes "prime p"
  shows   "divisor_sigma x (p ^ k) = (if x = 0 then Suc k else
             (p ^ (x * Suc k) - 1) div (p ^ x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
 2. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
 2. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
prime p
x = 0
[PROOF STEP]
have "nat_power p (real x) = 1"
[PROOF STATE]
proof (prove)
using this:
prime p
x = 0

goal (1 subgoal):
 1. nat_power p (real x) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_power p (real x) = 1

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
 2. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
hence "divisor_sigma (real x) (p ^ k) = real (Suc k)"
[PROOF STATE]
proof (prove)
using this:
nat_power p (real x) = 1

goal (1 subgoal):
 1. divisor_sigma (real x) (p ^ k) = real (Suc k)
[PROOF STEP]
by (subst divisor_sigma_prime_power_field) (simp_all del: nat_power_real_def add: assms)
[PROOF STATE]
proof (state)
this:
divisor_sigma (real x) (p ^ k) = real (Suc k)

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
 2. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
divisor_sigma (real x) (p ^ k) = real (Suc k)

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
unfolding divisor_sigma_of_nat
[PROOF STATE]
proof (prove)
using this:
real (divisor_sigma x (p ^ k)) = real (Suc k)

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
by (subst (asm) of_nat_eq_iff) (insert True, simp)
[PROOF STATE]
proof (state)
this:
divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
prime p
x \<noteq> 0
[PROOF STEP]
have gt_1: "p ^ x > 1"
[PROOF STATE]
proof (prove)
using this:
prime p
x \<noteq> 0

goal (1 subgoal):
 1. 1 < p ^ x
[PROOF STEP]
using power_gt1[of p "x - 1"]
[PROOF STATE]
proof (prove)
using this:
prime p
x \<noteq> 0
1 < p \<Longrightarrow> 1 < p ^ Suc (x - 1)

goal (1 subgoal):
 1. 1 < p ^ x
[PROOF STEP]
by (simp add: prime_gt_Suc_0_nat)
[PROOF STATE]
proof (state)
this:
1 < p ^ x

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
hence not_one: "real p ^ x \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
1 < p ^ x

goal (1 subgoal):
 1. real p ^ x \<noteq> 1
[PROOF STEP]
unfolding of_nat_power [symmetric] of_nat_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
1 < p ^ x

goal (1 subgoal):
 1. p ^ x \<noteq> 1
[PROOF STEP]
by (intro notI) simp
[PROOF STATE]
proof (state)
this:
real p ^ x \<noteq> 1

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
from gt_1
[PROOF STATE]
proof (chain)
picking this:
1 < p ^ x
[PROOF STEP]
have dvd: "p ^ x - 1 dvd p ^ (x * Suc k) - 1"
[PROOF STATE]
proof (prove)
using this:
1 < p ^ x

goal (1 subgoal):
 1. p ^ x - 1 dvd p ^ (x * Suc k) - 1
[PROOF STEP]
using geometric_sum_nat_dvd[of "p ^ x" "Suc k"] assms
[PROOF STATE]
proof (prove)
using this:
1 < p ^ x
\<lbrakk>1 < p ^ x; 0 < Suc k\<rbrakk> \<Longrightarrow> p ^ x - 1 dvd (p ^ x) ^ Suc k - 1
prime p

goal (1 subgoal):
 1. p ^ x - 1 dvd p ^ (x * Suc k) - 1
[PROOF STEP]
by (simp add: power_mult prime_gt_Suc_0_nat power_add)
[PROOF STATE]
proof (state)
this:
p ^ x - 1 dvd p ^ (x * Suc k) - 1

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
have "divisor_sigma (real x) (p ^ k) =
          real (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (real x) (p ^ k) = real (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
by (subst divisor_sigma_prime_power_field [OF assms, where 'a = real])
       (insert assms False dvd not_one, auto simp del: power_Suc nat_power_real_def
        simp: prime_gt_0_nat real_of_nat_div of_nat_diff prime_ge_Suc_0_nat power_mult [symmetric])
[PROOF STATE]
proof (state)
this:
divisor_sigma (real x) (p ^ k) = real (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
divisor_sigma (real x) (p ^ k) = real (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
unfolding divisor_sigma_of_nat
[PROOF STATE]
proof (prove)
using this:
real (divisor_sigma x (p ^ k)) = real (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))
[PROOF STEP]
by (subst (asm) of_nat_eq_iff)
[PROOF STATE]
proof (state)
this:
divisor_sigma x (p ^ k) = (if x = 0 then Suc k else (p ^ (x * Suc k) - 1) div (p ^ x - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_fun_mono:
  fixes f :: "nat \<Rightarrow> nat"
  shows "(\<And>i. i < n \<Longrightarrow> f i \<le> g i) \<Longrightarrow> sum f {..<n} \<le> sum g {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i < n \<Longrightarrow> f i \<le> g i) \<Longrightarrow> sum f {..<n} \<le> sum g {..<n}
[PROOF STEP]
by (induct n) (auto simp add: lessThan_Suc add_le_mono)


[STATEMENT]
lemma shortest_path_lte: "\<And> p . p \<in> connecting_paths u v \<Longrightarrow> shortest_path u v \<le> walk_length p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> connecting_paths u v \<Longrightarrow> shortest_path u v \<le> enat (walk_length p)
[PROOF STEP]
unfolding shortest_path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> connecting_paths u v \<Longrightarrow> (INF p\<in>connecting_paths u v. enat (walk_length p)) \<le> enat (walk_length p)
[PROOF STEP]
by (simp add: Inf_lower)


[STATEMENT]
lemma gbinomial_of_nat_symmetric: "k \<le> n \<Longrightarrow> (of_nat n) gchoose k = (of_nat n) gchoose (n - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat n gchoose k = of_nat n gchoose (n - k)
[PROOF STEP]
using binomial_symmetric[of k n]
[PROOF STATE]
proof (prove)
using this:
k \<le> n \<Longrightarrow> n choose k = n choose (n - k)

goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat n gchoose k = of_nat n gchoose (n - k)
[PROOF STEP]
by (simp add: binomial_gbinomial [symmetric])


[STATEMENT]
lemma surj_on_subset_right: "\<lbrakk> surj_on f A B; B' \<subseteq> B \<rbrakk> \<Longrightarrow> surj_on f A B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>surj_on f A B; B' \<subseteq> B\<rbrakk> \<Longrightarrow> surj_on f A B'
[PROOF STEP]
unfolding surj_on_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>b\<in>B. \<exists>a\<in>A. b = f a; B' \<subseteq> B\<rbrakk> \<Longrightarrow> \<forall>b\<in>B'. \<exists>a\<in>A. b = f a
[PROOF STEP]
by blast


[STATEMENT]
lemma less_0_prodinf:
  fixes f :: "nat \<Rightarrow> real"
  assumes f: "convergent_prod f" and 0: "\<And>i. f i > 0"
  shows "0 < prodinf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
have "prodinf f \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prodinf f \<noteq> 0
[PROOF STEP]
by (metis assms less_irrefl prodinf_nonzero)
[PROOF STATE]
proof (state)
this:
prodinf f \<noteq> 0

goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prodinf f \<noteq> 0

goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
have "0 < (\<Prod>n<i. f n)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < prod f {..<i}
[PROOF STEP]
by (simp add: 0 prod_pos)
[PROOF STATE]
proof (state)
this:
0 < prod f {..<?i}

goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < prod f {..<?i}
[PROOF STEP]
have "prodinf f \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 < prod f {..<?i}

goal (1 subgoal):
 1. 0 \<le> prodinf f
[PROOF STEP]
using convergent_prod_LIMSEQ [OF f] LIMSEQ_prod_nonneg 0 less_le
[PROOF STATE]
proof (prove)
using this:
0 < prod f {..<?i}
(\<lambda>n. prod f {..n}) \<longlonglongrightarrow> prodinf f
\<lbrakk>\<And>n. (0::?'a) \<le> ?f n; (\<lambda>n. prod ?f {..n}) \<longlonglongrightarrow> ?a\<rbrakk> \<Longrightarrow> (0::?'a) \<le> ?a
0 < f ?i
(?x < ?y) = (?x \<le> ?y \<and> ?x \<noteq> ?y)

goal (1 subgoal):
 1. 0 \<le> prodinf f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> prodinf f

goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prodinf f \<noteq> 0
0 \<le> prodinf f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prodinf f \<noteq> 0
0 \<le> prodinf f

goal (1 subgoal):
 1. 0 < prodinf f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < prodinf f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rot_circle_eq_circle:
  assumes "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
  shows "(rot_circle_cube (x, y)) = (circle_cube (rot_x'' y x, rot_y'' y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rot_circle_cube (x, y) = circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (rot_circle_cube (x, y)) = fst (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
 2. snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
show "fst (rot_circle_cube (x, y)) = fst (circle_cube (rot_x'' y x, rot_y'' y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (rot_circle_cube (x, y)) = fst (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. fst (rot_circle_cube (x, y)) = fst (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
by(auto simp add: circle_cube_def rot_circle_cube_def x_coord_inv_def circle_y_def x_coord_def)
[PROOF STATE]
proof (state)
this:
fst (rot_circle_cube (x, y)) = fst (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))

goal (1 subgoal):
 1. snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
have rw:  "\<bar>1/4 - x_coord y * x_coord y\<bar> =  1/4 - x_coord y * x_coord y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>1 / 4 - x_coord y * x_coord y\<bar> = 1 / 4 - x_coord y * x_coord y
[PROOF STEP]
apply(rule abs_of_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 1 / 4 - x_coord y * x_coord y
[PROOF STEP]
using assms mult_left_le
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1
\<lbrakk>?c \<le> (1::?'a); (0::?'a) \<le> ?a\<rbrakk> \<Longrightarrow> ?a * ?c \<le> ?a

goal (1 subgoal):
 1. 0 \<le> 1 / 4 - x_coord y * x_coord y
[PROOF STEP]
by (auto simp add: x_coord_def divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
\<bar>1 / 4 - x_coord y * x_coord y\<bar> = 1 / 4 - x_coord y * x_coord y

goal (1 subgoal):
 1. snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
show "snd (rot_circle_cube (x, y)) = snd (circle_cube (rot_x'' y x, rot_y'' y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
using assms d_gt_0
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1
0 < d

goal (1 subgoal):
 1. snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))
[PROOF STEP]
apply(simp add: circle_cube_nice rot_circle_cube_def x_coord_inv_2 circle_y_def algebra_simps rw)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1; 0 < d\<rbrakk> \<Longrightarrow> x + (x_coord y * x_coord y + x * (x * (x_coord y * (x_coord y * 4)))) = x * x + x * (x_coord y * (x_coord y * 4)) \<longrightarrow> x_coord y = 0
[PROOF STEP]
apply(auto simp add: x_coord_def algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1; 0 < d; y * y + (1 / 4 + (x * (y * 4) + x * (x * (y * (y * 4))))) = y + (x * (x * (y * 4)) + x * (y * (y * 4)))\<rbrakk> \<Longrightarrow> y * 2 = 1
[PROOF STEP]
by (sos "(((((A<0 * A<1) * ((A<0 * A<1) * R<1)) + (([~4*d^2] * A=0) + (((A<=0 * (A<=1 * (A<=3 * R<1))) * (R<8 * [d]^2)) + ((A<=0 * (A<=1 * (A<=3 * (A<1 * R<1)))) * (R<8 * [d]^2)))))) & ((((A<0 * A<1) * ((A<0 * A<1) * R<1)) + (([~4*d^2] * A=0) + (((A<=0 * (A<=1 * (A<=2 * R<1))) * (R<8 * [d]^2)) + ((A<=0 * (A<=1 * (A<=2 * (A<1 * R<1)))) * (R<8 * [d]^2)))))))")
[PROOF STATE]
proof (state)
this:
snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))

goal:
No subgoals!
[PROOF STEP]
(*Be patient: it takes a bit of time, still better than creeping its proof manually.*)
[PROOF STATE]
proof (state)
this:
snd (rot_circle_cube (x, y)) = snd (circle_cube (x_coord_inv ((2 * x - 1) * circle_y (x_coord y)), x_coord y / (2 * circle_y (x_coord (x_coord_inv ((2 * x - 1) * circle_y (x_coord y))))) + 1 / 2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in metric_space) metric_CauchyI:
  "(\<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < e) \<Longrightarrow> Cauchy X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < e) \<Longrightarrow> Cauchy X
[PROOF STEP]
by (simp add: Cauchy_def)


[STATEMENT]
lemma uniqLengthEqCardSet:
assumes "uniq l"
shows "length l = card (set l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length l = card (set l)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uniq l

goal (1 subgoal):
 1. length l = card (set l)
[PROOF STEP]
by (induct l) auto


[STATEMENT]
lemma binomial_eq_nsets: "n choose k = card (nsets {0..<n} k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose k = card ([{0..<n}]\<^bsup>k\<^esup>)
[PROOF STEP]
apply (simp add: binomial_def nsets_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {K. K \<subseteq> {0..<n} \<and> card K = k} = card {N. N \<subseteq> {0..<n} \<and> finite N \<and> card N = k}
[PROOF STEP]
by (meson subset_eq_atLeast0_lessThan_finite)


[STATEMENT]
lemma proj_k_mat:
  assumes "k < K"
  shows "proj_k k = mat K K (\<lambda>(i, j). if (i = j \<and> i = k) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_k k = mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0)
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0)); j < dim_col (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))\<rbrakk> \<Longrightarrow> proj_k k $$ (i, j) = mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0) $$ (i, j)
 2. dim_row (proj_k k) = dim_row (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))
 3. dim_col (proj_k k) = dim_col (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))
[PROOF STEP]
apply (simp add: proj_k_def ket_k_def index_outer_prod)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dim_row (proj_k k) = dim_row (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))
 2. dim_col (proj_k k) = dim_col (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))
[PROOF STEP]
using proj_k_dim
[PROOF STATE]
proof (prove)
using this:
proj_k ?k \<in> carrier_mat K K

goal (2 subgoals):
 1. dim_row (proj_k k) = dim_row (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))
 2. dim_col (proj_k k) = dim_col (mat K K (\<lambda>(i, j). if i = j \<and> i = k then 1 else 0))
[PROOF STEP]
by auto


[STATEMENT]
lemma sphere_bounds:
  assumes "x*x + y*y + z*z = (1::real)"
  shows "-1 \<le> x \<and> x \<le> 1"  "-1 \<le> y \<and> y \<le> 1"  "-1 \<le> z \<and> z \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<le> x \<and> x \<le> 1 &&& - 1 \<le> y \<and> y \<le> 1 &&& - 1 \<le> z \<and> z \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x * x + y * y + z * z = 1

goal (1 subgoal):
 1. - 1 \<le> x \<and> x \<le> 1 &&& - 1 \<le> y \<and> y \<le> 1 &&& - 1 \<le> z \<and> z \<le> 1
[PROOF STEP]
using sphere_bounds'[of x y z] sphere_bounds'[of y x z] sphere_bounds'[of z x y]
[PROOF STATE]
proof (prove)
using this:
x * x + y * y + z * z = 1
x * x + y * y + z * z = 1 \<Longrightarrow> - 1 \<le> x \<and> x \<le> 1
y * y + x * x + z * z = 1 \<Longrightarrow> - 1 \<le> y \<and> y \<le> 1
z * z + x * x + y * y = 1 \<Longrightarrow> - 1 \<le> z \<and> z \<le> 1

goal (1 subgoal):
 1. - 1 \<le> x \<and> x \<le> 1 &&& - 1 \<le> y \<and> y \<le> 1 &&& - 1 \<le> z \<and> z \<le> 1
[PROOF STEP]
by (auto simp add: field_simps)


[STATEMENT]
lemma null_space_orthogonal_complement_row_space_complex:
  fixes A::"complex^'cols::{finite,wellorder}^'rows::{finite,wellorder}"
  shows "null_space A = complex_matrix.orthogonal_complement (row_space (\<chi> i j. cnj (A $ i $ j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. null_space A = complex_matrix.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
using complex_matrix.null_space_orthogonal_complement_row_space
[PROOF STATE]
proof (prove)
using this:
null_space ?A = complex_matrix.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (?A $ i $ j)))

goal (1 subgoal):
 1. null_space A = complex_matrix.orthogonal_complement (row_space (\<chi>i j. cnj_class.cnj (A $ i $ j)))
[PROOF STEP]
.


[STATEMENT]
lemma abs_range: "\<lbrakk> 0 \<le> (a::'a::{ordered_ab_group_add_abs,abs_if}); -a \<le> x; x \<le> a \<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> a; - a \<le> x; x \<le> a\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<le> a
[PROOF STEP]
apply (clarsimp simp: abs_if)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> a; - a \<le> x; x \<le> a; x < (0::'a)\<rbrakk> \<Longrightarrow> - x \<le> a
[PROOF STEP]
apply (rule neg_le_iff_le[THEN iffD1], simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem th_3: "c_unfold (length ls) (c_fold ls) = ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_unfold (length ls) (c_fold ls) = ls
[PROOF STEP]
apply(induct ls)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c_unfold (length []) (c_fold []) = []
 2. \<And>a ls. c_unfold (length ls) (c_fold ls) = ls \<Longrightarrow> c_unfold (length (a # ls)) (c_fold (a # ls)) = a # ls
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ls. c_unfold (length ls) (c_fold ls) = ls \<Longrightarrow> c_unfold (length (a # ls)) (c_fold (a # ls)) = a # ls
[PROOF STEP]
apply(rule th_3_lm_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ls. c_unfold (length ls) (c_fold ls) = ls \<Longrightarrow> c_unfold (length ls) (c_fold ls) = ls
[PROOF STEP]
apply(assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_of_poly_normalize_field:
  "fps_of_poly (normalize (p :: 'a :: {field, normalization_semidom} poly)) =
     fps_of_poly p * fps_const (inverse (lead_coeff p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (normalize p) = fps_of_poly p * fps_const (inverse (lead_coeff p))
[PROOF STEP]
by (cases "p = 0")
     (simp_all add: normalize_poly_def div_const_unit_poly divide_simps dvd_field_iff)


[STATEMENT]
lemma abs_summable_on_restrict:
  fixes f :: "'a \<Rightarrow> 'b :: {banach, second_countable_topology}"
  assumes "A \<subseteq> B"
  shows   "f abs_summable_on A \<longleftrightarrow> (\<lambda>x. indicator A x *\<^sub>R f x) abs_summable_on B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)
[PROOF STEP]
have "count_space A = restrict_space (count_space B) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_space A = restrict_space (count_space B) A
[PROOF STEP]
by (rule restrict_count_space_subset [symmetric]) fact+
[PROOF STATE]
proof (state)
this:
count_space A = restrict_space (count_space B) A

goal (1 subgoal):
 1. (f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_space A = restrict_space (count_space B) A

goal (1 subgoal):
 1. (f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)
[PROOF STEP]
have "integrable \<dots> f \<longleftrightarrow> set_integrable (count_space B) A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (restrict_space (count_space B) A) f = set_integrable (count_space B) A f
[PROOF STEP]
by (simp add: integrable_restrict_space set_integrable_def)
[PROOF STATE]
proof (state)
this:
integrable (restrict_space (count_space B) A) f = set_integrable (count_space B) A f

goal (1 subgoal):
 1. (f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integrable (count_space A) f = set_integrable (count_space B) A f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable (count_space A) f = set_integrable (count_space B) A f

goal (1 subgoal):
 1. (f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)
[PROOF STEP]
unfolding abs_summable_on_def set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable (count_space A) f = integrable (count_space B) (\<lambda>x. indicat_real A x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable (count_space A) f = integrable (count_space B) (\<lambda>x. indicat_real A x *\<^sub>R f x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f abs_summable_on A) = ((\<lambda>x. indicat_real A x *\<^sub>R f x) abs_summable_on B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_set_diff:
  "finite S \<Longrightarrow> S' \<subseteq> S \<Longrightarrow> size_set (S - S') = size_set S - size_set S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; S' \<subseteq> S\<rbrakk> \<Longrightarrow> size_set (S - S') = size_set S - size_set S'
[PROOF STEP]
using sum_diff_nat finite_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?B; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> sum ?f (?A - ?B) = sum ?f ?A - sum ?f ?B
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. \<lbrakk>finite S; S' \<subseteq> S\<rbrakk> \<Longrightarrow> size_set (S - S') = size_set S - size_set S'
[PROOF STEP]
by metis


[STATEMENT]
lemma degree_lagrange_interpolation_poly:
  shows "degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
assume ab: "(a,b) \<in> set xs_ys"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> set xs_ys

goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
let ?xs = "filter (\<lambda>x. x\<noteq>a) (map fst xs_ys)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
from ab
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> set xs_ys
[PROOF STEP]
have "a \<in> set (map fst xs_ys)"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set xs_ys

goal (1 subgoal):
 1. a \<in> set (map fst xs_ys)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<in> set (map fst xs_ys)

goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
hence "Suc (length ?xs) \<le> length xs_ys"
[PROOF STATE]
proof (prove)
using this:
a \<in> set (map fst xs_ys)

goal (1 subgoal):
 1. Suc (length (filter (\<lambda>x. x \<noteq> a) (map fst xs_ys))) \<le> length xs_ys
[PROOF STEP]
by (induct xs_ys, auto)
[PROOF STATE]
proof (state)
this:
Suc (length (filter (\<lambda>x. x \<noteq> a) (map fst xs_ys))) \<le> length xs_ys

goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
hence "length ?xs \<le> length xs_ys - 1"
[PROOF STATE]
proof (prove)
using this:
Suc (length (filter (\<lambda>x. x \<noteq> a) (map fst xs_ys))) \<le> length xs_ys

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<noteq> a) (map fst xs_ys)) \<le> length xs_ys - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x. x \<noteq> a) (map fst xs_ys)) \<le> length xs_ys - 1

goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?a2, ?b2) \<in> set xs_ys \<Longrightarrow> length (filter (\<lambda>x. x \<noteq> ?a2) (map fst xs_ys)) \<le> length xs_ys - 1

goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
note main = this
[PROOF STATE]
proof (state)
this:
(?a2, ?b2) \<in> set xs_ys \<Longrightarrow> length (filter (\<lambda>x. x \<noteq> ?a2) (map fst xs_ys)) \<le> length xs_ys - 1

goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
unfolding lagrange_interpolation_poly_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Sum>(xj, yj)\<leftarrow>xs_ys. smult yj (lagrange_basis_poly (map fst xs_ys) xj)) \<le> length xs_ys - 1
[PROOF STEP]
by (rule degree_sum_list_le, auto, rule order_trans[OF degree_lagrange_basis_poly], insert main, auto)
[PROOF STATE]
proof (state)
this:
degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measure_preserving_preserves_nn_integral:
  assumes "T \<in> measure_preserving M N"
          "f \<in> borel_measurable N"
  shows "(\<integral>\<^sup>+x. f x \<partial>N) = (\<integral>\<^sup>+x. f (T x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M
[PROOF STEP]
have "(\<integral>\<^sup>+x. f (T x) \<partial>M) = (\<integral>\<^sup>+y. f y \<partial>distr M N T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N (distr M N T) f
[PROOF STEP]
using assms nn_integral_distr[of T M N f, OF measure_preservingE(1)[OF assms(1)]]
[PROOF STATE]
proof (prove)
using this:
T \<in> measure_preserving M N
f \<in> borel_measurable N
f \<in> borel_measurable (distr M N T) \<Longrightarrow> integral\<^sup>N (distr M N T) f = \<integral>\<^sup>+ x. f (T x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N (distr M N T) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N (distr M N T) f

goal (1 subgoal):
 1. integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N (distr M N T) f

goal (1 subgoal):
 1. integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M
[PROOF STEP]
have "... = (\<integral>\<^sup>+y. f y \<partial>N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (distr M N T) f = integral\<^sup>N N f
[PROOF STEP]
using measure_preserving_distr[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
distr M N T = N

goal (1 subgoal):
 1. integral\<^sup>N (distr M N T) f = integral\<^sup>N N f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (distr M N T) f = integral\<^sup>N N f

goal (1 subgoal):
 1. integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N N f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. f (T x) \<partial>M = integral\<^sup>N N f

goal (1 subgoal):
 1. integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N N f = \<integral>\<^sup>+ x. f (T x) \<partial>M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_word: "CARD('a word) = 2 ^ LENGTH('a::len)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a word) = 2 ^ LENGTH('a)
[PROOF STEP]
by (simp add: UNIV_eq card_image inj_on_word_of_int)


[STATEMENT]
lemma exp_first_term: "exp x = 1 + (\<Sum>n. inverse (fact (Suc n)) *\<^sub>R (x ^ Suc n))"
  for x :: "'a::{real_normed_algebra_1,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp x = (1::'a) + (\<Sum>n. x ^ Suc n /\<^sub>R fact (Suc n))
[PROOF STEP]
using exp_first_terms[of x 1]
[PROOF STATE]
proof (prove)
using this:
exp x = (\<Sum>n<1. x ^ n /\<^sub>R fact n) + (\<Sum>n. x ^ (n + 1) /\<^sub>R fact (n + 1))

goal (1 subgoal):
 1. exp x = (1::'a) + (\<Sum>n. x ^ Suc n /\<^sub>R fact (Suc n))
[PROOF STEP]
by simp


[STATEMENT]
lemma dropWhile_takeWhile:
  "(\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> dropWhile P (takeWhile Q xs) = takeWhile Q (dropWhile P xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> dropWhile P (takeWhile Q xs) = takeWhile Q (dropWhile P xs)
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma zero_less_floor [simp]: "0 < \<lfloor>x\<rfloor> \<longleftrightarrow> 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < \<lfloor>x\<rfloor>) = ((1::'a) \<le> x)
[PROOF STEP]
by (simp add: less_floor_iff)


[STATEMENT]
lemma continuous_power_int:
  fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_div_algebra"
  assumes "continuous F f"
    and "f (Lim F (\<lambda>x. x)) \<noteq> 0"
  shows "continuous F (\<lambda>x. power_int (f x) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. f x powi n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous F f
f (Lim F (\<lambda>x. x)) \<noteq> (0::'b)

goal (1 subgoal):
 1. continuous F (\<lambda>x. f x powi n)
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F
f (Lim F (\<lambda>x. x)) \<noteq> (0::'b)

goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) \<longlongrightarrow> f (Lim F (\<lambda>x. x)) powi n) F
[PROOF STEP]
by (rule tendsto_power_int)


[STATEMENT]
lemma (in prob_space) distributed_marginal_eq_joint1:
  assumes T: "sigma_finite_measure T"
  assumes S: "sigma_finite_measure S"
  assumes Px: "distributed M S X Px"
  assumes Pxy: "distributed M (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x)) Pxy"
  shows "AE x in S. Px x = (\<integral>\<^sup>+y. Pxy (x, y) \<partial>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in S. Px x = \<integral>\<^sup>+ y. Pxy (x, y) \<partial>T
[PROOF STEP]
using Px distr_marginal1[OF S T Pxy]
[PROOF STATE]
proof (prove)
using this:
distributed M S X Px
distributed M S X (\<lambda>x. \<integral>\<^sup>+ z. Pxy (x, z) \<partial>T)

goal (1 subgoal):
 1. AE x in S. Px x = \<integral>\<^sup>+ y. Pxy (x, y) \<partial>T
[PROOF STEP]
by (rule distributed_unique)


[STATEMENT]
lemma order_eq: "order (units_of R) = p - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (units_of R) = p - 1
[PROOF STEP]
using prime_p
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. order (units_of R) = p - 1
[PROOF STEP]
by (simp add: units.order_eq totient_prime)


[STATEMENT]
lemma ccspan_leq_using_vec:
  fixes A B :: "'a::{basis_enum,complex_normed_vector} list"
  shows "(ccspan (set A) \<le> ccspan (set B)) \<longleftrightarrow>
    is_subspace_of_vec_list (length (canonical_basis :: 'a list))
      (map vec_of_basis_enum A) (map vec_of_basis_enum B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
define d Av Bv Bo
    where "d = length (canonical_basis :: 'a list)"
      and "Av = map vec_of_basis_enum A"
      and "Bv = map vec_of_basis_enum B"
      and "Bo = gram_schmidt0 d Bv"
[PROOF STATE]
proof (state)
this:
d = length canonical_basis
Av = map vec_of_basis_enum A
Bv = map vec_of_basis_enum B
Bo = gram_schmidt0 d Bv

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
interpret complex_vec_space d
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have Av_carrier: "set Av \<subseteq> carrier_vec d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Av \<subseteq> carrier_vec d
[PROOF STEP]
unfolding Av_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map vec_of_basis_enum A) \<subseteq> carrier_vec d
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> set A \<Longrightarrow> vec_of_basis_enum xa \<in> carrier_vec d
[PROOF STEP]
by (simp add: carrier_vecI d_def dim_vec_of_basis_enum')
[PROOF STATE]
proof (state)
this:
set Av \<subseteq> carrier_vec d

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have Bv_carrier: "set Bv \<subseteq> carrier_vec d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Bv \<subseteq> carrier_vec d
[PROOF STEP]
unfolding Bv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map vec_of_basis_enum B) \<subseteq> carrier_vec d
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> set B \<Longrightarrow> vec_of_basis_enum xa \<in> carrier_vec d
[PROOF STEP]
by (simp add: carrier_vecI d_def dim_vec_of_basis_enum')
[PROOF STATE]
proof (state)
this:
set Bv \<subseteq> carrier_vec d

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have Bo_carrier: "set Bo \<subseteq> carrier_vec d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Bo \<subseteq> carrier_vec d
[PROOF STEP]
apply (simp add: Bo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (gram_schmidt0 d Bv) \<subseteq> carrier_vec d
[PROOF STEP]
using Bv_carrier
[PROOF STATE]
proof (prove)
using this:
set Bv \<subseteq> carrier_vec d

goal (1 subgoal):
 1. set (gram_schmidt0 d Bv) \<subseteq> carrier_vec d
[PROOF STEP]
by (rule gram_schmidt0_result(1))
[PROOF STATE]
proof (state)
this:
set Bo \<subseteq> carrier_vec d

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have orth_Bo: "corthogonal Bo"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. corthogonal Bo
[PROOF STEP]
apply (simp add: Bo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. corthogonal (gram_schmidt0 d Bv)
[PROOF STEP]
using Bv_carrier
[PROOF STATE]
proof (prove)
using this:
set Bv \<subseteq> carrier_vec d

goal (1 subgoal):
 1. corthogonal (gram_schmidt0 d Bv)
[PROOF STEP]
by (rule gram_schmidt0_result(3))
[PROOF STATE]
proof (state)
this:
corthogonal Bo

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have distinct_Bo: "distinct Bo"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct Bo
[PROOF STEP]
apply (simp add: Bo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (gram_schmidt0 d Bv)
[PROOF STEP]
using Bv_carrier
[PROOF STATE]
proof (prove)
using this:
set Bv \<subseteq> carrier_vec d

goal (1 subgoal):
 1. distinct (gram_schmidt0 d Bv)
[PROOF STEP]
by (rule gram_schmidt0_result(2))
[PROOF STATE]
proof (state)
this:
distinct Bo

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have "ccspan (set A) \<le> ccspan (set B) \<longleftrightarrow> cspan (set A) \<subseteq> cspan (set B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = (cspan (set A) \<subseteq> cspan (set B))
[PROOF STEP]
apply (transfer fixing: A B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closure (cspan (set A)) \<subseteq> closure (cspan (set B))) = (cspan (set A) \<subseteq> cspan (set B))
[PROOF STEP]
apply (subst closure_finite_cspan, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cspan (set A) \<subseteq> closure (cspan (set B))) = (cspan (set A) \<subseteq> cspan (set B))
[PROOF STEP]
by (subst closure_finite_cspan, simp_all)
[PROOF STATE]
proof (state)
this:
(ccspan (set A) \<le> ccspan (set B)) = (cspan (set A) \<subseteq> cspan (set B))

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(ccspan (set A) \<le> ccspan (set B)) = (cspan (set A) \<subseteq> cspan (set B))

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> span (set Av) \<subseteq> span (set Bv)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cspan (set A) \<subseteq> cspan (set B)) = (local.span (set Av) \<subseteq> local.span (set Bv))
[PROOF STEP]
apply (simp add: Av_def Bv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cspan (set A) \<subseteq> cspan (set B)) = (local.span (vec_of_basis_enum ` set A) \<subseteq> local.span (vec_of_basis_enum ` set B))
[PROOF STEP]
apply (subst vec_of_basis_enum_cspan[symmetric], simp add: d_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cspan (set A) \<subseteq> cspan (set B)) = (vec_of_basis_enum ` cspan (set A) \<subseteq> local.span (vec_of_basis_enum ` set B))
[PROOF STEP]
apply (subst vec_of_basis_enum_cspan[symmetric], simp add: d_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cspan (set A) \<subseteq> cspan (set B)) = (vec_of_basis_enum ` cspan (set A) \<subseteq> vec_of_basis_enum ` cspan (set B))
[PROOF STEP]
by (metis inj_image_subset_iff inj_on_def vec_of_basis_enum_inverse)
[PROOF STATE]
proof (state)
this:
(cspan (set A) \<subseteq> cspan (set B)) = (local.span (set Av) \<subseteq> local.span (set Bv))

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cspan (set A) \<subseteq> cspan (set B)) = (local.span (set Av) \<subseteq> local.span (set Bv))

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> span (set Av) \<subseteq> span (set Bo)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.span (set Av) \<subseteq> local.span (set Bv)) = (local.span (set Av) \<subseteq> local.span (set Bo))
[PROOF STEP]
unfolding Bo_def Av_def Bv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.span (set (map vec_of_basis_enum A)) \<subseteq> local.span (set (map vec_of_basis_enum B))) = (local.span (set (map vec_of_basis_enum A)) \<subseteq> local.span (set (gram_schmidt0 d (map vec_of_basis_enum B))))
[PROOF STEP]
apply (subst gram_schmidt0_result(4)[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set (map vec_of_basis_enum B) \<subseteq> carrier_vec d
 2. (local.span (set (map vec_of_basis_enum A)) \<subseteq> local.span (set (map vec_of_basis_enum B))) = (local.span (set (map vec_of_basis_enum A)) \<subseteq> local.span (set (map vec_of_basis_enum B)))
[PROOF STEP]
by (simp_all add: carrier_dim_vec d_def dim_vec_of_basis_enum' image_subset_iff)
[PROOF STATE]
proof (state)
this:
(local.span (set Av) \<subseteq> local.span (set Bv)) = (local.span (set Av) \<subseteq> local.span (set Bo))

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(local.span (set Av) \<subseteq> local.span (set Bv)) = (local.span (set Av) \<subseteq> local.span (set Bo))

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<forall>v\<in>set Av. adjuster d v Bo = - v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.span (set Av) \<subseteq> local.span (set Bo)) = (\<forall>v\<in>set Av. adjuster d v Bo = - v)
[PROOF STEP]
proof (intro iffI ballI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v. \<lbrakk>local.span (set Av) \<subseteq> local.span (set Bo); v \<in> set Av\<rbrakk> \<Longrightarrow> adjuster d v Bo = - v
 2. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v. \<lbrakk>local.span (set Av) \<subseteq> local.span (set Bo); v \<in> set Av\<rbrakk> \<Longrightarrow> adjuster d v Bo = - v
 2. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
assume "v \<in> set Av" and "span (set Av) \<subseteq> span (set Bo)"
[PROOF STATE]
proof (state)
this:
v \<in> set Av
local.span (set Av) \<subseteq> local.span (set Bo)

goal (2 subgoals):
 1. \<And>v. \<lbrakk>local.span (set Av) \<subseteq> local.span (set Bo); v \<in> set Av\<rbrakk> \<Longrightarrow> adjuster d v Bo = - v
 2. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> set Av
local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
have "v \<in> span (set Bo)"
[PROOF STATE]
proof (prove)
using this:
v \<in> set Av
local.span (set Av) \<subseteq> local.span (set Bo)

goal (1 subgoal):
 1. v \<in> local.span (set Bo)
[PROOF STEP]
using Av_carrier span_mem
[PROOF STATE]
proof (prove)
using this:
v \<in> set Av
local.span (set Av) \<subseteq> local.span (set Bo)
set Av \<subseteq> carrier_vec d
\<lbrakk>?E \<subseteq> carrier_vec d; ?u \<in> ?E\<rbrakk> \<Longrightarrow> ?u \<in> local.span ?E

goal (1 subgoal):
 1. v \<in> local.span (set Bo)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> local.span (set Bo)

goal (2 subgoals):
 1. \<And>v. \<lbrakk>local.span (set Av) \<subseteq> local.span (set Bo); v \<in> set Av\<rbrakk> \<Longrightarrow> adjuster d v Bo = - v
 2. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
have "adjuster d v Bo + v = 0\<^sub>v d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster d v Bo + v = 0\<^sub>v d
[PROOF STEP]
apply (rule adjuster_already_in_span)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. v \<in> carrier_vec d
 2. set Bo \<subseteq> carrier_vec d
 3. corthogonal Bo
 4. v \<in> local.span (set Bo)
[PROOF STEP]
using Av_carrier \<open>v \<in> set Av\<close> Bo_carrier orth_Bo
        \<open>v \<in> span (set Bo)\<close>
[PROOF STATE]
proof (prove)
using this:
set Av \<subseteq> carrier_vec d
v \<in> set Av
set Bo \<subseteq> carrier_vec d
corthogonal Bo
v \<in> local.span (set Bo)

goal (4 subgoals):
 1. v \<in> carrier_vec d
 2. set Bo \<subseteq> carrier_vec d
 3. corthogonal Bo
 4. v \<in> local.span (set Bo)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
adjuster d v Bo + v = 0\<^sub>v d

goal (2 subgoals):
 1. \<And>v. \<lbrakk>local.span (set Av) \<subseteq> local.span (set Bo); v \<in> set Av\<rbrakk> \<Longrightarrow> adjuster d v Bo = - v
 2. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
adjuster d v Bo + v = 0\<^sub>v d
[PROOF STEP]
show "adjuster d v Bo = - v"
[PROOF STATE]
proof (prove)
using this:
adjuster d v Bo + v = 0\<^sub>v d

goal (1 subgoal):
 1. adjuster d v Bo = - v
[PROOF STEP]
using Av_carrier Bo_carrier \<open>v \<in> set Av\<close>
[PROOF STATE]
proof (prove)
using this:
adjuster d v Bo + v = 0\<^sub>v d
set Av \<subseteq> carrier_vec d
set Bo \<subseteq> carrier_vec d
v \<in> set Av

goal (1 subgoal):
 1. adjuster d v Bo = - v
[PROOF STEP]
by (metis (no_types, lifting) add.inv_equality adjuster_carrier' local.vec_neg subsetD)
[PROOF STATE]
proof (state)
this:
adjuster d v Bo = - v

goal (1 subgoal):
 1. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
assume adj_minusv: "\<forall>v\<in>set Av. adjuster d v Bo = - v"
[PROOF STATE]
proof (state)
this:
\<forall>v\<in>set Av. adjuster d v Bo = - v

goal (1 subgoal):
 1. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
have *: "adjuster d v Bo \<in> span (set Bo)" if "v \<in> set Av" for v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster d v Bo \<in> local.span (set Bo)
[PROOF STEP]
apply (rule adjuster_in_span)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. v \<in> carrier_vec d
 2. set Bo \<subseteq> carrier_vec d
 3. distinct Bo
[PROOF STEP]
using Bo_carrier that Av_carrier distinct_Bo
[PROOF STATE]
proof (prove)
using this:
set Bo \<subseteq> carrier_vec d
v \<in> set Av
set Av \<subseteq> carrier_vec d
distinct Bo

goal (3 subgoals):
 1. v \<in> carrier_vec d
 2. set Bo \<subseteq> carrier_vec d
 3. distinct Bo
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?v1 \<in> set Av \<Longrightarrow> adjuster d ?v1 Bo \<in> local.span (set Bo)

goal (1 subgoal):
 1. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
have "v \<in> span (set Bo)" if "v \<in> set Av" for v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.span (set Bo)
[PROOF STEP]
using *[OF that] adj_minusv[rule_format, OF that]
[PROOF STATE]
proof (prove)
using this:
adjuster d v Bo \<in> local.span (set Bo)
adjuster d v Bo = - v

goal (1 subgoal):
 1. v \<in> local.span (set Bo)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- v \<in> local.span (set Bo); adjuster d v Bo = - v\<rbrakk> \<Longrightarrow> v \<in> local.span (set Bo)
[PROOF STEP]
by (metis (no_types, lifting) Av_carrier Bo_carrier adjust_nonzero distinct_Bo subsetD that uminus_l_inv_vec)
[PROOF STATE]
proof (state)
this:
?v1 \<in> set Av \<Longrightarrow> ?v1 \<in> local.span (set Bo)

goal (1 subgoal):
 1. \<forall>v\<in>set Av. adjuster d v Bo = - v \<Longrightarrow> local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?v1 \<in> set Av \<Longrightarrow> ?v1 \<in> local.span (set Bo)
[PROOF STEP]
show "span (set Av) \<subseteq> span (set Bo)"
[PROOF STATE]
proof (prove)
using this:
?v1 \<in> set Av \<Longrightarrow> ?v1 \<in> local.span (set Bo)

goal (1 subgoal):
 1. local.span (set Av) \<subseteq> local.span (set Bo)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>v. v \<in> set Av \<Longrightarrow> v \<in> local.span (set Bo); x \<in> local.span (set Av)\<rbrakk> \<Longrightarrow> x \<in> local.span (set Bo)
[PROOF STEP]
by (meson Bo_carrier in_mono span_subsetI subsetI)
[PROOF STATE]
proof (state)
this:
local.span (set Av) \<subseteq> local.span (set Bo)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(local.span (set Av) \<subseteq> local.span (set Bo)) = (\<forall>v\<in>set Av. adjuster d v Bo = - v)

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(local.span (set Av) \<subseteq> local.span (set Bo)) = (\<forall>v\<in>set Av. adjuster d v Bo = - v)

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
have "\<dots> = is_subspace_of_vec_list d Av Bv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v\<in>set Av. adjuster d v Bo = - v) = is_subspace_of_vec_list d Av Bv
[PROOF STEP]
by (simp add: is_subspace_of_vec_list_def d_def Bo_def)
[PROOF STATE]
proof (state)
this:
(\<forall>v\<in>set Av. adjuster d v Bo = - v) = is_subspace_of_vec_list d Av Bv

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list (length canonical_basis) (map vec_of_basis_enum A) (map vec_of_basis_enum B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list d Av Bv
[PROOF STEP]
show "ccspan (set A) \<le> ccspan (set B) \<longleftrightarrow> is_subspace_of_vec_list d Av Bv"
[PROOF STATE]
proof (prove)
using this:
(ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list d Av Bv

goal (1 subgoal):
 1. (ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list d Av Bv
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(ccspan (set A) \<le> ccspan (set B)) = is_subspace_of_vec_list d Av Bv

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma two_powr_height_bound_deg:
  assumes "invar_vebt t n "
  shows " 2^(height t) \<le> 2*(n::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
have " (height t) = \<lceil> log 2 n\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (height t) = \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
by (simp add: assms heigt_uplog_rel)
[PROOF STATE]
proof (state)
this:
int (height t) = \<lceil>log 2 (real n)\<rceil>

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int (height t) = \<lceil>log 2 (real n)\<rceil>

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
have "\<lceil> log 2 n\<rceil> \<le> log 2 n +1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lceil>log 2 (real n)\<rceil> \<le> log 2 (real n) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int \<lceil>log 2 (real n)\<rceil> \<le> log 2 (real n) + 1

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int \<lceil>log 2 (real n)\<rceil> \<le> log 2 (real n) + 1

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
hence "2 powr \<lceil> log 2 n\<rceil> \<le> 2 powr  (log 2 n +1)"
[PROOF STATE]
proof (prove)
using this:
real_of_int \<lceil>log 2 (real n)\<rceil> \<le> log 2 (real n) + 1

goal (1 subgoal):
 1. 2 powr real_of_int \<lceil>log 2 (real n)\<rceil> \<le> 2 powr (log 2 (real n) + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 powr real_of_int \<lceil>log 2 (real n)\<rceil> \<le> 2 powr (log 2 (real n) + 1)

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 powr real_of_int \<lceil>log 2 (real n)\<rceil> \<le> 2 powr (log 2 (real n) + 1)

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
have " 2 powr  (log 2 n +1) = 2 powr 1 * 2 powr  (log 2 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)
[PROOF STEP]
by (simp add: powr_add)
[PROOF STATE]
proof (state)
this:
2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
hence " 2 powr  (log 2 n +1) = 2 * n"
[PROOF STATE]
proof (prove)
using this:
2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)

goal (1 subgoal):
 1. 2 powr (log 2 (real n) + 1) = real (2 * n)
[PROOF STEP]
using assms deg_not_0
[PROOF STATE]
proof (prove)
using this:
2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)
invar_vebt t n
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n

goal (1 subgoal):
 1. 2 powr (log 2 (real n) + 1) = real (2 * n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
2 powr (log 2 (real n) + 1) = real (2 * n)

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
int (height t) = \<lceil>log 2 (real n)\<rceil>
real_of_int \<lceil>log 2 (real n)\<rceil> \<le> log 2 (real n) + 1
2 powr real_of_int \<lceil>log 2 (real n)\<rceil> \<le> 2 powr (log 2 (real n) + 1)
2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)
2 powr (log 2 (real n) + 1) = real (2 * n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (height t) = \<lceil>log 2 (real n)\<rceil>
real_of_int \<lceil>log 2 (real n)\<rceil> \<le> log 2 (real n) + 1
2 powr real_of_int \<lceil>log 2 (real n)\<rceil> \<le> 2 powr (log 2 (real n) + 1)
2 powr (log 2 (real n) + 1) = 2 powr 1 * 2 powr log 2 (real n)
2 powr (log 2 (real n) + 1) = real (2 * n)

goal (1 subgoal):
 1. 2 ^ height t \<le> 2 * n
[PROOF STEP]
by (metis linorder_not_less not_one_le_zero of_int_0 of_int_less_iff of_int_numeral of_int_of_nat_eq of_nat_le_iff one_add_one order_less_le powr_realpow real_of_nat_eq_numeral_power_cancel_iff zle_add1_eq_le)
[PROOF STATE]
proof (state)
this:
2 ^ height t \<le> 2 * n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSLIMSEQ_sin_cos_pi:
  "(\<lambda>n. real n * sin (pi / real n) * cos (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real n * sin (pi / real n) * cos (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S pi
[PROOF STEP]
using NSLIMSEQ_cos_one NSLIMSEQ_mult NSLIMSEQ_sin_pi
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. cos (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S 1
\<lbrakk>?X \<longlonglongrightarrow>\<^sub>N\<^sub>S ?a; ?Y \<longlonglongrightarrow>\<^sub>N\<^sub>S ?b\<rbrakk> \<Longrightarrow> (\<lambda>n. ?X n * ?Y n) \<longlonglongrightarrow>\<^sub>N\<^sub>S ?a * ?b
(\<lambda>n. real n * sin (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S pi

goal (1 subgoal):
 1. (\<lambda>n. real n * sin (pi / real n) * cos (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S pi
[PROOF STEP]
by force


[STATEMENT]
lemma compact_Inter:
  fixes \<F> :: "'a :: heine_borel set set"
  assumes com: "\<And>S. S \<in> \<F> \<Longrightarrow> compact S" and "\<F> \<noteq> {}"
  shows "compact(\<Inter> \<F>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (\<Inter> \<F>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?S \<in> \<F> \<Longrightarrow> compact ?S
\<F> \<noteq> {}

goal (1 subgoal):
 1. compact (\<Inter> \<F>)
[PROOF STEP]
by (meson Inf_lower all_not_in_conv bounded_subset closed_Inter compact_eq_bounded_closed)


[STATEMENT]
lemma all_impl_Max:
  assumes "\<forall>x. f x \<ge> (a::int)"
          "finite (range f)"
  shows "(MAX x. f x) \<ge> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> Max (range f)
[PROOF STEP]
by (simp add: Max_ge_iff assms(1) assms(2))


[STATEMENT]
lemma affine_hull_span:
  assumes "a \<in> S"
  shows "affine hull S = {a + v | v. v \<in> span {x - a | x. x \<in> S - {a}}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = {a + v |v. v \<in> span {x - a |x. x \<in> S - {a}}}
[PROOF STEP]
using affine_hull_insert_span[of a "S - {a}", unfolded insert_Diff[OF assms]]
[PROOF STATE]
proof (prove)
using this:
a \<notin> S - {a} \<Longrightarrow> affine hull S = {a + v |v. v \<in> span {x - a |x. x \<in> S - {a}}}

goal (1 subgoal):
 1. affine hull S = {a + v |v. v \<in> span {x - a |x. x \<in> S - {a}}}
[PROOF STEP]
by auto


[STATEMENT]
lemma Gamma_Weierstrass_real: "Gamma_series_Weierstrass x \<longlonglongrightarrow> Gamma (x :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma_series_Weierstrass x \<longlonglongrightarrow> Gamma x
[PROOF STEP]
using Gamma_Weierstrass_complex[of "of_real x"]
[PROOF STATE]
proof (prove)
using this:
Gamma_series_Weierstrass (complex_of_real x) \<longlonglongrightarrow> Gamma (complex_of_real x)

goal (1 subgoal):
 1. Gamma_series_Weierstrass x \<longlonglongrightarrow> Gamma x
[PROOF STEP]
unfolding Gamma_series_Weierstrass_def[abs_def]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. exp (- euler_mascheroni * complex_of_real x) / complex_of_real x * (\<Prod>k = 1..n. exp (complex_of_real x / of_nat k) / (1 + complex_of_real x / of_nat k))) \<longlonglongrightarrow> Gamma (complex_of_real x)

goal (1 subgoal):
 1. (\<lambda>n. exp (- euler_mascheroni * x) / x * (\<Prod>k = 1..n. exp (x / real k) / (1 + x / real k))) \<longlonglongrightarrow> Gamma x
[PROOF STEP]
by (subst tendsto_complex_of_real_iff [symmetric])
     (simp_all add: exp_of_real[symmetric] Gamma_complex_of_real)


[STATEMENT]
lemma ac_mult':
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "y \<in> nonzero Q\<^sub>p"
  shows "ac n (x \<otimes> y) = (ac n x) \<otimes>\<^bsub>Zp_res_ring n\<^esub> (ac n y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n (x \<otimes> y) = ac n x \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> ac n y
[PROOF STEP]
unfolding ac_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) = (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> (if y = \<zero> then 0 else angular_component y n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) = (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> (if y = \<zero> then 0 else angular_component y n)
[PROOF STEP]
have 0: "angular_component (x \<otimes> y) = angular_component x \<otimes>\<^bsub>Z\<^sub>p\<^esub> angular_component y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angular_component (x \<otimes> y) = angular_component x \<otimes>\<^bsub>Z\<^sub>p\<^esub> angular_component y
[PROOF STEP]
using assms angular_component_mult[of x y]
[PROOF STATE]
proof (prove)
using this:
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
\<lbrakk>x \<in> nonzero Q\<^sub>p; y \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> angular_component (x \<otimes> y) = angular_component x \<otimes>\<^bsub>Z\<^sub>p\<^esub> angular_component y

goal (1 subgoal):
 1. angular_component (x \<otimes> y) = angular_component x \<otimes>\<^bsub>Z\<^sub>p\<^esub> angular_component y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
angular_component (x \<otimes> y) = angular_component x \<otimes>\<^bsub>Z\<^sub>p\<^esub> angular_component y

goal (1 subgoal):
 1. (if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) = (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> (if y = \<zero> then 0 else angular_component y n)
[PROOF STEP]
show "(if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) =
    (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>Zp_res_ring n\<^esub> (if y = \<zero> then 0 else angular_component y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) = (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> (if y = \<zero> then 0 else angular_component y n)
[PROOF STEP]
using assms angular_component_closed[of x] angular_component_closed[of y]
[PROOF STATE]
proof (prove)
using this:
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p
x \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component x \<in> carrier Z\<^sub>p
y \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component y \<in> carrier Z\<^sub>p

goal (1 subgoal):
 1. (if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) = (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> (if y = \<zero> then 0 else angular_component y n)
[PROOF STEP]
by (simp add: "0" Qp.integral_iff Qp.nonzero_closed Qp.nonzero_memE(2) residue_of_prod)
[PROOF STATE]
proof (state)
this:
(if x \<otimes> y = \<zero> then 0 else angular_component (x \<otimes> y) n) = (if x = \<zero> then 0 else angular_component x n) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> (if y = \<zero> then 0 else angular_component y n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Amicable_pair_sym: fixes m::nat and n ::nat
  assumes "m Amic n " shows "n Amic m "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n Amic m
[PROOF STEP]
using  Amicable_pair_def assms
[PROOF STATE]
proof (prove)
using this:
?m Amic ?n \<equiv> ?m = aliquot_sum ?n \<and> ?n = aliquot_sum ?m
m Amic n

goal (1 subgoal):
 1. n Amic m
[PROOF STEP]
by blast


[STATEMENT]
theorem (in group) solvable_iff_trivial_derived_seq:
  "solvable G \<longleftrightarrow> (\<exists>n. (derived G ^^ n) (carrier G) = { \<one> })"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solvable G = (\<exists>n. (derived G ^^ n) (carrier G) = {\<one>})
[PROOF STEP]
using solvable_imp_trivial_derived_seq subgroup_self trivial_derived_seq_imp_solvable
[PROOF STATE]
proof (prove)
using this:
solvable_seq G ?H \<Longrightarrow> \<exists>n. (derived G ^^ n) ?H = {\<one>}
subgroup (carrier G) G
\<lbrakk>subgroup ?H G; (derived G ^^ ?n) ?H = {\<one>}\<rbrakk> \<Longrightarrow> solvable_seq G ?H

goal (1 subgoal):
 1. solvable G = (\<exists>n. (derived G ^^ n) (carrier G) = {\<one>})
[PROOF STEP]
by (auto simp add: solvable_def)


[STATEMENT]
lemma Re_eq_pihalf_lemma:
    "\<bar>Re z\<bar> = pi/2 \<Longrightarrow> Im z = 0 \<Longrightarrow>
      Re ((exp (\<i>*z) + inverse (exp (\<i>*z))) / 2) = 0 \<and> 0 \<le> Im ((exp (\<i>*z) + inverse (exp (\<i>*z))) / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>Re z\<bar> = pi / 2; Im z = 0\<rbrakk> \<Longrightarrow> Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2) = 0 \<and> 0 \<le> Im ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
[PROOF STEP]
apply (simp add: cos_i_times [symmetric] Re_cos Im_cos abs_if del: eq_divide_eq_numeral1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(if Re z < 0 then - Re z else Re z) = pi / 2; Im z = 0\<rbrakk> \<Longrightarrow> cos (Re z) = 0
[PROOF STEP]
by (metis cos_minus cos_pi_half)


[STATEMENT]
lemma natural_zero_minus_one: "(0::natural) - 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 - 1 = 0
[PROOF STEP]
by (rule zero_diff)


[STATEMENT]
lemma (in ordered_ab_group_add) add_nonpos_eq_0_iff:
  assumes x: "0 \<ge> x" and y: "0 \<ge> y"
  shows "x + y = 0 \<longleftrightarrow> x = 0 \<and> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = (0::'a)) = (x = (0::'a) \<and> y = (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x + y = (0::'a)) = (x = (0::'a) \<and> y = (0::'a))
[PROOF STEP]
from add_nonneg_eq_0_iff[of "-x" "-y"] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(0::'a) \<le> - x; (0::'a) \<le> - y\<rbrakk> \<Longrightarrow> (- x + - y = (0::'a)) = (- x = (0::'a) \<and> - y = (0::'a))
x \<le> (0::'a)
y \<le> (0::'a)
[PROOF STEP]
have "- (x + y) = 0 \<longleftrightarrow> - x = 0 \<and> - y = 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<le> - x; (0::'a) \<le> - y\<rbrakk> \<Longrightarrow> (- x + - y = (0::'a)) = (- x = (0::'a) \<and> - y = (0::'a))
x \<le> (0::'a)
y \<le> (0::'a)

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

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

goal (1 subgoal):
 1. (x + y = (0::'a)) = (x = (0::'a) \<and> y = (0::'a))
[PROOF STEP]
have "(- (x + y) = 0) = (x + y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (x + y) = (0::'a)) = (x + y = (0::'a))
[PROOF STEP]
unfolding neg_equal_0_iff_equal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = (0::'a)) = (x + y = (0::'a))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(- (x + y) = (0::'a)) = (x + y = (0::'a))

goal (1 subgoal):
 1. (x + y = (0::'a)) = (x = (0::'a) \<and> y = (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x + y = (0::'a)) = (- x = (0::'a) \<and> - y = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x + y = (0::'a)) = (- x = (0::'a) \<and> - y = (0::'a))

goal (1 subgoal):
 1. (x + y = (0::'a)) = (x = (0::'a) \<and> y = (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x + y = (0::'a)) = (x = (0::'a) \<and> y = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quadratic_shape1a:
  fixes a b c x y::"real"
  assumes agt: "a > 0"
  assumes xyroots: "x < y \<and> a*x^2 + b*x + c = 0 \<and> a*y^2 + b*y + c = 0"
  shows "\<And>z. (z > x \<and> z < y \<Longrightarrow> a*z^2 + b*z + c < 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. x < z \<and> z < y \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
assume zgt: "z > x"
[PROOF STATE]
proof (state)
this:
x < z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
assume zlt: "z < y"
[PROOF STATE]
proof (state)
this:
z < y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have frac_gtz: "(1/(2*a)) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (2 * a)
[PROOF STEP]
using agt
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. 0 < 1 / (2 * a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / (2 * a)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have xy_prop:"(x = (-b + sqrt(b^2 - 4*a*c))/(2*a) \<and> y = (-b - sqrt(b^2 - 4*a*c))/(2*a))
    \<or> (y = (-b + sqrt(b^2 - 4*a*c))/(2*a) \<and> x = (-b - sqrt(b^2 - 4*a*c))/(2*a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<or> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
using xyroots agt discriminant_iff
[PROOF STATE]
proof (prove)
using this:
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0
0 < a
?a \<noteq> 0 \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (0 \<le> discrim ?a ?b ?c \<and> (?x = (- ?b + sqrt (discrim ?a ?b ?c)) / (2 * ?a) \<or> ?x = (- ?b - sqrt (discrim ?a ?b ?c)) / (2 * ?a)))

goal (1 subgoal):
 1. x = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<or> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
unfolding discrim_def
[PROOF STATE]
proof (prove)
using this:
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0
0 < a
?a \<noteq> 0 \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (0 \<le> ?b\<^sup>2 - 4 * ?a * ?c \<and> (?x = (- ?b + sqrt (?b\<^sup>2 - 4 * ?a * ?c)) / (2 * ?a) \<or> ?x = (- ?b - sqrt (?b\<^sup>2 - 4 * ?a * ?c)) / (2 * ?a)))

goal (1 subgoal):
 1. x = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<or> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<or> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have "b^2 - 4*a*c \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c
[PROOF STEP]
using xyroots discriminant_iff
[PROOF STATE]
proof (prove)
using this:
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0
?a \<noteq> 0 \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (0 \<le> discrim ?a ?b ?c \<and> (?x = (- ?b + sqrt (discrim ?a ?b ?c)) / (2 * ?a) \<or> ?x = (- ?b - sqrt (discrim ?a ?b ?c)) / (2 * ?a)))

goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c
[PROOF STEP]
using assms(1) discrim_def
[PROOF STATE]
proof (prove)
using this:
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0
?a \<noteq> 0 \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (0 \<le> discrim ?a ?b ?c \<and> (?x = (- ?b + sqrt (discrim ?a ?b ?c)) / (2 * ?a) \<or> ?x = (- ?b - sqrt (discrim ?a ?b ?c)) / (2 * ?a)))
0 < a
discrim ?a ?b ?c \<equiv> ?b\<^sup>2 - 4 * ?a * ?c

goal (1 subgoal):
 1. 0 \<le> b\<^sup>2 - 4 * a * c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> b\<^sup>2 - 4 * a * c

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> b\<^sup>2 - 4 * a * c
[PROOF STEP]
have pos_discrim: "b^2 - 4*a*c > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> b\<^sup>2 - 4 * a * c

goal (1 subgoal):
 1. 0 < b\<^sup>2 - 4 * a * c
[PROOF STEP]
using xyroots discriminant_zero
[PROOF STATE]
proof (prove)
using this:
0 \<le> b\<^sup>2 - 4 * a * c
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0
\<lbrakk>?a \<noteq> 0; discrim ?a ?b ?c = 0\<rbrakk> \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (?x = - ?b / (2 * ?a))

goal (1 subgoal):
 1. 0 < b\<^sup>2 - 4 * a * c
[PROOF STEP]
using \<open>0 \<le> b\<^sup>2 - 4 * a * c\<close> assms(1) discrim_def less_eq_real_def linorder_not_less
[PROOF STATE]
proof (prove)
using this:
0 \<le> b\<^sup>2 - 4 * a * c
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0
\<lbrakk>?a \<noteq> 0; discrim ?a ?b ?c = 0\<rbrakk> \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (?x = - ?b / (2 * ?a))
0 \<le> b\<^sup>2 - 4 * a * c
0 < a
discrim ?a ?b ?c \<equiv> ?b\<^sup>2 - 4 * ?a * ?c
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. 0 < b\<^sup>2 - 4 * a * c
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < b\<^sup>2 - 4 * a * c

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < b\<^sup>2 - 4 * a * c
[PROOF STEP]
have sqrt_gt: "sqrt(b^2 - 4*a*c) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < b\<^sup>2 - 4 * a * c

goal (1 subgoal):
 1. 0 < sqrt (b\<^sup>2 - 4 * a * c)
[PROOF STEP]
using real_sqrt_gt_0_iff
[PROOF STATE]
proof (prove)
using this:
0 < b\<^sup>2 - 4 * a * c
(0 < sqrt ?y) = (0 < ?y)

goal (1 subgoal):
 1. 0 < sqrt (b\<^sup>2 - 4 * a * c)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < sqrt (b\<^sup>2 - 4 * a * c)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < sqrt (b\<^sup>2 - 4 * a * c)
[PROOF STEP]
have "(- b - sqrt(b^2 - 4*a*c)) < (- b + sqrt(b^2 - 4*a*c))"
[PROOF STATE]
proof (prove)
using this:
0 < sqrt (b\<^sup>2 - 4 * a * c)

goal (1 subgoal):
 1. - b - sqrt (b\<^sup>2 - 4 * a * c) < - b + sqrt (b\<^sup>2 - 4 * a * c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- b - sqrt (b\<^sup>2 - 4 * a * c) < - b + sqrt (b\<^sup>2 - 4 * a * c)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- b - sqrt (b\<^sup>2 - 4 * a * c) < - b + sqrt (b\<^sup>2 - 4 * a * c)
[PROOF STEP]
have "(- b - sqrt(b^2 - 4*a*c))*(1/(2*a)) < (- b + sqrt(b^2 - 4*a*c))*(1/(2*a)) "
[PROOF STATE]
proof (prove)
using this:
- b - sqrt (b\<^sup>2 - 4 * a * c) < - b + sqrt (b\<^sup>2 - 4 * a * c)

goal (1 subgoal):
 1. (- b - sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a)) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a))
[PROOF STEP]
using frac_gtz
[PROOF STATE]
proof (prove)
using this:
- b - sqrt (b\<^sup>2 - 4 * a * c) < - b + sqrt (b\<^sup>2 - 4 * a * c)
0 < 1 / (2 * a)

goal (1 subgoal):
 1. (- b - sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a)) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a))
[PROOF STEP]
by (simp add: divide_strict_right_mono)
[PROOF STATE]
proof (state)
this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a)) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a))

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a)) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a))
[PROOF STEP]
have "(- b - sqrt(b^2 - 4*a*c))/(2*a) < (- b + sqrt(b^2 - 4*a*c))/(2*a)"
[PROOF STATE]
proof (prove)
using this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a)) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) * (1 / (2 * a))

goal (1 subgoal):
 1. (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
have xandy: "x = (- b - sqrt(b^2 - 4*a*c))/(2*a) \<and> y = (- b + sqrt(b^2 - 4*a*c))/(2*a)"
[PROOF STATE]
proof (prove)
using this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)

goal (1 subgoal):
 1. x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
using xy_prop xyroots
[PROOF STATE]
proof (prove)
using this:
(- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) < (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
x = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<or> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0

goal (1 subgoal):
 1. x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
let ?mdpt = "-b/(2*a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have xlt: "x < ?mdpt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < - b / (2 * a)
[PROOF STEP]
using xandy sqrt_gt
[PROOF STATE]
proof (prove)
using this:
x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
0 < sqrt (b\<^sup>2 - 4 * a * c)

goal (1 subgoal):
 1. x < - b / (2 * a)
[PROOF STEP]
using frac_gtz divide_minus_left divide_strict_right_mono sqrt_gt
[PROOF STATE]
proof (prove)
using this:
x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
0 < sqrt (b\<^sup>2 - 4 * a * c)
0 < 1 / (2 * a)
- ?a / ?b = - (?a / ?b)
\<lbrakk>?a < ?b; (0::?'a) < ?c\<rbrakk> \<Longrightarrow> ?a / ?c < ?b / ?c
0 < sqrt (b\<^sup>2 - 4 * a * c)

goal (1 subgoal):
 1. x < - b / (2 * a)
[PROOF STEP]
by (smt (verit) agt)
[PROOF STATE]
proof (state)
this:
x < - b / (2 * a)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have ylt: "?mdpt < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - b / (2 * a) < y
[PROOF STEP]
using xandy sqrt_gt frac_gtz
[PROOF STATE]
proof (prove)
using this:
x = (- b - sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a) \<and> y = (- b + sqrt (b\<^sup>2 - 4 * a * c)) / (2 * a)
0 < sqrt (b\<^sup>2 - 4 * a * c)
0 < 1 / (2 * a)

goal (1 subgoal):
 1. - b / (2 * a) < y
[PROOF STEP]
by (smt (verit, del_insts) divide_strict_right_mono zero_less_divide_1_iff)
[PROOF STATE]
proof (state)
this:
- b / (2 * a) < y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have mdpt_val: "a*?mdpt^2 + b*?mdpt + c < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
have firsteq: "a*?mdpt^2 + b*?mdpt + c = (a*b^2)/(4*a^2) - (b^2)/(2*a) + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = a * b\<^sup>2 / (4 * a\<^sup>2) - b\<^sup>2 / (2 * a) + c
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = a * b\<^sup>2 / (4 * a\<^sup>2) - b\<^sup>2 / (2 * a) + c

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

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
have h2: "(b^2)/(2*a) = (2*b^2)/(4*a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b\<^sup>2 / (2 * a) = 2 * b\<^sup>2 / (4 * a)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
b\<^sup>2 / (2 * a) = 2 * b\<^sup>2 / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
have h3: "c = (4*a*c)/(4*a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = 4 * a * c / (4 * a)
[PROOF STEP]
using agt
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. c = 4 * a * c / (4 * a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = 4 * a * c / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
have "a*?mdpt^2 + b*?mdpt + c = (b^2)/(4*a) - (2*b^2)/(4*a) + (4*a*c)/(4*a) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = b\<^sup>2 / (4 * a) - 2 * b\<^sup>2 / (4 * a) + 4 * a * c / (4 * a)
[PROOF STEP]
using firsteq h1 h2 h3
[PROOF STATE]
proof (prove)
using this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = a * b\<^sup>2 / (4 * a\<^sup>2) - b\<^sup>2 / (2 * a) + c
a * b\<^sup>2 / (4 * a\<^sup>2) = b\<^sup>2 / (4 * a)
b\<^sup>2 / (2 * a) = 2 * b\<^sup>2 / (4 * a)
c = 4 * a * c / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = b\<^sup>2 / (4 * a) - 2 * b\<^sup>2 / (4 * a) + 4 * a * c / (4 * a)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = b\<^sup>2 / (4 * a) - 2 * b\<^sup>2 / (4 * a) + 4 * a * c / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = b\<^sup>2 / (4 * a) - 2 * b\<^sup>2 / (4 * a) + 4 * a * c / (4 * a)
[PROOF STEP]
have "a*?mdpt^2 + b*?mdpt + c = (b^2 - 2*b^2 + 4*a*c)/(4*a)"
[PROOF STATE]
proof (prove)
using this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = b\<^sup>2 / (4 * a) - 2 * b\<^sup>2 / (4 * a) + 4 * a * c / (4 * a)

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

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = (b\<^sup>2 - 2 * b\<^sup>2 + 4 * a * c) / (4 * a)
[PROOF STEP]
have eq2: "a*?mdpt^2 + b*?mdpt + c = (4*a*c - b^2)/(4*a)"
[PROOF STATE]
proof (prove)
using this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = (b\<^sup>2 - 2 * b\<^sup>2 + 4 * a * c) / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = (4 * a * c - b\<^sup>2) / (4 * a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = (4 * a * c - b\<^sup>2) / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
have h: "4*a*c - b^2 < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * a * c - b\<^sup>2 < 0
[PROOF STEP]
using pos_discrim
[PROOF STATE]
proof (prove)
using this:
0 < b\<^sup>2 - 4 * a * c

goal (1 subgoal):
 1. 4 * a * c - b\<^sup>2 < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
4 * a * c - b\<^sup>2 < 0

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
have "1/(4*a) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (4 * a)
[PROOF STEP]
using agt
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. 0 < 1 / (4 * a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < 1 / (4 * a)

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

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

goal (1 subgoal):
 1. (4 * a * c - b\<^sup>2) * (1 / (4 * a)) < 0
[PROOF STEP]
using mult_less_0_iff
[PROOF STATE]
proof (prove)
using this:
0 < 1 / (4 * a)
4 * a * c - b\<^sup>2 < 0
(?a * ?b < (0::?'a)) = ((0::?'a) < ?a \<and> ?b < (0::?'a) \<or> ?a < (0::?'a) \<and> (0::?'a) < ?b)

goal (1 subgoal):
 1. (4 * a * c - b\<^sup>2) * (1 / (4 * a)) < 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(4 * a * c - b\<^sup>2) * (1 / (4 * a)) < 0

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

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
using eq2
[PROOF STATE]
proof (prove)
using this:
(4 * a * c - b\<^sup>2) * (1 / (4 * a)) < 0
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c = (4 * a * c - b\<^sup>2) / (4 * a)

goal (1 subgoal):
 1. a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have nex: "\<not> (\<exists>k> x. k < y \<and> poly [:c, b, a:] k = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>k>x. k < y \<and> poly [:c, b, a:] k = 0)
[PROOF STEP]
using discriminant_iff agt
[PROOF STATE]
proof (prove)
using this:
?a \<noteq> 0 \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (0 \<le> discrim ?a ?b ?c \<and> (?x = (- ?b + sqrt (discrim ?a ?b ?c)) / (2 * ?a) \<or> ?x = (- ?b - sqrt (discrim ?a ?b ?c)) / (2 * ?a)))
0 < a

goal (1 subgoal):
 1. \<not> (\<exists>k>x. k < y \<and> poly [:c, b, a:] k = 0)
[PROOF STEP]
by (metis discrim_def less_irrefl quadratic_poly_eval xandy)
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>k>x. k < y \<and> poly [:c, b, a:] k = 0)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have nor2: "\<not> (\<exists>x>z. x < - b / (2 * a) \<and> poly [:c, b, a:] x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>x>z. x < - b / (2 * a) \<and> poly [:c, b, a:] x = 0)
[PROOF STEP]
using nex xlt ylt zgt zlt
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>k>x. k < y \<and> poly [:c, b, a:] k = 0)
x < - b / (2 * a)
- b / (2 * a) < y
x < z
z < y

goal (1 subgoal):
 1. \<not> (\<exists>x>z. x < - b / (2 * a) \<and> poly [:c, b, a:] x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>x>z. x < - b / (2 * a) \<and> poly [:c, b, a:] x = 0)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have nor: "\<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)
[PROOF STEP]
using nex xlt ylt zgt zlt discriminant_iff agt
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>k>x. k < y \<and> poly [:c, b, a:] k = 0)
x < - b / (2 * a)
- b / (2 * a) < y
x < z
z < y
?a \<noteq> 0 \<Longrightarrow> (?a * ?x\<^sup>2 + ?b * ?x + ?c = 0) = (0 \<le> discrim ?a ?b ?c \<and> (?x = (- ?b + sqrt (discrim ?a ?b ?c)) / (2 * ?a) \<or> ?x = (- ?b - sqrt (discrim ?a ?b ?c)) / (2 * ?a)))
0 < a

goal (1 subgoal):
 1. \<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)
[PROOF STEP]
have mdpt_lt: "?mdpt < z \<Longrightarrow> a*z^2 + b*z + c < 0 "
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)

goal (1 subgoal):
 1. - b / (2 * a) < z \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
using mdpt_val zgt zlt xlt ylt poly_IVT_pos[where p = "[:c, b, a:]", where a= "?mdpt", where b = "z"]
      quadratic_poly_eval[of c b a]
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0)
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
x < z
z < y
x < - b / (2 * a)
- b / (2 * a) < y
\<lbrakk>- b / (2 * a) < z; poly [:c, b, a:] (- b / (2 * a)) < 0; 0 < poly [:c, b, a:] z\<rbrakk> \<Longrightarrow> \<exists>x>- b / (2 * a). x < z \<and> poly [:c, b, a:] x = 0
poly [:c, b, a:] ?x = a * ?x\<^sup>2 + b * ?x + c

goal (1 subgoal):
 1. - b / (2 * a) < z \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
by (metis \<open>\<not> (\<exists>k>x. k < y \<and> poly [:c, b, a:] k = 0)\<close> linorder_neqE_linordered_idom)
[PROOF STATE]
proof (state)
this:
- b / (2 * a) < z \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
have mdpt_gt: "?mdpt > z \<Longrightarrow> a*z^2 + b*z + c < 0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
using zgt zlt mdpt_val xlt ylt nor2 poly_IVT_neg[where p = "[:c, b, a:]", where a = "z", where b = "?mdpt"] quadratic_poly_eval[of c b a]
[PROOF STATE]
proof (prove)
using this:
x < z
z < y
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0
x < - b / (2 * a)
- b / (2 * a) < y
\<not> (\<exists>x>z. x < - b / (2 * a) \<and> poly [:c, b, a:] x = 0)
\<lbrakk>z < - b / (2 * a); 0 < poly [:c, b, a:] z; poly [:c, b, a:] (- b / (2 * a)) < 0\<rbrakk> \<Longrightarrow> \<exists>x>z. x < - b / (2 * a) \<and> poly [:c, b, a:] x = 0
poly [:c, b, a:] ?x = a * ?x\<^sup>2 + b * ?x + c

goal (1 subgoal):
 1. z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
by (metis linorder_neqE_linordered_idom nex)
[PROOF STATE]
proof (state)
this:
z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x < z; z < y\<rbrakk> \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
show "a*z^2 + b*z + c < 0"
[PROOF STATE]
proof (prove)
using this:
z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0

goal (1 subgoal):
 1. a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
using mdpt_lt mdpt_gt mdpt_val
[PROOF STATE]
proof (prove)
using this:
z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
- b / (2 * a) < z \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
z < - b / (2 * a) \<Longrightarrow> a * z\<^sup>2 + b * z + c < 0
a * (- b / (2 * a))\<^sup>2 + b * (- b / (2 * a)) + c < 0

goal (1 subgoal):
 1. a * z\<^sup>2 + b * z + c < 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a * z\<^sup>2 + b * z + c < 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rcoset_rel_conv_lcoset_rel:
  "rcoset_rel G = map_prod uminus uminus ` (lcoset_rel G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcoset_rel G = map_prod uminus uminus ` lcoset_rel G
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
fix x :: "'g\<times>'g"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
obtain a b where ab: "x=(a,b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. \<And>x. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
hence "(x \<in> rcoset_rel G) = (a-b \<in> G)"
[PROOF STATE]
proof (prove)
using this:
x = (a, b)

goal (1 subgoal):
 1. (x \<in> rcoset_rel G) = (a - b \<in> G)
[PROOF STEP]
using rcoset_rel_def
[PROOF STATE]
proof (prove)
using this:
x = (a, b)
rcoset_rel ?A \<equiv> {(x, y). x - y \<in> ?A}

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

goal (1 subgoal):
 1. \<And>x. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<in> rcoset_rel G) = (a - b \<in> G)

goal (1 subgoal):
 1. \<And>x. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
have "\<dots> = ( (-b,-a) \<in> lcoset_rel G )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b \<in> G) = ((- b, - a) \<in> lcoset_rel G)
[PROOF STEP]
using uminus_closed lcoset_rel_def
[PROOF STATE]
proof (prove)
using this:
?g \<in> G \<Longrightarrow> - ?g \<in> G
lcoset_rel ?A \<equiv> {(x, y). - x + y \<in> ?A}

goal (1 subgoal):
 1. (a - b \<in> G) = ((- b, - a) \<in> lcoset_rel G)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(a - b \<in> G) = ((- b, - a) \<in> lcoset_rel G)

goal (1 subgoal):
 1. \<And>x. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x \<in> rcoset_rel G) = ((- b, - a) \<in> lcoset_rel G)
[PROOF STEP]
show  "(x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` (lcoset_rel G))"
[PROOF STATE]
proof (prove)
using this:
(x \<in> rcoset_rel G) = ((- b, - a) \<in> lcoset_rel G)

goal (1 subgoal):
 1. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
using ab symD[OF lcoset_rel_sym] map_prod_def
[PROOF STATE]
proof (prove)
using this:
(x \<in> rcoset_rel G) = ((- b, - a) \<in> lcoset_rel G)
x = (a, b)
(?b, ?a) \<in> lcoset_rel G \<Longrightarrow> (?a, ?b) \<in> lcoset_rel G
map_prod ?f ?g = (\<lambda>(x, y). (?f x, ?g y))

goal (1 subgoal):
 1. (x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)
[PROOF STEP]
by    force
[PROOF STATE]
proof (state)
this:
(x \<in> rcoset_rel G) = (x \<in> map_prod uminus uminus ` lcoset_rel G)

goal:
No subgoals!
[PROOF STEP]
qed