[STATEMENT]
lemma closed_proj_rel: "closed {(x::'a::euclidean_space nonzero, y::'a nonzero). proj_rel x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {(x, y). proj_rel x y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed {(x, y). proj_rel x y}
[PROOF STEP]
have closed_proj_rel_euclidean:
    "\<exists>A B. 0 \<notin> A \<and> 0 \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and>
      A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}"
    if "\<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a" "a \<noteq> 0" "b \<noteq> 0"
    for a b::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
proof -\<comment> \<open>explicitly constructing open ``cones'' that are disjoint\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define a1 where "a1 = a /\<^sub>R norm a"
[PROOF STATE]
proof (state)
this:
a1 = a /\<^sub>R norm a

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define b1 where "b1 = b /\<^sub>R norm b"
[PROOF STATE]
proof (state)
this:
b1 = b /\<^sub>R norm b

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have norm_a1[simp]: "norm a1 = 1" and norm_b1[simp]: "norm b1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm a1 = 1 &&& norm b1 = 1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> 0 \<Longrightarrow> b \<noteq> ?c *\<^sub>R a
a \<noteq> (0::'a)
b \<noteq> (0::'a)

goal (1 subgoal):
 1. norm a1 = 1 &&& norm b1 = 1
[PROOF STEP]
by (auto simp: a1_def b1_def divide_simps)
[PROOF STATE]
proof (state)
this:
norm a1 = 1
norm b1 = 1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have a_alt_def: "a = norm a *\<^sub>R a1" and b_alt_def: "b = norm b *\<^sub>R b1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = norm a *\<^sub>R a1 &&& b = norm b *\<^sub>R b1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> 0 \<Longrightarrow> b \<noteq> ?c *\<^sub>R a
a \<noteq> (0::'a)
b \<noteq> (0::'a)

goal (1 subgoal):
 1. a = norm a *\<^sub>R a1 &&& b = norm b *\<^sub>R b1
[PROOF STEP]
by (auto simp: a1_def b1_def)
[PROOF STATE]
proof (state)
this:
a = norm a *\<^sub>R a1
b = norm b *\<^sub>R b1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have a1_neq_b1: "a1 \<noteq> b1" "a1 \<noteq> -b1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a1 \<noteq> b1 &&& a1 \<noteq> - b1
[PROOF STEP]
using that(1)[of "norm b / norm a"] that(2-)
[PROOF STATE]
proof (prove)
using this:
norm b / norm a \<noteq> 0 \<Longrightarrow> b \<noteq> (norm b / norm a) *\<^sub>R a
a \<noteq> (0::'a)
b \<noteq> (0::'a)

goal (1 subgoal):
 1. a1 \<noteq> b1 &&& a1 \<noteq> - b1
[PROOF STEP]
apply (auto simp: a1_def b1_def divide_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>b \<noteq> (norm b / norm a) *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); (1 / norm a) *\<^sub>R a = (1 / norm b) *\<^sub>R b\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>b \<noteq> (norm b / norm a) *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); (1 / norm a) *\<^sub>R a = - ((1 / norm b) *\<^sub>R b)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (metis divideR_right divide_inverse inverse_eq_divide norm_eq_zero scaleR_scaleR)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> (norm b / norm a) *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); (1 / norm a) *\<^sub>R a = - ((1 / norm b) *\<^sub>R b)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis (no_types, lifting) add.inverse_inverse b1_def b_alt_def inverse_eq_divide
            scaleR_scaleR scale_eq_0_iff scale_minus_left that(1))
[PROOF STATE]
proof (state)
this:
a1 \<noteq> b1
a1 \<noteq> - b1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define e where "e = (1/2) * (min 1 (min (dist a1 b1) (dist (-a1) b1)))"
[PROOF STATE]
proof (state)
this:
e = 1 / 2 * min 1 (min (dist a1 b1) (dist (- a1) b1))

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have e_less: "2 * e \<le> dist a1 b1" "2 * e \<le> dist (-a1) b1" "e < 1"
      and e_pos: "0 < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * e \<le> dist a1 b1 &&& 2 * e \<le> dist (- a1) b1 &&& e < 1) &&& 0 < e
[PROOF STEP]
using that a1_neq_b1
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> 0 \<Longrightarrow> b \<noteq> ?c *\<^sub>R a
a \<noteq> (0::'a)
b \<noteq> (0::'a)
a1 \<noteq> b1
a1 \<noteq> - b1

goal (1 subgoal):
 1. (2 * e \<le> dist a1 b1 &&& 2 * e \<le> dist (- a1) b1 &&& e < 1) &&& 0 < e
[PROOF STEP]
by (auto simp: e_def min_def)
[PROOF STATE]
proof (state)
this:
2 * e \<le> dist a1 b1
2 * e \<le> dist (- a1) b1
e < 1
0 < e

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define A1 where "A1 = ball a1 e \<inter> {x. norm x = 1}"
[PROOF STATE]
proof (state)
this:
A1 = ball a1 e \<inter> {x. norm x = 1}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define B1 where "B1 = ball b1 e \<inter> {x. norm x = 1}"
[PROOF STATE]
proof (state)
this:
B1 = ball b1 e \<inter> {x. norm x = 1}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have disjoint: "A1 \<inter> B1 = {}" "uminus ` A1 \<inter> B1 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A1 \<inter> B1 = {} &&& uminus ` A1 \<inter> B1 = {}
[PROOF STEP]
using e_less
[PROOF STATE]
proof (prove)
using this:
2 * e \<le> dist a1 b1
2 * e \<le> dist (- a1) b1
e < 1

goal (1 subgoal):
 1. A1 \<inter> B1 = {} &&& uminus ` A1 \<inter> B1 = {}
[PROOF STEP]
apply (auto simp: A1_def B1_def mem_ball)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>2 * e \<le> dist a1 b1; 2 * e \<le> dist (- a1) b1; e < 1; dist a1 x < e; dist b1 x < e; norm x = 1\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>2 * e \<le> dist a1 b1; 2 * e \<le> dist (- a1) b1; e < 1; dist b1 (- xa) < e; dist a1 xa < e; norm xa = 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (smt dist_commute dist_triangle)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>2 * e \<le> dist a1 b1; 2 * e \<le> dist (- a1) b1; e < 1; dist b1 (- xa) < e; dist a1 xa < e; norm xa = 1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (smt add_uminus_conv_diff diff_self dist_0_norm dist_add_cancel dist_commute dist_norm dist_triangle)
[PROOF STATE]
proof (state)
this:
A1 \<inter> B1 = {}
uminus ` A1 \<inter> B1 = {}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have norm_1: "x \<in> A1 \<Longrightarrow> norm x = 1"
      "x \<in> B1 \<Longrightarrow> norm x = 1"
      for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> A1 \<Longrightarrow> norm x = 1) &&& (x \<in> B1 \<Longrightarrow> norm x = 1)
[PROOF STEP]
by (auto simp: A1_def B1_def)
[PROOF STATE]
proof (state)
this:
?x \<in> A1 \<Longrightarrow> norm ?x = 1
?x \<in> B1 \<Longrightarrow> norm ?x = 1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define scales where "scales X = {c *\<^sub>R x |c x. c \<noteq> 0 \<and> x \<in> X}" for X::"'a set"
[PROOF STATE]
proof (state)
this:
scales ?X = {c *\<^sub>R x |c x. c \<noteq> 0 \<and> x \<in> ?X}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have scales_mem: "c *\<^sub>R x \<in> (scales X) \<longleftrightarrow> x \<in> (scales X)" if "c \<noteq> 0" for c x X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c *\<^sub>R x \<in> scales X) = (x \<in> scales X)
[PROOF STEP]
apply (auto simp: scales_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ca xa. \<lbrakk>c *\<^sub>R x = ca *\<^sub>R xa; ca \<noteq> 0; xa \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
 2. \<And>ca xa. \<lbrakk>x = ca *\<^sub>R xa; ca \<noteq> 0; xa \<in> X\<rbrakk> \<Longrightarrow> \<exists>cb x. (c * ca) *\<^sub>R xa = cb *\<^sub>R x \<and> cb \<noteq> 0 \<and> x \<in> X
[PROOF STEP]
apply (metis eq_vector_fraction_iff that)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ca xa. \<lbrakk>x = ca *\<^sub>R xa; ca \<noteq> 0; xa \<in> X\<rbrakk> \<Longrightarrow> \<exists>cb x. (c * ca) *\<^sub>R xa = cb *\<^sub>R x \<and> cb \<noteq> 0 \<and> x \<in> X
[PROOF STEP]
apply (metis divisors_zero that)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
?c \<noteq> 0 \<Longrightarrow> (?c *\<^sub>R ?x \<in> scales ?X) = (?x \<in> scales ?X)

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define A where "A = scales A1"
[PROOF STATE]
proof (state)
this:
A = scales A1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
define B where "B = scales B1"
[PROOF STATE]
proof (state)
this:
B = scales B1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
from disjoint
[PROOF STATE]
proof (chain)
picking this:
A1 \<inter> B1 = {}
uminus ` A1 \<inter> B1 = {}
[PROOF STEP]
have "A \<inter> B = {}"
[PROOF STATE]
proof (prove)
using this:
A1 \<inter> B1 = {}
uminus ` A1 \<inter> B1 = {}

goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
apply (auto simp: A_def B_def mem_ball scales_def, goal_cases)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c ca xa xb. \<lbrakk>A1 \<inter> B1 = {}; uminus ` A1 \<inter> B1 = {}; c *\<^sub>R xa = ca *\<^sub>R xb; c \<noteq> 0; xa \<in> A1; ca \<noteq> 0; xb \<in> B1\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (smt disjoint_iff_not_equal imageI mult_cancel_right norm_1(1) norm_1(2) norm_scaleR
          scaleR_left.minus scale_left_imp_eq scale_minus_right)
[PROOF STATE]
proof (state)
this:
A \<inter> B = {}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have "0 \<notin> A" "0 \<notin> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<notin> A &&& (0::'a) \<notin> B
[PROOF STEP]
using e_less \<open>a \<noteq> 0\<close> \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
2 * e \<le> dist a1 b1
2 * e \<le> dist (- a1) b1
e < 1
a \<noteq> (0::'a)
b \<noteq> (0::'a)

goal (1 subgoal):
 1. (0::'a) \<notin> A &&& (0::'a) \<notin> B
[PROOF STEP]
by (auto simp: A_def B_def A1_def B1_def mem_ball a1_def b1_def scales_def)
[PROOF STATE]
proof (state)
this:
(0::'a) \<notin> A
(0::'a) \<notin> B

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(0::'a) \<notin> A
(0::'a) \<notin> B

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
let ?S = "top_of_set {x. norm x = 1}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have open_scales: "open (scales X)" if "openin ?S X" for X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
have X1: "x \<in> X \<Longrightarrow> norm x = 1" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X \<Longrightarrow> norm x = 1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set {x. norm x = 1}) X

goal (1 subgoal):
 1. x \<in> X \<Longrightarrow> norm x = 1
[PROOF STEP]
by (auto simp: openin_subtopology)
[PROOF STATE]
proof (state)
this:
?x1 \<in> X \<Longrightarrow> norm ?x1 = 1

goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
have "0 \<notin> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<notin> X
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set {x. norm x = 1}) X

goal (1 subgoal):
 1. (0::'a) \<notin> X
[PROOF STEP]
by (auto simp: openin_subtopology)
[PROOF STATE]
proof (state)
this:
(0::'a) \<notin> X

goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
have "scales X = (\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> (topspace (top_of_set (UNIV - {0})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scales X = (\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a}))
[PROOF STEP]
apply (auto simp: scales_def)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>c xa. \<lbrakk>c \<noteq> 0; xa \<in> X; (inverse \<bar>c\<bar> * inverse (norm xa) * c) *\<^sub>R xa \<notin> uminus ` X\<rbrakk> \<Longrightarrow> (inverse \<bar>c\<bar> * inverse (norm xa) * c) *\<^sub>R xa \<in> X
 2. \<And>c. \<lbrakk>c \<noteq> 0; (0::'a) \<in> X\<rbrakk> \<Longrightarrow> False
 3. \<And>x. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
 4. \<And>x xb. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - xb; xb \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
subgoal for c x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<noteq> 0; x \<in> X; (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<notin> uminus ` X\<rbrakk> \<Longrightarrow> (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<in> X
[PROOF STEP]
using \<open>0 \<notin> X\<close>
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin> X

goal (1 subgoal):
 1. \<lbrakk>c \<noteq> 0; x \<in> X; (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<notin> uminus ` X\<rbrakk> \<Longrightarrow> (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<in> X
[PROOF STEP]
apply (cases "c > 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>c \<noteq> 0; x \<in> X; (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<notin> uminus ` X; (0::'a) \<notin> X; 0 < c\<rbrakk> \<Longrightarrow> (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<in> X
 2. \<lbrakk>c \<noteq> 0; x \<in> X; (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<notin> uminus ` X; (0::'a) \<notin> X; \<not> 0 < c\<rbrakk> \<Longrightarrow> (inverse \<bar>c\<bar> * inverse (norm x) * c) *\<^sub>R x \<in> X
[PROOF STEP]
by (auto simp: X1)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>c. \<lbrakk>c \<noteq> 0; (0::'a) \<in> X\<rbrakk> \<Longrightarrow> False
 2. \<And>x. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
 3. \<And>x xb. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - xb; xb \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c_ \<noteq> 0; (0::'a) \<in> X\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis X1 norm_zero zero_neq_one)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
 2. \<And>x xb. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - xb; xb \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
apply (rule exI[where x="norm x"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x \<in> X\<rbrakk> \<Longrightarrow> \<exists>xa. x = norm x *\<^sub>R xa \<and> norm x \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
apply (rule exI[where x="x /\<^sub>R norm x"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x \<in> X\<rbrakk> \<Longrightarrow> x = norm x *\<^sub>R (x /\<^sub>R norm x) \<and> norm x \<noteq> 0 \<and> x /\<^sub>R norm x \<in> X
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xb. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - xb; xb \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
subgoal for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - y; y \<in> X\<rbrakk> \<Longrightarrow> \<exists>c xa. x = c *\<^sub>R xa \<and> c \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
apply (rule exI[where x="- norm x"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - y; y \<in> X\<rbrakk> \<Longrightarrow> \<exists>xa. x = - norm x *\<^sub>R xa \<and> - norm x \<noteq> 0 \<and> xa \<in> X
[PROOF STEP]
apply (rule exI[where x=y])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - y; y \<in> X\<rbrakk> \<Longrightarrow> x = - norm x *\<^sub>R y \<and> - norm x \<noteq> 0 \<and> y \<in> X
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); x /\<^sub>R norm x = - y; y \<in> X\<rbrakk> \<Longrightarrow> x = - (norm x *\<^sub>R y)
[PROOF STEP]
by (metis divideR_right norm_eq_zero scale_minus_right)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
scales X = (\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a}))

goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
scales X = (\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a}))

goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
have "openin (top_of_set (UNIV - {0})) \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))
[PROOF STEP]
have *: " {y. inverse (norm y) * norm y = 1} = UNIV - {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. inverse (norm y) * norm y = 1} = UNIV - {0::'b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{y. inverse (norm y) * norm y = 1} = UNIV - {0::?'b2}

goal (1 subgoal):
 1. openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set {x. norm x = 1}) X
[PROOF STEP]
have "openin ?S (uminus ` X)"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set {x. norm x = 1}) X

goal (1 subgoal):
 1. openin (top_of_set {x. norm x = 1}) (uminus ` X)
[PROOF STEP]
apply (clarsimp simp: openin_subtopology)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. \<lbrakk>open T; X = T \<inter> {x. norm x = 1}\<rbrakk> \<Longrightarrow> \<exists>Ta. open Ta \<and> uminus ` (T \<inter> {x. norm x = 1}) = Ta \<inter> {x. norm x = 1}
[PROOF STEP]
by (auto simp: open_negations intro!: exI[where x="uminus ` T" for T])
[PROOF STATE]
proof (state)
this:
openin (top_of_set {x. norm x = 1}) (uminus ` X)

goal (1 subgoal):
 1. openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set {x. norm x = 1}) (uminus ` X)
[PROOF STEP]
have "openin ?S (X \<union> uminus ` X)"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set {x. norm x = 1}) (uminus ` X)

goal (1 subgoal):
 1. openin (top_of_set {x. norm x = 1}) (X \<union> uminus ` X)
[PROOF STEP]
using \<open>openin _ X\<close>
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set {x. norm x = 1}) (uminus ` X)
openin (top_of_set {x. norm x = 1}) X

goal (1 subgoal):
 1. openin (top_of_set {x. norm x = 1}) (X \<union> uminus ` X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
openin (top_of_set {x. norm x = 1}) (X \<union> uminus ` X)

goal (1 subgoal):
 1. openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))
[PROOF STEP]
from _ this
[PROOF STATE]
proof (chain)
picking this:
PROP ?psi \<Longrightarrow> PROP ?psi
openin (top_of_set {x. norm x = 1}) (X \<union> uminus ` X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
openin (top_of_set {x. norm x = 1}) (X \<union> uminus ` X)

goal (1 subgoal):
 1. openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))
[PROOF STEP]
apply (rule continuous_map_open)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (top_of_set (UNIV - {0::'a})) (top_of_set {x. norm x = 1}) (\<lambda>x. x /\<^sub>R norm x)
[PROOF STEP]
apply (auto simp: continuous_map_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. openin (top_of_set {x. norm x = 1}) U \<Longrightarrow> openin (top_of_set (UNIV - {0::'a})) {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> U}
[PROOF STEP]
apply (subst(asm) openin_subtopology)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. \<exists>T. openin euclidean T \<and> U = T \<inter> {x. norm x = 1} \<Longrightarrow> openin (top_of_set (UNIV - {0::'a})) {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> U}
[PROOF STEP]
apply (auto simp: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set (UNIV - {0::'a})) {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> T \<and> inverse (norm x) * norm x = 1}
[PROOF STEP]
apply (subst openin_subtopology)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> \<exists>Ta. openin euclidean Ta \<and> {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> T \<and> inverse (norm x) * norm x = 1} = Ta \<inter> (UNIV - {0::'a})
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> \<exists>Ta. open Ta \<and> {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> T \<and> inverse (norm x) * norm x = 1} = Ta \<inter> (UNIV - {0::'a})
[PROOF STEP]
subgoal for T
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open T \<Longrightarrow> \<exists>Ta. open Ta \<and> {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> T \<and> inverse (norm x) * norm x = 1} = Ta \<inter> (UNIV - {0::'a})
[PROOF STEP]
apply (rule exI[where x="(\<lambda>x. x /\<^sub>R norm x) -` T \<inter> UNIV - {0}"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open T \<Longrightarrow> open ((\<lambda>T. T /\<^sub>R norm T) -` T \<inter> UNIV - {0::'a}) \<and> {x. x \<noteq> (0::'a) \<and> x /\<^sub>R norm x \<in> T \<and> inverse (norm x) * norm x = 1} = ((\<lambda>T. T /\<^sub>R norm T) -` T \<inter> UNIV - {0::'a}) \<inter> (UNIV - {0::'a})
[PROOF STEP]
apply (auto simp: Diff_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open T \<Longrightarrow> open ((\<lambda>T. T /\<^sub>R norm T) -` T \<inter> - {0::'a})
[PROOF STEP]
apply (rule open_continuous_vimage)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. open T \<Longrightarrow> open (- {0::'a})
 2. open T \<Longrightarrow> continuous_on (- {0::'a}) (\<lambda>T. T /\<^sub>R norm T)
 3. open T \<Longrightarrow> open T
[PROOF STEP]
by (auto intro!: continuous_intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
openin (top_of_set (UNIV - {0::'a})) ((\<lambda>x. x /\<^sub>R norm x) -` (X \<union> uminus ` X) \<inter> topspace (top_of_set (UNIV - {0::'a})))

goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set (UNIV - {0::'a})) (scales X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (UNIV - {0::'a})) (scales X)

goal (1 subgoal):
 1. open (scales X)
[PROOF STEP]
apply (subst (asm) openin_subtopology)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>T. openin euclidean T \<and> scales X = T \<inter> (UNIV - {0::'a}) \<Longrightarrow> open (scales X)
[PROOF STEP]
by clarsimp auto
[PROOF STATE]
proof (state)
this:
open (scales X)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
openin (top_of_set {x. norm x = 1}) ?X1 \<Longrightarrow> open (scales ?X1)

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have "openin ?S A1" "openin ?S B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set {x. norm x = 1}) A1 &&& openin (top_of_set {x. norm x = 1}) B1
[PROOF STEP]
by (auto simp: openin_subtopology A1_def B1_def)
[PROOF STATE]
proof (state)
this:
openin (top_of_set {x. norm x = 1}) A1
openin (top_of_set {x. norm x = 1}) B1

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
from open_scales[OF this(1)] open_scales[OF this(2)]
[PROOF STATE]
proof (chain)
picking this:
open (scales A1)
open (scales B1)
[PROOF STEP]
have "open A" "open B"
[PROOF STATE]
proof (prove)
using this:
open (scales A1)
open (scales B1)

goal (1 subgoal):
 1. open A &&& open B
[PROOF STEP]
by (simp_all add: A_def B_def)
[PROOF STATE]
proof (state)
this:
open A
open B

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
open A
open B

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have "a \<in> A" "b \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> A &&& b \<in> B
[PROOF STEP]
by (force simp: A_def B_def A1_def B1_def that e_pos scales_def intro: a_alt_def b_alt_def)+
[PROOF STATE]
proof (state)
this:
a \<in> A
b \<in> B

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> A
b \<in> B

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
have False if "c *\<^sub>R p \<in> B" "p \<in> A" "c \<noteq> 0" for p c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using that \<open>0 \<notin> A\<close> \<open>0 \<notin> B\<close> \<open>A \<inter> B = {}\<close>
[PROOF STATE]
proof (prove)
using this:
c *\<^sub>R p \<in> B
p \<in> A
c \<noteq> 0
(0::'a) \<notin> A
(0::'a) \<notin> B
A \<inter> B = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp: A_def B_def scales_mem)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?c1 *\<^sub>R ?p1 \<in> B; ?p1 \<in> A; ?c1 \<noteq> 0\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?c1 *\<^sub>R ?p1 \<in> B; ?p1 \<in> A; ?c1 \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?c1 *\<^sub>R ?p1 \<in> B; ?p1 \<in> A; ?c1 \<noteq> 0\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
by (auto simp: prod_eq_iff)
[PROOF STATE]
proof (state)
this:
A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<notin> A
(0::'a) \<notin> B
open A
open B
a \<in> A
b \<in> B
A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin> A
(0::'a) \<notin> B
open A
open B
a \<in> A
b \<in> B
A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}

goal (1 subgoal):
 1. \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>c. c \<noteq> 0 \<Longrightarrow> ?b \<noteq> c *\<^sub>R ?a; ?a \<noteq> (0::'a); ?b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> ?a \<in> A \<and> ?b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}

goal (1 subgoal):
 1. closed {(x, y). proj_rel x y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {(x, y). proj_rel x y}
[PROOF STEP]
unfolding closed_def open_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>- {(x, y). proj_rel x y}. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> - {(x, y). proj_rel x y}
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>- {x. (case x of (x, a) \<Rightarrow> \<exists>c. a = (if c = 0 then One else c *\<^sub>R x) \<and> c \<noteq> 0) \<and> pred_prod (\<lambda>x. x \<in> UNIV - {0::'a}) (\<lambda>x. x \<in> UNIV - {0::'a}) x} \<inter> Collect (pred_prod (\<lambda>x. x \<in> UNIV - {0::'a}) (\<lambda>x. x \<in> UNIV - {0::'a})). \<exists>A\<in>{A. \<forall>x\<in>A. x \<in> UNIV - {0::'a}}. \<exists>B\<in>{A. \<forall>x\<in>A. x \<in> UNIV - {0::'a}}. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> - {x. (case x of (x, a) \<Rightarrow> \<exists>c. a = (if c = 0 then One else c *\<^sub>R x) \<and> c \<noteq> 0) \<and> pred_prod (\<lambda>x. x \<in> UNIV - {0::'a}) (\<lambda>x. x \<in> UNIV - {0::'a}) x} \<inter> Collect (pred_prod (\<lambda>x. x \<in> UNIV - {0::'a}) (\<lambda>x. x \<in> UNIV - {0::'a}))
[PROOF STEP]
apply (simp add: split_beta' bool_aux pred_prod.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>- {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<inter> Collect (pred_prod (\<lambda>x. x \<noteq> (0::'a)) (\<lambda>x. x \<noteq> (0::'a))). \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> Collect (pred_prod (\<lambda>x. x \<noteq> (0::'a)) (\<lambda>x. x \<noteq> (0::'a))))
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<inter> Collect (pred_prod (\<lambda>x. x \<noteq> (0::'a)) (\<lambda>x. x \<noteq> (0::'a))) \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> Collect (pred_prod (\<lambda>x. x \<noteq> (0::'a)) (\<lambda>x. x \<noteq> (0::'a))))
[PROOF STEP]
apply (clarsimp simp: pred_prod.simps[abs_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
[PROOF STEP]
subgoal for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
[PROOF STEP]
apply (subgoal_tac "(\<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a\<rbrakk> \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
 2. \<And>c. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); c \<noteq> 0\<rbrakk> \<Longrightarrow> b \<noteq> c *\<^sub>R a
[PROOF STEP]
using closed_proj_rel_euclidean[of b a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>A B. (0::'a) \<notin> A \<and> (0::'a) \<notin> B \<and> open A \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}

goal (2 subgoals):
 1. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a\<rbrakk> \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
 2. \<And>c. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); c \<noteq> 0\<rbrakk> \<Longrightarrow> b \<noteq> c *\<^sub>R a
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A B. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a; (0::'a) \<notin> A; (0::'a) \<notin> B; open A; open B; a \<in> A; b \<in> B; A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}\<rbrakk> \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
 2. \<And>c. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); c \<noteq> 0\<rbrakk> \<Longrightarrow> b \<noteq> c *\<^sub>R a
[PROOF STEP]
subgoal for A B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a; (0::'a) \<notin> A; (0::'a) \<notin> B; open A; open B; a \<in> A; b \<in> B; A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}\<rbrakk> \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
[PROOF STEP]
apply (rule exI[where x=A])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a; (0::'a) \<notin> A; (0::'a) \<notin> B; open A; open B; a \<in> A; b \<in> B; A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}\<rbrakk> \<Longrightarrow> (\<forall>x\<in>A. x \<noteq> (0::'a)) \<and> open A \<and> (\<exists>B. (\<forall>x\<in>B. x \<noteq> (0::'a)) \<and> open B \<and> a \<in> A \<and> b \<in> B \<and> A \<times> B \<subseteq> - {x. (\<exists>c. c \<noteq> 0 \<and> snd x = c *\<^sub>R fst x) \<and> (\<exists>a b. x = (a, b) \<and> a \<noteq> (0::'a) \<and> b \<noteq> (0::'a))} \<and> A \<times> B \<subseteq> {a. a \<noteq> (0::'a)} \<times> {b. b \<noteq> (0::'a)})
[PROOF STEP]
apply (auto intro!: exI[where x=B])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c aa. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a; (0::'a) \<notin> A; (0::'a) \<notin> B; open A; open B; a \<in> A; b \<in> B; A \<times> B \<subseteq> - {(x, y). (x, y) \<noteq> 0 \<and> (\<exists>c. c \<noteq> 0 \<and> y = c *\<^sub>R x)}; aa \<in> A; c *\<^sub>R aa \<in> B; c \<noteq> 0; aa \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (auto simp: subset_iff prod_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c aa. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); \<And>c. c \<noteq> 0 \<Longrightarrow> b \<noteq> c *\<^sub>R a; (0::'a) \<notin> A; (0::'a) \<notin> B; open A; open B; a \<in> A; b \<in> B; \<forall>a b. a \<in> A \<and> b \<in> B \<longrightarrow> a = (0::'a) \<and> b = (0::'a) \<or> (\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a); aa \<in> A; c *\<^sub>R aa \<in> B; c \<noteq> 0; aa \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); c \<noteq> 0\<rbrakk> \<Longrightarrow> b \<noteq> c *\<^sub>R a
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>c. c = 0 \<or> b \<noteq> c *\<^sub>R a; a \<noteq> (0::'a); b \<noteq> (0::'a); c_ \<noteq> 0\<rbrakk> \<Longrightarrow> b \<noteq> c_ *\<^sub>R a
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closed {(x, y). proj_rel x y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_eSuc_right': "(m::eint) * (n + 1) =  m + m * n  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m * (n + 1) = m + m * n
[PROOF STEP]
using mult_eSuc_right add.commute
[PROOF STATE]
proof (prove)
using this:
?m * (?n + 1) = ?m * ?n + ?m
?a + ?b = ?b + ?a

goal (1 subgoal):
 1. m * (n + 1) = m + m * n
[PROOF STEP]
by simp


[STATEMENT]
lemma monomial_uminus:
  shows "- monomial c s = monomial (- c) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - monomial c s = monomial (- c) s
[PROOF STEP]
by (transfer, rule ext, simp add: Poly_Mapping.when_def)


[STATEMENT]
theorem higman_idx: "\<exists>(i::nat) j. emb (f i) (f j) \<and> i < j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i j. emb (f i) (f j) \<and> i < j
[PROOF STEP]
proof (rule bar_idx)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bar ?ws
 2. is_prefix ?ws f
[PROOF STEP]
show "bar []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bar []
[PROOF STEP]
by (rule higman)
[PROOF STATE]
proof (state)
this:
bar []

goal (1 subgoal):
 1. is_prefix [] f
[PROOF STEP]
show "is_prefix [] f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_prefix [] f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_prefix [] f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_int_ge_real':
  "(real_of_int (a::int) + b \<ge> 0) = (real_of_int a + real_of_int \<lfloor>b\<rfloor> \<ge> 0 \<or> (real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> real_of_int a + b) = (0 \<le> real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0 \<le> real_of_int a + b) = (0 \<le> real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
have th: "(real_of_int a + b \<ge>0) = (real_of_int (-a) + (-b) \<le> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> real_of_int a + b) = (real_of_int (- a) + - b \<le> 0)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(0 \<le> real_of_int a + b) = (real_of_int (- a) + - b \<le> 0)

goal (1 subgoal):
 1. (0 \<le> real_of_int a + b) = (0 \<le> real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> real_of_int a + b) = (0 \<le> real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
by (simp only: th split_int_le_real'[where a="-a" and b="-b"])
    (simp add: algebra_simps ,arith)
[PROOF STATE]
proof (state)
this:
(0 \<le> real_of_int a + b) = (0 \<le> real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma halt_lemma:
  "\<lbrakk>wf LE; \<forall>n. (\<not> P (f n) \<longrightarrow> (f (Suc n), (f n)) \<in> LE)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf LE; \<forall>n. \<not> P (f n) \<longrightarrow> (f (Suc n), f n) \<in> LE\<rbrakk> \<Longrightarrow> \<exists>n. P (f n)
[PROOF STEP]
by (metis wf_iff_no_infinite_down_chain)


[STATEMENT]
lemma measure_try_spmf:
  "measure (measure_spmf (try_spmf p q)) A = measure (measure_spmf p) A + pmf p None * measure (measure_spmf q) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (TRY p ELSE q)) A = Sigma_Algebra.measure (measure_spmf p) A + pmf p None * Sigma_Algebra.measure (measure_spmf q) A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (TRY p ELSE q)) A = Sigma_Algebra.measure (measure_spmf p) A + pmf p None * Sigma_Algebra.measure (measure_spmf q) A
[PROOF STEP]
have "emeasure (measure_spmf (try_spmf p q)) A = emeasure (measure_spmf p) A + pmf p None * emeasure (measure_spmf q) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_spmf (TRY p ELSE q)) A = emeasure (measure_spmf p) A + ennreal (pmf p None) * emeasure (measure_spmf q) A
[PROOF STEP]
by(fold nn_integral_spmf)(simp add: spmf_try_spmf nn_integral_add ennreal_mult' nn_integral_cmult)
[PROOF STATE]
proof (state)
this:
emeasure (measure_spmf (TRY p ELSE q)) A = emeasure (measure_spmf p) A + ennreal (pmf p None) * emeasure (measure_spmf q) A

goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (TRY p ELSE q)) A = Sigma_Algebra.measure (measure_spmf p) A + pmf p None * Sigma_Algebra.measure (measure_spmf q) A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure (measure_spmf (TRY p ELSE q)) A = emeasure (measure_spmf p) A + ennreal (pmf p None) * emeasure (measure_spmf q) A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure (measure_spmf (TRY p ELSE q)) A = emeasure (measure_spmf p) A + ennreal (pmf p None) * emeasure (measure_spmf q) A

goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (TRY p ELSE q)) A = Sigma_Algebra.measure (measure_spmf p) A + pmf p None * Sigma_Algebra.measure (measure_spmf q) A
[PROOF STEP]
by(simp add: measure_spmf.emeasure_eq_measure ennreal_mult'[symmetric] ennreal_plus[symmetric] del: ennreal_plus)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure (measure_spmf (TRY p ELSE q)) A = Sigma_Algebra.measure (measure_spmf p) A + pmf p None * Sigma_Algebra.measure (measure_spmf q) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_ldistinct': "(\<And>x. isCont f x) \<Longrightarrow> closed {xs. ldistinct (f xs)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. isCont f x) \<Longrightarrow> closed {xs. ldistinct (f xs)}
[PROOF STEP]
using continuous_closed_vimage[of _ f, OF closed_ldistinct]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. isCont f x) \<Longrightarrow> closed (f -` {xs. ldistinct xs})

goal (1 subgoal):
 1. (\<And>x. isCont f x) \<Longrightarrow> closed {xs. ldistinct (f xs)}
[PROOF STEP]
by auto


[STATEMENT]
lemma set_zmset_eq_empty_iff[simp]: "set_zmset M = {} \<longleftrightarrow> M = {#}\<^sub>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set_zmset M = {}) = (M = {#}\<^sub>z)
[PROOF STEP]
by (auto simp add: zmultiset_eq_iff zcount_eq_zero_iff)


[STATEMENT]
lemma prod_list_remove1: "(x :: 'b :: comm_monoid_mult) \<in> set xs \<Longrightarrow> prod_list (remove1 x xs) * x = prod_list xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> prod_list (remove1 x xs) * x = prod_list xs
[PROOF STEP]
by (induct xs, auto simp: ac_simps)


[STATEMENT]
lemma has_laplace_minus:
  assumes f: "(f has_laplace F) S"
  assumes g: "(g has_laplace G) S"
  shows "((\<lambda>x. f x - g x) has_laplace F - G) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x - g x) has_laplace F - G) S
[PROOF STEP]
using has_laplace_add[OF f has_laplace_uminus[OF g]]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x + - g x) has_laplace F + - G) S

goal (1 subgoal):
 1. ((\<lambda>x. f x - g x) has_laplace F - G) S
[PROOF STEP]
by simp


[STATEMENT]
lemma (in Corps) Ig_nonzero:"\<lbrakk>valuation K v; ideal (Vr K v) I; I \<noteq> {\<zero>\<^bsub>Vr K v\<^esub>}\<rbrakk>
                  \<Longrightarrow> (Ig K v I) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; ideal (Vr K v) I; I \<noteq> {\<zero>\<^bsub>Vr K v\<^esub>}\<rbrakk> \<Longrightarrow> Ig K v I \<noteq> \<zero>
[PROOF STEP]
by (rule contrapos_pp, simp+,
    frule LI_infinity[of v I], assumption+,
    frule val_Ig[of v I], assumption+, erule conjE,
    simp add:value_of_zero)


[STATEMENT]
lemma "bool_vec_from_simplice {1,2} =
    vec n (\<lambda>i. i \<notin> {1,2})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bool_vec_from_simplice {1, 2} = vec n (\<lambda>i. i \<notin> {1, 2})
[PROOF STEP]
unfolding bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>i. i \<notin> {1, 2}) = vec n (\<lambda>i. i \<notin> {1, 2})
[PROOF STEP]
by auto


[STATEMENT]
lemma (in \<Z>) dg_Par_incl_Par_is_arr'[dg_Par_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> dg_Par \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> dg_Par \<alpha>\<lparr>Obj\<rparr>"
    and "A \<subseteq>\<^sub>\<circ> B"
    and "A' = A"
    and "B' = B"
  shows "incl_Par A B : A' \<mapsto>\<^bsub>dg_Par \<alpha>\<^esub> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incl_Rel A B : A' \<mapsto>\<^bsub>dg_Par \<alpha>\<^esub> B'
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> dg_Par \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> dg_Par \<alpha>\<lparr>Obj\<rparr>
A \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. incl_Rel A B : A' \<mapsto>\<^bsub>dg_Par \<alpha>\<^esub> B'
[PROOF STEP]
unfolding assms(4,5)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> dg_Par \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> dg_Par \<alpha>\<lparr>Obj\<rparr>
A \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. incl_Rel A B : A \<mapsto>\<^bsub>dg_Par \<alpha>\<^esub> B
[PROOF STEP]
by (rule dg_Par_incl_Par_is_arr)


[STATEMENT]
lemma finite_is_semialg:
  assumes "F \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "finite F"
  shows "is_semialgebraic n F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n F
[PROOF STEP]
using Qp.finite_sets_are_algebraic is_algebraic_imp_is_semialg[of n F]
           assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> ?F \<subseteq> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<longrightarrow> is_algebraic Q\<^sub>p ?n ?F
is_algebraic Q\<^sub>p n F \<Longrightarrow> is_semialgebraic n F
F \<subseteq> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
finite F

goal (1 subgoal):
 1. is_semialgebraic n F
[PROOF STEP]
by blast


[STATEMENT]
lemma word_less_rbl: "x < y \<longleftrightarrow> rev_bl_order False (rev (to_bl x)) (rev (to_bl y))"
  for x y :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x < y) = rev_bl_order False (rev (to_bl x)) (rev (to_bl y))
[PROOF STEP]
by (simp add: word_less_alt rev_bl_order_bl_to_bin)


[STATEMENT]
lemma OrdDom_hunion [simp]: "OrdDom (s1 \<squnion> s2) \<longleftrightarrow> OrdDom s1 \<and> OrdDom s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdDom (s1 \<squnion> s2) = (OrdDom s1 \<and> OrdDom s2)
[PROOF STEP]
by (auto simp: OrdDom_def)


[STATEMENT]
lemma ord_eq_le_eq_trans: "\<lbrakk> a=b; b\<le>c; c=d \<rbrakk> \<Longrightarrow> a\<le>d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a = b; b \<le> c; c = d\<rbrakk> \<Longrightarrow> a \<le> d
[PROOF STEP]
by auto


[STATEMENT]
lemma llcp_lappend_same [simp]:
  "llcp (lappend xs ys) (lappend xs zs) = llength xs + llcp ys zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llcp (lappend xs ys) (lappend xs zs) = llength xs + llcp ys zs
[PROOF STEP]
by(coinduction arbitrary: xs rule: enat_coinduct)(auto simp add: iadd_is_0 llcp_eq_0_iff epred_iadd1 epred_llcp epred_llength)


[STATEMENT]
lemma retraction_maps_compose:
   "\<lbrakk>retraction_maps X Y f f'; retraction_maps Y Z g g'\<rbrakk> \<Longrightarrow> retraction_maps X Z (g \<circ> f) (f' \<circ> g')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X Y f f'; retraction_maps Y Z g g'\<rbrakk> \<Longrightarrow> retraction_maps X Z (g \<circ> f) (f' \<circ> g')
[PROOF STEP]
by (clarsimp simp: retraction_maps_def continuous_map_compose) (simp add: continuous_map_def)


[STATEMENT]
lemma unit_prod:
  assumes "finite S"
  shows "is_unit (prod (\<lambda>i. U $ i $ i) S) = (\<forall>i\<in>S. is_unit (U $ i $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>S. U $ i $ i) = (\<forall>i\<in>S. is_unit (U $ i $ i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>S. U $ i $ i) = (\<forall>i\<in>S. is_unit (U $ i $ i))
[PROOF STEP]
proof (induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_unit (\<Prod>i\<in>{}. U $ i $ i) = (\<forall>i\<in>{}. is_unit (U $ i $ i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; is_unit (\<Prod>i\<in>F. U $ i $ i) = (\<forall>i\<in>F. is_unit (U $ i $ i))\<rbrakk> \<Longrightarrow> is_unit (\<Prod>i\<in>insert x F. U $ i $ i) = (\<forall>i\<in>insert x F. is_unit (U $ i $ i))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. is_unit (\<Prod>i\<in>{}. U $ i $ i) = (\<forall>i\<in>{}. is_unit (U $ i $ i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; is_unit (\<Prod>i\<in>F. U $ i $ i) = (\<forall>i\<in>F. is_unit (U $ i $ i))\<rbrakk> \<Longrightarrow> is_unit (\<Prod>i\<in>insert x F. U $ i $ i) = (\<forall>i\<in>insert x F. is_unit (U $ i $ i))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>{}. U $ i $ i) = (\<forall>i\<in>{}. is_unit (U $ i $ i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_unit (\<Prod>i\<in>{}. U $ i $ i) = (\<forall>i\<in>{}. is_unit (U $ i $ i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; is_unit (\<Prod>i\<in>F. U $ i $ i) = (\<forall>i\<in>F. is_unit (U $ i $ i))\<rbrakk> \<Longrightarrow> is_unit (\<Prod>i\<in>insert x F. U $ i $ i) = (\<forall>i\<in>insert x F. is_unit (U $ i $ i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; is_unit (\<Prod>i\<in>F. U $ i $ i) = (\<forall>i\<in>F. is_unit (U $ i $ i))\<rbrakk> \<Longrightarrow> is_unit (\<Prod>i\<in>insert x F. U $ i $ i) = (\<forall>i\<in>insert x F. is_unit (U $ i $ i))
[PROOF STEP]
case (insert a S)
[PROOF STATE]
proof (state)
this:
finite S
a \<notin> S
is_unit (\<Prod>i\<in>S. U $ i $ i) = (\<forall>i\<in>S. is_unit (U $ i $ i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; is_unit (\<Prod>i\<in>F. U $ i $ i) = (\<forall>i\<in>F. is_unit (U $ i $ i))\<rbrakk> \<Longrightarrow> is_unit (\<Prod>i\<in>insert x F. U $ i $ i) = (\<forall>i\<in>insert x F. is_unit (U $ i $ i))
[PROOF STEP]
have "prod (\<lambda>i. U $ i $ i) (insert a S) = U $ a $ a * prod (\<lambda>i. U $ i $ i) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>insert a S. U $ i $ i) = U $ a $ a * (\<Prod>i\<in>S. U $ i $ i)
[PROOF STEP]
by (simp add: insert.hyps(2))
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>insert a S. U $ i $ i) = U $ a $ a * (\<Prod>i\<in>S. U $ i $ i)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; is_unit (\<Prod>i\<in>F. U $ i $ i) = (\<forall>i\<in>F. is_unit (U $ i $ i))\<rbrakk> \<Longrightarrow> is_unit (\<Prod>i\<in>insert x F. U $ i $ i) = (\<forall>i\<in>insert x F. is_unit (U $ i $ i))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i\<in>insert a S. U $ i $ i) = U $ a $ a * (\<Prod>i\<in>S. U $ i $ i)

goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>insert a S. U $ i $ i) = (\<forall>i\<in>insert a S. is_unit (U $ i $ i))
[PROOF STEP]
using is_unit_mult_iff insert.hyps
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i\<in>insert a S. U $ i $ i) = U $ a $ a * (\<Prod>i\<in>S. U $ i $ i)
is_unit (?a * ?b) = (is_unit ?a \<and> is_unit ?b)
finite S
a \<notin> S
is_unit (\<Prod>i\<in>S. U $ i $ i) = (\<forall>i\<in>S. is_unit (U $ i $ i))

goal (1 subgoal):
 1. is_unit (\<Prod>i\<in>insert a S. U $ i $ i) = (\<forall>i\<in>insert a S. is_unit (U $ i $ i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_unit (\<Prod>i\<in>insert a S. U $ i $ i) = (\<forall>i\<in>insert a S. is_unit (U $ i $ i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pdevs_of_list_map_scaleR:
  "pdevs_of_list (map (scaleR r) xs) = scaleR_pdevs r (pdevs_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_of_list (map ((*\<^sub>R) r) xs) = scaleR_pdevs r (pdevs_of_list xs)
[PROOF STEP]
by (auto intro!: pdevs_eqI simp: pdevs_apply_pdevs_of_list)


[STATEMENT]
lemma Hadamard's_inequality:
  fixes A::"real mat"
  assumes A: "A \<in> carrier_mat n n"
  shows  "abs (det A) \<le> sqrt (prod_list (map sq_norm (rows A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
let ?us = "map (row A) [0 ..< n]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
interpret gso: gram_schmidt_fs n ?us
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have len: "length ?us = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (row A) [0..<n]) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (map (row A) [0..<n]) = n

goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have us: "set ?us \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (row A) [0..<n]) \<subseteq> carrier_vec n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. set (map (row A) [0..<n]) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map (row A) [0..<n]) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
let ?vs = "map gso.gso [0..<n]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
proof (cases "carrier_vec n \<subseteq> gso.span (set ?us)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n]))

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
with us len
[PROOF STATE]
proof (chain)
picking this:
set (map (row A) [0..<n]) \<subseteq> carrier_vec n
length (map (row A) [0..<n]) = n
carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n]))
[PROOF STEP]
have basis: "gso.basis_list ?us"
[PROOF STATE]
proof (prove)
using this:
set (map (row A) [0..<n]) \<subseteq> carrier_vec n
length (map (row A) [0..<n]) = n
carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n]))

goal (1 subgoal):
 1. gso.basis_list (map (row A) [0..<n])
[PROOF STEP]
unfolding gso.basis_list_def
[PROOF STATE]
proof (prove)
using this:
set (map (row A) [0..<n]) \<subseteq> carrier_vec n
length (map (row A) [0..<n]) = n
carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n]))

goal (1 subgoal):
 1. set (map (row A) [0..<n]) \<subseteq> carrier_vec n \<and> length (map (row A) [0..<n]) = n \<and> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gso.basis_list (map (row A) [0..<n])

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
note in_dep = gso.basis_list_imp_lin_indpt_list[OF basis]
[PROOF STATE]
proof (state)
this:
gso.lin_indpt_list (map (row A) [0..<n])

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
interpret gso: gram_schmidt_fs_lin_indpt n ?us
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gram_schmidt_fs_lin_indpt n (map (row A) [0..<n])
[PROOF STEP]
by (standard) (use in_dep gso.lin_indpt_list_def in auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have last: "0 \<le> prod_list (map sq_norm ?vs) \<and> prod_list (map sq_norm ?vs) \<le> prod_list (map sq_norm ?us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> prod_list (map sq_norm (map gso.gso [0..<n])) \<and> prod_list (map sq_norm (map gso.gso [0..<n])) \<le> prod_list (map sq_norm (map (row A) [0..<n]))
[PROOF STEP]
proof (rule prod_list_le_mono, force, unfold length_map length_upt)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
assume "i < n - 0"
[PROOF STATE]
proof (state)
this:
i < n - 0

goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
hence i: "i < n"
[PROOF STATE]
proof (prove)
using this:
i < n - 0

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

goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
have vsi: "map sq_norm ?vs ! i = sq_norm (?vs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map sq_norm (map gso.gso [0..<n]) ! i = \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. map sq_norm (map gso.gso [0..<n]) ! i = \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map sq_norm (map gso.gso [0..<n]) ! i = \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
have usi: "map sq_norm ?us ! i = sq_norm (row A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map sq_norm (map (row A) [0..<n]) ! i = \<parallel>row A i\<parallel>\<^sup>2
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. map sq_norm (map (row A) [0..<n]) ! i = \<parallel>row A i\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map sq_norm (map (row A) [0..<n]) ! i = \<parallel>row A i\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
have zero: "0 \<le> sq_norm (?vs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
have le: "sq_norm (?vs ! i) \<le> sq_norm (row A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<le> \<parallel>row A i\<parallel>\<^sup>2
[PROOF STEP]
using gso.sq_norm_gso_le_f i
[PROOF STATE]
proof (prove)
using this:
?i < length (map (row A) [0..<n]) \<Longrightarrow> \<parallel>gso.gso ?i\<parallel>\<^sup>2 \<le> \<parallel>map (row A) [0..<n] ! ?i\<parallel>\<^sup>2
i < n

goal (1 subgoal):
 1. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<le> \<parallel>row A i\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<le> \<parallel>row A i\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<And>i. i < n - 0 \<Longrightarrow> 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
show "0 \<le> map sq_norm ?vs ! i \<and> map sq_norm ?vs ! i \<le> map sq_norm ?us ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i
[PROOF STEP]
unfolding vsi usi
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<and> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<le> \<parallel>row A i\<parallel>\<^sup>2
[PROOF STEP]
using zero le
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2
\<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<le> \<parallel>row A i\<parallel>\<^sup>2

goal (1 subgoal):
 1. 0 \<le> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<and> \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2 \<le> \<parallel>row A i\<parallel>\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> map sq_norm (map gso.gso [0..<n]) ! i \<and> map sq_norm (map gso.gso [0..<n]) ! i \<le> map sq_norm (map (row A) [0..<n]) ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> prod_list (map sq_norm (map gso.gso [0..<n])) \<and> prod_list (map sq_norm (map gso.gso [0..<n])) \<le> prod_list (map sq_norm (map (row A) [0..<n]))

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have Fs: "gso.FF \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n (map (row A) [0..<n]) \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_of_rows n (map (row A) [0..<n]) \<in> carrier_mat n n

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have A_Fs: "A = gso.FF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = mat_of_rows n (map (row A) [0..<n])
[PROOF STEP]
by (rule eq_matI, subst gso.FF_index, insert A, auto)
[PROOF STATE]
proof (state)
this:
A = mat_of_rows n (map (row A) [0..<n])

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
hence "abs (det A) = abs (det (gso.FF))"
[PROOF STATE]
proof (prove)
using this:
A = mat_of_rows n (map (row A) [0..<n])

goal (1 subgoal):
 1. \<bar>det A\<bar> = \<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>det A\<bar> = \<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar>

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
(* the following three steps are based on a discussion with Bertram Felgenhauer *)
[PROOF STATE]
proof (state)
this:
\<bar>det A\<bar> = \<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar>

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>det A\<bar> = \<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar>

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "\<dots> = abs (sqrt (det (gso.FF) * det (gso.FF)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar> = \<bar>sqrt (det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])))\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar> = \<bar>sqrt (det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])))\<bar>

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>det (mat_of_rows n (map (row A) [0..<n]))\<bar> = \<bar>sqrt (det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])))\<bar>

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "det (gso.FF) * det (gso.FF) = det (gso.FF) * det (gso.FF)\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])) = det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))\<^sup>T
[PROOF STEP]
unfolding det_transpose[OF Fs]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])) = det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])) = det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))\<^sup>T

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n])) = det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))\<^sup>T

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "\<dots> = det (gso.FF * (gso.FF)\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))\<^sup>T = det (mat_of_rows n (map (row A) [0..<n]) * (mat_of_rows n (map (row A) [0..<n]))\<^sup>T)
[PROOF STEP]
by (subst det_mult[OF Fs], insert Fs, auto)
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))\<^sup>T = det (mat_of_rows n (map (row A) [0..<n]) * (mat_of_rows n (map (row A) [0..<n]))\<^sup>T)

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n (map (row A) [0..<n])) * det (mat_of_rows n (map (row A) [0..<n]))\<^sup>T = det (mat_of_rows n (map (row A) [0..<n]) * (mat_of_rows n (map (row A) [0..<n]))\<^sup>T)

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "\<dots> = gso.Gramian_determinant ?us n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat_of_rows n (map (row A) [0..<n]) * (mat_of_rows n (map (row A) [0..<n]))\<^sup>T) = gso.Gramian_determinant (map (row A) [0..<n]) n
[PROOF STEP]
unfolding gso.Gramian_matrix_def gso.Gramian_determinant_def Let_def A_Fs[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (A * A\<^sup>T) = det (mat n n (\<lambda>(i, y). map (row A) [0..<n] ! i $ y) * (mat n n (\<lambda>(i, y). map (row A) [0..<n] ! i $ y))\<^sup>T)
[PROOF STEP]
by (rule arg_cong[of _ _ det], rule arg_cong2[of _ _ _ _ "(*)"], insert A, auto)
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n (map (row A) [0..<n]) * (mat_of_rows n (map (row A) [0..<n]))\<^sup>T) = gso.Gramian_determinant (map (row A) [0..<n]) n

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n (map (row A) [0..<n]) * (mat_of_rows n (map (row A) [0..<n]))\<^sup>T) = gso.Gramian_determinant (map (row A) [0..<n]) n

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "\<dots> = (\<Prod>j \<in> set [0 ..< n]. \<parallel>?vs ! j\<parallel>\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gso.Gramian_determinant (map (row A) [0..<n]) n = (\<Prod>j\<in>set [0..<n]. \<parallel>map gso.gso [0..<n] ! j\<parallel>\<^sup>2)
[PROOF STEP]
by (subst gso.Gramian_determinant) (auto intro!: prod.cong)
[PROOF STATE]
proof (state)
this:
gso.Gramian_determinant (map (row A) [0..<n]) n = (\<Prod>j\<in>set [0..<n]. \<parallel>map gso.gso [0..<n] ! j\<parallel>\<^sup>2)

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gso.Gramian_determinant (map (row A) [0..<n]) n = (\<Prod>j\<in>set [0..<n]. \<parallel>map gso.gso [0..<n] ! j\<parallel>\<^sup>2)

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "\<dots> = prod_list (map (\<lambda> i. sq_norm (?vs ! i)) [0 ..< n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>j\<in>set [0..<n]. \<parallel>map gso.gso [0..<n] ! j\<parallel>\<^sup>2) = (\<Prod>i\<leftarrow>[0..<n]. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2)
[PROOF STEP]
by (subst prod.distinct_set_conv_list, auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>j\<in>set [0..<n]. \<parallel>map gso.gso [0..<n] ! j\<parallel>\<^sup>2) = (\<Prod>i\<leftarrow>[0..<n]. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2)

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>j\<in>set [0..<n]. \<parallel>map gso.gso [0..<n] ! j\<parallel>\<^sup>2) = (\<Prod>i\<leftarrow>[0..<n]. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2)

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "map (\<lambda> i. sq_norm (?vs ! i)) [0 ..< n] = map sq_norm ?vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2) [0..<n] = map sq_norm (map gso.gso [0..<n])
[PROOF STEP]
by (intro nth_equalityI, auto)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2) [0..<n] = map sq_norm (map gso.gso [0..<n])

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. \<parallel>map gso.gso [0..<n] ! i\<parallel>\<^sup>2) [0..<n] = map sq_norm (map gso.gso [0..<n])

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "abs (sqrt (prod_list \<dots>)) \<le> sqrt (prod_list (map sq_norm ?us))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sqrt (prod_list (map sq_norm (map gso.gso [0..<n])))\<bar> \<le> sqrt (prod_list (map sq_norm (map (row A) [0..<n])))
[PROOF STEP]
using last
[PROOF STATE]
proof (prove)
using this:
0 \<le> prod_list (map sq_norm (map gso.gso [0..<n])) \<and> prod_list (map sq_norm (map gso.gso [0..<n])) \<le> prod_list (map sq_norm (map (row A) [0..<n]))

goal (1 subgoal):
 1. \<bar>sqrt (prod_list (map sq_norm (map gso.gso [0..<n])))\<bar> \<le> sqrt (prod_list (map sq_norm (map (row A) [0..<n])))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>sqrt (prod_list (map sq_norm (map gso.gso [0..<n])))\<bar> \<le> sqrt (prod_list (map sq_norm (map (row A) [0..<n])))

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>sqrt (prod_list (map sq_norm (map gso.gso [0..<n])))\<bar> \<le> sqrt (prod_list (map sq_norm (map (row A) [0..<n])))

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have "?us = rows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (row A) [0..<n] = rows A
[PROOF STEP]
unfolding rows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (row A) [0..<n] = map (row A) [0..<dim_row A]
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. map (row A) [0..<n] = map (row A) [0..<dim_row A]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map (row A) [0..<n] = rows A

goal (2 subgoals):
 1. carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
 2. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))

goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))

goal (1 subgoal):
 1. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n]))

goal (1 subgoal):
 1. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
from mat_of_rows_rows[unfolded rows_def,of A] A gram_schmidt.non_span_det_zero[OF len False us]
[PROOF STATE]
proof (chain)
picking this:
mat_of_rows (dim_col A) (map (row A) [0..<dim_row A]) = A
A \<in> carrier_mat n n
det (mat_of_rows n (map (row A) [0..<n])) = 0
[PROOF STEP]
have zero: "det A = 0"
[PROOF STATE]
proof (prove)
using this:
mat_of_rows (dim_col A) (map (row A) [0..<dim_row A]) = A
A \<in> carrier_mat n n
det (mat_of_rows n (map (row A) [0..<n])) = 0

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

goal (1 subgoal):
 1. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
have ge: "prod_list (map sq_norm (rows A)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> prod_list (map sq_norm (rows A))
[PROOF STEP]
by (rule prod_list_nonneg, auto simp: sq_norm_vec_ge_0)
[PROOF STATE]
proof (state)
this:
0 \<le> prod_list (map sq_norm (rows A))

goal (1 subgoal):
 1. \<not> carrier_vec n \<subseteq> gso.span (set (map (row A) [0..<n])) \<Longrightarrow> \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
unfolding zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>0\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
using ge
[PROOF STATE]
proof (prove)
using this:
0 \<le> prod_list (map sq_norm (rows A))

goal (1 subgoal):
 1. \<bar>0\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>det A\<bar> \<le> sqrt (prod_list (map sq_norm (rows A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_cross_mult_less_hmset:
  fixes Aa A Ba B :: hmultiset
  assumes A_lt: "A < Aa" and B_lt: "B < Ba"
  shows "A * Ba + B * Aa < A * B + Aa * Ba"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * Ba + B * Aa < A * B + Aa * Ba
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * Ba + B * Aa < A * B + Aa * Ba
[PROOF STEP]
obtain j m1 m2 where A: "A = j + m1" and Aa: "Aa = j + m2" and hd_m: "head_\<omega> m1 < head_\<omega> m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j m1 m2. \<lbrakk>A = j + m1; Aa = j + m2; head_\<omega> m1 < head_\<omega> m2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis hmset_pair_decompose_less[OF A_lt])
[PROOF STATE]
proof (state)
this:
A = j + m1
Aa = j + m2
head_\<omega> m1 < head_\<omega> m2

goal (1 subgoal):
 1. A * Ba + B * Aa < A * B + Aa * Ba
[PROOF STEP]
obtain k n1 n2 where B: "B = k + n1" and Ba: "Ba = k + n2" and hd_n: "head_\<omega> n1 < head_\<omega> n2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k n1 n2. \<lbrakk>B = k + n1; Ba = k + n2; head_\<omega> n1 < head_\<omega> n2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis hmset_pair_decompose_less[OF B_lt])
[PROOF STATE]
proof (state)
this:
B = k + n1
Ba = k + n2
head_\<omega> n1 < head_\<omega> n2

goal (1 subgoal):
 1. A * Ba + B * Aa < A * B + Aa * Ba
[PROOF STEP]
have hd_lt: "head_\<omega> (m1 * n2 + m2 * n1) < head_\<omega> (m1 * n1 + m2 * n2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. head_\<omega> (m1 * n2 + m2 * n1) < head_\<omega> (m1 * n1 + m2 * n2)
[PROOF STEP]
proof simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1) < sup (head_\<omega> m1 * head_\<omega> n1) (head_\<omega> m2 * head_\<omega> n2)
[PROOF STEP]
have "\<And>h ha :: hmultiset. 0 < h \<or> \<not> ha < h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h ha. 0 < h \<or> \<not> ha < h
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < ?h \<or> \<not> ?ha < ?h

goal (1 subgoal):
 1. sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1) < sup (head_\<omega> m1 * head_\<omega> n1) (head_\<omega> m2 * head_\<omega> n2)
[PROOF STEP]
hence "\<not> head_\<omega> m2 * head_\<omega> n2 \<le> sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1)"
[PROOF STATE]
proof (prove)
using this:
0 < ?h \<or> \<not> ?ha < ?h

goal (1 subgoal):
 1. \<not> head_\<omega> m2 * head_\<omega> n2 \<le> sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1)
[PROOF STEP]
using hd_m hd_n sup_hmultiset_def
[PROOF STATE]
proof (prove)
using this:
0 < ?h \<or> \<not> ?ha < ?h
head_\<omega> m1 < head_\<omega> m2
head_\<omega> n1 < head_\<omega> n2
sup ?A ?B = (if ?A < ?B then ?B else ?A)

goal (1 subgoal):
 1. \<not> head_\<omega> m2 * head_\<omega> n2 \<le> sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> head_\<omega> m2 * head_\<omega> n2 \<le> sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1)

goal (1 subgoal):
 1. sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1) < sup (head_\<omega> m1 * head_\<omega> n1) (head_\<omega> m2 * head_\<omega> n2)
[PROOF STEP]
thus "sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1)
      < sup (head_\<omega> m1 * head_\<omega> n1) (head_\<omega> m2 * head_\<omega> n2)"
[PROOF STATE]
proof (prove)
using this:
\<not> head_\<omega> m2 * head_\<omega> n2 \<le> sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1)

goal (1 subgoal):
 1. sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1) < sup (head_\<omega> m1 * head_\<omega> n1) (head_\<omega> m2 * head_\<omega> n2)
[PROOF STEP]
by (meson leI sup.bounded_iff)
[PROOF STATE]
proof (state)
this:
sup (head_\<omega> m1 * head_\<omega> n2) (head_\<omega> m2 * head_\<omega> n1) < sup (head_\<omega> m1 * head_\<omega> n1) (head_\<omega> m2 * head_\<omega> n2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
head_\<omega> (m1 * n2 + m2 * n1) < head_\<omega> (m1 * n1 + m2 * n2)

goal (1 subgoal):
 1. A * Ba + B * Aa < A * B + Aa * Ba
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * Ba + B * Aa < A * B + Aa * Ba
[PROOF STEP]
unfolding A Aa B Ba ring_distribs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j * k + m1 * k + (j * n2 + m1 * n2) + (k * j + n1 * j + (k * m2 + n1 * m2)) < j * k + m1 * k + (j * n1 + m1 * n1) + (j * k + m2 * k + (j * n2 + m2 * n2))
[PROOF STEP]
by (simp add: algebra_simps head_\<omega>_lt_imp_lt[OF hd_lt])
[PROOF STATE]
proof (state)
this:
A * Ba + B * Aa < A * B + Aa * Ba

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_power:
  shows "\<lbrakk> p < 2 ^ x; x < len_of TYPE ('a) \<rbrakk> \<Longrightarrow> of_nat p < (2 :: 'a :: len word) ^ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat p < 2 ^ x
[PROOF STEP]
apply (rule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat p < ?y
 2. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> ?y \<le> 2 ^ x
[PROOF STEP]
apply (rule of_nat_mono_maybe)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> ?x3 < 2 ^ LENGTH('a)
 2. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> p < ?x3
 3. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat ?x3 \<le> 2 ^ x
[PROOF STEP]
apply (erule power_strict_increasing)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. p < 2 ^ x \<Longrightarrow> 1 < 2
 2. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> p < 2 ^ x
 3. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat (2 ^ x) \<le> 2 ^ x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> p < 2 ^ x
 2. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat (2 ^ x) \<le> 2 ^ x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p < 2 ^ x; x < LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat (2 ^ x) \<le> 2 ^ x
[PROOF STEP]
apply (simp add: word_unat_power del: of_nat_power)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done