[STATEMENT]
lemma decomposition_theorem_polyhedra_1:
  assumes A: "A \<in> carrier_mat nr n"
    and b: "b \<in> carrier_vec nr"
    and P: "P = polyhedron A b"
  shows "\<exists> Q X. X \<subseteq> carrier_vec n \<and> finite X \<and>
    Q \<subseteq> carrier_vec n \<and> finite Q \<and>
    P = convex_hull Q + cone X \<and>
    (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow>
      X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
    \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = convex_hull Q + cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = convex_hull Q + cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
let ?oi = "of_int :: int \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = convex_hull Q + cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
interpret next_dim: gram_schmidt "n + 1" "TYPE ('a)"
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = convex_hull Q + cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
interpret gram_schmidt_m "n + 1" n "TYPE('a)"
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
from P[unfolded polyhedron_def]
[PROOF STATE]
proof (chain)
picking this:
P = {x \<in> carrier_vec n. A *\<^sub>v x \<le> b}
[PROOF STEP]
have "P \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
P = {x \<in> carrier_vec n. A *\<^sub>v x \<le> b}

goal (1 subgoal):
 1. P \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have mcb: "mat_of_col (-b) \<in> carrier_mat nr 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_col (- b) \<in> carrier_mat nr 1
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec nr

goal (1 subgoal):
 1. mat_of_col (- b) \<in> carrier_mat nr 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_of_col (- b) \<in> carrier_mat nr 1

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
define M where "M = (A @\<^sub>c mat_of_col (-b)) @\<^sub>r (0\<^sub>m 1 n @\<^sub>c -1\<^sub>m 1)"
[PROOF STATE]
proof (state)
this:
M = (A @\<^sub>c mat_of_col (- b)) @\<^sub>r 0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have M_top: "A @\<^sub>c mat_of_col (- b) \<in> carrier_mat nr (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A @\<^sub>c mat_of_col (- b) \<in> carrier_mat nr (n + 1)
[PROOF STEP]
by (rule carrier_append_cols[OF A mcb])
[PROOF STATE]
proof (state)
this:
A @\<^sub>c mat_of_col (- b) \<in> carrier_mat nr (n + 1)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have M_bottom: "(0\<^sub>m 1 n @\<^sub>c -1\<^sub>m 1) \<in> carrier_mat 1 (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1 \<in> carrier_mat 1 (n + 1)
[PROOF STEP]
by (rule carrier_append_cols, auto)
[PROOF STATE]
proof (state)
this:
0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1 \<in> carrier_mat 1 (n + 1)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have M_dim: "M \<in> carrier_mat (nr + 1) (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<in> carrier_mat (nr + 1) (n + 1)
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c mat_of_col (- b)) @\<^sub>r 0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1 \<in> carrier_mat (nr + 1) (n + 1)
[PROOF STEP]
by (rule carrier_append_rows[OF M_top M_bottom])
[PROOF STATE]
proof (state)
this:
M \<in> carrier_mat (nr + 1) (n + 1)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
M \<in> carrier_mat (nr + 1) (n + 1)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
fix x :: "'a vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
assume x: "x \<in> carrier_vec n"
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec n

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have "x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M =
          (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> t \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
let ?y = "x @\<^sub>v vec_of_scal t"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have y: "?y \<in> carrier_vec (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal t \<in> carrier_vec (n + 1)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal t \<in> carrier_vec (n + 1)
[PROOF STEP]
by(simp del: One_nat_def)
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal t \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "?y \<in> next_dim.polyhedral_cone M =
            (M *\<^sub>v ?y \<le> 0\<^sub>v (nr + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v (nr + 1))
[PROOF STEP]
unfolding next_dim.polyhedral_cone_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> {x \<in> carrier_vec (n + 1). M *\<^sub>v x \<le> 0\<^sub>v (dim_row M)}) = (M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v (nr + 1))
[PROOF STEP]
using y M_dim
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal t \<in> carrier_vec (n + 1)
M \<in> carrier_mat (nr + 1) (n + 1)

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> {x \<in> carrier_vec (n + 1). M *\<^sub>v x \<le> 0\<^sub>v (dim_row M)}) = (M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v (nr + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v (nr + 1))

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v (nr + 1))

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "0\<^sub>v (nr + 1) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v (nr + 1) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v (nr + 1) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>v (nr + 1) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "M *\<^sub>v ?y \<le> 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1 =
                   ((A @\<^sub>c mat_of_col (-b)) *\<^sub>v ?y \<le> 0\<^sub>v nr \<and>
                   (0\<^sub>m 1 n @\<^sub>c -1\<^sub>m 1) *\<^sub>v ?y \<le> 0\<^sub>v 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) = ((A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr \<and> (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v 1)
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((A @\<^sub>c mat_of_col (- b)) @\<^sub>r 0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) = ((A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr \<and> (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v 1)
[PROOF STEP]
by (intro append_rows_le[OF M_top M_bottom _ y], auto)
[PROOF STATE]
proof (state)
this:
(M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) = ((A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr \<and> (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v 1)

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(M *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) = ((A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v nr \<and> (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) \<le> 0\<^sub>v 1)

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "(A @\<^sub>c mat_of_col(-b)) *\<^sub>v ?y =
                 A *\<^sub>v x + mat_of_col(-b) *\<^sub>v vec_of_scal t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) = A *\<^sub>v x + mat_of_col (- b) *\<^sub>v vec_of_scal t
[PROOF STEP]
by (rule mat_mult_append_cols[OF A _ x],
            auto simp add: b simp del: One_nat_def)
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) = A *\<^sub>v x + mat_of_col (- b) *\<^sub>v vec_of_scal t

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c mat_of_col (- b)) *\<^sub>v (x @\<^sub>v vec_of_scal t) = A *\<^sub>v x + mat_of_col (- b) *\<^sub>v vec_of_scal t

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "mat_of_col(-b) *\<^sub>v vec_of_scal t = t \<cdot>\<^sub>v (-b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_col (- b) *\<^sub>v vec_of_scal t = t \<cdot>\<^sub>v - b
[PROOF STEP]
by(rule mult_mat_of_row_vec_of_scal)
[PROOF STATE]
proof (state)
this:
mat_of_col (- b) *\<^sub>v vec_of_scal t = t \<cdot>\<^sub>v - b

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_col (- b) *\<^sub>v vec_of_scal t = t \<cdot>\<^sub>v - b

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "A *\<^sub>v x + t \<cdot>\<^sub>v (-b) = A *\<^sub>v x - t \<cdot>\<^sub>v b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x + t \<cdot>\<^sub>v - b = A *\<^sub>v x - t \<cdot>\<^sub>v b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x + t \<cdot>\<^sub>v - b = A *\<^sub>v x - t \<cdot>\<^sub>v b

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x + t \<cdot>\<^sub>v - b = A *\<^sub>v x - t \<cdot>\<^sub>v b

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "(0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) =
                 0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) = 0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t
[PROOF STEP]
by(rule mat_mult_append_cols, auto simp add: x simp del: One_nat_def)
[PROOF STATE]
proof (state)
this:
(0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) = 0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) *\<^sub>v (x @\<^sub>v vec_of_scal t) = 0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "\<dots> = - vec_of_scal t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t = - vec_of_scal t
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n

goal (1 subgoal):
 1. 0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t = - vec_of_scal t
[PROOF STEP]
by (auto simp del: One_nat_def)
[PROOF STATE]
proof (state)
this:
0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t = - vec_of_scal t

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>m 1 n *\<^sub>v x + - 1\<^sub>m 1 *\<^sub>v vec_of_scal t = - vec_of_scal t

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
have "(\<dots> \<le> 0\<^sub>v 1) = (t \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- vec_of_scal t \<le> 0\<^sub>v 1) = ((0::'a) \<le> t)
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim_vec (- vec_of_scal t) = dim_vec (0\<^sub>v 1) \<and> (\<forall>i<dim_vec (0\<^sub>v 1). (- vec_of_scal t) $ i \<le> 0\<^sub>v 1 $ i)) = ((0::'a) \<le> t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- vec_of_scal t \<le> 0\<^sub>v 1) = ((0::'a) \<le> t)

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
show "(?y \<in> next_dim.polyhedral_cone M) =
                    (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> t \<ge> 0)"
[PROOF STATE]
proof (prove)
using this:
(x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)

goal (1 subgoal):
 1. (x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(x @\<^sub>v vec_of_scal t \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - t \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> t)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x7 \<in> carrier_vec n \<Longrightarrow> (?x7 @\<^sub>v vec_of_scal ?t7 \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v ?x7 - ?t7 \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> ?t7)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
note M_cone_car = this
[PROOF STATE]
proof (state)
this:
?x7 \<in> carrier_vec n \<Longrightarrow> (?x7 @\<^sub>v vec_of_scal ?t7 \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v ?x7 - ?t7 \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> ?t7)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
from next_dim.farkas_minkowsky_weyl_theorem_2[OF M_dim, of db "max 1 Bnd"]
[PROOF STATE]
proof (chain)
picking this:
\<exists>X\<subseteq>carrier_vec (n + 1). finite X \<and> next_dim.polyhedral_cone M = next_dim.cone X \<and> (is_det_bound db \<longrightarrow> M \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int (max 1 Bnd)) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n + 1 - 1) (max 1 (max 1 Bnd)))))
[PROOF STEP]
obtain X where X: "next_dim.polyhedral_cone M = next_dim.cone X" and
    fin_X: "finite X" and X_carrier: "X \<subseteq> carrier_vec (n+1)"
    and Bnd: "is_det_bound db \<Longrightarrow> M \<in> \<int>\<^sub>m \<inter> Bounded_mat (?oi (max 1 Bnd)) \<Longrightarrow>
          X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (?oi (db n (max 1 Bnd)))"
[PROOF STATE]
proof (prove)
using this:
\<exists>X\<subseteq>carrier_vec (n + 1). finite X \<and> next_dim.polyhedral_cone M = next_dim.cone X \<and> (is_det_bound db \<longrightarrow> M \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int (max 1 Bnd)) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n + 1 - 1) (max 1 (max 1 Bnd)))))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>next_dim.polyhedral_cone M = next_dim.cone X; finite X; X \<subseteq> carrier_vec (n + 1); \<lbrakk>is_det_bound db; M \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int (max 1 Bnd))\<rbrakk> \<Longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.polyhedral_cone M = next_dim.cone X
finite X
X \<subseteq> carrier_vec (n + 1)
\<lbrakk>is_det_bound db; M \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int (max 1 Bnd))\<rbrakk> \<Longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
let ?f = "\<lambda> x. if x $ n = 0 then 1 else 1 / (x $ n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
define Y where "Y = {?f x \<cdot>\<^sub>v x | x. x \<in> X}"
[PROOF STATE]
proof (state)
this:
Y = {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X}

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have "finite Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Y
[PROOF STEP]
unfolding Y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X}
[PROOF STEP]
using fin_X
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. finite {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite Y

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have Y_carrier: "Y \<subseteq> carrier_vec (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
unfolding Y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X} \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
using X_carrier
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X} \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Y \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have "?f ` X \<subseteq> {y. y > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<subseteq> {y. (0::'a) < y}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<Longrightarrow> x \<in> {y. (0::'a) < y}
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<Longrightarrow> x \<in> {y. (0::'a) < y}
[PROOF STEP]
assume "y \<in> ?f ` X"
[PROOF STATE]
proof (state)
this:
y \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<Longrightarrow> x \<in> {y. (0::'a) < y}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X
[PROOF STEP]
obtain x where x: "x \<in> X" and y: "y = ?f x"
[PROOF STATE]
proof (prove)
using this:
y \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> X; y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> X
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<Longrightarrow> x \<in> {y. (0::'a) < y}
[PROOF STEP]
show "y \<in> {y. y > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> {y. (0::'a) < y}
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> y \<in> {y. (0::'a) < y}
 2. \<not> ?P \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
assume "x $ n = 0"
[PROOF STATE]
proof (state)
this:
x $ n = (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> y \<in> {y. (0::'a) < y}
 2. \<not> ?P \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
thus "y \<in> {y. y > 0}"
[PROOF STATE]
proof (prove)
using this:
x $ n = (0::'a)

goal (1 subgoal):
 1. y \<in> {y. (0::'a) < y}
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
x $ n = (0::'a)
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n)

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

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
assume P: "x $ n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
have "x = vec_first x n @\<^sub>v vec_last x 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = vec_first x n @\<^sub>v vec_last x 1
[PROOF STEP]
using x X_carrier vec_first_last_append
[PROOF STATE]
proof (prove)
using this:
x \<in> X
X \<subseteq> carrier_vec (n + 1)
?v \<in> carrier_vec (?n + ?m) \<Longrightarrow> vec_first ?v ?n @\<^sub>v vec_last ?v ?m = ?v

goal (1 subgoal):
 1. x = vec_first x n @\<^sub>v vec_last x 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = vec_first x n @\<^sub>v vec_last x 1

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = vec_first x n @\<^sub>v vec_last x 1

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
have "vec_last x 1 = vec_of_scal (vec_last x 1 $ 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last x 1 = vec_of_scal (vec_last x 1 $ 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_last x 1 = vec_of_scal (vec_last x 1 $ 0)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_last x 1 = vec_of_scal (vec_last x 1 $ 0)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
have "vec_last x 1 $ 0 = x $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last x 1 $ 0 = x $ n
[PROOF STEP]
using x X_carrier
[PROOF STATE]
proof (prove)
using this:
x \<in> X
X \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. vec_last x 1 $ 0 = x $ n
[PROOF STEP]
unfolding vec_last_def
[PROOF STATE]
proof (prove)
using this:
x \<in> X
X \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. vec 1 (\<lambda>i. x $ (dim_vec x - 1 + i)) $ 0 = x $ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_last x 1 $ 0 = x $ n

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)
[PROOF STEP]
have "x = vec_first x n @\<^sub>v vec_of_scal (x $ n)"
[PROOF STATE]
proof (prove)
using this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)

goal (1 subgoal):
 1. x = vec_first x n @\<^sub>v vec_of_scal (x $ n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
have "x \<in> next_dim.polyhedral_cone M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> next_dim.polyhedral_cone M
[PROOF STEP]
using x X X_carrier next_dim.set_in_cone
[PROOF STATE]
proof (prove)
using this:
x \<in> X
next_dim.polyhedral_cone M = next_dim.cone X
X \<subseteq> carrier_vec (n + 1)
?Vs \<subseteq> carrier_vec (n + 1) \<Longrightarrow> ?Vs \<subseteq> next_dim.cone ?Vs

goal (1 subgoal):
 1. x \<in> next_dim.polyhedral_cone M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> next_dim.polyhedral_cone M

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)
x \<in> next_dim.polyhedral_cone M
[PROOF STEP]
have "x $ n \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)
x \<in> next_dim.polyhedral_cone M

goal (1 subgoal):
 1. (0::'a) \<le> x $ n
[PROOF STEP]
using M_cone_car vec_first_carrier
[PROOF STATE]
proof (prove)
using this:
x = vec_first x n @\<^sub>v vec_of_scal (x $ n)
x \<in> next_dim.polyhedral_cone M
?x7 \<in> carrier_vec n \<Longrightarrow> (?x7 @\<^sub>v vec_of_scal ?t7 \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v ?x7 - ?t7 \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> ?t7)
vec_first ?v ?n \<in> carrier_vec ?n

goal (1 subgoal):
 1. (0::'a) \<le> x $ n
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> x $ n

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
hence "x $ n > 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> x $ n

goal (1 subgoal):
 1. (0::'a) < x $ n
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> x $ n
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. (0::'a) < x $ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) < x $ n

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> {y. (0::'a) < y}
[PROOF STEP]
thus "y \<in> {y. y > 0}"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < x $ n

goal (1 subgoal):
 1. y \<in> {y. (0::'a) < y}
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
(0::'a) < x $ n
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y \<in> {y. (0::'a) < y}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<subseteq> {y. (0::'a) < y}

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
hence Y: "next_dim.cone Y = next_dim.polyhedral_cone M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<subseteq> {y. (0::'a) < y}

goal (1 subgoal):
 1. next_dim.cone Y = next_dim.polyhedral_cone M
[PROOF STEP]
unfolding Y_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<subseteq> {y. (0::'a) < y}

goal (1 subgoal):
 1. next_dim.cone {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X} = next_dim.polyhedral_cone M
[PROOF STEP]
using next_dim.cone_smult_basis[OF X_carrier] X
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) ` X \<subseteq> {y. (0::'a) < y}
?l ` X \<subseteq> {x. (0::'a) < x} \<Longrightarrow> next_dim.cone {?l v \<cdot>\<^sub>v v |v. v \<in> X} = next_dim.cone X
next_dim.polyhedral_cone M = next_dim.cone X

goal (1 subgoal):
 1. next_dim.cone {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X} = next_dim.polyhedral_cone M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.cone Y = next_dim.polyhedral_cone M

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
define Y0 where "Y0 = {v \<in> Y. v $ n = 0}"
[PROOF STATE]
proof (state)
this:
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
define Y1 where "Y1 = Y - Y0"
[PROOF STATE]
proof (state)
this:
Y1 = Y - Y0

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have Y0_carrier: "Y0 \<subseteq> carrier_vec (n + 1)" and Y1_carrier: "Y1 \<subseteq> carrier_vec (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y0 \<subseteq> carrier_vec (n + 1) &&& Y1 \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
unfolding Y0_def Y1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v \<in> Y. v $ n = (0::'a)} \<subseteq> carrier_vec (n + 1) &&& Y - {v \<in> Y. v $ n = (0::'a)} \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
using Y_carrier
[PROOF STATE]
proof (prove)
using this:
Y \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. {v \<in> Y. v $ n = (0::'a)} \<subseteq> carrier_vec (n + 1) &&& Y - {v \<in> Y. v $ n = (0::'a)} \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Y0 \<subseteq> carrier_vec (n + 1)
Y1 \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have "finite Y0" and "finite Y1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Y0 &&& finite Y1
[PROOF STEP]
unfolding Y0_def Y1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {v \<in> Y. v $ n = (0::'a)} &&& finite (Y - {v \<in> Y. v $ n = (0::'a)})
[PROOF STEP]
using \<open>finite Y\<close>
[PROOF STATE]
proof (prove)
using this:
finite Y

goal (1 subgoal):
 1. finite {v \<in> Y. v $ n = (0::'a)} &&& finite (Y - {v \<in> Y. v $ n = (0::'a)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite Y0
finite Y1

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
have Y1: "\<And> y. y \<in> Y1 \<Longrightarrow> y $ n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
assume y: "y \<in> Y1"
[PROOF STATE]
proof (state)
this:
y \<in> Y1

goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
hence "y \<in> Y"
[PROOF STATE]
proof (prove)
using this:
y \<in> Y1

goal (1 subgoal):
 1. y \<in> Y
[PROOF STEP]
unfolding Y1_def
[PROOF STATE]
proof (prove)
using this:
y \<in> Y - Y0

goal (1 subgoal):
 1. y \<in> Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> Y

goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> Y
[PROOF STEP]
obtain x where "x \<in> X" and x: "y = ?f x \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
y \<in> Y

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> X; y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Y_def
[PROOF STATE]
proof (prove)
using this:
y \<in> {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> X; y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> X
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x

goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x
[PROOF STEP]
have "x $ n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> X
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a)
[PROOF STEP]
using x y Y1_def Y0_def
[PROOF STATE]
proof (prove)
using this:
x \<in> X
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x
y \<in> Y1
Y1 = Y - Y0
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x $ n \<noteq> (0::'a)
[PROOF STEP]
have "y = 1 / (x $ n) \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. y = (1::'a) / x $ n \<cdot>\<^sub>v x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x $ n \<noteq> (0::'a)
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x

goal (1 subgoal):
 1. y = (1::'a) / x $ n \<cdot>\<^sub>v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = (1::'a) / x $ n \<cdot>\<^sub>v x

goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = (1::'a) / x $ n \<cdot>\<^sub>v x
[PROOF STEP]
have "y $ n = 1 / (x $ n) * x $ n"
[PROOF STATE]
proof (prove)
using this:
y = (1::'a) / x $ n \<cdot>\<^sub>v x

goal (1 subgoal):
 1. y $ n = (1::'a) / x $ n * x $ n
[PROOF STEP]
using X_carrier \<open>x \<in> X\<close>
[PROOF STATE]
proof (prove)
using this:
y = (1::'a) / x $ n \<cdot>\<^sub>v x
X \<subseteq> carrier_vec (n + 1)
x \<in> X

goal (1 subgoal):
 1. y $ n = (1::'a) / x $ n * x $ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y $ n = (1::'a) / x $ n * x $ n

goal (1 subgoal):
 1. \<And>y. y \<in> Y1 \<Longrightarrow> y $ n = (1::'a)
[PROOF STEP]
thus "y $ n = 1"
[PROOF STATE]
proof (prove)
using this:
y $ n = (1::'a) / x $ n * x $ n

goal (1 subgoal):
 1. y $ n = (1::'a)
[PROOF STEP]
using \<open>x $ n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
y $ n = (1::'a) / x $ n * x $ n
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. y $ n = (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y $ n = (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y6 \<in> Y1 \<Longrightarrow> ?y6 $ n = (1::'a)

goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
let ?Z0 = "{vec_first y n | y. y \<in> Y0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
let ?Z1 = "{vec_first y n | y. y \<in> Y1}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))
[PROOF STEP]
proof (intro exI conjI impI)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. ?X1 \<subseteq> carrier_vec n
 2. finite ?X1
 3. ?Q \<subseteq> carrier_vec n
 4. finite ?Q
 5. P = m.convex_hull ?Q + m.cone ?X1
 6. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> ?X1 \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 7. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> ?Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
show "?Z0 \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {vec_first y n |y. y \<in> Y0} \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{vec_first y n |y. y \<in> Y0} \<subseteq> carrier_vec n

goal (6 subgoals):
 1. finite {vec_first y n |y. y \<in> Y0}
 2. ?Q \<subseteq> carrier_vec n
 3. finite ?Q
 4. P = m.convex_hull ?Q + m.cone {vec_first y n |y. y \<in> Y0}
 5. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 6. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> ?Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
show "?Z1 \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {vec_first y n |y. y \<in> Y1} \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{vec_first y n |y. y \<in> Y1} \<subseteq> carrier_vec n

goal (5 subgoals):
 1. finite {vec_first y n |y. y \<in> Y0}
 2. finite {vec_first y n |y. y \<in> Y1}
 3. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
 4. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 5. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
show "finite ?Z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
using \<open>finite Y0\<close>
[PROOF STATE]
proof (prove)
using this:
finite Y0

goal (1 subgoal):
 1. finite {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {vec_first y n |y. y \<in> Y0}

goal (4 subgoals):
 1. finite {vec_first y n |y. y \<in> Y1}
 2. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
 3. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 4. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
show "finite ?Z1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {vec_first y n |y. y \<in> Y1}
[PROOF STEP]
using \<open>finite Y1\<close>
[PROOF STATE]
proof (prove)
using this:
finite Y1

goal (1 subgoal):
 1. finite {vec_first y n |y. y \<in> Y1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {vec_first y n |y. y \<in> Y1}

goal (3 subgoals):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 3. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
show "P = convex_hull ?Z1 + cone ?Z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
assume "x \<in> P"
[PROOF STATE]
proof (state)
this:
x \<in> P

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence xn: "x \<in> carrier_vec n" and "A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
using this:
x \<in> P

goal (1 subgoal):
 1. x \<in> carrier_vec n &&& A *\<^sub>v x \<le> b
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
x \<in> P
P = m.polyhedron A b

goal (1 subgoal):
 1. x \<in> carrier_vec n &&& A *\<^sub>v x \<le> b
[PROOF STEP]
unfolding polyhedron_def
[PROOF STATE]
proof (prove)
using this:
x \<in> P
P = {x \<in> carrier_vec n. A *\<^sub>v x \<le> b}

goal (1 subgoal):
 1. x \<in> carrier_vec n &&& A *\<^sub>v x \<le> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec n
A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "A *\<^sub>v x - 1 \<cdot>\<^sub>v b \<le> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. A *\<^sub>v x - (1::'a) \<cdot>\<^sub>v b \<le> 0\<^sub>v nr
[PROOF STEP]
using vec_le_iff_diff_le_0 A b carrier_vecD mult_mat_vec_carrier one_smult_vec
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
A *\<^sub>v x \<le> b
(?a \<le> ?b) = (?a - ?b \<le> 0\<^sub>v (dim_vec ?a))
A \<in> carrier_mat nr n
b \<in> carrier_vec nr
?v \<in> carrier_vec ?n \<Longrightarrow> dim_vec ?v = ?n
\<lbrakk>?A \<in> carrier_mat ?nr ?n; ?v \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> ?A *\<^sub>v ?v \<in> carrier_vec ?nr
(1::?'a) \<cdot>\<^sub>v ?v = ?v

goal (1 subgoal):
 1. A *\<^sub>v x - (1::'a) \<cdot>\<^sub>v b \<le> 0\<^sub>v nr
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x - (1::'a) \<cdot>\<^sub>v b \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "x @\<^sub>v vec_of_scal 1 \<in> next_dim.polyhedral_cone M"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - (1::'a) \<cdot>\<^sub>v b \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.polyhedral_cone M
[PROOF STEP]
using M_cone_car[OF xn]
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - (1::'a) \<cdot>\<^sub>v b \<le> 0\<^sub>v nr
(x @\<^sub>v vec_of_scal ?t7 \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - ?t7 \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> ?t7)

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.polyhedral_cone M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.polyhedral_cone M

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "x @\<^sub>v vec_of_scal 1 \<in> next_dim.cone Y"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.polyhedral_cone M

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
[PROOF STEP]
using Y
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.polyhedral_cone M
next_dim.cone Y = next_dim.polyhedral_cone M

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "x @\<^sub>v vec_of_scal 1 \<in> next_dim.finite_cone Y"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.finite_cone Y
[PROOF STEP]
using next_dim.cone_iff_finite_cone[OF Y_carrier \<open>finite Y\<close>]
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
next_dim.cone Y = next_dim.finite_cone Y

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.finite_cone Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.finite_cone Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.finite_cone Y
[PROOF STEP]
obtain c where c: "next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal 1)"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.finite_cone Y

goal (1 subgoal):
 1. (\<And>c. next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding next_dim.finite_cone_def
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> {b. \<exists>c. next_dim.nonneg_lincomb c (if finite Y then Y else {}) b}

goal (1 subgoal):
 1. (\<And>c. next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>finite Y\<close>
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> {b. \<exists>c. next_dim.nonneg_lincomb c (if finite Y then Y else {}) b}
finite Y

goal (1 subgoal):
 1. (\<And>c. next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a))

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
let ?y = "next_dim.lincomb c Y1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
let ?z = "next_dim.lincomb c Y0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have y_dim: "?y \<in> carrier_vec (n + 1)" and z_dim: "?z \<in> carrier_vec (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.lincomb c Y1 \<in> carrier_vec (n + 1) &&& next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)
[PROOF STEP]
unfolding next_dim.nonneg_lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.lincomb c Y1 \<in> carrier_vec (n + 1) &&& next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)
[PROOF STEP]
using Y0_carrier Y1_carrier next_dim.lincomb_closed
[PROOF STATE]
proof (prove)
using this:
Y0 \<subseteq> carrier_vec (n + 1)
Y1 \<subseteq> carrier_vec (n + 1)
?S \<subseteq> carrier_vec (n + 1) \<Longrightarrow> next_dim.lincomb ?a ?S \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. next_dim.lincomb c Y1 \<in> carrier_vec (n + 1) &&& next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y1 \<in> carrier_vec (n + 1)
next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence yz_dim: "?y + ?z \<in> carrier_vec (n + 1)"
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y1 \<in> carrier_vec (n + 1)
next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. next_dim.lincomb c Y1 + next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y1 + next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "x @\<^sub>v vec_of_scal 1 = next_dim.lincomb c Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) = next_dim.lincomb c Y
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a))

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) = next_dim.lincomb c Y
[PROOF STEP]
unfolding next_dim.nonneg_lincomb_def
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y = x @\<^sub>v vec_of_scal (1::'a) \<and> c ` Y \<subseteq> Collect ((\<le>) (0::'a))

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) = next_dim.lincomb c Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) = next_dim.lincomb c Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) = next_dim.lincomb c Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "Y = Y1 \<union> Y0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y = Y1 \<union> Y0
[PROOF STEP]
unfolding Y1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y = Y - Y0 \<union> Y0
[PROOF STEP]
using Y0_def
[PROOF STATE]
proof (prove)
using this:
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. Y = Y - Y0 \<union> Y0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Y = Y1 \<union> Y0

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Y = Y1 \<union> Y0

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "next_dim.lincomb c (Y1 \<union> Y0) = ?y + ?z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.lincomb c (Y1 \<union> Y0) = next_dim.lincomb c Y1 + next_dim.lincomb c Y0
[PROOF STEP]
using next_dim.lincomb_union2[of Y1 Y0]
            \<open>finite Y0\<close> \<open>finite Y\<close> Y0_carrier Y_carrier
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (Y1 \<union> Y0); Y1 \<union> Y0 \<subseteq> carrier_vec (n + 1); Y1 \<inter> Y0 = {}\<rbrakk> \<Longrightarrow> next_dim.lincomb ?a Y1 + next_dim.lincomb ?b Y0 = next_dim.lincomb (\<lambda>v. if v \<in> Y1 then ?a v else ?b v) (Y1 \<union> Y0)
finite Y0
finite Y
Y0 \<subseteq> carrier_vec (n + 1)
Y \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. next_dim.lincomb c (Y1 \<union> Y0) = next_dim.lincomb c Y1 + next_dim.lincomb c Y0
[PROOF STEP]
unfolding Y1_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (Y - Y0 \<union> Y0); Y - Y0 \<union> Y0 \<subseteq> carrier_vec (n + 1); (Y - Y0) \<inter> Y0 = {}\<rbrakk> \<Longrightarrow> next_dim.lincomb ?a (Y - Y0) + next_dim.lincomb ?b Y0 = next_dim.lincomb (\<lambda>v. if v \<in> Y - Y0 then ?a v else ?b v) (Y - Y0 \<union> Y0)
finite Y0
finite Y
Y0 \<subseteq> carrier_vec (n + 1)
Y \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. next_dim.lincomb c (Y - Y0 \<union> Y0) = next_dim.lincomb c (Y - Y0) + next_dim.lincomb c Y0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c (Y1 \<union> Y0) = next_dim.lincomb c Y1 + next_dim.lincomb c Y0

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c (Y1 \<union> Y0) = next_dim.lincomb c Y1 + next_dim.lincomb c Y0

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "?y + ?z = vec_first (?y + ?z) n @\<^sub>v vec_last (?y + ?z) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.lincomb c Y1 + next_dim.lincomb c Y0 = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1
[PROOF STEP]
using vec_first_last_append[of "?y + ?z" n 1] add_carrier_vec yz_dim
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y1 + next_dim.lincomb c Y0 \<in> carrier_vec (n + 1) \<Longrightarrow> vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1 = next_dim.lincomb c Y1 + next_dim.lincomb c Y0
\<lbrakk>?v\<^sub>1 \<in> carrier_vec ?n; ?v\<^sub>2 \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> ?v\<^sub>1 + ?v\<^sub>2 \<in> carrier_vec ?n
next_dim.lincomb c Y1 + next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. next_dim.lincomb c Y1 + next_dim.lincomb c Y0 = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y1 + next_dim.lincomb c Y0 = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y1 + next_dim.lincomb c Y0 = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "vec_last (?y + ?z) 1 = vec_of_scal ((?y + ?z) $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1 = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
[PROOF STEP]
using vec_of_scal_dim_1 vec_last_index[OF yz_dim, of 0]
[PROOF STATE]
proof (prove)
using this:
(?v \<in> carrier_vec 1) = (?v = vec_of_scal (?v $ 0))
0 < 1 \<Longrightarrow> vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1 $ 0 = (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ (n + 0)

goal (1 subgoal):
 1. vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1 = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_last (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) 1 = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x @\<^sub>v vec_of_scal (1::'a) = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
[PROOF STEP]
have "x @\<^sub>v vec_of_scal 1 =
                     vec_first (?y + ?z) n @\<^sub>v vec_of_scal ((?y + ?z) $ n)"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "x = vec_first (?y + ?z) n" and
          yz_last: "vec_of_scal 1 = vec_of_scal ((?y + ?z) $ n)"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)

goal (1 subgoal):
 1. x = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n &&& vec_of_scal (1::'a) = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
[PROOF STEP]
using append_vec_eq yz_dim xn
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n @\<^sub>v vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
\<lbrakk>?v \<in> carrier_vec ?n; ?v' \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> (?v @\<^sub>v ?w = ?v' @\<^sub>v ?w') = (?v = ?v' \<and> ?w = ?w')
next_dim.lincomb c Y1 + next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)
x \<in> carrier_vec n

goal (1 subgoal):
 1. x = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n &&& vec_of_scal (1::'a) = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n
vec_of_scal (1::'a) = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence xyz: "x = vec_first ?y n + vec_first ?z n"
[PROOF STATE]
proof (prove)
using this:
x = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n
vec_of_scal (1::'a) = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)

goal (1 subgoal):
 1. x = vec_first (next_dim.lincomb c Y1) n + vec_first (next_dim.lincomb c Y0) n
[PROOF STEP]
using vec_first_add[of n ?y ?z] y_dim z_dim
[PROOF STATE]
proof (prove)
using this:
x = vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n
vec_of_scal (1::'a) = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
\<lbrakk>n \<le> dim_vec (next_dim.lincomb c Y1); n \<le> dim_vec (next_dim.lincomb c Y0)\<rbrakk> \<Longrightarrow> vec_first (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) n = vec_first (next_dim.lincomb c Y1) n + vec_first (next_dim.lincomb c Y0) n
next_dim.lincomb c Y1 \<in> carrier_vec (n + 1)
next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. x = vec_first (next_dim.lincomb c Y1) n + vec_first (next_dim.lincomb c Y0) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = vec_first (next_dim.lincomb c Y1) n + vec_first (next_dim.lincomb c Y0) n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "1 = ((?y + ?z) $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) = (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n
[PROOF STEP]
using yz_last index_vec_of_scal
[PROOF STATE]
proof (prove)
using this:
vec_of_scal (1::'a) = vec_of_scal ((next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n)
vec_of_scal ?x $ 0 = ?x

goal (1 subgoal):
 1. (1::'a) = (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
(1::'a) = (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "1 = ?y $ n + ?z $ n"
[PROOF STATE]
proof (prove)
using this:
(1::'a) = (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n

goal (1 subgoal):
 1. (1::'a) = next_dim.lincomb c Y1 $ n + next_dim.lincomb c Y0 $ n
[PROOF STEP]
using y_dim z_dim
[PROOF STATE]
proof (prove)
using this:
(1::'a) = (next_dim.lincomb c Y1 + next_dim.lincomb c Y0) $ n
next_dim.lincomb c Y1 \<in> carrier_vec (n + 1)
next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. (1::'a) = next_dim.lincomb c Y1 $ n + next_dim.lincomb c Y0 $ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) = next_dim.lincomb c Y1 $ n + next_dim.lincomb c Y0 $ n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(1::'a) = next_dim.lincomb c Y1 $ n + next_dim.lincomb c Y0 $ n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have zn0: "?z $ n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.lincomb c Y0 $ n = (0::'a)
[PROOF STEP]
using next_dim.lincomb_index[OF _ Y0_carrier] Y0_def
[PROOF STATE]
proof (prove)
using this:
?i < n + 1 \<Longrightarrow> next_dim.lincomb ?a Y0 $ ?i = (\<Sum>x\<in>Y0. ?a x * x $ ?i)
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. next_dim.lincomb c Y0 $ n = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y0 $ n = (0::'a)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(1::'a) = next_dim.lincomb c Y1 $ n + next_dim.lincomb c Y0 $ n
next_dim.lincomb c Y0 $ n = (0::'a)
[PROOF STEP]
have yn1: "1 = ?y $ n"
[PROOF STATE]
proof (prove)
using this:
(1::'a) = next_dim.lincomb c Y1 $ n + next_dim.lincomb c Y0 $ n
next_dim.lincomb c Y0 $ n = (0::'a)

goal (1 subgoal):
 1. (1::'a) = next_dim.lincomb c Y1 $ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) = next_dim.lincomb c Y1 $ n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "next_dim.nonneg_lincomb c Y1 ?y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.nonneg_lincomb c Y1 (next_dim.lincomb c Y1)
[PROOF STEP]
using c Y1_def
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a))
Y1 = Y - Y0

goal (1 subgoal):
 1. next_dim.nonneg_lincomb c Y1 (next_dim.lincomb c Y1)
[PROOF STEP]
unfolding next_dim.nonneg_lincomb_def
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y = x @\<^sub>v vec_of_scal (1::'a) \<and> c ` Y \<subseteq> Collect ((\<le>) (0::'a))
Y1 = Y - Y0

goal (1 subgoal):
 1. next_dim.lincomb c Y1 = next_dim.lincomb c Y1 \<and> c ` Y1 \<subseteq> Collect ((\<le>) (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.nonneg_lincomb c Y1 (next_dim.lincomb c Y1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "?y \<in> next_dim.cone Y1"
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y1 (next_dim.lincomb c Y1)

goal (1 subgoal):
 1. next_dim.lincomb c Y1 \<in> next_dim.cone Y1
[PROOF STEP]
using next_dim.cone_iff_finite_cone[OF Y1_carrier] \<open>finite Y1\<close>
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y1 (next_dim.lincomb c Y1)
finite Y1 \<Longrightarrow> next_dim.cone Y1 = next_dim.finite_cone Y1
finite Y1

goal (1 subgoal):
 1. next_dim.lincomb c Y1 \<in> next_dim.cone Y1
[PROOF STEP]
unfolding next_dim.finite_cone_def
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y1 (next_dim.lincomb c Y1)
finite Y1 \<Longrightarrow> next_dim.cone Y1 = {b. \<exists>c. next_dim.nonneg_lincomb c (if finite Y1 then Y1 else {}) b}
finite Y1

goal (1 subgoal):
 1. next_dim.lincomb c Y1 \<in> next_dim.cone Y1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y1 \<in> next_dim.cone Y1

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence y: "vec_first ?y n \<in> convex_hull ?Z1"
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y1 \<in> next_dim.cone Y1

goal (1 subgoal):
 1. vec_first (next_dim.lincomb c Y1) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
[PROOF STEP]
using convex_hull_next_dim[OF _ Y1_carrier \<open>finite Y1\<close> _ y_dim] Y1 yn1
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y1 \<in> next_dim.cone Y1
\<lbrakk>n + 1 = n + 1; \<forall>y\<in>Y1. y $ n = (1::'a); next_dim.lincomb c Y1 $ n = (1::'a)\<rbrakk> \<Longrightarrow> (vec_first (next_dim.lincomb c Y1) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}) = (next_dim.lincomb c Y1 \<in> next_dim.cone Y1)
?y6 \<in> Y1 \<Longrightarrow> ?y6 $ n = (1::'a)
(1::'a) = next_dim.lincomb c Y1 $ n

goal (1 subgoal):
 1. vec_first (next_dim.lincomb c Y1) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec_first (next_dim.lincomb c Y1) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "next_dim.nonneg_lincomb c Y0 ?z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next_dim.nonneg_lincomb c Y0 (next_dim.lincomb c Y0)
[PROOF STEP]
using c Y0_def
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y (x @\<^sub>v vec_of_scal (1::'a))
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. next_dim.nonneg_lincomb c Y0 (next_dim.lincomb c Y0)
[PROOF STEP]
unfolding next_dim.nonneg_lincomb_def
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y = x @\<^sub>v vec_of_scal (1::'a) \<and> c ` Y \<subseteq> Collect ((\<le>) (0::'a))
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. next_dim.lincomb c Y0 = next_dim.lincomb c Y0 \<and> c ` Y0 \<subseteq> Collect ((\<le>) (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
next_dim.nonneg_lincomb c Y0 (next_dim.lincomb c Y0)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "?z \<in> next_dim.cone Y0"
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y0 (next_dim.lincomb c Y0)

goal (1 subgoal):
 1. next_dim.lincomb c Y0 \<in> next_dim.cone Y0
[PROOF STEP]
using \<open>finite Y0\<close> next_dim.cone_iff_finite_cone[OF Y0_carrier \<open>finite Y0\<close>]
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y0 (next_dim.lincomb c Y0)
finite Y0
next_dim.cone Y0 = next_dim.finite_cone Y0

goal (1 subgoal):
 1. next_dim.lincomb c Y0 \<in> next_dim.cone Y0
[PROOF STEP]
unfolding next_dim.finite_cone_def
[PROOF STATE]
proof (prove)
using this:
next_dim.nonneg_lincomb c Y0 (next_dim.lincomb c Y0)
finite Y0
next_dim.cone Y0 = {b. \<exists>c. next_dim.nonneg_lincomb c (if finite Y0 then Y0 else {}) b}

goal (1 subgoal):
 1. next_dim.lincomb c Y0 \<in> next_dim.cone Y0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
next_dim.lincomb c Y0 \<in> next_dim.cone Y0

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence z: "vec_first ?z n \<in> cone ?Z0"
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y0 \<in> next_dim.cone Y0

goal (1 subgoal):
 1. vec_first (next_dim.lincomb c Y0) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
using cone_next_dim[OF _ Y0_carrier \<open>finite Y0\<close> _ _ zn0] Y0_def
            next_dim.lincomb_closed[OF Y0_carrier]
[PROOF STATE]
proof (prove)
using this:
next_dim.lincomb c Y0 \<in> next_dim.cone Y0
\<lbrakk>n + 1 = n + 1; \<forall>y\<in>Y0. y $ n = (0::'a); next_dim.lincomb c Y0 \<in> carrier_vec (n + 1)\<rbrakk> \<Longrightarrow> (vec_first (next_dim.lincomb c Y0) n \<in> m.cone {vec_first y n |y. y \<in> Y0}) = (next_dim.lincomb c Y0 \<in> next_dim.cone Y0)
Y0 = {v \<in> Y. v $ n = (0::'a)}
next_dim.lincomb ?a Y0 \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. vec_first (next_dim.lincomb c Y0) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vec_first (next_dim.lincomb c Y0) n \<in> m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
from xyz y z
[PROOF STATE]
proof (chain)
picking this:
x = vec_first (next_dim.lincomb c Y1) n + vec_first (next_dim.lincomb c Y0) n
vec_first (next_dim.lincomb c Y1) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
vec_first (next_dim.lincomb c Y0) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "x \<in> convex_hull ?Z1 + cone ?Z0"
[PROOF STATE]
proof (prove)
using this:
x = vec_first (next_dim.lincomb c Y1) n + vec_first (next_dim.lincomb c Y0) n
vec_first (next_dim.lincomb c Y1) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
vec_first (next_dim.lincomb c Y0) n \<in> m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. x \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x8 \<in> P \<Longrightarrow> ?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x8 \<in> P \<Longrightarrow> ?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x8 \<in> P \<Longrightarrow> ?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
assume "x \<in> convex_hull ?Z1 + cone ?Z0"
[PROOF STATE]
proof (state)
this:
x \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
obtain y z where "x = y + z" and y: "y \<in> convex_hull ?Z1"
          and z: "z \<in> cone ?Z0"
[PROOF STATE]
proof (prove)
using this:
x \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. (\<And>y z. \<lbrakk>x = y + z; y \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}; z \<in> m.cone {vec_first y n |y. y \<in> Y0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: set_plus_elim)
[PROOF STATE]
proof (state)
this:
x = y + z
y \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
z \<in> m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have yn: "y \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> carrier_vec n
[PROOF STEP]
using y convex_hull_carrier[OF \<open>?Z1 \<subseteq> carrier_vec n\<close>]
[PROOF STATE]
proof (prove)
using this:
y \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
m.convex_hull {vec_first y n |y. y \<in> Y1} \<subseteq> carrier_vec n

goal (1 subgoal):
 1. y \<in> carrier_vec n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "y @\<^sub>v vec_of_scal 1 \<in> carrier_vec (n + 1)"
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier_vec n

goal (1 subgoal):
 1. y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)
[PROOF STEP]
using vec_of_scal_dim(2)
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier_vec n
vec_of_scal ?x \<in> carrier_vec 1

goal (1 subgoal):
 1. y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "vec_first (y @\<^sub>v vec_of_scal 1) n \<in> convex_hull ?Z1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
[PROOF STEP]
using vec_first_append[OF yn] y
[PROOF STATE]
proof (prove)
using this:
vec_first (y @\<^sub>v ?w) n = y
y \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}

goal (1 subgoal):
 1. vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "(y @\<^sub>v vec_of_scal 1) $ n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y @\<^sub>v vec_of_scal (1::'a)) $ n = (1::'a)
[PROOF STEP]
using yn
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier_vec n

goal (1 subgoal):
 1. (y @\<^sub>v vec_of_scal (1::'a)) $ n = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(y @\<^sub>v vec_of_scal (1::'a)) $ n = (1::'a)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)
vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
(y @\<^sub>v vec_of_scal (1::'a)) $ n = (1::'a)
[PROOF STEP]
have "y @\<^sub>v vec_of_scal 1 \<in> next_dim.cone Y1"
[PROOF STATE]
proof (prove)
using this:
y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)
vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
(y @\<^sub>v vec_of_scal (1::'a)) $ n = (1::'a)

goal (1 subgoal):
 1. y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y1
[PROOF STEP]
using convex_hull_next_dim[OF _ Y1_carrier \<open>finite Y1\<close>] Y1
[PROOF STATE]
proof (prove)
using this:
y @\<^sub>v vec_of_scal (1::'a) \<in> carrier_vec (n + 1)
vec_first (y @\<^sub>v vec_of_scal (1::'a)) n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}
(y @\<^sub>v vec_of_scal (1::'a)) $ n = (1::'a)
\<lbrakk>n + 1 = n + 1; \<forall>y\<in>Y1. y $ n = (1::'a); ?y \<in> carrier_vec (n + 1); ?y $ n = (1::'a)\<rbrakk> \<Longrightarrow> (vec_first ?y n \<in> m.convex_hull {vec_first y n |y. y \<in> Y1}) = (?y \<in> next_dim.cone Y1)
?y6 \<in> Y1 \<Longrightarrow> ?y6 $ n = (1::'a)

goal (1 subgoal):
 1. y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y1

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence y_cone: "y @\<^sub>v vec_of_scal 1 \<in> next_dim.cone Y"
[PROOF STATE]
proof (prove)
using this:
y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y1

goal (1 subgoal):
 1. y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
[PROOF STEP]
using next_dim.cone_mono[of Y1 Y] Y1_def
[PROOF STATE]
proof (prove)
using this:
y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y1
Y1 \<subseteq> Y \<Longrightarrow> next_dim.cone Y1 \<subseteq> next_dim.cone Y
Y1 = Y - Y0

goal (1 subgoal):
 1. y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have zn: "z \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> carrier_vec n
[PROOF STEP]
using z cone_carrier[of ?Z0]
[PROOF STATE]
proof (prove)
using this:
z \<in> m.cone {vec_first y n |y. y \<in> Y0}
{vec_first y n |y. y \<in> Y0} \<subseteq> carrier_vec n \<Longrightarrow> m.cone {vec_first y n |y. y \<in> Y0} \<subseteq> carrier_vec n

goal (1 subgoal):
 1. z \<in> carrier_vec n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
z \<in> carrier_vec n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "z @\<^sub>v vec_of_scal 0 \<in> carrier_vec (n + 1)"
[PROOF STATE]
proof (prove)
using this:
z \<in> carrier_vec n

goal (1 subgoal):
 1. z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)
[PROOF STEP]
using vec_of_scal_dim(2)
[PROOF STATE]
proof (prove)
using this:
z \<in> carrier_vec n
vec_of_scal ?x \<in> carrier_vec 1

goal (1 subgoal):
 1. z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "vec_first (z @\<^sub>v vec_of_scal 0) n \<in> cone ?Z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
using vec_first_append[OF zn] z
[PROOF STATE]
proof (prove)
using this:
vec_first (z @\<^sub>v ?w) n = z
z \<in> m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "(z @\<^sub>v vec_of_scal 0) $ n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z @\<^sub>v vec_of_scal (0::'a)) $ n = (0::'a)
[PROOF STEP]
using zn
[PROOF STATE]
proof (prove)
using this:
z \<in> carrier_vec n

goal (1 subgoal):
 1. (z @\<^sub>v vec_of_scal (0::'a)) $ n = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(z @\<^sub>v vec_of_scal (0::'a)) $ n = (0::'a)

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)
vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
(z @\<^sub>v vec_of_scal (0::'a)) $ n = (0::'a)
[PROOF STEP]
have "z @\<^sub>v vec_of_scal 0 \<in> next_dim.cone Y0"
[PROOF STATE]
proof (prove)
using this:
z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)
vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
(z @\<^sub>v vec_of_scal (0::'a)) $ n = (0::'a)

goal (1 subgoal):
 1. z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y0
[PROOF STEP]
using cone_next_dim[OF _ Y0_carrier \<open>finite Y0\<close>] Y0_def
[PROOF STATE]
proof (prove)
using this:
z @\<^sub>v vec_of_scal (0::'a) \<in> carrier_vec (n + 1)
vec_first (z @\<^sub>v vec_of_scal (0::'a)) n \<in> m.cone {vec_first y n |y. y \<in> Y0}
(z @\<^sub>v vec_of_scal (0::'a)) $ n = (0::'a)
\<lbrakk>n + 1 = n + 1; \<forall>y\<in>Y0. y $ n = (0::'a); ?y \<in> carrier_vec (n + 1); ?y $ n = (0::'a)\<rbrakk> \<Longrightarrow> (vec_first ?y n \<in> m.cone {vec_first y n |y. y \<in> Y0}) = (?y \<in> next_dim.cone Y0)
Y0 = {v \<in> Y. v $ n = (0::'a)}

goal (1 subgoal):
 1. z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y0

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence z_cone: "z @\<^sub>v vec_of_scal 0 \<in> next_dim.cone Y"
[PROOF STATE]
proof (prove)
using this:
z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y0

goal (1 subgoal):
 1. z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y
[PROOF STEP]
using Y0_def next_dim.cone_mono[of Y0 Y]
[PROOF STATE]
proof (prove)
using this:
z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y0
Y0 = {v \<in> Y. v $ n = (0::'a)}
Y0 \<subseteq> Y \<Longrightarrow> next_dim.cone Y0 \<subseteq> next_dim.cone Y

goal (1 subgoal):
 1. z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z @\<^sub>v vec_of_scal (0::'a) \<in> next_dim.cone Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have xn: "x \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier_vec n
[PROOF STEP]
using \<open>x = y + z\<close> yn zn
[PROOF STATE]
proof (prove)
using this:
x = y + z
y \<in> carrier_vec n
z \<in> carrier_vec n

goal (1 subgoal):
 1. x \<in> carrier_vec n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec n

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
have "x @\<^sub>v vec_of_scal 1 = (y @\<^sub>v vec_of_scal 1) + (z @\<^sub>v vec_of_scal 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) = y @\<^sub>v vec_of_scal (1::'a) + (z @\<^sub>v vec_of_scal (0::'a))
[PROOF STEP]
using \<open>x = y + z\<close> append_vec_add[OF yn zn]
[PROOF STATE]
proof (prove)
using this:
x = y + z
\<lbrakk>?w \<in> carrier_vec ?m; ?w' \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> y @\<^sub>v ?w + (z @\<^sub>v ?w') = (y + z) @\<^sub>v ?w + ?w'

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) = y @\<^sub>v vec_of_scal (1::'a) + (z @\<^sub>v vec_of_scal (0::'a))
[PROOF STEP]
unfolding vec_of_scal_def
[PROOF STATE]
proof (prove)
using this:
x = y + z
\<lbrakk>?w \<in> carrier_vec ?m; ?w' \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> y @\<^sub>v ?w + (z @\<^sub>v ?w') = (y + z) @\<^sub>v ?w + ?w'

goal (1 subgoal):
 1. x @\<^sub>v vec 1 (\<lambda>i. 1::'a) = y @\<^sub>v vec 1 (\<lambda>i. 1::'a) + (z @\<^sub>v vec 1 (\<lambda>i. 0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) = y @\<^sub>v vec_of_scal (1::'a) + (z @\<^sub>v vec_of_scal (0::'a))

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "x @\<^sub>v vec_of_scal 1 \<in> next_dim.cone Y"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) = y @\<^sub>v vec_of_scal (1::'a) + (z @\<^sub>v vec_of_scal (0::'a))

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
[PROOF STEP]
using next_dim.cone_elem_sum[OF Y_carrier y_cone z_cone]
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) = y @\<^sub>v vec_of_scal (1::'a) + (z @\<^sub>v vec_of_scal (0::'a))
y @\<^sub>v vec_of_scal (1::'a) + (z @\<^sub>v vec_of_scal (0::'a)) \<in> next_dim.cone Y

goal (1 subgoal):
 1. x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "A *\<^sub>v x - b \<le> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y

goal (1 subgoal):
 1. A *\<^sub>v x - b \<le> 0\<^sub>v nr
[PROOF STEP]
using M_cone_car[OF xn] Y
[PROOF STATE]
proof (prove)
using this:
x @\<^sub>v vec_of_scal (1::'a) \<in> next_dim.cone Y
(x @\<^sub>v vec_of_scal ?t7 \<in> next_dim.polyhedral_cone M) = (A *\<^sub>v x - ?t7 \<cdot>\<^sub>v b \<le> 0\<^sub>v nr \<and> (0::'a) \<le> ?t7)
next_dim.cone Y = next_dim.polyhedral_cone M

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

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - b \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. A *\<^sub>v x \<le> b
[PROOF STEP]
using vec_le_iff_diff_le_0[of "A *\<^sub>v x" b]
            dim_mult_mat_vec[of A x] A
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - b \<le> 0\<^sub>v nr
(A *\<^sub>v x \<le> b) = (A *\<^sub>v x - b \<le> 0\<^sub>v (dim_vec (A *\<^sub>v x)))
dim_vec (A *\<^sub>v x) = dim_row A
A \<in> carrier_mat nr n

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

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
hence "x \<in> P"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. x \<in> P
[PROOF STEP]
using P xn
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b
P = m.polyhedron A b
x \<in> carrier_vec n

goal (1 subgoal):
 1. x \<in> P
[PROOF STEP]
unfolding polyhedron_def
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b
P = {x \<in> carrier_vec n. A *\<^sub>v x \<le> b}
x \<in> carrier_vec n

goal (1 subgoal):
 1. x \<in> P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> P

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0} \<Longrightarrow> ?x8 \<in> P

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x8 \<in> P \<Longrightarrow> ?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0} \<Longrightarrow> ?x8 \<in> P
[PROOF STEP]
show "P = convex_hull ?Z1 + cone ?Z0"
[PROOF STATE]
proof (prove)
using this:
?x8 \<in> P \<Longrightarrow> ?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
?x8 \<in> m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0} \<Longrightarrow> ?x8 \<in> P

goal (1 subgoal):
 1. P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P = m.convex_hull {vec_first y n |y. y \<in> Y1} + m.cone {vec_first y n |y. y \<in> Y0}

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
let ?Bnd = "db n (max 1 Bnd)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
assume "A \<in> \<int>\<^sub>m \<inter> Bounded_mat (?oi Bnd)"
      "b \<in> \<int>\<^sub>v \<inter> Bounded_vec (?oi Bnd)"
      and db: "is_det_bound db"
[PROOF STATE]
proof (state)
this:
A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)
b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
is_det_bound db

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
hence *: "A \<in> \<int>\<^sub>m" "A \<in> Bounded_mat (?oi Bnd)" "b \<in> \<int>\<^sub>v" "b \<in> Bounded_vec (?oi Bnd)"
[PROOF STATE]
proof (prove)
using this:
A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)
b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
is_det_bound db

goal (1 subgoal):
 1. (A \<in> \<int>\<^sub>m &&& A \<in> Bounded_mat (of_int Bnd)) &&& b \<in> \<int>\<^sub>v &&& b \<in> Bounded_vec (of_int Bnd)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> \<int>\<^sub>m
A \<in> Bounded_mat (of_int Bnd)
b \<in> \<int>\<^sub>v
b \<in> Bounded_vec (of_int Bnd)

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have "elements_mat M \<subseteq> elements_mat A \<union> vec_set (-b) \<union> {0,-1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat M \<subseteq> elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)}
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat ((A @\<^sub>c mat_of_col (- b)) @\<^sub>r 0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) \<subseteq> elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)}
[PROOF STEP]
unfolding elements_mat_append_rows[OF M_top M_bottom]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat (A @\<^sub>c mat_of_col (- b)) \<union> elements_mat (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) \<subseteq> elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)}
[PROOF STEP]
unfolding elements_mat_append_cols[OF A mcb]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat A \<union> elements_mat (mat_of_col (- b)) \<union> elements_mat (0\<^sub>m 1 n @\<^sub>c - 1\<^sub>m 1) \<subseteq> elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)}
[PROOF STEP]
by (subst elements_mat_append_cols, auto)
[PROOF STATE]
proof (state)
this:
elements_mat M \<subseteq> elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)}

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
elements_mat M \<subseteq> elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)}

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have "\<dots> \<subseteq> \<int> \<inter> ({x. abs x \<le> ?oi Bnd} \<union> {0,-1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)} \<subseteq> \<int> \<inter> ({x. \<bar>x\<bar> \<le> of_int Bnd} \<union> {0::'a, - (1::'a)})
[PROOF STEP]
using *[unfolded Bounded_mat_elements_mat Ints_mat_elements_mat
          Bounded_vec_vec_set Ints_vec_vec_set]
[PROOF STATE]
proof (prove)
using this:
elements_mat A \<subseteq> \<int>
\<forall>x\<in>elements_mat A. \<bar>x\<bar> \<le> of_int Bnd
set\<^sub>v b \<subseteq> \<int>
\<forall>x\<in>set\<^sub>v b. \<bar>x\<bar> \<le> of_int Bnd

goal (1 subgoal):
 1. elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)} \<subseteq> \<int> \<inter> ({x. \<bar>x\<bar> \<le> of_int Bnd} \<union> {0::'a, - (1::'a)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)} \<subseteq> \<int> \<inter> ({x. \<bar>x\<bar> \<le> of_int Bnd} \<union> {0::'a, - (1::'a)})

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
elements_mat A \<union> set\<^sub>v (- b) \<union> {0::'a, - (1::'a)} \<subseteq> \<int> \<inter> ({x. \<bar>x\<bar> \<le> of_int Bnd} \<union> {0::'a, - (1::'a)})

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have "\<dots> \<subseteq> \<int> \<inter> ({x. abs x \<le> ?oi (max 1 Bnd)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int> \<inter> ({x. \<bar>x\<bar> \<le> of_int Bnd} \<union> {0::'a, - (1::'a)}) \<subseteq> \<int> \<inter> {x. \<bar>x\<bar> \<le> of_int (max 1 Bnd)}
[PROOF STEP]
by (auto simp: of_int_max)
[PROOF STATE]
proof (state)
this:
\<int> \<inter> ({x. \<bar>x\<bar> \<le> of_int Bnd} \<union> {0::'a, - (1::'a)}) \<subseteq> \<int> \<inter> {x. \<bar>x\<bar> \<le> of_int (max 1 Bnd)}

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
elements_mat M \<subseteq> \<int> \<inter> {x. \<bar>x\<bar> \<le> of_int (max 1 Bnd)}
[PROOF STEP]
have "M \<in> \<int>\<^sub>m" "M \<in> Bounded_mat (?oi (max 1 Bnd))"
[PROOF STATE]
proof (prove)
using this:
elements_mat M \<subseteq> \<int> \<inter> {x. \<bar>x\<bar> \<le> of_int (max 1 Bnd)}

goal (1 subgoal):
 1. M \<in> \<int>\<^sub>m &&& M \<in> Bounded_mat (of_int (max 1 Bnd))
[PROOF STEP]
unfolding Bounded_mat_elements_mat Ints_mat_elements_mat
[PROOF STATE]
proof (prove)
using this:
elements_mat M \<subseteq> \<int> \<inter> {x. \<bar>x\<bar> \<le> of_int (max 1 Bnd)}

goal (1 subgoal):
 1. elements_mat M \<subseteq> \<int> &&& \<forall>x\<in>elements_mat M. \<bar>x\<bar> \<le> of_int (max 1 Bnd)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<in> \<int>\<^sub>m
M \<in> Bounded_mat (of_int (max 1 Bnd))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
hence "M \<in> \<int>\<^sub>m \<inter> Bounded_mat (?oi (max 1 Bnd))"
[PROOF STATE]
proof (prove)
using this:
M \<in> \<int>\<^sub>m
M \<in> Bounded_mat (of_int (max 1 Bnd))

goal (1 subgoal):
 1. M \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int (max 1 Bnd))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
M \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int (max 1 Bnd))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from Bnd[OF db this]
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have XBnd: "X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (?oi ?Bnd)"
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (1 subgoal):
 1. X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
assume y: "y \<in> Y"
[PROOF STATE]
proof (state)
this:
y \<in> Y

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> Y
[PROOF STEP]
obtain x where y: "y = ?f x \<cdot>\<^sub>v x" and xX: "x \<in> X"
[PROOF STATE]
proof (prove)
using this:
y \<in> Y

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x; x \<in> X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Y_def
[PROOF STATE]
proof (prove)
using this:
y \<in> {(if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x |x. x \<in> X}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x; x \<in> X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x
x \<in> X

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
with \<open>X \<subseteq> carrier_vec (n+1)\<close>
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> carrier_vec (n + 1)
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x
x \<in> X
[PROOF STEP]
have x: "x \<in> carrier_vec (n+1)"
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier_vec (n + 1)
y = (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x
x \<in> X

goal (1 subgoal):
 1. x \<in> carrier_vec (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec (n + 1)

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from XBnd xX
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
x \<in> X
[PROOF STEP]
have xI: "x \<in> \<int>\<^sub>v" and xB: "x \<in> Bounded_vec (?oi ?Bnd)"
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
x \<in> X

goal (1 subgoal):
 1. x \<in> \<int>\<^sub>v &&& x \<in> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> \<int>\<^sub>v
x \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
x \<in> \<int>\<^sub>v
x \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
assume "y $ n = 0"
[PROOF STATE]
proof (state)
this:
y $ n = (0::'a)

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
hence "y = x"
[PROOF STATE]
proof (prove)
using this:
y $ n = (0::'a)

goal (1 subgoal):
 1. y = x
[PROOF STEP]
unfolding y
[PROOF STATE]
proof (prove)
using this:
((if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x) $ n = (0::'a)

goal (1 subgoal):
 1. (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x = x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
((if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x) $ n = (0::'a)
x \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = x

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
hence "y \<in> \<int>\<^sub>v \<inter> Bounded_vec (?oi ?Bnd)"
[PROOF STATE]
proof (prove)
using this:
y = x

goal (1 subgoal):
 1. y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
using xI xB
[PROOF STATE]
proof (prove)
using this:
y = x
x \<in> \<int>\<^sub>v
x \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (1 subgoal):
 1. y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
y $ n = (0::'a) \<Longrightarrow> y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
note y0 = this
[PROOF STATE]
proof (state)
this:
y $ n = (0::'a) \<Longrightarrow> y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
y $ n = (0::'a) \<Longrightarrow> y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
assume "y $ n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
y $ n \<noteq> (0::'a)

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
hence x0: "x $ n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
y $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
y $ n \<noteq> (0::'a)
x \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a)
[PROOF STEP]
unfolding y
[PROOF STATE]
proof (prove)
using this:
((if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x) $ n \<noteq> (0::'a)
x \<in> carrier_vec (n + 1)

goal (1 subgoal):
 1. x $ n \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x $ n \<noteq> (0::'a)

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from x xI
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier_vec (n + 1)
x \<in> \<int>\<^sub>v
[PROOF STEP]
have "x $ n \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec (n + 1)
x \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. x $ n \<in> \<int>
[PROOF STEP]
unfolding Ints_vec_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec (n + 1)
x \<in> {x. \<forall>i<dim_vec x. x $ i \<in> \<int>}

goal (1 subgoal):
 1. x $ n \<in> \<int>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x $ n \<in> \<int>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
with x0
[PROOF STATE]
proof (chain)
picking this:
x $ n \<noteq> (0::'a)
x $ n \<in> \<int>
[PROOF STEP]
have "abs (x $ n) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
x $ n \<noteq> (0::'a)
x $ n \<in> \<int>

goal (1 subgoal):
 1. (1::'a) \<le> \<bar>x $ n\<bar>
[PROOF STEP]
by (meson Ints_nonzero_abs_ge1)
[PROOF STATE]
proof (state)
this:
(1::'a) \<le> \<bar>x $ n\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
hence abs: "abs (1 / (x $ n)) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<le> \<bar>x $ n\<bar>

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

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n\<bar> \<le> (1::'a)

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have "abs ((1 / (x $ n)) * a) = abs (1 / (x $ n)) * abs a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(1::'a) / x $ n * a\<bar> = \<bar>(1::'a) / x $ n\<bar> * \<bar>a\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n * a\<bar> = \<bar>(1::'a) / x $ n\<bar> * \<bar>a\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n * a\<bar> = \<bar>(1::'a) / x $ n\<bar> * \<bar>a\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have "\<dots> \<le> 1 * abs a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(1::'a) / x $ n\<bar> * \<bar>a\<bar> \<le> (1::'a) * \<bar>a\<bar>
[PROOF STEP]
by (rule mult_right_mono[OF abs], auto)
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n\<bar> * \<bar>a\<bar> \<le> (1::'a) * \<bar>a\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>(1::'a) / x $ n * a\<bar> \<le> (1::'a) * \<bar>a\<bar>
[PROOF STEP]
have "abs ((1 / (x $ n)) * a) \<le> abs a"
[PROOF STATE]
proof (prove)
using this:
\<bar>(1::'a) / x $ n * a\<bar> \<le> (1::'a) * \<bar>a\<bar>

goal (1 subgoal):
 1. \<bar>(1::'a) / x $ n * a\<bar> \<le> \<bar>a\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n * a\<bar> \<le> \<bar>a\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n * ?a8\<bar> \<le> \<bar>?a8\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
note abs = this
[PROOF STATE]
proof (state)
this:
\<bar>(1::'a) / x $ n * ?a8\<bar> \<le> \<bar>?a8\<bar>

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from x0
[PROOF STATE]
proof (chain)
picking this:
x $ n \<noteq> (0::'a)
[PROOF STEP]
have y: "y = (1 / (x $ n)) \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. y = (1::'a) / x $ n \<cdot>\<^sub>v x
[PROOF STEP]
unfolding y
[PROOF STATE]
proof (prove)
using this:
x $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. (if x $ n = (0::'a) then 1::'a else (1::'a) / x $ n) \<cdot>\<^sub>v x = (1::'a) / x $ n \<cdot>\<^sub>v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = (1::'a) / x $ n \<cdot>\<^sub>v x

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have vy: "vec_set y = (\<lambda> a. (1 / (x $ n)) * a) ` vec_set x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set\<^sub>v y = (*) ((1::'a) / x $ n) ` set\<^sub>v x
[PROOF STEP]
unfolding y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set\<^sub>v ((1::'a) / x $ n \<cdot>\<^sub>v x) = (*) ((1::'a) / x $ n) ` set\<^sub>v x
[PROOF STEP]
by (auto simp: vec_set_def)
[PROOF STATE]
proof (state)
this:
set\<^sub>v y = (*) ((1::'a) / x $ n) ` set\<^sub>v x

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
have "y \<in> Bounded_vec (?oi ?Bnd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
using xB abs
[PROOF STATE]
proof (prove)
using this:
x \<in> Bounded_vec (of_int (db n (max 1 Bnd)))
\<bar>(1::'a) / x $ n * ?a8\<bar> \<le> \<bar>?a8\<bar>

goal (1 subgoal):
 1. y \<in> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
unfolding Bounded_vec_vec_set vy
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set\<^sub>v x. \<bar>x\<bar> \<le> of_int (db n (max 1 Bnd))
\<bar>(1::'a) / x $ n * ?a8\<bar> \<le> \<bar>?a8\<bar>

goal (1 subgoal):
 1. \<forall>x\<in>(*) ((1::'a) / x $ n) ` set\<^sub>v x. \<bar>x\<bar> \<le> of_int (db n (max 1 Bnd))
[PROOF STEP]
by (smt imageE max.absorb2 max.bounded_iff)
[PROOF STATE]
proof (state)
this:
y \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
y $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
note yn0 = this
[PROOF STATE]
proof (state)
this:
y $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
note y0 yn0
[PROOF STATE]
proof (state)
this:
y $ n = (0::'a) \<Longrightarrow> y \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
y $ n \<noteq> (0::'a) \<Longrightarrow> y \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y8 \<in> Y; ?y8 $ n = (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
\<lbrakk>?y8 \<in> Y; ?y8 $ n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
note BndY = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y8 \<in> Y; ?y8 $ n = (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
\<lbrakk>?y8 \<in> Y; ?y8 $ n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from \<open>Y \<subseteq> carrier_vec (n+1)\<close>
[PROOF STATE]
proof (chain)
picking this:
Y \<subseteq> carrier_vec (n + 1)
[PROOF STEP]
have setvY: "y \<in> Y \<Longrightarrow> set\<^sub>v (vec_first y n) \<subseteq> set\<^sub>v y" for y
[PROOF STATE]
proof (prove)
using this:
Y \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. y \<in> Y \<Longrightarrow> set\<^sub>v (vec_first y n) \<subseteq> set\<^sub>v y
[PROOF STEP]
unfolding vec_first_def vec_set_def
[PROOF STATE]
proof (prove)
using this:
Y \<subseteq> carrier_vec (n + 1)

goal (1 subgoal):
 1. y \<in> Y \<Longrightarrow> ($) (vec n (($) y)) ` {..<dim_vec (vec n (($) y))} \<subseteq> ($) y ` {..<dim_vec y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y6 \<in> Y \<Longrightarrow> set\<^sub>v (vec_first ?y6 n) \<subseteq> set\<^sub>v ?y6

goal (2 subgoals):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
 2. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from BndY(1) setvY
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y8 \<in> Y; ?y8 $ n = (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
?y6 \<in> Y \<Longrightarrow> set\<^sub>v (vec_first ?y6 n) \<subseteq> set\<^sub>v ?y6
[PROOF STEP]
show "?Z0 \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (?oi (db n (max 1 Bnd)))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y8 \<in> Y; ?y8 $ n = (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
?y6 \<in> Y \<Longrightarrow> set\<^sub>v (vec_first ?y6 n) \<subseteq> set\<^sub>v ?y6

goal (1 subgoal):
 1. {vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
by (force simp: Bounded_vec_vec_set Ints_vec_vec_set Y0_def)
[PROOF STATE]
proof (state)
this:
{vec_first y n |y. y \<in> Y0} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd)))

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd); b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
from BndY(2) setvY
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y8 \<in> Y; ?y8 $ n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> Bounded_vec (of_int (db n (max 1 Bnd)))
?y6 \<in> Y \<Longrightarrow> set\<^sub>v (vec_first ?y6 n) \<subseteq> set\<^sub>v ?y6
[PROOF STEP]
show "?Z1 \<subseteq> Bounded_vec (?oi (db n (max 1 Bnd)))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y8 \<in> Y; ?y8 $ n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ?y8 \<in> Bounded_vec (of_int (db n (max 1 Bnd)))
?y6 \<in> Y \<Longrightarrow> set\<^sub>v (vec_first ?y6 n) \<subseteq> set\<^sub>v ?y6

goal (1 subgoal):
 1. {vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
[PROOF STEP]
by (force simp: Bounded_vec_vec_set Ints_vec_vec_set Y0_def Y1_def)
[PROOF STATE]
proof (state)
this:
{vec_first y n |y. y \<in> Y1} \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>Q X. X \<subseteq> carrier_vec n \<and> finite X \<and> Q \<subseteq> carrier_vec n \<and> finite Q \<and> P = m.convex_hull Q + m.cone X \<and> (is_det_bound db \<longrightarrow> A \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd) \<longrightarrow> b \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<longrightarrow> X \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> Q \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))))

goal:
No subgoals!
[PROOF STEP]
qed