[STATEMENT]
theorem decomposition_theorem_integer_hull_of_polyhedron:
  assumes db: "is_det_bound db"
  and A: "A \<in> carrier_mat nr n"
  and b: "b \<in> carrier_vec nr"
  and AI: "A \<in> \<int>\<^sub>m"
  and bI: "b \<in> \<int>\<^sub>v"
  and P: "P = polyhedron A b"
  and Bnd: "of_int Bnd \<ge> Max (abs ` (elements_mat A \<union> vec_set b))"
shows "\<exists> H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v
  \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd)))
  \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd)))
  \<and> finite (H \<union> C)
  \<and> integer_hull P = convex_hull H + cone C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define MBnd where "MBnd = Max (abs ` (elements_mat A \<union> set\<^sub>v b))"
[PROOF STATE]
proof (state)
this:
MBnd = Max (abs ` (elements_mat A \<union> set\<^sub>v b))

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define DBnd :: 'a where "DBnd = of_int (db n (max 1 Bnd))"
[PROOF STATE]
proof (state)
this:
DBnd = of_int (db n (max 1 Bnd))

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define nBnd where "nBnd = of_nat (n+1) * DBnd"
[PROOF STATE]
proof (state)
this:
nBnd = of_nat (n + 1) * DBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have DBnd0: "DBnd \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> DBnd
[PROOF STEP]
unfolding DBnd_def of_int_0_le_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> db n (max 1 Bnd)
[PROOF STEP]
by (rule is_det_bound_ge_zero[OF db], auto)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> DBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have Pn: "P \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<subseteq> carrier_vec n
[PROOF STEP]
unfolding P polyhedron_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier_vec n. A *\<^sub>v x \<le> b} \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "A \<in> Bounded_mat MBnd \<and> b \<in> Bounded_vec MBnd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> Bounded_mat MBnd \<and> b \<in> Bounded_vec MBnd
[PROOF STEP]
unfolding MBnd_def Bounded_mat_elements_mat Bounded_vec_vec_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>elements_mat A. \<bar>x\<bar> \<le> Max (abs ` (elements_mat A \<union> set\<^sub>v b))) \<and> (\<forall>x\<in>set\<^sub>v b. \<bar>x\<bar> \<le> Max (abs ` (elements_mat A \<union> set\<^sub>v b)))
[PROOF STEP]
by (intro ballI conjI Max_ge finite_imageI imageI finite_UnI, auto)
[PROOF STATE]
proof (state)
this:
A \<in> Bounded_mat MBnd \<and> b \<in> Bounded_vec MBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence "A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)"
[PROOF STATE]
proof (prove)
using this:
A \<in> Bounded_mat MBnd \<and> b \<in> Bounded_vec MBnd

goal (1 subgoal):
 1. A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)
[PROOF STEP]
using Bounded_mat_mono[OF Bnd] Bounded_vec_mono[OF Bnd]
[PROOF STATE]
proof (prove)
using this:
A \<in> Bounded_mat MBnd \<and> b \<in> Bounded_vec MBnd
Bounded_mat (Max (abs ` (elements_mat A \<union> set\<^sub>v b))) \<subseteq> Bounded_mat (of_int Bnd)
Bounded_vec (Max (abs ` (elements_mat A \<union> set\<^sub>v b))) \<subseteq> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)
[PROOF STEP]
unfolding MBnd_def
[PROOF STATE]
proof (prove)
using this:
A \<in> Bounded_mat (Max (abs ` (elements_mat A \<union> set\<^sub>v b))) \<and> b \<in> Bounded_vec (Max (abs ` (elements_mat A \<union> set\<^sub>v b)))
Bounded_mat (Max (abs ` (elements_mat A \<union> set\<^sub>v b))) \<subseteq> Bounded_mat (of_int Bnd)
Bounded_vec (Max (abs ` (elements_mat A \<union> set\<^sub>v b))) \<subseteq> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from decomposition_theorem_polyhedra_1[OF A b P, of db Bnd] db AI bI this
[PROOF STATE]
proof (chain)
picking this:
\<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))))
is_det_bound db
A \<in> \<int>\<^sub>m
b \<in> \<int>\<^sub>v
A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)
[PROOF STEP]
obtain QQ Q C where C: "C \<subseteq> carrier_vec n" and finC: "finite C"
    and QQ: "QQ \<subseteq> carrier_vec n" and finQ: "finite QQ" and BndQQ: "QQ \<subseteq> Bounded_vec DBnd"
    and P: "P = Q + cone C"
    and Q_def: "Q = convex_hull QQ"
    and CI: "C \<subseteq> \<int>\<^sub>v" and BndC: "C \<subseteq> Bounded_vec DBnd"
[PROOF STATE]
proof (prove)
using this:
\<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))))
is_det_bound db
A \<in> \<int>\<^sub>m
b \<in> \<int>\<^sub>v
A \<in> Bounded_mat (of_int Bnd) \<and> b \<in> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. (\<And>C QQ Q. \<lbrakk>C \<subseteq> carrier_vec n; finite C; QQ \<subseteq> carrier_vec n; finite QQ; QQ \<subseteq> Bounded_vec DBnd; P = Q + cone C; Q = convex_hull QQ; C \<subseteq> \<int>\<^sub>v; C \<subseteq> Bounded_vec DBnd\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: DBnd_def)
[PROOF STATE]
proof (state)
this:
C \<subseteq> carrier_vec n
finite C
QQ \<subseteq> carrier_vec n
finite QQ
QQ \<subseteq> Bounded_vec DBnd
P = Q + cone C
Q = convex_hull QQ
C \<subseteq> \<int>\<^sub>v
C \<subseteq> Bounded_vec DBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define Bnd' where "Bnd' = of_nat n * DBnd"
[PROOF STATE]
proof (state)
this:
Bnd' = of_nat n * DBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
note coneC = cone_iff_finite_cone[OF C finC]
[PROOF STATE]
proof (state)
this:
cone C = finite_cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have Q: "Q \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q \<subseteq> carrier_vec n
[PROOF STEP]
unfolding Q_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull QQ \<subseteq> carrier_vec n
[PROOF STEP]
using convex_hull_carrier[OF QQ]
[PROOF STATE]
proof (prove)
using this:
convex_hull QQ \<subseteq> carrier_vec n

goal (1 subgoal):
 1. convex_hull QQ \<subseteq> carrier_vec n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Q \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define B where "B = {x. \<exists> a D. nonneg_lincomb a D x \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall> d \<in> D. a d \<le> 1)}"
[PROOF STATE]
proof (state)
this:
B = {x. \<exists>a D. nonneg_lincomb a D x \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))}

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
B = {x. \<exists>a D. nonneg_lincomb a D x \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))}

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
assume "b \<in> B"
[PROOF STATE]
proof (state)
this:
b \<in> B

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> B
[PROOF STEP]
obtain a D where b: "b = lincomb a D" and DC: "D \<subseteq> C"
      and linD: "lin_indpt D" and bnd_a: "\<forall> d \<in> D. 0 \<le> a d \<and> a d \<le> 1"
[PROOF STATE]
proof (prove)
using this:
b \<in> B

goal (1 subgoal):
 1. (\<And>a D. \<lbrakk>b = lincomb a D; D \<subseteq> C; lin_indpt D; \<forall>d\<in>D. (0::'a) \<le> a d \<and> a d \<le> (1::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: B_def nonneg_lincomb_def)
[PROOF STATE]
proof (state)
this:
b = lincomb a D
D \<subseteq> C
lin_indpt D
\<forall>d\<in>D. (0::'a) \<le> a d \<and> a d \<le> (1::'a)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from DC C
[PROOF STATE]
proof (chain)
picking this:
D \<subseteq> C
C \<subseteq> carrier_vec n
[PROOF STEP]
have D: "D \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> C
C \<subseteq> carrier_vec n

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

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from DC finC
[PROOF STATE]
proof (chain)
picking this:
D \<subseteq> C
finite C
[PROOF STEP]
have finD: "finite D"
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> C
finite C

goal (1 subgoal):
 1. finite D
[PROOF STEP]
by (metis finite_subset)
[PROOF STATE]
proof (state)
this:
finite D

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from D linD finD
[PROOF STATE]
proof (chain)
picking this:
D \<subseteq> carrier_vec n
lin_indpt D
finite D
[PROOF STEP]
have cardD: "card D \<le> n"
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> carrier_vec n
lin_indpt D
finite D

goal (1 subgoal):
 1. card D \<le> n
[PROOF STEP]
using dim_is_n li_le_dim(2)
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> carrier_vec n
lin_indpt D
finite D
local.dim = n
\<lbrakk>fin_dim; ?A \<subseteq> carrier_vec n; lin_indpt ?A\<rbrakk> \<Longrightarrow> card ?A \<le> local.dim

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

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from BndC DC
[PROOF STATE]
proof (chain)
picking this:
C \<subseteq> Bounded_vec DBnd
D \<subseteq> C
[PROOF STEP]
have BndD: "D \<subseteq> Bounded_vec DBnd"
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> Bounded_vec DBnd
D \<subseteq> C

goal (1 subgoal):
 1. D \<subseteq> Bounded_vec DBnd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<subseteq> Bounded_vec DBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from lincomb_card_bound[OF this D DBnd0 _ cardD, of a, folded b] bnd_a
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> D \<Longrightarrow> \<bar>a x\<bar> \<le> (1::'a)) \<Longrightarrow> b \<in> Bounded_vec (of_nat n * DBnd)
\<forall>d\<in>D. (0::'a) \<le> a d \<and> a d \<le> (1::'a)
[PROOF STEP]
have "b \<in> Bounded_vec Bnd'"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> D \<Longrightarrow> \<bar>a x\<bar> \<le> (1::'a)) \<Longrightarrow> b \<in> Bounded_vec (of_nat n * DBnd)
\<forall>d\<in>D. (0::'a) \<le> a d \<and> a d \<le> (1::'a)

goal (1 subgoal):
 1. b \<in> Bounded_vec Bnd'
[PROOF STEP]
unfolding Bnd'_def
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> D \<Longrightarrow> \<bar>a x\<bar> \<le> (1::'a)) \<Longrightarrow> b \<in> Bounded_vec (of_nat n * DBnd)
\<forall>d\<in>D. (0::'a) \<le> a d \<and> a d \<le> (1::'a)

goal (1 subgoal):
 1. b \<in> Bounded_vec (of_nat n * DBnd)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
b \<in> Bounded_vec Bnd'

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?ba6 \<in> B \<Longrightarrow> ?ba6 \<in> Bounded_vec Bnd'

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence BndB: "B \<subseteq> Bounded_vec Bnd'"
[PROOF STATE]
proof (prove)
using this:
?ba6 \<in> B \<Longrightarrow> ?ba6 \<in> Bounded_vec Bnd'

goal (1 subgoal):
 1. B \<subseteq> Bounded_vec Bnd'
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
B \<subseteq> Bounded_vec Bnd'

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from BndQQ
[PROOF STATE]
proof (chain)
picking this:
QQ \<subseteq> Bounded_vec DBnd
[PROOF STEP]
have BndQ: "Q \<subseteq> Bounded_vec DBnd"
[PROOF STATE]
proof (prove)
using this:
QQ \<subseteq> Bounded_vec DBnd

goal (1 subgoal):
 1. Q \<subseteq> Bounded_vec DBnd
[PROOF STEP]
unfolding Q_def
[PROOF STATE]
proof (prove)
using this:
QQ \<subseteq> Bounded_vec DBnd

goal (1 subgoal):
 1. convex_hull QQ \<subseteq> Bounded_vec DBnd
[PROOF STEP]
using QQ
[PROOF STATE]
proof (prove)
using this:
QQ \<subseteq> Bounded_vec DBnd
QQ \<subseteq> carrier_vec n

goal (1 subgoal):
 1. convex_hull QQ \<subseteq> Bounded_vec DBnd
[PROOF STEP]
by (metis convex_hull_bound)
[PROOF STATE]
proof (state)
this:
Q \<subseteq> Bounded_vec DBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have B: "B \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> carrier_vec n
[PROOF STEP]
unfolding B_def nonneg_lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>a D. (lincomb a D = x \<and> a ` D \<subseteq> Collect ((\<le>) (0::'a))) \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))} \<subseteq> carrier_vec n
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> carrier_vec n

goal (1 subgoal):
 1. {x. \<exists>a D. (lincomb a D = x \<and> a ` D \<subseteq> Collect ((\<le>) (0::'a))) \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))} \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from Q B
[PROOF STATE]
proof (chain)
picking this:
Q \<subseteq> carrier_vec n
B \<subseteq> carrier_vec n
[PROOF STEP]
have QB: "Q + B \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
Q \<subseteq> carrier_vec n
B \<subseteq> carrier_vec n

goal (1 subgoal):
 1. Q + B \<subseteq> carrier_vec n
[PROOF STEP]
by (auto elim!: set_plus_elim)
[PROOF STATE]
proof (state)
this:
Q + B \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from sum_in_Bounded_vecI[of _ DBnd _ Bnd' n] BndQ BndB B Q
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> Bounded_vec DBnd; ?y \<in> Bounded_vec Bnd'; ?x \<in> carrier_vec n; ?y \<in> carrier_vec n\<rbrakk> \<Longrightarrow> ?x + ?y \<in> Bounded_vec (DBnd + Bnd')
Q \<subseteq> Bounded_vec DBnd
B \<subseteq> Bounded_vec Bnd'
B \<subseteq> carrier_vec n
Q \<subseteq> carrier_vec n
[PROOF STEP]
have "Q + B \<subseteq> Bounded_vec (DBnd + Bnd')"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> Bounded_vec DBnd; ?y \<in> Bounded_vec Bnd'; ?x \<in> carrier_vec n; ?y \<in> carrier_vec n\<rbrakk> \<Longrightarrow> ?x + ?y \<in> Bounded_vec (DBnd + Bnd')
Q \<subseteq> Bounded_vec DBnd
B \<subseteq> Bounded_vec Bnd'
B \<subseteq> carrier_vec n
Q \<subseteq> carrier_vec n

goal (1 subgoal):
 1. Q + B \<subseteq> Bounded_vec (DBnd + Bnd')
[PROOF STEP]
by (auto elim!: set_plus_elim)
[PROOF STATE]
proof (state)
this:
Q + B \<subseteq> Bounded_vec (DBnd + Bnd')

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Q + B \<subseteq> Bounded_vec (DBnd + Bnd')

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "DBnd + Bnd' = nBnd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DBnd + Bnd' = nBnd
[PROOF STEP]
unfolding nBnd_def Bnd'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DBnd + of_nat n * DBnd = of_nat (n + 1) * DBnd
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
DBnd + Bnd' = nBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Q + B \<subseteq> Bounded_vec nBnd
[PROOF STEP]
have QB_Bnd: "Q + B \<subseteq> Bounded_vec nBnd"
[PROOF STATE]
proof (prove)
using this:
Q + B \<subseteq> Bounded_vec nBnd

goal (1 subgoal):
 1. Q + B \<subseteq> Bounded_vec nBnd
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Q + B \<subseteq> Bounded_vec nBnd

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have finQBZ: "finite ((Q + B) \<inter> \<int>\<^sub>v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((Q + B) \<inter> \<int>\<^sub>v)
[PROOF STEP]
proof (rule finite_subset[OF subsetI])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> ?B
 2. finite ?B
[PROOF STEP]
define ZBnd where "ZBnd = floor nBnd"
[PROOF STATE]
proof (state)
this:
ZBnd = \<lfloor>nBnd\<rfloor>

goal (2 subgoals):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> ?B
 2. finite ?B
[PROOF STEP]
let ?vecs = "set (map vec_of_list (concat_lists (map (\<lambda> i. map (of_int :: _ \<Rightarrow> 'a) [-ZBnd..ZBnd]) [0..<n])))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> ?B
 2. finite ?B
[PROOF STEP]
have id: "?vecs = vec_of_list `
      {as. length as = n \<and> (\<forall>i<n. \<exists> b. as ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd})}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n]))) = vec_of_list ` {as. length as = n \<and> (\<forall>i<n. \<exists>b. as ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd})}
[PROOF STEP]
unfolding set_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list ` set (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n])) = vec_of_list ` {as. length as = n \<and> (\<forall>i<n. \<exists>b. as ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd})}
[PROOF STEP]
by (rule image_cong, auto)
[PROOF STATE]
proof (state)
this:
set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n]))) = vec_of_list ` {as. length as = n \<and> (\<forall>i<n. \<exists>b. as ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd})}

goal (2 subgoals):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> ?B
 2. finite ?B
[PROOF STEP]
show "finite ?vecs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n]))))
[PROOF STEP]
by (rule finite_set)
[PROOF STATE]
proof (state)
this:
finite (set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n]))))

goal (1 subgoal):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>]) [0..<n])))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>]) [0..<n])))
[PROOF STEP]
assume "x \<in> (Q + B) \<inter> \<int>\<^sub>v"
[PROOF STATE]
proof (state)
this:
x \<in> (Q + B) \<inter> \<int>\<^sub>v

goal (1 subgoal):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>]) [0..<n])))
[PROOF STEP]
hence xQB: "x \<in> Q + B" and xI: "x \<in> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
using this:
x \<in> (Q + B) \<inter> \<int>\<^sub>v

goal (1 subgoal):
 1. x \<in> Q + B &&& x \<in> \<int>\<^sub>v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Q + B
x \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>]) [0..<n])))
[PROOF STEP]
from xQB QB_Bnd QB
[PROOF STATE]
proof (chain)
picking this:
x \<in> Q + B
Q + B \<subseteq> Bounded_vec nBnd
Q + B \<subseteq> carrier_vec n
[PROOF STEP]
have xBnd: "x \<in> Bounded_vec nBnd" and x: "x \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
x \<in> Q + B
Q + B \<subseteq> Bounded_vec nBnd
Q + B \<subseteq> carrier_vec n

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

goal (1 subgoal):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>]) [0..<n])))
[PROOF STEP]
have xid: "x = vec_of_list (list_of_vec x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = vec_of_list (list_of_vec x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = vec_of_list (list_of_vec x)

goal (1 subgoal):
 1. \<And>x. x \<in> (Q + B) \<inter> \<int>\<^sub>v \<Longrightarrow> x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>]) [0..<n])))
[PROOF STEP]
show "x \<in> ?vecs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n])))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> vec_of_list ` {as. length as = n \<and> (\<forall>i<n. \<exists>b. as ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd})}
[PROOF STEP]
proof (subst xid, intro imageI CollectI conjI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (list_of_vec x) = n
 2. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
show "length (list_of_vec x) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_of_vec x) = n
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n

goal (1 subgoal):
 1. length (list_of_vec x) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (list_of_vec x) = n

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
assume i: "i < n"
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
have id: "list_of_vec x ! i = x $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec x ! i = x $ i
[PROOF STEP]
using i x
[PROOF STATE]
proof (prove)
using this:
i < n
x \<in> carrier_vec n

goal (1 subgoal):
 1. list_of_vec x ! i = x $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_of_vec x ! i = x $ i

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
from xBnd[unfolded Bounded_vec_def] i x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {x. \<forall>i<dim_vec x. \<bar>x $ i\<bar> \<le> nBnd}
i < n
x \<in> carrier_vec n
[PROOF STEP]
have xiBnd: "abs (x $ i) \<le> nBnd"
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<forall>i<dim_vec x. \<bar>x $ i\<bar> \<le> nBnd}
i < n
x \<in> carrier_vec n

goal (1 subgoal):
 1. \<bar>x $ i\<bar> \<le> nBnd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>x $ i\<bar> \<le> nBnd

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
from xI[unfolded Ints_vec_def] i x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {x. \<forall>i<dim_vec x. x $ i \<in> \<int>}
i < n
x \<in> carrier_vec n
[PROOF STEP]
have "x $ i \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<forall>i<dim_vec x. x $ i \<in> \<int>}
i < n
x \<in> carrier_vec n

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

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x $ i \<in> \<int>
[PROOF STEP]
obtain b where b: "x $ i = of_int b"
[PROOF STATE]
proof (prove)
using this:
x $ i \<in> \<int>

goal (1 subgoal):
 1. (\<And>b. x $ i = of_int b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Ints_def
[PROOF STATE]
proof (prove)
using this:
x $ i \<in> range of_int

goal (1 subgoal):
 1. (\<And>b. x $ i = of_int b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x $ i = of_int b

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
show "\<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}
[PROOF STEP]
unfolding id ZBnd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. x $ i = of_int b \<and> b \<in> {- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>}
[PROOF STEP]
using xiBnd
[PROOF STATE]
proof (prove)
using this:
\<bar>x $ i\<bar> \<le> nBnd

goal (1 subgoal):
 1. \<exists>b. x $ i = of_int b \<and> b \<in> {- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>}
[PROOF STEP]
unfolding b
[PROOF STATE]
proof (prove)
using this:
\<bar>of_int b\<bar> \<le> nBnd

goal (1 subgoal):
 1. \<exists>b. of_int b = of_int b \<and> b \<in> {- \<lfloor>nBnd\<rfloor>..\<lfloor>nBnd\<rfloor>}
[PROOF STEP]
by (intro exI[of _ b], auto intro!: abs_neg_floor abs_pos_floor)
[PROOF STATE]
proof (state)
this:
\<exists>b. list_of_vec x ! i = of_int b \<and> b \<in> {- ZBnd..ZBnd}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> set (map vec_of_list (concat_lists (map (\<lambda>i. map of_int [- ZBnd..ZBnd]) [0..<n])))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite ((Q + B) \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have QBZ: "(Q + B) \<inter> \<int>\<^sub>v \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Q + B) \<inter> \<int>\<^sub>v \<subseteq> carrier_vec n
[PROOF STEP]
using QB
[PROOF STATE]
proof (prove)
using this:
Q + B \<subseteq> carrier_vec n

goal (1 subgoal):
 1. (Q + B) \<inter> \<int>\<^sub>v \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Q + B) \<inter> \<int>\<^sub>v \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from decomposition_theorem_polyhedra_2[OF QBZ finQBZ, folded integer_hull_def, OF C finC refl]
[PROOF STATE]
proof (chain)
picking this:
\<exists>A b nr. A \<in> carrier_mat nr n \<and> b \<in> carrier_vec nr \<and> integer_hull (Q + B) + cone C = polyhedron A b
[PROOF STEP]
obtain A' b' nr' where A': "A' \<in> carrier_mat nr' n" and b': "b' \<in> carrier_vec nr'"
    and IH: "integer_hull (Q + B) + cone C = polyhedron A' b'"
[PROOF STATE]
proof (prove)
using this:
\<exists>A b nr. A \<in> carrier_mat nr n \<and> b \<in> carrier_vec nr \<and> integer_hull (Q + B) + cone C = polyhedron A b

goal (1 subgoal):
 1. (\<And>A' nr' b'. \<lbrakk>A' \<in> carrier_mat nr' n; b' \<in> carrier_vec nr'; integer_hull (Q + B) + cone C = polyhedron A' b'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A' \<in> carrier_mat nr' n
b' \<in> carrier_vec nr'
integer_hull (Q + B) + cone C = polyhedron A' b'

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
A' \<in> carrier_mat nr' n
b' \<in> carrier_vec nr'
integer_hull (Q + B) + cone C = polyhedron A' b'

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
assume "p \<in> P \<inter> \<int>\<^sub>v"
[PROOF STATE]
proof (state)
this:
p \<in> P \<inter> \<int>\<^sub>v

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence pI: "p \<in> \<int>\<^sub>v" and p: "p \<in> Q + cone C"
[PROOF STATE]
proof (prove)
using this:
p \<in> P \<inter> \<int>\<^sub>v

goal (1 subgoal):
 1. p \<in> \<int>\<^sub>v &&& p \<in> Q + cone C
[PROOF STEP]
unfolding P
[PROOF STATE]
proof (prove)
using this:
p \<in> (Q + cone C) \<inter> \<int>\<^sub>v

goal (1 subgoal):
 1. p \<in> \<int>\<^sub>v &&& p \<in> Q + cone C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<in> \<int>\<^sub>v
p \<in> Q + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from set_plus_elim[OF p]
[PROOF STATE]
proof (chain)
picking this:
(\<And>a b. \<lbrakk>p = a + b; a \<in> Q; b \<in> cone C\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain q c where
      pqc: "p = q + c" and qQ: "q \<in> Q" and cC: "c \<in> cone C"
[PROOF STATE]
proof (prove)
using this:
(\<And>a b. \<lbrakk>p = a + b; a \<in> Q; b \<in> cone C\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>q c. \<lbrakk>p = q + c; q \<in> Q; c \<in> cone C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = q + c
q \<in> Q
c \<in> cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from qQ Q
[PROOF STATE]
proof (chain)
picking this:
q \<in> Q
Q \<subseteq> carrier_vec n
[PROOF STEP]
have q: "q \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
q \<in> Q
Q \<subseteq> carrier_vec n

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

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from Caratheodory_theorem[OF C] cC
[PROOF STATE]
proof (chain)
picking this:
cone C = \<Union> {finite_cone B |B. B \<subseteq> C \<and> lin_indpt B}
c \<in> cone C
[PROOF STEP]
obtain D where cD: "c \<in> finite_cone D" and DC: "D \<subseteq> C" and linD: "lin_indpt D"
[PROOF STATE]
proof (prove)
using this:
cone C = \<Union> {finite_cone B |B. B \<subseteq> C \<and> lin_indpt B}
c \<in> cone C

goal (1 subgoal):
 1. (\<And>D. \<lbrakk>c \<in> finite_cone D; D \<subseteq> C; lin_indpt D\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> finite_cone D
D \<subseteq> C
lin_indpt D

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from DC C
[PROOF STATE]
proof (chain)
picking this:
D \<subseteq> C
C \<subseteq> carrier_vec n
[PROOF STEP]
have D: "D \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> C
C \<subseteq> carrier_vec n

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

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from DC finC
[PROOF STATE]
proof (chain)
picking this:
D \<subseteq> C
finite C
[PROOF STEP]
have finD: "finite D"
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> C
finite C

goal (1 subgoal):
 1. finite D
[PROOF STEP]
by (metis finite_subset)
[PROOF STATE]
proof (state)
this:
finite D

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from cD finD
[PROOF STATE]
proof (chain)
picking this:
c \<in> finite_cone D
finite D
[PROOF STEP]
obtain a where "nonneg_lincomb a D c"
[PROOF STATE]
proof (prove)
using this:
c \<in> finite_cone D
finite D

goal (1 subgoal):
 1. (\<And>a. nonneg_lincomb a D c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding finite_cone_def
[PROOF STATE]
proof (prove)
using this:
c \<in> {b. \<exists>c. nonneg_lincomb c (if finite D then D else {}) b}
finite D

goal (1 subgoal):
 1. (\<And>a. nonneg_lincomb a D c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nonneg_lincomb a D c

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence caD: "c = lincomb a D" and a0: "\<And> d. d \<in> D \<Longrightarrow> a d \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
nonneg_lincomb a D c

goal (1 subgoal):
 1. c = lincomb a D &&& (\<And>d. d \<in> D \<Longrightarrow> (0::'a) \<le> a d)
[PROOF STEP]
unfolding nonneg_lincomb_def
[PROOF STATE]
proof (prove)
using this:
lincomb a D = c \<and> a ` D \<subseteq> Collect ((\<le>) (0::'a))

goal (1 subgoal):
 1. c = lincomb a D &&& (\<And>d. d \<in> D \<Longrightarrow> (0::'a) \<le> a d)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = lincomb a D
?d4 \<in> D \<Longrightarrow> (0::'a) \<le> a ?d4

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define a1 where "a1 = (\<lambda> c. a c - of_int (floor (a c)))"
[PROOF STATE]
proof (state)
this:
a1 = (\<lambda>c. a c - of_int \<lfloor>a c\<rfloor>)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define a2 where "a2 = (\<lambda> c. of_int (floor (a c)) :: 'a)"
[PROOF STATE]
proof (state)
this:
a2 = (\<lambda>c. of_int \<lfloor>a c\<rfloor>)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define d where "d = lincomb a2 D"
[PROOF STATE]
proof (state)
this:
d = lincomb a2 D

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
define b where "b = lincomb a1 D"
[PROOF STATE]
proof (state)
this:
b = lincomb a1 D

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have b: "b \<in> carrier_vec n" and d: "d \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> carrier_vec n &&& d \<in> carrier_vec n
[PROOF STEP]
unfolding d_def b_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a1 D \<in> carrier_vec n &&& lincomb a2 D \<in> carrier_vec n
[PROOF STEP]
using D
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb a1 D \<in> carrier_vec n &&& lincomb a2 D \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> carrier_vec n
d \<in> carrier_vec n

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have bB: "b \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> B
[PROOF STEP]
unfolding B_def b_def nonneg_lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a1 D \<in> {x. \<exists>a D. (lincomb a D = x \<and> a ` D \<subseteq> Collect ((\<le>) (0::'a))) \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))}
[PROOF STEP]
proof (intro CollectI exI[of _ a1] exI[of _ D] conjI ballI refl subsetI linD)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> a1 ` D \<Longrightarrow> (0::'a) \<le> x
 2. \<And>x. x \<in> D \<Longrightarrow> x \<in> C
 3. \<And>d. d \<in> D \<Longrightarrow> a1 d \<le> (1::'a)
[PROOF STEP]
show "x \<in> a1 ` D \<Longrightarrow> 0 \<le> x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> a1 ` D \<Longrightarrow> (0::'a) \<le> x
[PROOF STEP]
using a0
[PROOF STATE]
proof (prove)
using this:
?d4 \<in> D \<Longrightarrow> (0::'a) \<le> a ?d4

goal (1 subgoal):
 1. x \<in> a1 ` D \<Longrightarrow> (0::'a) \<le> x
[PROOF STEP]
unfolding a1_def
[PROOF STATE]
proof (prove)
using this:
?d4 \<in> D \<Longrightarrow> (0::'a) \<le> a ?d4

goal (1 subgoal):
 1. x \<in> (\<lambda>c. a c - of_int \<lfloor>a c\<rfloor>) ` D \<Longrightarrow> (0::'a) \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x4 \<in> a1 ` D \<Longrightarrow> (0::'a) \<le> ?x4

goal (2 subgoals):
 1. \<And>x. x \<in> D \<Longrightarrow> x \<in> C
 2. \<And>d. d \<in> D \<Longrightarrow> a1 d \<le> (1::'a)
[PROOF STEP]
show "a1 c \<le> 1" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a1 c \<le> (1::'a)
[PROOF STEP]
unfolding a1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a c - of_int \<lfloor>a c\<rfloor> \<le> (1::'a)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
a1 ?c4 \<le> (1::'a)

goal (1 subgoal):
 1. \<And>x. x \<in> D \<Longrightarrow> x \<in> C
[PROOF STEP]
qed (insert DC, auto)
[PROOF STATE]
proof (state)
this:
b \<in> B

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have cbd: "c = b + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = b + d
[PROOF STEP]
unfolding b_def d_def caD lincomb_sum[OF finD D, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a D = lincomb (\<lambda>v. a1 v + a2 v) D
[PROOF STEP]
by (rule lincomb_cong[OF refl D], auto simp: a1_def a2_def)
[PROOF STATE]
proof (state)
this:
c = b + d

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "nonneg_lincomb a2 D d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_lincomb a2 D d
[PROOF STEP]
unfolding d_def nonneg_lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a2 D = lincomb a2 D \<and> a2 ` D \<subseteq> Collect ((\<le>) (0::'a))
[PROOF STEP]
by (intro allI conjI refl subsetI, insert a0, auto simp: a2_def)
[PROOF STATE]
proof (state)
this:
nonneg_lincomb a2 D d

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence dC: "d \<in> cone C"
[PROOF STATE]
proof (prove)
using this:
nonneg_lincomb a2 D d

goal (1 subgoal):
 1. d \<in> cone C
[PROOF STEP]
unfolding cone_def finite_cone_def
[PROOF STATE]
proof (prove)
using this:
nonneg_lincomb a2 D d

goal (1 subgoal):
 1. d \<in> {x. \<exists>Ws. finite Ws \<and> Ws \<subseteq> C \<and> x \<in> {b. \<exists>c. nonneg_lincomb c (if finite Ws then Ws else {}) b}}
[PROOF STEP]
using finC finD DC
[PROOF STATE]
proof (prove)
using this:
nonneg_lincomb a2 D d
finite C
finite D
D \<subseteq> C

goal (1 subgoal):
 1. d \<in> {x. \<exists>Ws. finite Ws \<and> Ws \<subseteq> C \<and> x \<in> {b. \<exists>c. nonneg_lincomb c (if finite Ws then Ws else {}) b}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d \<in> cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have p: "p = (q + b) + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = q + b + d
[PROOF STEP]
unfolding pqc cbd
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q + (b + d) = q + b + d
[PROOF STEP]
using q b d
[PROOF STATE]
proof (prove)
using this:
q \<in> carrier_vec n
b \<in> carrier_vec n
d \<in> carrier_vec n

goal (1 subgoal):
 1. q + (b + d) = q + b + d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = q + b + d

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have dI: "d \<in> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<in> \<int>\<^sub>v
[PROOF STEP]
using CI DC C
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> \<int>\<^sub>v
D \<subseteq> C
C \<subseteq> carrier_vec n

goal (1 subgoal):
 1. d \<in> \<int>\<^sub>v
[PROOF STEP]
unfolding d_def indexed_Ints_vec_UNIV
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> indexed_Ints_vec UNIV
D \<subseteq> C
C \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb a2 D \<in> indexed_Ints_vec UNIV
[PROOF STEP]
by (intro lincomb_indexed_Ints_vec, auto simp: a2_def)
[PROOF STATE]
proof (state)
this:
d \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
from diff_indexed_Ints_vec[of _ _ _ UNIV, folded indexed_Ints_vec_UNIV, OF _ d pI dI, unfolded p]
[PROOF STATE]
proof (chain)
picking this:
q + b + d \<in> carrier_vec n \<Longrightarrow> q + b + d - d \<in> \<int>\<^sub>v
[PROOF STEP]
have "q + b + d - d \<in> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
using this:
q + b + d \<in> carrier_vec n \<Longrightarrow> q + b + d - d \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. q + b + d - d \<in> \<int>\<^sub>v
[PROOF STEP]
using q b d
[PROOF STATE]
proof (prove)
using this:
q + b + d \<in> carrier_vec n \<Longrightarrow> q + b + d - d \<in> \<int>\<^sub>v
q \<in> carrier_vec n
b \<in> carrier_vec n
d \<in> carrier_vec n

goal (1 subgoal):
 1. q + b + d - d \<in> \<int>\<^sub>v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q + b + d - d \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
q + b + d - d \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "q + b + d - d = q + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q + b + d - d = q + b
[PROOF STEP]
using q b d
[PROOF STATE]
proof (prove)
using this:
q \<in> carrier_vec n
b \<in> carrier_vec n
d \<in> carrier_vec n

goal (1 subgoal):
 1. q + b + d - d = q + b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q + b + d - d = q + b

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
q + b \<in> \<int>\<^sub>v
[PROOF STEP]
have qbI: "q + b \<in> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
using this:
q + b \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. q + b \<in> \<int>\<^sub>v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q + b \<in> \<int>\<^sub>v

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "p \<in> integer_hull (Q + B) + cone C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> integer_hull (Q + B) + cone C
[PROOF STEP]
unfolding p integer_hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q + b + d \<in> convex_hull ((Q + B) \<inter> \<int>\<^sub>v) + cone C
[PROOF STEP]
by (intro set_plus_intro dC set_mp[OF set_in_convex_hull] IntI qQ bB qbI, insert Q B,
          auto elim!: set_plus_elim)
[PROOF STATE]
proof (state)
this:
p \<in> integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?p6 \<in> P \<inter> \<int>\<^sub>v \<Longrightarrow> ?p6 \<in> integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence "P \<inter> \<int>\<^sub>v \<subseteq> integer_hull (Q + B) + cone C"
[PROOF STATE]
proof (prove)
using this:
?p6 \<in> P \<inter> \<int>\<^sub>v \<Longrightarrow> ?p6 \<in> integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. P \<inter> \<int>\<^sub>v \<subseteq> integer_hull (Q + B) + cone C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<inter> \<int>\<^sub>v \<subseteq> integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
hence one_dir: "integer_hull P \<subseteq> integer_hull (Q + B) + cone C"
[PROOF STATE]
proof (prove)
using this:
P \<inter> \<int>\<^sub>v \<subseteq> integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. integer_hull P \<subseteq> integer_hull (Q + B) + cone C
[PROOF STEP]
unfolding IH
[PROOF STATE]
proof (prove)
using this:
P \<inter> \<int>\<^sub>v \<subseteq> polyhedron A' b'

goal (1 subgoal):
 1. integer_hull P \<subseteq> polyhedron A' b'
[PROOF STEP]
unfolding integer_hull_def
[PROOF STATE]
proof (prove)
using this:
P \<inter> \<int>\<^sub>v \<subseteq> polyhedron A' b'

goal (1 subgoal):
 1. convex_hull (P \<inter> \<int>\<^sub>v) \<subseteq> polyhedron A' b'
[PROOF STEP]
using convex_convex_hull[OF polyhedra_are_convex[OF A' b' refl]]
      convex_hull_mono
[PROOF STATE]
proof (prove)
using this:
P \<inter> \<int>\<^sub>v \<subseteq> polyhedron A' b'
convex_hull (polyhedron A' b') = polyhedron A' b'
?Vs \<subseteq> ?Ws \<Longrightarrow> convex_hull ?Vs \<subseteq> convex_hull ?Ws

goal (1 subgoal):
 1. convex_hull (P \<inter> \<int>\<^sub>v) \<subseteq> polyhedron A' b'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integer_hull P \<subseteq> integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "integer_hull (Q + B) + cone C \<subseteq> integer_hull P + cone C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_hull (Q + B) + cone C \<subseteq> integer_hull P + cone C
[PROOF STEP]
unfolding P
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_hull (Q + B) + cone C \<subseteq> integer_hull (Q + cone C) + cone C
[PROOF STEP]
proof (intro set_plus_mono2 subset_refl integer_hull_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B \<subseteq> cone C
[PROOF STEP]
show "B \<subseteq> cone C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> cone C
[PROOF STEP]
unfolding B_def cone_def finite_cone_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>a D. nonneg_lincomb a D x \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))} \<subseteq> {x. \<exists>Ws. finite Ws \<and> Ws \<subseteq> C \<and> x \<in> {b. \<exists>c. nonneg_lincomb c (if finite Ws then Ws else {}) b}}
[PROOF STEP]
using finite_subset[OF _ finC]
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> C \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. {x. \<exists>a D. nonneg_lincomb a D x \<and> D \<subseteq> C \<and> lin_indpt D \<and> (\<forall>d\<in>D. a d \<le> (1::'a))} \<subseteq> {x. \<exists>Ws. finite Ws \<and> Ws \<subseteq> C \<and> x \<in> {b. \<exists>c. nonneg_lincomb c (if finite Ws then Ws else {}) b}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<subseteq> cone C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integer_hull (Q + B) + cone C \<subseteq> integer_hull P + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integer_hull (Q + B) + cone C \<subseteq> integer_hull P + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "\<dots> = integer_hull P + integer_hull (cone C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_hull P + cone C = integer_hull P + integer_hull (cone C)
[PROOF STEP]
using integer_hull_integer_cone[OF C CI]
[PROOF STATE]
proof (prove)
using this:
integer_hull (cone C) = cone C

goal (1 subgoal):
 1. integer_hull P + cone C = integer_hull P + integer_hull (cone C)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integer_hull P + cone C = integer_hull P + integer_hull (cone C)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integer_hull P + cone C = integer_hull P + integer_hull (cone C)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "\<dots> = convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_hull P + integer_hull (cone C) = convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v)
[PROOF STEP]
unfolding integer_hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v) = convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integer_hull P + integer_hull (cone C) = convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integer_hull P + integer_hull (cone C) = convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "\<dots> = convex_hull ((P \<inter> \<int>\<^sub>v) + (cone C \<inter> \<int>\<^sub>v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v) = convex_hull (P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v)
[PROOF STEP]
by (rule convex_hull_sum[symmetric], insert Pn cone_carrier[OF C], auto)
[PROOF STATE]
proof (state)
this:
convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v) = convex_hull (P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convex_hull (P \<inter> \<int>\<^sub>v) + convex_hull (cone C \<inter> \<int>\<^sub>v) = convex_hull (P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "\<dots> \<subseteq> convex_hull ((P + cone C) \<inter> \<int>\<^sub>v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull (P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v) \<subseteq> convex_hull ((P + cone C) \<inter> \<int>\<^sub>v)
[PROOF STEP]
proof (rule convex_hull_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v \<subseteq> (P + cone C) \<inter> \<int>\<^sub>v
[PROOF STEP]
show "P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v \<subseteq> (P + cone C) \<inter> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v \<subseteq> (P + cone C) \<inter> \<int>\<^sub>v
[PROOF STEP]
using add_indexed_Ints_vec[of _ n _ UNIV, folded indexed_Ints_vec_UNIV] cone_carrier[OF C] Pn
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier_vec n; ?y \<in> carrier_vec n; ?x \<in> \<int>\<^sub>v; ?y \<in> \<int>\<^sub>v\<rbrakk> \<Longrightarrow> ?x + ?y \<in> \<int>\<^sub>v
cone C \<subseteq> carrier_vec n
P \<subseteq> carrier_vec n

goal (1 subgoal):
 1. P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v \<subseteq> (P + cone C) \<inter> \<int>\<^sub>v
[PROOF STEP]
by (auto elim!: set_plus_elim)
[PROOF STATE]
proof (state)
this:
P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v \<subseteq> (P + cone C) \<inter> \<int>\<^sub>v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex_hull (P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v) \<subseteq> convex_hull ((P + cone C) \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convex_hull (P \<inter> \<int>\<^sub>v + cone C \<inter> \<int>\<^sub>v) \<subseteq> convex_hull ((P + cone C) \<inter> \<int>\<^sub>v)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "\<dots> = integer_hull (P + cone C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull ((P + cone C) \<inter> \<int>\<^sub>v) = integer_hull (P + cone C)
[PROOF STEP]
unfolding integer_hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_hull ((P + cone C) \<inter> \<int>\<^sub>v) = convex_hull ((P + cone C) \<inter> \<int>\<^sub>v)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
convex_hull ((P + cone C) \<inter> \<int>\<^sub>v) = integer_hull (P + cone C)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convex_hull ((P + cone C) \<inter> \<int>\<^sub>v) = integer_hull (P + cone C)

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
have "P + cone C = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
have CC: "cone C \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cone C \<subseteq> carrier_vec n
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> carrier_vec n

goal (1 subgoal):
 1. cone C \<subseteq> carrier_vec n
[PROOF STEP]
by (rule cone_carrier)
[PROOF STATE]
proof (state)
this:
cone C \<subseteq> carrier_vec n

goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
have "P + cone C = Q + (cone C + cone C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P + cone C = Q + (cone C + cone C)
[PROOF STEP]
unfolding P
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q + cone C + cone C = Q + (cone C + cone C)
[PROOF STEP]
by (rule assoc_add_vecset[symmetric, OF Q CC CC])
[PROOF STATE]
proof (state)
this:
P + cone C = Q + (cone C + cone C)

goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P + cone C = Q + (cone C + cone C)

goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
have "cone C + cone C = cone C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cone C + cone C = cone C
[PROOF STEP]
by (rule cone_add_cone[OF C])
[PROOF STATE]
proof (state)
this:
cone C + cone C = cone C

goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P + cone C = Q + cone C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P + cone C = Q + cone C

goal (1 subgoal):
 1. P + cone C = P
[PROOF STEP]
unfolding P
[PROOF STATE]
proof (prove)
using this:
Q + cone C + cone C = Q + cone C

goal (1 subgoal):
 1. Q + cone C + cone C = Q + cone C
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P + cone C = P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P + cone C = P

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integer_hull (Q + B) + cone C \<subseteq> integer_hull P
[PROOF STEP]
have "integer_hull (Q + B) + cone C \<subseteq> integer_hull P"
[PROOF STATE]
proof (prove)
using this:
integer_hull (Q + B) + cone C \<subseteq> integer_hull P

goal (1 subgoal):
 1. integer_hull (Q + B) + cone C \<subseteq> integer_hull P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integer_hull (Q + B) + cone C \<subseteq> integer_hull P

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
with one_dir
[PROOF STATE]
proof (chain)
picking this:
integer_hull P \<subseteq> integer_hull (Q + B) + cone C
integer_hull (Q + B) + cone C \<subseteq> integer_hull P
[PROOF STEP]
have id: "integer_hull P = integer_hull (Q + B) + cone C"
[PROOF STATE]
proof (prove)
using this:
integer_hull P \<subseteq> integer_hull (Q + B) + cone C
integer_hull (Q + B) + cone C \<subseteq> integer_hull P

goal (1 subgoal):
 1. integer_hull P = integer_hull (Q + B) + cone C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integer_hull P = integer_hull (Q + B) + cone C

goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>H Ca. H \<union> Ca \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> Ca \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> Ca) \<and> integer_hull (Q + B) + cone C = convex_hull H + cone Ca
[PROOF STEP]
unfolding integer_hull_def DBnd_def[symmetric] nBnd_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>H Ca. H \<union> Ca \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec nBnd \<and> Ca \<subseteq> Bounded_vec DBnd \<and> finite (H \<union> Ca) \<and> convex_hull ((Q + B) \<inter> \<int>\<^sub>v) + cone C = convex_hull H + cone Ca
[PROOF STEP]
proof (rule exI[of _ "(Q + B) \<inter> \<int>\<^sub>v"], intro exI[of _ C] conjI refl BndC)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (Q + B) \<inter> \<int>\<^sub>v \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v
 2. (Q + B) \<inter> \<int>\<^sub>v \<subseteq> Bounded_vec nBnd
 3. finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)
[PROOF STEP]
from QB_Bnd
[PROOF STATE]
proof (chain)
picking this:
Q + B \<subseteq> Bounded_vec nBnd
[PROOF STEP]
show "(Q + B) \<inter> \<int>\<^sub>v \<subseteq> Bounded_vec nBnd"
[PROOF STATE]
proof (prove)
using this:
Q + B \<subseteq> Bounded_vec nBnd

goal (1 subgoal):
 1. (Q + B) \<inter> \<int>\<^sub>v \<subseteq> Bounded_vec nBnd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Q + B) \<inter> \<int>\<^sub>v \<subseteq> Bounded_vec nBnd

goal (2 subgoals):
 1. (Q + B) \<inter> \<int>\<^sub>v \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v
 2. finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)
[PROOF STEP]
show "(Q + B) \<inter> \<int>\<^sub>v \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Q + B) \<inter> \<int>\<^sub>v \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v
[PROOF STEP]
using QB C CI
[PROOF STATE]
proof (prove)
using this:
Q + B \<subseteq> carrier_vec n
C \<subseteq> carrier_vec n
C \<subseteq> \<int>\<^sub>v

goal (1 subgoal):
 1. (Q + B) \<inter> \<int>\<^sub>v \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Q + B) \<inter> \<int>\<^sub>v \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v

goal (1 subgoal):
 1. finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)
[PROOF STEP]
show "finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)
[PROOF STEP]
using finQBZ finC
[PROOF STATE]
proof (prove)
using this:
finite ((Q + B) \<inter> \<int>\<^sub>v)
finite C

goal (1 subgoal):
 1. finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ((Q + B) \<inter> \<int>\<^sub>v \<union> C)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>H C. H \<union> C \<subseteq> carrier_vec n \<inter> \<int>\<^sub>v \<and> H \<subseteq> Bounded_vec (of_nat (n + 1) * of_int (db n (max 1 Bnd))) \<and> C \<subseteq> Bounded_vec (of_int (db n (max 1 Bnd))) \<and> finite (H \<union> C) \<and> integer_hull P = convex_hull H + cone C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_var_monom_mult:  "sum_var (m * n) x = sum_var m x + sum_var n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_var (m * n) x = sum_var m x + sum_var n x
[PROOF STEP]
by (transfer, rule sum_var_list_monom_mult_list)


[STATEMENT]
lemma fusc_fusc'_iterate: "pure Pair \<diamondop> fusc \<diamondop> fusc' = stern_brocot_loopless"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pure Pair \<diamondop> fusc \<diamondop> fusc' = stern_brocot_loopless
[PROOF STEP]
apply(rule stern_brocot_loopless.unique)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pure Pair \<diamondop> fusc \<diamondop> fusc' = (1, 1) ## smap step (pure Pair \<diamondop> fusc \<diamondop> fusc')
[PROOF STEP]
apply(rule stream.expand; simp add: step_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pure Pair \<diamondop> fusc' \<diamondop> (fusc + fusc' - 2 * (fusc mod fusc')) = smap (\<lambda>(n, d). (d, n + d - 2 * (n mod d))) (pure Pair \<diamondop> fusc \<diamondop> fusc')
[PROOF STEP]
apply(applicative_lifting; simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma replicate_mset_le_iff_le[simp]: "replicate_mset m x \<le> replicate_mset n x \<longleftrightarrow> m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (replicate_mset m x \<le> replicate_mset n x) = (m \<le> n)
[PROOF STEP]
by (induct n m rule: diff_induct) auto


[STATEMENT]
lemma continuous_real_polymonial_function:
  assumes "real_polynomial_function f"
    shows "continuous (at x) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function f

goal (1 subgoal):
 1. isCont f x
[PROOF STEP]
by (induct f) (auto simp: linear_continuous_at)


[STATEMENT]
lemma witness_det: "det (submatrix Aw' rows_with_1 rows_with_1) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (submatrix Aw' rows_with_1 rows_with_1) \<noteq> 0
[PROOF STEP]
unfolding witness_submatrix
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (1\<^sub>m (r ^ N_half)) \<noteq> 0
[PROOF STEP]
by simp


[STATEMENT]
lemma of_complex_mult_of_complex [simp]:
  shows "(of_complex z1) *\<^sub>h (of_complex z2) = of_complex (z1 * z2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_complex z1 *\<^sub>h of_complex z2 = of_complex (z1 * z2)
[PROOF STEP]
by (transfer, transfer, simp)


[STATEMENT]
lemma qtable_project_fv: "qtable (Suc n) (fv \<phi>) (mem_restr (lift_envs R)) P X \<Longrightarrow>
    qtable n (Formula.fvi (Suc 0) \<phi>) (mem_restr R)
      (\<lambda>v. \<exists>x. P ((if 0 \<in> fv \<phi> then Some x else None) # v)) (tl ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qtable (Suc n) (fv \<phi>) (mem_restr (lift_envs R)) P X \<Longrightarrow> qtable n (Formula.fvi (Suc 0) \<phi>) (mem_restr R) (\<lambda>v. \<exists>x. P ((if 0 \<in> fv \<phi> then Some x else None) # v)) (tl ` X)
[PROOF STEP]
using neq0_conv
[PROOF STATE]
proof (prove)
using this:
(?n \<noteq> 0) = (0 < ?n)

goal (1 subgoal):
 1. qtable (Suc n) (fv \<phi>) (mem_restr (lift_envs R)) P X \<Longrightarrow> qtable n (Formula.fvi (Suc 0) \<phi>) (mem_restr R) (\<lambda>v. \<exists>x. P ((if 0 \<in> fv \<phi> then Some x else None) # v)) (tl ` X)
[PROOF STEP]
by (fastforce simp: image_iff Bex_def fvi_Suc elim!: qtable_cong dest!: qtable_project)


[STATEMENT]
lemma transfer_bex [transfer_intro]:
  "a \<equiv> Iset (star_n A) \<Longrightarrow> (\<And>X. p (star_n X) \<equiv> eventually (\<lambda>n. P n (X n)) \<U>) \<Longrightarrow>
    \<exists>x\<in>a. p x \<equiv> eventually (\<lambda>n. \<exists>x\<in>A n. P n x) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<equiv> Iset (star_n A); \<And>X. p (star_n X) \<equiv> \<forall>\<^sub>F n in \<U>. P n (X n)\<rbrakk> \<Longrightarrow> \<exists>x\<in>a. p x \<equiv> \<forall>\<^sub>F n in \<U>. \<exists>x\<in>A n. P n x
[PROOF STEP]
by (simp only: Bex_def transfer_ex transfer_conj transfer_mem)


[STATEMENT]
lemma prv_eqv_scnj_insert:
  assumes "F \<subseteq> fmla" and "finite F" and "\<phi> \<in> fmla"
  shows "prv (eqv (scnj (insert \<phi> F)) (cnj \<phi> (scnj F)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (eqv (scnj (insert \<phi> F)) (cnj \<phi> (scnj F)))
[PROOF STEP]
by (simp add: assms prv_eqvI prv_imp_cnj_scnj prv_imp_scnj_insert)


[STATEMENT]
lemma design_cart_product_size: "size ((mset_set \<V>) \<times># \<B>) = \<v> * \<b>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (mset_set \<V> \<times># \<B>) = \<v> * \<b>
[PROOF STEP]
by (simp add: size_cartesian_product)


[STATEMENT]
lemma polysub[simp]:
fixes p::"'a::ring_1 poly"
shows "Ipoly bs (polysub p q) = Ipoly bs p - Ipoly bs q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly bs (p -\<^sub>p q) = Ipoly bs p - Ipoly bs q
[PROOF STEP]
by (simp add: polysub_def)


[STATEMENT]
lemma sym_group_one: "one (sym_group n) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>sym_group n\<^esub> = id
[PROOF STEP]
unfolding sym_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>\<lparr>carrier = {p. p permutes {1..n}}, monoid.mult = (\<circ>), one = id\<rparr>\<^esub> = id
[PROOF STEP]
by simp


[STATEMENT]
lemma liftAll2_and:
"liftAll2 (\<lambda> v v'. phi v v' \<and> chi v v') inp inp' =
(liftAll2 phi inp inp' \<and> liftAll2 chi inp inp')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liftAll2 (\<lambda>v v'. phi v v' \<and> chi v v') inp inp' = (liftAll2 phi inp inp' \<and> liftAll2 chi inp inp')
[PROOF STEP]
unfolding liftAll2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i v1 v2. inp i = Some v1 \<and> inp' i = Some v2 \<longrightarrow> phi v1 v2 \<and> chi v1 v2) = ((\<forall>i v1 v2. inp i = Some v1 \<and> inp' i = Some v2 \<longrightarrow> phi v1 v2) \<and> (\<forall>i v1 v2. inp i = Some v1 \<and> inp' i = Some v2 \<longrightarrow> chi v1 v2))
[PROOF STEP]
by force


[STATEMENT]
theorem p47:
  "(\<forall>x. P1(x) \<longrightarrow> P0(x)) \<and> (\<exists>x. P1(x)) \<Longrightarrow>
   (\<forall>x. P2(x) \<longrightarrow> P0(x)) \<and> (\<exists>x. P2(x)) \<Longrightarrow>
   (\<forall>x. P3(x) \<longrightarrow> P0(x)) \<and> (\<exists>x. P3(x)) \<Longrightarrow>
   (\<forall>x. P4(x) \<longrightarrow> P0(x)) \<and> (\<exists>x. P4(x)) \<Longrightarrow>
   (\<forall>x. P5(x) \<longrightarrow> P0(x)) \<and> (\<exists>x. P5(x)) \<Longrightarrow>
   (\<exists>x. Q1(x)) \<and> (\<forall>x. Q1(x) \<longrightarrow> Q0(x)) \<Longrightarrow>
   \<forall>x. P0(x) \<longrightarrow> ((\<forall>y. Q0(y) \<longrightarrow> R(x,y)) \<or>
                   (\<forall>y. P0(y) \<and> S(y,x) \<and> (\<exists>z. Q0(z) \<and> R(y,z)) \<longrightarrow> R(x,y))) \<Longrightarrow>
   \<forall>x y. P3(y) \<and> (P5(x) \<or> P4(x)) \<longrightarrow> S(x,y) \<Longrightarrow>
   \<forall>x y. P3(x) \<and> P2(y) \<longrightarrow> S(x,y) \<Longrightarrow>
   \<forall>x y. P2(x) \<and> P1(y) \<longrightarrow> S(x,y) \<Longrightarrow>
   \<forall>x y. P1(x) \<and> (P2(y) \<or> Q1(y)) \<longrightarrow> \<not>R(x,y) \<Longrightarrow>
   \<forall>x y. P3(x) \<and> P4(y) \<longrightarrow> R(x,y) \<Longrightarrow>
   \<forall>x y. P3(x) \<and> P5(y) \<longrightarrow> \<not>R(x,y) \<Longrightarrow>
   \<forall>x. P4(x) \<or> P5(x) \<longrightarrow> (\<exists>y. Q0(y) \<and> R(x,y)) \<Longrightarrow>
   \<exists>x y. P0(x) \<and> P0(y) \<and> (\<exists>z. Q1(z) \<and> R(y,z) \<and> R(x,y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@obtain x1 x2 x3 x4 x5 where "P1(x1)" "P2(x2)" "P3(x3)" "P4(x4)" "P5(x5)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@have "S(x3,x2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@have "S(x2,x1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@have "R(x3,x4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@have "\<not>R(x3,x5)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x. P1 x \<longrightarrow> P0 x) \<and> (\<exists>x. P1 x); (\<forall>x. P2 x \<longrightarrow> P0 x) \<and> (\<exists>x. P2 x); (\<forall>x. P3 x \<longrightarrow> P0 x) \<and> (\<exists>x. P3 x); (\<forall>x. P4 x \<longrightarrow> P0 x) \<and> (\<exists>x. P4 x); (\<forall>x. P5 x \<longrightarrow> P0 x) \<and> (\<exists>x. P5 x); (\<exists>x. Q1 x) \<and> (\<forall>x. Q1 x \<longrightarrow> Q0 x); \<forall>x. P0 x \<longrightarrow> (\<forall>y. Q0 y \<longrightarrow> R (x, y)) \<or> (\<forall>y. P0 y \<and> S (y, x) \<and> (\<exists>z. Q0 z \<and> R (y, z)) \<longrightarrow> R (x, y)); \<forall>x y. P3 y \<and> (P5 x \<or> P4 x) \<longrightarrow> S (x, y); \<forall>x y. P3 x \<and> P2 y \<longrightarrow> S (x, y); \<forall>x y. P2 x \<and> P1 y \<longrightarrow> S (x, y); \<forall>x y. P1 x \<and> (P2 y \<or> Q1 y) \<longrightarrow> \<not> R (x, y); \<forall>x y. P3 x \<and> P4 y \<longrightarrow> R (x, y); \<forall>x y. P3 x \<and> P5 y \<longrightarrow> \<not> R (x, y); \<forall>x. P4 x \<or> P5 x \<longrightarrow> (\<exists>y. Q0 y \<and> R (x, y))\<rbrakk> \<Longrightarrow> \<exists>x y. P0 x \<and> P0 y \<and> (\<exists>z. Q1 z \<and> R (y, z) \<and> R (x, y))
[PROOF STEP]
@qed


[STATEMENT]
lemma symm_strong_reduction_simulation_is_bisimulation:
  fixes Rel :: "('proc \<times> 'proc) set"
    and Cal :: "'proc processCalculus"
  assumes "sym Rel"
      and "strong_reduction_simulation Rel Cal"
  shows "strong_reduction_bisimulation Rel Cal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strong_reduction_simulation Rel Cal \<and> (\<forall>P Q Q'. (P, Q) \<in> Rel \<and> Q \<longmapsto>Cal Q' \<longrightarrow> (\<exists>P'. P \<longmapsto>Cal P' \<and> (P', Q') \<in> Rel))
[PROOF STEP]
using assms symD[of Rel]
[PROOF STATE]
proof (prove)
using this:
sym Rel
strong_reduction_simulation Rel Cal
sym Rel \<and> (?b, ?a) \<in> Rel \<Longrightarrow> (?a, ?b) \<in> Rel

goal (1 subgoal):
 1. strong_reduction_simulation Rel Cal \<and> (\<forall>P Q Q'. (P, Q) \<in> Rel \<and> Q \<longmapsto>Cal Q' \<longrightarrow> (\<exists>P'. P \<longmapsto>Cal P' \<and> (P', Q') \<in> Rel))
[PROOF STEP]
by blast


[STATEMENT]
lemma inv_sum_group [simp]:
  assumes "\<And>i. i \<in> I \<Longrightarrow> group (G i)" and x: "x \<in> carrier (sum_group I G)"
  shows "m_inv (sum_group I G) x = (\<lambda>i\<in>I. m_inv (G i) (x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>sum_group I G\<^esub> x = (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i)
[PROOF STEP]
proof (rule group.inv_equality)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Group.group (sum_group I G)
 2. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>sum_group I G\<^esub> x = \<one>\<^bsub>sum_group I G\<^esub>
 3. x \<in> carrier (sum_group I G)
 4. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (sum_group I G)
[PROOF STEP]
show "(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>sum_group I G\<^esub> x = \<one>\<^bsub>sum_group I G\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>sum_group I G\<^esub> x = \<one>\<^bsub>sum_group I G\<^esub>
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (sum_group I G)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>sum_group I G\<^esub> x = \<one>\<^bsub>sum_group I G\<^esub>
[PROOF STEP]
by (auto simp: carrier_sum_group PiE_iff group.l_inv assms intro: restrict_ext)
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>sum_group I G\<^esub> x = \<one>\<^bsub>sum_group I G\<^esub>

goal (3 subgoals):
 1. Group.group (sum_group I G)
 2. x \<in> carrier (sum_group I G)
 3. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (sum_group I G)
[PROOF STEP]
show "(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (sum_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (sum_group I G)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (sum_group I G)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (sum_group I G)
[PROOF STEP]
by (simp add: carrier_sum_group PiE_iff group.inv_eq_1_iff assms conj_commute cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (sum_group I G)

goal (2 subgoals):
 1. Group.group (sum_group I G)
 2. x \<in> carrier (sum_group I G)
[PROOF STEP]
qed (auto simp: assms)