Convex Analysis (Rockafellar, 1970) -- Chapter 04 -- Section 21 -- Part 4

section Chap04section Section21set_option linter.unnecessarySimpa false

Helper for Theorem 21.2 (Step 4 route): an affine function that is nonnegative on Unknown identifier `C`C and vanishes at a point of Unknown identifier `ri`ri C must vanish on all of Unknown identifier `C`C.

lemma helperForTheorem_21_2_affine_nonneg_on_C_and_zero_at_ri_forces_zero_on_C {n : } (C : Set (Fin n )) (x0 : Fin n ) (hx0ri : x0 euclideanRelativeInterior_fin n C) (g : (Fin n ) →ᵃ[] ) (hg_nonneg : x : Fin n , x C 0 g x) (hg_x0 : g x0 = 0) : x : Fin n , x C g x = 0 := by intro x hxC let e := (EuclideanSpace.equiv (ι := Fin n) (𝕜 := )) have hx0C : x0 C := helperForTheorem_21_1_riFin_subset_C C hx0ri have hx0riE : e.symm x0 euclideanRelativeInterior n (e.symm '' C) := (mem_euclideanRelativeInterior_fin_iff (n := n) (C := C) (x := x0)).1 hx0ri have hx0A : e.symm x0 affineSpan (e.symm '' C) := by exact (subset_affineSpan (s := (e.symm '' C))) (by exact x0, hx0C, rfl) have hxA : e.symm x affineSpan (e.symm '' C) := by exact (subset_affineSpan (s := (e.symm '' C))) (by exact x, hxC, rfl) have hvDir : e.symm x - e.symm x0 (affineSpan (e.symm '' C)).direction := by exact (affineSpan (e.symm '' C)).vsub_mem_direction hxA hx0A rcases exists_add_sub_mem_of_mem_ri_of_mem_direction (n := n) (C := (e.symm '' C)) (x := e.symm x0) (v := e.symm x - e.symm x0) hx0riE hvDir with ε, hεpos, _hplusC, hminusC have hminusC_fin : x0 - ε (x - x0) C := by have hminusImage : e.symm (x0 - ε (x - x0)) e.symm '' C := by simpa [e, map_sub, map_smul, sub_eq_add_neg, add_comm, add_left_comm, add_assoc, smul_sub] using hminusC rcases hminusImage with y, hyC, hyEq have hyx : y = x0 - ε (x - x0) := e.symm.injective hyEq simpa [hyx] using hyC have hg_minus_nonneg : 0 g (x0 - ε (x - x0)) := hg_nonneg (x0 - ε (x - x0)) hminusC_fin have hdecomp := AffineMap.decomp g have hg_formula : g (x0 - ε (x - x0)) = g x0 - ε * (g x - g x0) := by have hgx0 : g x0 = g.linear x0 + g 0 := by simpa [Pi.add_apply] using congrArg (fun h => h x0) hdecomp have hgx : g x = g.linear x + g 0 := by simpa [Pi.add_apply] using congrArg (fun h => h x) hdecomp have hgminus : g (x0 - ε (x - x0)) = g.linear (x0 - ε (x - x0)) + g 0 := by simpa [Pi.add_apply] using congrArg (fun h => h (x0 - ε (x - x0))) hdecomp calc g (x0 - ε (x - x0)) = g.linear (x0 - ε (x - x0)) + g 0 := hgminus _ = (g.linear x0 + g 0) - ε * ((g.linear x + g 0) - (g.linear x0 + g 0)) := by simp [g.linear.map_sub, g.linear.map_smul] ring _ = g x0 - ε * (g x - g x0) := by rw [hgx0, hgx] have hcalc : 0 -ε * g x := by have : 0 g x0 - ε * (g x - g x0) := by simpa [hg_formula] using hg_minus_nonneg simpa [hg_x0] using this have hgx_le : g x 0 := by nlinarith [hcalc, hεpos] exact le_antisymm hgx_le (hg_nonneg x hxC)

Helper for Theorem 21.2: if a nonnegative support combination of the affine block vanishes on all of Unknown identifier `C`C, then the same support combination is automatically nonnegative on the strict- feasible affine upper hull Unknown identifier `U`U.

lemma helperForTheorem_21_2_support_nonneg_on_U_of_affineSupport_zero_on_C {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (lamAffineSupport : Fin l ) (hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (hAffineSupport_zero_on_C : x : Fin n , x C ( j : Fin l, lamAffineSupport j * fAffine j x) = 0) : u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j := by intro u hu rcases (show u {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)} from by simpa [hU_def] using hu) with x, hxC, _hxStrict, hxLeU have hLower : ( j : Fin l, lamAffineSupport j * fAffine j x) j : Fin l, lamAffineSupport j * u j := by refine Finset.sum_le_sum ?_ intro j hj exact mul_le_mul_of_nonneg_left (hxLeU j) (hlamAffineSupport_nonneg j) have hZero : ( j : Fin l, lamAffineSupport j * fAffine j x) = 0 := hAffineSupport_zero_on_C x hxC calc 0 = j : Fin l, lamAffineSupport j * fAffine j x := hZero.symm _ j : Fin l, lamAffineSupport j * u j := hLower

Helper for Theorem 21.2: from the boundary geometry of the strict-feasible affine upper hull, retain the full oriented separator data against the strict negative orthant rather than only the induced support inequality.

lemma helperForTheorem_21_2_boundary_support_oriented_data_on_strictFeasibleAffineUpperHull {l : } (U : Set (Fin l )) (hUconv : Convex U) (hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (hUne : U.Nonempty) (_hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (hzeroNotMemU : (fun _ : Fin l => (0 : )) U) : lamAffine : Fin l , β : , ( j : Fin l, 0 lamAffine j) lamAffine 0 0 β ( u : Fin l , u U β u ⬝ᵥ lamAffine) ( o : Fin l , ( j : Fin l, o j < 0) o ⬝ᵥ lamAffine β) := by let O : Set (Fin l ) := {o : Fin l | j : Fin l, o j < 0} have hO_nonempty_convex : O.Nonempty Convex O := by simpa [O] using helperForTheorem_21_1_negativeOrthant_nonempty_convex l have hUO_disjoint : Disjoint U O := by refine Set.disjoint_left.2 ?_ intro u huU huO have huLeZero : j : Fin l, u j 0 := by intro j exact (huO j).le have hzeroMemU : (fun _ : Fin l => (0 : )) U := hUupper huU huLeZero exact hzeroNotMemU hzeroMemU have hUO_disjoint_intrinsic : Disjoint (intrinsicInterior U) (intrinsicInterior O) := by exact hUO_disjoint.mono intrinsicInterior_subset intrinsicInterior_subset have hsepExists : H : Set (Fin l ), HyperplaneSeparatesProperly l H U O := by exact (exists_hyperplaneSeparatesProperly_iff_disjoint_intrinsicInterior (n := l) (C₁ := U) (C₂ := O) hUne hO_nonempty_convex.1 hUconv hO_nonempty_convex.2).2 hUO_disjoint_intrinsic rcases hsepExists with H, hHsep rcases hyperplaneSeparatesProperly_oriented l H U O hHsep with b, β, hb_ne_zero, _hHdef, hU_lower, hO_upper, _hNotBothInH have hb_nonneg : j : Fin l, 0 b j := helperForTheorem_21_1_separatorNormal_nonneg_on_negativeOrthant O rfl b β hO_upper have hβ_nonneg : 0 β := helperForTheorem_21_1_separatorBeta_nonneg_on_negativeOrthant O rfl b β hO_upper hb_ne_zero hb_nonneg refine b, β, hb_nonneg, hb_ne_zero, hβ_nonneg, hU_lower, ?_ intro o ho exact hO_upper o ho

Helper for Theorem 21.2: in the all-shifted branch, if the affine support combination vanishes on Unknown identifier `C`C and an external Section 20 / Corollary 7.3.3 bridge supplies a negative-support witness whenever 0 sorry : Prop0 Unknown identifier `U`U, then necessarily 0 sorry : Prop0 Unknown identifier `U`U.

This is the correct dependency-level interface for the remaining geometric step. The earlier attempt to derive 0 sorry : Prop0 Unknown identifier `U`U directly from boundary support data alone was too strong.

lemma helperForTheorem_21_2_zeroMemU_of_affineSupport_zero_on_C_and_negativeWitnessBridge_in_allShifted_context {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (lamAffineSupport : Fin l ) (hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (hzeroNotMemU_to_existsNegativeSupportWitness : ((fun _ : Fin l => (0 : )) U) u : Fin l , u U ( j : Fin l, lamAffineSupport j * u j) < 0) (hAffineSupport_zero_on_C : x : Fin n , x C ( j : Fin l, lamAffineSupport j * fAffine j x) = 0) : (fun _ : Fin l => (0 : )) U := by have hSupport_nonneg_on_U : u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j := by exact helperForTheorem_21_2_support_nonneg_on_U_of_affineSupport_zero_on_C C fStrict fAffine U hU_def lamAffineSupport hlamAffineSupport_nonneg hAffineSupport_zero_on_C exact helperForTheorem_21_2_zeroMemU_of_supportNonneg_and_zeroNotMemU_to_exists_negative_support_witness U lamAffineSupport hzeroNotMemU_to_existsNegativeSupportWitness hSupport_nonneg_on_U

The mixed strict/equality image used in the direct Unknown identifier `Theorem`Theorem 20.2 route for Theorem 21.2. The first block records strict upper bounds for the convex constraints, while the second block records the affine constraints exactly.

def theorem21MixedStrictEqualityImage {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) : Set (Fin (k + l) ) := {z : Fin (k + l) | x, x C ( i : Fin k, fStrict i x < (z (Fin.castAdd l i) : EReal)) ( j : Fin l, fAffine j x = z (Fin.natAdd k j))}

Helper for Theorem 21.2: the mixed strict/equality image is convex.

lemma helperForTheorem_21_2_convexity_of_mixedStrictEqualityImage {n k l : } (C : Set (Fin n )) (hC : Convex C) (fStrict : Fin k (Fin n ) EReal) (hfStrict : i : Fin k, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i)) (fAffine : Fin l (Fin n ) ) (hAffine : j : Fin l, g : (Fin n ) →ᵃ[] , fAffine j = g) : Convex (theorem21MixedStrictEqualityImage C fStrict fAffine) := by intro u hu v hv a b ha hb hab rcases hu with x, hxC, hxStrict, hxAffineEq rcases hv with y, hyC, hyStrict, hyAffineEq refine a x + b y, hC hxC hyC ha hb hab, ?_, ?_ · intro i have hconvToReal : ConvexOn (effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) (fun x => (fStrict i x).toReal) := convexOn_toReal_on_effectiveDomain (hf := hfStrict i) have hxLtTop : fStrict i x < ( : EReal) := lt_of_lt_of_le (hxStrict i) (by simp) have hyLtTop : fStrict i y < ( : EReal) := lt_of_lt_of_le (hyStrict i) (by simp) have hxDom : x effectiveDomain (Set.univ : Set (Fin n )) (fStrict i) := by simpa [effectiveDomain_eq] using hxLtTop have hyDom : y effectiveDomain (Set.univ : Set (Fin n )) (fStrict i) := by simpa [effectiveDomain_eq] using hyLtTop have hzDom : a x + b y effectiveDomain (Set.univ : Set (Fin n )) (fStrict i) := hconvToReal.1 hxDom hyDom ha hb hab have hzToRealLe : (fStrict i (a x + b y)).toReal a * (fStrict i x).toReal + b * (fStrict i y).toReal := hconvToReal.2 hxDom hyDom ha hb hab have hproperFinite : ConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i) Set.Nonempty (effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) x' effectiveDomain (Set.univ : Set (Fin n )) (fStrict i), fStrict i x' fStrict i x' := (properConvexFunctionOn_iff_effectiveDomain_nonempty_finite (Set.univ : Set (Fin n )) (fStrict i)).1 (hfStrict i) have hxNeTop : fStrict i x ( : EReal) := mem_effectiveDomain_imp_ne_top hxDom have hyNeTop : fStrict i y ( : EReal) := mem_effectiveDomain_imp_ne_top hyDom have hzNeTop : fStrict i (a x + b y) ( : EReal) := mem_effectiveDomain_imp_ne_top hzDom have hxNeBot : fStrict i x ( : EReal) := (hproperFinite.2.2 x hxDom).1 have hyNeBot : fStrict i y ( : EReal) := (hproperFinite.2.2 y hyDom).1 have hzNeBot : fStrict i (a x + b y) ( : EReal) := (hproperFinite.2.2 (a x + b y) hzDom).1 have hxRealLt : (fStrict i x).toReal < u (Fin.castAdd l i) := by have hxStrictE : (((fStrict i x).toReal : ) : EReal) < (u (Fin.castAdd l i) : EReal) := by simpa [EReal.coe_toReal hxNeTop hxNeBot] using hxStrict i exact (EReal.coe_lt_coe_iff).1 hxStrictE have hyRealLt : (fStrict i y).toReal < v (Fin.castAdd l i) := by have hyStrictE : (((fStrict i y).toReal : ) : EReal) < (v (Fin.castAdd l i) : EReal) := by simpa [EReal.coe_toReal hyNeTop hyNeBot] using hyStrict i exact (EReal.coe_lt_coe_iff).1 hyStrictE have hrightLt : a * (fStrict i x).toReal + b * (fStrict i y).toReal < a * u (Fin.castAdd l i) + b * v (Fin.castAdd l i) := by have hax_le : a * (fStrict i x).toReal a * u (Fin.castAdd l i) := (mul_le_mul_of_nonneg_left hxRealLt.le ha) have hby_le : b * (fStrict i y).toReal b * v (Fin.castAdd l i) := (mul_le_mul_of_nonneg_left hyRealLt.le hb) have hab_pos : 0 < a 0 < b := by by_cases ha0 : a = 0 · right have : b = 1 := by linarith linarith · left exact lt_of_le_of_ne ha (Ne.symm ha0) rcases hab_pos with ha_pos | hb_pos · have hax_lt : a * (fStrict i x).toReal < a * u (Fin.castAdd l i) := mul_lt_mul_of_pos_left hxRealLt ha_pos exact add_lt_add_of_lt_of_le hax_lt hby_le · have hby_lt : b * (fStrict i y).toReal < b * v (Fin.castAdd l i) := mul_lt_mul_of_pos_left hyRealLt hb_pos exact add_lt_add_of_le_of_lt hax_le hby_lt have hzRealLt : (fStrict i (a x + b y)).toReal < a * u (Fin.castAdd l i) + b * v (Fin.castAdd l i) := lt_of_le_of_lt hzToRealLe hrightLt have hzRealLtE : (((fStrict i (a x + b y)).toReal : ) : EReal) < ((a * u (Fin.castAdd l i) + b * v (Fin.castAdd l i) : ) : EReal) := by exact_mod_cast hzRealLt have hzCoe : (((fStrict i (a x + b y)).toReal : ) : EReal) = fStrict i (a x + b y) := EReal.coe_toReal hzNeTop hzNeBot simpa [hzCoe, Pi.add_apply, smul_eq_mul] using hzRealLtE · intro j rcases hAffine j with g, hg have hzEq : fAffine j (a x + b y) = a * fAffine j x + b * fAffine j y := by have hdecomp := AffineMap.decomp g have hgx : g x = g.linear x + g 0 := by simpa [Pi.add_apply] using congrArg (fun h => h x) hdecomp have hgy : g y = g.linear y + g 0 := by simpa [Pi.add_apply] using congrArg (fun h => h y) hdecomp have hgxy : g (a x + b y) = g.linear (a x + b y) + g 0 := by simpa [Pi.add_apply] using congrArg (fun h => h (a x + b y)) hdecomp calc fAffine j (a x + b y) = g (a x + b y) := by simp [hg] _ = a * g x + b * g y := by rw [hgxy, g.linear.map_add, g.linear.map_smul, g.linear.map_smul, hgx, hgy] have hab' : b = 1 - a := by linarith rw [hab'] simp [smul_eq_mul] ring_nf _ = a * fAffine j x + b * fAffine j y := by simp [hg] calc fAffine j (a x + b y) = a * fAffine j x + b * fAffine j y := hzEq _ = a * u (Fin.natAdd k j) + b * v (Fin.natAdd k j) := by rw [hxAffineEq j, hyAffineEq j] _ = (a u + b v) (Fin.natAdd k j) := by simp [Pi.add_apply, smul_eq_mul]

Helper for Theorem 21.2: every positive shifted strict-feasible point yields a point in the mixed strict/equality image.

lemma helperForTheorem_21_2_nonempty_mixedStrictEqualityImage_of_allShiftedPrimal {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) : (theorem21MixedStrictEqualityImage C fStrict fAffine).Nonempty := by rcases hAllShiftedPrimal 1 (by norm_num) with x, hxC, hxStrict, _hxAffineLt let z : Fin (k + l) := Fin.append (fun _ : Fin k => (0 : )) (fun j : Fin l => fAffine j x) refine z, x, hxC, ?_, ?_ · intro i simpa [z, Fin.append] using hxStrict i · intro j simp [z, Fin.append]

Helper for Theorem 21.2: the mixed strict/equality image is disjoint from the nonpositive orthant exactly when the target primal system is infeasible.

lemma helperForTheorem_21_2_disjoint_mixedStrictEqualityImage_nonpositiveOrthant_of_notPrimal {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) : Disjoint (theorem21MixedStrictEqualityImage C fStrict fAffine) {z : Fin (k + l) | q : Fin (k + l), z q 0} := by refine Set.disjoint_left.2 ?_ intro z hzImage hzOrthant rcases hzImage with x, hxC, hxStrict, hxAffineEq have hxStrictNeg : i : Fin k, fStrict i x < (0 : EReal) := by intro i have hzNonpos : z (Fin.castAdd l i) 0 := hzOrthant (Fin.castAdd l i) have hzNonposE : (z (Fin.castAdd l i) : EReal) (0 : EReal) := by exact_mod_cast hzNonpos exact lt_of_lt_of_le (hxStrict i) hzNonposE have hxAffineLe : j : Fin l, fAffine j x 0 := by intro j have hzNonpos : z (Fin.natAdd k j) 0 := hzOrthant (Fin.natAdd k j) simpa [hxAffineEq j] using hzNonpos exact hNotPrimal x, hxC, hxStrictNeg, hxAffineLe

Helper for Theorem 21.2: the closed nonpositive orthant in ^ sorry : Type^Unknown identifier `m`m is nonempty and convex.

lemma helperForTheorem_21_2_nonpositiveOrthant_nonempty_convex (m : ) : ({z : Fin m | i : Fin m, z i 0} : Set (Fin m )).Nonempty Convex {z : Fin m | i : Fin m, z i 0} := by constructor · exact fun _ => 0, by intro i; simp · Try this: intro u hu v hv a b ha hb hab iintro u hu v hv a b ha hb hab intro i have hu0 : u i 0 := hu i have hv0 : v i 0 := hv i have : a * u i + b * v i 0 := by nlinarith simpa [Pi.add_apply, smul_eq_mul] using this

Helper for Theorem 21.2: the closed nonpositive orthant is polyhedral.

lemma helperForTheorem_21_2_nonpositiveOrthant_polyhedral (m : ) : IsPolyhedralConvexSet m {z : Fin m | i : Fin m, z i 0} := by let b : Fin m Fin m := fun i => Pi.single i (1 : ) let β : Fin m := fun _ => 0 have hpoly : IsPolyhedralConvexSet m {z : Fin m | i : Fin m, z ⬝ᵥ b i β i} := by simpa using (polyhedralConvexSet_solutionSet_linearEq_and_inequalities m 0 m (fun i : Fin 0 => (0 : Fin m )) (fun i : Fin 0 => (0 : )) b β) have hEq : {z : Fin m | i : Fin m, z ⬝ᵥ b i β i} = {z : Fin m | i : Fin m, z i 0} := by ext z constructor · intro hz i have hzi : z ⬝ᵥ b i β i := hz i simpa [b, β] using hzi · intro hz i have hzi : z i 0 := hz i simpa [b, β] using hzi simpa [hEq] using hpoly

Helper for Theorem 21.2: direct mixed-image route in the all-shifted branch. Instead of passing through the auxiliary upper hull Unknown identifier `U`U, apply Theorem 20.2 directly to the mixed strict/equality image and the nonpositive orthant, then promote the resulting separator inequality from Unknown identifier `ri`ri C to all of Unknown identifier `C`C via the Section 21.1 closure machinery.

lemma helperForTheorem_21_2_targetDual_of_allShiftedPrimal_via_direct_theorem20_2_route {n k l : } (C : Set (Fin n )) (hC : Convex C) (fStrict : Fin k (Fin n ) EReal) (hfStrict : i : Fin k, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i)) (hdomStrict : i : Fin k, euclideanRelativeInterior_fin n C effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) (fAffine : Fin l (Fin n ) ) (hAffine : j : Fin l, g : (Fin n ) →ᵃ[] , fAffine j = g) (hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) (hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) : lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) ( i : Fin k, lamStrict i 0) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal)) := by let C₁ : Set (Fin (k + l) ) := theorem21MixedStrictEqualityImage C fStrict fAffine let C₂ : Set (Fin (k + l) ) := {z : Fin (k + l) | q : Fin (k + l), z q 0} have hC₁ne : C₁.Nonempty := by simpa [C₁] using helperForTheorem_21_2_nonempty_mixedStrictEqualityImage_of_allShiftedPrimal C fStrict fAffine hAllShiftedPrimal have hC₁conv : Convex C₁ := by simpa [C₁] using helperForTheorem_21_2_convexity_of_mixedStrictEqualityImage C hC fStrict hfStrict fAffine hAffine have hC₂data : C₂.Nonempty Convex C₂ := by simpa [C₂] using helperForTheorem_21_2_nonpositiveOrthant_nonempty_convex (k + l) have hC₂poly : IsPolyhedralConvexSet (k + l) C₂ := by simpa [C₂] using helperForTheorem_21_2_nonpositiveOrthant_polyhedral (k + l) have hC₁C₂_disjoint : Disjoint C₁ C₂ := by simpa [C₁, C₂] using helperForTheorem_21_2_disjoint_mixedStrictEqualityImage_nonpositiveOrthant_of_notPrimal C fStrict fAffine hNotPrimal have hC₂riC₁_disjoint : Disjoint C₂ (intrinsicInterior C₁) := by refine Set.disjoint_left.2 ?_ intro z hzC₂ hzri exact hC₁C₂_disjoint.le_bot intrinsicInterior_subset hzri, hzC₂ have hleftRiEmpty : C₂ intrinsicInterior C₁ = ( : Set (Fin (k + l) )) := by simpa [Set.disjoint_iff_inter_eq_empty] using hC₂riC₁_disjoint rcases (exists_hyperplaneSeparatesProperly_and_not_subset_right_iff_inter_intrinsicInterior_eq_empty_of_nonempty_convex_polyhedral_left (n := k + l) C₂ C₁ hC₂data.1 hC₁ne hC₁conv hC₂poly).2 hleftRiEmpty with H, hHproper21, hC₁_not_subsetH have hHproper12 : HyperplaneSeparatesProperly (k + l) H C₁ C₂ := hyperplaneSeparatesProperly_comm hHproper21 rcases hyperplaneSeparatesProperly_oriented (k + l) H C₁ C₂ hHproper12 with b, α, hb_ne_zero, hHdef, hC₁_lower, hC₂_upper, _hNotBoth let O : Set (Fin (k + l) ) := {o : Fin (k + l) | q : Fin (k + l), o q < 0} have hO_upper : o O, o ⬝ᵥ b α := by intro o ho exact hC₂_upper o (by intro q exact (ho q).le) have hb_nonneg : q : Fin (k + l), 0 b q := helperForTheorem_21_1_separatorNormal_nonneg_on_negativeOrthant O rfl b α hO_upper have hα_nonneg : 0 α := helperForTheorem_21_1_separatorBeta_nonneg_on_negativeOrthant O rfl b α hO_upper hb_ne_zero hb_nonneg let lamStrict : Fin k := fun i => b (Fin.castAdd l i) let lamAffine : Fin l := fun j => b (Fin.natAdd k j) rcases helperForTheorem_21_2_supportWeightedAffine_properConvex_and_dom C fAffine hAffine lamAffine with gSupport, hgSupport, hproperSupport, hdomSupport let fAug : Fin (k + 1) (Fin n ) EReal := Fin.append fStrict (fun _ x => ((gSupport x : ) : EReal)) let lAug : Fin (k + 1) := Fin.append lamStrict (fun _ : Fin 1 => (1 : )) have hlStrict_nonneg : i : Fin k, 0 lamStrict i := by intro i exact hb_nonneg (Fin.castAdd l i) have hlAffine_nonneg : j : Fin l, 0 lamAffine j := by intro j exact hb_nonneg (Fin.natAdd k j) have hfAug : q : Fin (k + 1), ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fAug q) := by intro q refine Fin.addCases ?_ ?_ q · intro i simpa [fAug] using hfStrict i · intro j have hj0 : j = (0 : Fin 1) := Subsingleton.elim j 0 subst hj0 simpa [fAug] using hproperSupport have hdomAug : q : Fin (k + 1), euclideanRelativeInterior_fin n C effectiveDomain (Set.univ : Set (Fin n )) (fAug q) := by intro q refine Fin.addCases ?_ ?_ q · intro i simpa [fAug] using hdomStrict i · intro j have hj0 : j = (0 : Fin 1) := Subsingleton.elim j 0 subst hj0 simpa [fAug] using hdomSupport have hriRealAug : x euclideanRelativeInterior_fin n C, 0 q : Fin (k + 1), lAug q * (fAug q x).toReal := by intro x hxri have hxC : x C := helperForTheorem_21_1_riFin_subset_C C hxri have hxDom : i : Fin k, x effectiveDomain (Set.univ : Set (Fin n )) (fStrict i) := by intro i exact hdomStrict i hxri let S : := i : Fin k, lamStrict i let F : := i : Fin k, lamStrict i * (fStrict i x).toReal + gSupport x have hF_nonneg : 0 F := by by_contra hFneg have hFltα : F < α := lt_of_not_ge (by linarith [hα_nonneg]) let ε : := (α - F) / (S + 1) have hS_nonneg : 0 S := by dsimp [S] exact Finset.sum_nonneg (by intro i hi exact hlStrict_nonneg i) have hS1_pos : 0 < S + 1 := by linarith have hε_pos : 0 < ε := by dsimp [ε] exact div_pos (by linarith) hS1_pos let z : Fin (k + l) := Fin.append (fun i : Fin k => (fStrict i x).toReal + ε) (fun j : Fin l => fAffine j x) have hz_mem : z C₁ := by refine x, hxC, ?_, ?_ · intro i have hneTop : fStrict i x ( : EReal) := mem_effectiveDomain_imp_ne_top (hxDom i) have hfinite_i : ConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i) Set.Nonempty (effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) x' effectiveDomain (Set.univ : Set (Fin n )) (fStrict i), fStrict i x' fStrict i x' := (properConvexFunctionOn_iff_effectiveDomain_nonempty_finite (Set.univ : Set (Fin n )) (fStrict i)).1 (hfStrict i) have hneBot : fStrict i x ( : EReal) := (hfinite_i.2.2 x (hxDom i)).1 have hreal : (fStrict i x).toReal < (fStrict i x).toReal + ε := by linarith have hrealE : (((fStrict i x).toReal : ) : EReal) < (((fStrict i x).toReal + ε : ) : EReal) := by exact_mod_cast hreal simpa [z, Fin.append, EReal.coe_toReal hneTop hneBot] using hrealE · intro j simp [z, Fin.append] have hsep_z : α z ⬝ᵥ b := hC₁_lower z hz_mem have hz_dot : z ⬝ᵥ b = i : Fin k, ((fStrict i x).toReal + ε) * lamStrict i + gSupport x := by rw [dotProduct, Fin.sum_univ_add] simp [z, lamStrict, lamAffine, hgSupport x, mul_comm, This simp argument is unused: mul_left_comm Hint: Omit it from the simp argument list. simp [z, lamStrict, lamAffine, hgSupport x, mul_comm, mul_l̵e̵f̵t̵_̵c̵o̵m̵m̵,̵ ̵m̵u̵l̵_̵assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_left_comm, This simp argument is unused: mul_assoc Hint: Omit it from the simp argument list. simp [z, lamStrict, lamAffine, hgSupport x, mul_comm, mul_left_comm,̵ ̵m̵u̵l̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_assoc] have hε_mul : ε * (S + 1) = α - F := by have hS1_ne : S + 1 0 := by linarith dsimp [ε] field_simp [hS1_ne] have hF_eps_lt : F + ε * S < α := by have hEq : F + ε * S = α - ε := by linarith rw [hEq] linarith have hsum_eq : i : Fin k, ((fStrict i x).toReal + ε) * lamStrict i + gSupport x = F + ε * S := by calc i : Fin k, ((fStrict i x).toReal + ε) * lamStrict i + gSupport x = ( i : Fin k, ((fStrict i x).toReal * lamStrict i + ε * lamStrict i)) + gSupport x := by refine congrArg (fun t : => t + gSupport x) ?_ refine Finset.sum_congr rfl ?_ intro i hi ring _ = ( i : Fin k, (fStrict i x).toReal * lamStrict i) + i : Fin k, ε * lamStrict i + gSupport x := by rw [Finset.sum_add_distrib] _ = ( i : Fin k, lamStrict i * (fStrict i x).toReal) + ( i : Fin k, ε * lamStrict i) + gSupport x := by congr 2 refine Finset.sum_congr rfl ?_ intro i hi ring _ = ( i : Fin k, lamStrict i * (fStrict i x).toReal) + ε * ( i : Fin k, lamStrict i) + gSupport x := by rw [Finset.mul_sum] _ = F + ε * S := by dsimp [F, S] ring have : α < α := by calc α z ⬝ᵥ b := hsep_z _ = i : Fin k, ((fStrict i x).toReal + ε) * lamStrict i + gSupport x := hz_dot _ = F + ε * S := hsum_eq _ < α := hF_eps_lt exact lt_irrefl _ this have hsum_eq : q : Fin (k + 1), lAug q * (fAug q x).toReal = F := by rw [Fin.sum_univ_add] simp [lAug, fAug, F, lamStrict, mul_comm, This simp argument is unused: mul_left_comm Hint: Omit it from the simp argument list. simp [lAug, fAug, F, lamStrict, mul_comm, mul_l̵e̵f̵t̵_̵c̵o̵m̵m̵,̵ ̵m̵u̵l̵_̵assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_left_comm, This simp argument is unused: mul_assoc Hint: Omit it from the simp argument list. simp [lAug, fAug, F, lamStrict, mul_comm, mul_left_comm,̵ ̵m̵u̵l̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_assoc] have : 0 F := hF_nonneg simpa [hsum_eq] have hriEAug : x euclideanRelativeInterior_fin n C, (0 : EReal) q : Fin (k + 1), ((lAug q : ) : EReal) * fAug q x := helperForTheorem_21_1_ri_real_certificate_to_ri_ereal_for_weightedSum C fAug hfAug hdomAug lAug hriRealAug have hCne : C.Nonempty := by rcases hAllShiftedPrimal 1 (by norm_num) with x, hxC, _hxStrict, _hxAffine exact x, hxC have hlAug_nonneg : q : Fin (k + 1), 0 lAug q := by intro q refine Fin.addCases ?_ ?_ q · intro i simpa [lAug] using hlStrict_nonneg i · intro j have hj0 : j = (0 : Fin 1) := Subsingleton.elim j 0 subst hj0 simp [lAug] have hglobalAug : x, x C (0 : EReal) q : Fin (k + 1), ((lAug q : ) : EReal) * fAug q x := helperForTheorem_21_1_promote_ri_ereal_certificate_to_C C hC hCne fAug hfAug hdomAug lAug hlAug_nonneg hriEAug have hglobal : x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal) := by intro x hxC have hgSupportE : ((gSupport x : ) : EReal) = j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal) := by calc ((gSupport x : ) : EReal) = ((( j : Fin l, lamAffine j * fAffine j x : ) : ) : EReal) := by rw [hgSupport x] _ = j : Fin l, (((lamAffine j * fAffine j x : ) : EReal)) := by exact helperForTheorem_21_1_coe_finset_sum_real (s := (Finset.univ : Finset (Fin l))) (g := fun j : Fin l => lamAffine j * fAffine j x) _ = j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal) := by refine Finset.sum_congr rfl ?_ intro j hj simp [EReal.coe_mul, This simp argument is unused: mul_assoc Hint: Omit it from the simp argument list. simp [EReal.coe_mul,̵ ̵m̵u̵l̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_assoc] have haug := hglobalAug x hxC rw [Fin.sum_univ_add] at haug simpa [lAug, fAug, lamStrict, hgSupportE, add_assoc] using haug have hStrict_nonzero : i : Fin k, lamStrict i 0 := by by_contra hNoStrict have hLamStrictZero : lamStrict = 0 := by funext i by_contra hi exact hNoStrict i, hi rcases hFeasRi with x0, hx0ri, hx0Affine have hx0C : x0 C := helperForTheorem_21_1_riFin_subset_C C hx0ri have hgSupport_nonneg_on_C : x, x C 0 gSupport x := by intro x hxC have hglob := hglobal x hxC have hgSupportE : ((gSupport x : ) : EReal) = j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal) := by calc ((gSupport x : ) : EReal) = ((( j : Fin l, lamAffine j * fAffine j x : ) : ) : EReal) := by rw [hgSupport x] _ = j : Fin l, (((lamAffine j * fAffine j x : ) : EReal)) := by exact helperForTheorem_21_1_coe_finset_sum_real (s := (Finset.univ : Finset (Fin l))) (g := fun j : Fin l => lamAffine j * fAffine j x) _ = j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal) := by refine Finset.sum_congr rfl ?_ intro j hj simp [EReal.coe_mul] have hglob' : (0 : EReal) ((gSupport x : ) : EReal) := by calc (0 : EReal) j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal) := by simpa [hLamStrictZero] using hglob _ = ((gSupport x : ) : EReal) := hgSupportE.symm simpa using hglob' have hgSupport_nonpos_x0 : gSupport x0 0 := by rw [hgSupport x0] refine Finset.sum_nonpos ?_ intro j hj exact mul_nonpos_of_nonneg_of_nonpos (hlAffine_nonneg j) (hx0Affine j) have hgSupport_x0_eq : gSupport x0 = 0 := le_antisymm hgSupport_nonpos_x0 (hgSupport_nonneg_on_C x0 hx0C) have hgSupport_zero_on_C : x, x C gSupport x = 0 := helperForTheorem_21_2_affine_nonneg_on_C_and_zero_at_ri_forces_zero_on_C C x0 hx0ri gSupport hgSupport_nonneg_on_C hgSupport_x0_eq have hα_le_zero : α 0 := by rcases hC₁ne with z0, hz0mem have hz0mem' : z0 C₁ := hz0mem rcases hz0mem with x, hxC, _hxStrict, hxAffineEq have hb_strict_zero : i : Fin k, b (Fin.castAdd l i) = 0 := by intro i simpa [lamStrict] using congrArg (fun f : Fin k => f i) hLamStrictZero have hz0_dot_zero : z0 ⬝ᵥ b = 0 := by rw [dotProduct, Fin.sum_univ_add] have hstrict : i : Fin k, z0 (Fin.castAdd l i) * b (Fin.castAdd l i) = 0 := by refine Finset.sum_eq_zero ?_ intro i hi simp [hb_strict_zero i] have haff : j : Fin l, z0 (Fin.natAdd k j) * b (Fin.natAdd k j) = 0 := by calc j : Fin l, z0 (Fin.natAdd k j) * b (Fin.natAdd k j) = j : Fin l, lamAffine j * fAffine j x := by refine Finset.sum_congr rfl ?_ intro j hj rw [ hxAffineEq j] simp [lamAffine, mul_comm] _ = gSupport x := by rw [hgSupport x] _ = 0 := hgSupport_zero_on_C x hxC simpa [hstrict, haff] exact by calc α z0 ⬝ᵥ b := hC₁_lower z0 hz0mem' _ = 0 := hz0_dot_zero have hα_eq_zero : α = 0 := le_antisymm hα_le_zero hα_nonneg have hC₁_subsetH : C₁ H := by intro z hz rcases hz with x, hxC, _hxStrict, hxAffineEq rw [hHdef] have hb_strict_zero : i : Fin k, b (Fin.castAdd l i) = 0 := by intro i simpa [lamStrict] using congrArg (fun f : Fin k => f i) hLamStrictZero have hz_dot_zero : z ⬝ᵥ b = 0 := by rw [dotProduct, Fin.sum_univ_add] have hstrict : i : Fin k, z (Fin.castAdd l i) * b (Fin.castAdd l i) = 0 := by refine Finset.sum_eq_zero ?_ intro i hi simp [hb_strict_zero i] have haff : j : Fin l, z (Fin.natAdd k j) * b (Fin.natAdd k j) = 0 := by calc j : Fin l, z (Fin.natAdd k j) * b (Fin.natAdd k j) = j : Fin l, lamAffine j * fAffine j x := by refine Finset.sum_congr rfl ?_ intro j hj rw [ hxAffineEq j] simp [lamAffine, mul_comm] _ = gSupport x := by rw [hgSupport x] _ = 0 := hgSupport_zero_on_C x hxC simpa [hstrict, haff] simpa [hα_eq_zero] using hz_dot_zero exact hC₁_not_subsetH hC₁_subsetH exact lamStrict, lamAffine, hlStrict_nonneg, hlAffine_nonneg, hStrict_nonzero, hglobal

Helper for Theorem 21.2: external dependency-level Section 20 / Corollary 7.3.3 bridge in the all-shifted branch, returning the contradiction callback Unknown identifier `support_nonneg_on_U` (a : sorry), 0 sorry False : Propsupport_nonneg_on_U (0 Unknown identifier `U`U False) needed by the local proof.

lemma helperForTheorem_21_2_missing_dependencyLevelBridge_supportNonneg_zeroNotMemU_in_allShifted_context {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (_hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (_hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (_hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) (_hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) (_hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (_hUconv : Convex U) (_hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (_hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (hExternalDependencyBridge : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False) : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False := by -- Route correction: this declaration is a pure adapter from an explicit -- dependency-level bridge to the local callback shape used downstream. exact helperForTheorem_21_2_dependencyBridge_supportNonneg_zeroNotMemU_in_allShifted_context C fStrict fAffine U _hU_def _hFeasRi _hAllShiftedPrimal _hNotPrimal _hzeroMemClosureU _hUconv _hUupper lamAffineSupport _hlamAffineSupport_nonneg hExternalDependencyBridge

Helper for Theorem 21.2: external closure/support bridge needed in the all-shifted primal branch, upgrading support nonnegativity on Unknown identifier `U`U to stuck at solving universe constraint ?u.4100323+1 =?= max 1 ?u.4100328 while trying to unify ?m.4 : Sort (max 1 ?u.4100328) with ?m.4 : Sort (max 1 ?u.4100328)(fun _ => 0) Unknown identifier `U`U under the boundary-data geometry assumptions.

lemma helperForTheorem_21_2_supportNonneg_on_U_implies_zeroMemU_externalBridge {l : } (U : Set (Fin l )) (_hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (_hUconv : Convex U) (_hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (hSupport_nonneg_on_U : u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) (hSupportNonneg_to_zeroMemU : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) (fun _ : Fin l => (0 : )) U) : (fun _ : Fin l => (0 : )) U := by -- Route correction: isolate the unresolved dependency as a standalone bridge statement -- so the main all-shifted proof uses a single call site. -- First register the closure-at-zero inequality derivable from continuity. have hSupportAtZero : 0 j : Fin l, lamAffineSupport j * (fun _ : Fin l => (0 : )) j := helperForTheorem_21_2_support_nonneg_at_zero_of_zeroMemClosure U lamAffineSupport _hzeroMemClosureU hSupport_nonneg_on_U have _hSupportAtZeroReal : (0 : ) 0 := by simpa using hSupportAtZero -- Route correction: the actual geometric upgrade is supplied explicitly as an external -- dependency-level bridge (Section 20 / Corollary 7.3.3 specialization). exact hSupportNonneg_to_zeroMemU hSupport_nonneg_on_U

Helper for Theorem 21.2: missing Section 20 / Corollary 7.3.3 specialization in the all-shifted boundary-data context, upgrading support nonnegativity on Unknown identifier `U`U to stuck at solving universe constraint ?u.4101122+1 =?= max 1 ?u.4101127 while trying to unify ?m.4 : Sort (max 1 ?u.4101127) with ?m.4 : Sort (max 1 ?u.4101127)(fun _ => 0) Unknown identifier `U`U.

lemma helperForTheorem_21_2_section20Specialization_supportNonneg_to_zeroMemU_in_allShifted_context {n k l : } (_C : Set (Fin n )) (_fStrict : Fin k (Fin n ) EReal) (_fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (_hU_def : U = {u : Fin l | x, x _C ( i : Fin k, _fStrict i x < (0 : EReal)) ( j : Fin l, _fAffine j x u j)}) (_hFeasRi : x, x euclideanRelativeInterior_fin n _C j : Fin l, _fAffine j x 0) (_hAllShiftedPrimal : ε : , 0 < ε x, x _C ( i : Fin k, _fStrict i x < (0 : EReal)) ( j : Fin l, _fAffine j x < ε)) (_hNotPrimal : ¬ ( x, x _C ( i : Fin k, _fStrict i x < (0 : EReal)) ( j : Fin l, _fAffine j x 0))) (_hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (_hUconv : Convex U) (_hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (_hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (hExternalDependencyBridge : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False) : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) (fun _ : Fin l => (0 : )) U := by intro hSupport_nonneg_on_U -- Route correction: isolate the only unresolved dependency as a negative-witness bridge -- callback, then consume it via a pure contradiction helper. have hzeroNotMemU_to_existsNegativeSupportWitness : ((fun _ : Fin l => (0 : )) U) u : Fin l , u U ( j : Fin l, lamAffineSupport j * u j) < 0 := by intro hzeroNotMemU exact helperForTheorem_21_2_allShifted_zeroNotMemU_implies_exists_negative_support_witness_dependencyBridge _C _fStrict _fAffine U _hU_def _hFeasRi _hAllShiftedPrimal _hNotPrimal _hzeroMemClosureU _hUconv _hUupper lamAffineSupport _hlamAffineSupport_nonneg hExternalDependencyBridge hzeroNotMemU -- Route correction: factor the negative-witness bridge through a contradiction callback -- and then curry it to a direct `support_nonneg_on_U → 0 ∈ U` callback. have hSupportNonneg_zeroNotMemU_contradiction : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False := helperForTheorem_21_2_supportNonneg_zeroNotMemU_contradiction_of_negative_support_witness_bridge U lamAffineSupport hzeroNotMemU_to_existsNegativeSupportWitness exact helperForTheorem_21_2_supportNonneg_to_zeroMemU_of_zeroNotMemU_contradictionBridge U lamAffineSupport hSupportNonneg_zeroNotMemU_contradiction hSupport_nonneg_on_U

Helper for Theorem 21.2: compose the all-shifted Section 20 specialization Unknown identifier `support_nonneg_on_U`stuck at solving universe constraint ?u.4101919+1 =?= max 1 ?u.4102031 while trying to unify ?m.4 : Sort (max 1 ?u.4102031) with ?m.4 : Sort (max 1 ?u.4102031)support_nonneg_on_U (fun _ => 0) Unknown identifier `U`U into the contradiction callback Unknown identifier `support_nonneg_on_U`stuck at solving universe constraint ?u.4102927+1 =?= max 1 ?u.4102932 while trying to unify ?m.4 : Sort (max 1 ?u.4102932) with ?m.4 : Sort (max 1 ?u.4102932)support_nonneg_on_U ((fun _ => 0) Unknown identifier `U`U False) used by local adapters.

lemma helperForTheorem_21_2_externalDependencyBridge_from_section20_specialization_in_allShifted_context {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (_hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (_hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (_hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) (_hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) (_hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (_hUconv : Convex U) (_hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (_hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (hSection20Specialization : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) (fun _ : Fin l => (0 : )) U) : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False := by -- Route correction: first convert membership callback to contradiction callback. have hExternalDependencyBridge : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False := helperForTheorem_21_2_supportNonneg_zeroNotMemU_contradictionCallback_of_zeroMemU_callback U lamAffineSupport hSection20Specialization -- Then expose it in the exact all-shifted adapter shape consumed downstream. exact helperForTheorem_21_2_missing_dependencyLevelBridge_supportNonneg_zeroNotMemU_in_allShifted_context C fStrict fAffine U _hU_def _hFeasRi _hAllShiftedPrimal _hNotPrimal _hzeroMemClosureU _hUconv _hUupper lamAffineSupport _hlamAffineSupport_nonneg hExternalDependencyBridge

Helper for Theorem 21.2: in the boundary-data setup, transport support nonnegativity from Unknown identifier `C`C to Unknown identifier `U`U and then apply the external closure/support callback to conclude 0 sorry : Prop0 Unknown identifier `U`U.

lemma helperForTheorem_21_2_zeroMemU_of_boundaryData_support_nonneg_and_externalCallback {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (hUconv : Convex U) (hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (gSupport : (Fin n ) →ᵃ[] ) (hgSupport : x : Fin n , gSupport x = j : Fin l, lamAffineSupport j * fAffine j x) (hgSupport_nonneg_on_C : x, x C 0 gSupport x) (hSupportNonneg_to_zeroMemU : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) (fun _ : Fin l => (0 : )) U) : (fun _ : Fin l => (0 : )) U := by -- Route correction: keep the unresolved dependency isolated to a callback argument, -- and fully discharge the deterministic transport/application steps here. have hSupport_nonneg_on_U : u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j := helperForTheorem_21_2_boundaryData_support_nonneg_on_U C fStrict fAffine U hU_def lamAffineSupport hlamAffineSupport_nonneg gSupport hgSupport hgSupport_nonneg_on_C -- Apply the external closure-support bridge at this single adapter site. exact helperForTheorem_21_2_supportNonneg_on_U_implies_zeroMemU_externalBridge U hzeroMemClosureU hUconv hUupper lamAffineSupport hSupport_nonneg_on_U hSupportNonneg_to_zeroMemU

Helper for Theorem 21.2: in the all-shifted boundary-data context, once an external Section 20 / Corollary 7.3.3 contradiction bridge is provided, any global nonnegativity witness for Unknown identifier `gSupport`gSupport on Unknown identifier `C`C yields stuck at solving universe constraint ?u.4104629+1 =?= max 1 ?u.4104634 while trying to unify ?m.4 : Sort (max 1 ?u.4104634) with ?m.4 : Sort (max 1 ?u.4104634)(fun _ => 0) Unknown identifier `U`U.

lemma helperForTheorem_21_2_zeroMemU_of_gSupport_nonneg_on_C_and_externalDependencyBridge_in_allShifted_context {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) (hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) (hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (hUconv : Convex U) (hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (gSupport : (Fin n ) →ᵃ[] ) (hgSupport : x : Fin n , gSupport x = j : Fin l, lamAffineSupport j * fAffine j x) (hExternalDependencyBridge : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False) : ( x, x C 0 gSupport x) (fun _ : Fin l => (0 : )) U := by intro hgSupport_nonneg_on_C -- Route correction: keep the dependency-level callback explicit, and discharge the -- deterministic local transport/adaptation steps in one reusable helper. have hSupportNonneg_zeroNotMemU_contradiction : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False := by intro hSupport_nonneg_on_U hzeroNotMemU have hDependencyBridge : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False := helperForTheorem_21_2_affineOnly_localDependencyBridge_of_external_in_allShifted_context C fStrict fAffine U hU_def hFeasRi hAllShiftedPrimal hNotPrimal hzeroMemClosureU hUconv hUupper lamAffineSupport hlamAffineSupport_nonneg hExternalDependencyBridge -- Specialize the dependency bridge at the current support and temporary non-membership. exact helperForTheorem_21_2_supportNonneg_zeroNotMemU_contradiction_of_dependencyBridge_in_allShifted_context C fStrict fAffine U hU_def hFeasRi hAllShiftedPrimal hNotPrimal hzeroMemClosureU hUconv hUupper lamAffineSupport hlamAffineSupport_nonneg hDependencyBridge hSupport_nonneg_on_U hzeroNotMemU have hSupportNonneg_to_zeroMemU : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) (fun _ : Fin l => (0 : )) U := by -- Curry the contradiction callback into a direct membership callback. exact helperForTheorem_21_2_supportNonneg_to_zeroMemU_of_zeroNotMemU_contradictionBridge U lamAffineSupport hSupportNonneg_zeroNotMemU_contradiction -- Finish by transporting nonnegativity from `C` to `U` and applying the callback. exact helperForTheorem_21_2_zeroMemU_of_boundaryData_support_nonneg_and_externalCallback C fStrict fAffine U hU_def hzeroMemClosureU hUconv hUupper lamAffineSupport hlamAffineSupport_nonneg gSupport hgSupport hgSupport_nonneg_on_C hSupportNonneg_to_zeroMemU

Helper for Theorem 21.2: dependency-level Section 20 / Corollary 7.3.3 bridge in the all-shifted boundary-data context.

This is the exact local contradiction form needed in the Unknown identifier `muStrict`sorry = 0 : PropmuStrict = 0 branch: if the support-weighted affine sum is nonnegative on all of Unknown identifier `C`C, then 0 sorry : Prop0 Unknown identifier `U`U is impossible.

lemma helperForTheorem_21_2_section20Bridge_allShifted_gSupportNonnegOnC_contradiction {n k l : } (C : Set (Fin n )) (fStrict : Fin k (Fin n ) EReal) (fAffine : Fin l (Fin n ) ) (U : Set (Fin l )) (hU_def : U = {u : Fin l | x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x u j)}) (hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) (hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) (hzeroMemClosureU : (fun _ : Fin l => (0 : )) closure U) (hUconv : Convex U) (hUupper : {u v : Fin l }, u U ( j : Fin l, u j v j) v U) (lamAffineSupport : Fin l ) (hlamAffineSupport_nonneg : j : Fin l, 0 lamAffineSupport j) (gSupport : (Fin n ) →ᵃ[] ) (hgSupport : x : Fin n , gSupport x = j : Fin l, lamAffineSupport j * fAffine j x) (hExternalDependencyBridge : ( u : Fin l , u U 0 j : Fin l, lamAffineSupport j * u j) ((fun _ : Fin l => (0 : )) U) False) (hgSupport_nonneg_on_C : x, x C 0 j : Fin l, lamAffineSupport j * fAffine j x) (hzeroNotMemU : (fun _ : Fin l => (0 : )) U) : False := by -- Consume the external dependency-level bridge as a callback to deduce `0 ∈ U`, -- then contradict the temporary non-membership premise. have hzeroMemU : (fun _ : Fin l => (0 : )) U := helperForTheorem_21_2_zeroMemU_of_gSupport_nonneg_on_C_and_externalDependencyBridge_in_allShifted_context C fStrict fAffine U hU_def hFeasRi hAllShiftedPrimal hNotPrimal hzeroMemClosureU hUconv hUupper lamAffineSupport hlamAffineSupport_nonneg gSupport hgSupport hExternalDependencyBridge (by intro x hxC simpa [hgSupport x] using hgSupport_nonneg_on_C x hxC) exact hzeroNotMemU hzeroMemU

Helper for Theorem 21.2: if all positive shifts admit shifted-primal points but the target primal is false, closure/separation (Corollary 7.3.3 + Theorem 20.2 route) should produce a target dual certificate.

lemma helperForTheorem_21_2_all_shifted_primal_to_target_dual_via_closure_and_theorem20_2 {n k l : } (C : Set (Fin n )) (hC : Convex C) (fStrict : Fin k (Fin n ) EReal) (hfStrict : i : Fin k, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i)) (hdomStrict : i : Fin k, euclideanRelativeInterior_fin n C effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) (fAffine : Fin l (Fin n ) ) (hAffine : j : Fin l, g : (Fin n ) →ᵃ[] , fAffine j = g) (hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) (hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε)) : lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) ( i : Fin k, lamStrict i 0) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal)) := by exact helperForTheorem_21_2_targetDual_of_allShiftedPrimal_via_direct_theorem20_2_route C hC fStrict hfStrict hdomStrict fAffine hAffine hFeasRi hAllShiftedPrimal hNotPrimal

Helper for Theorem 21.2: in the branch ¬sorry : Prop¬Unknown identifier `targetPrimal`targetPrimal and 0 < sorry + sorry : Prop0 < Unknown identifier `k`k+Unknown identifier `l`l, either obtain one shifted dual witness and convert it, or use the all-shifted-primal closure route.

lemma helperForTheorem_21_2_notPrimal_branch_dual_exists {n k l : } (C : Set (Fin n )) (hC : Convex C) (hklPos : 0 < k + l) (fStrict : Fin k (Fin n ) EReal) (hfStrict : i : Fin k, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i)) (hdomStrict : i : Fin k, euclideanRelativeInterior_fin n C effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) (fAffine : Fin l (Fin n ) ) (hAffine : j : Fin l, g : (Fin n ) →ᵃ[] , fAffine j = g) (hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) (hNotPrimal : ¬ ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0))) : lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) ( i : Fin k, lamStrict i 0) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal)) := by -- Route correction: split on existence of one shifted-dual witness instead of forcing it. by_cases hSomeShiftedDual : ε : , 0 < ε ( lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) (( i : Fin k, lamStrict i 0) ( j : Fin l, lamAffine j 0)) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * (((fAffine j x - ε : ) : EReal)))) · rcases hSomeShiftedDual with ε, , hShiftedDual exact helperForTheorem_21_2_shifted_dual_to_target_dual_with_strict_nonzero C fStrict fAffine hFeasRi ε hShiftedDual · have hAllShiftedPrimal : ε : , 0 < ε x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x < ε) := by intro ε have hAlt := helperForTheorem_21_2_shifted_appended_alternative C hC hklPos fStrict hfStrict hdomStrict fAffine hAffine ε rw [xor_def] at hAlt rcases hAlt with hAlt | hAlt · exact hAlt.1 · have hShiftedDual : lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) (( i : Fin k, lamStrict i 0) ( j : Fin l, lamAffine j 0)) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * (((fAffine j x - ε : ) : EReal))) := hAlt.1 have hSomeShiftedDual' : ε : , 0 < ε ( lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) (( i : Fin k, lamStrict i 0) ( j : Fin l, lamAffine j 0)) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * (((fAffine j x - ε : ) : EReal)))) := ε, , hShiftedDual exact False.elim (hSomeShiftedDual hSomeShiftedDual') exact helperForTheorem_21_2_all_shifted_primal_to_target_dual_via_closure_and_theorem20_2 C hC fStrict hfStrict hdomStrict fAffine hAffine hFeasRi hNotPrimal hAllShiftedPrimal
-- Proof sketch: apply the strict/weak alternative machinery from Theorem 21.1 to -- shifted affine constraints, then combine closure/separation arguments (via Theorem 20.2) -- to derive a dual certificate exactly when the primal strict-feasibility branch fails.

Theorem 21.2: Let Unknown identifier `C`C be convex, let be proper convex functions with Unknown identifier `dom`sorry sorry : Propdom fᵢ Unknown identifier `ri`ri C, and let be affine functions such that has a solution in Unknown identifier `ri`ri C. Then exactly one alternative holds: (a) there exists Unknown identifier `x`sorry sorry : Propx Unknown identifier `C`C with and ; or (b) there are nonnegative multipliers, with at least one multiplier in the first block nonzero, such that the weighted sum is nonnegative on all of Unknown identifier `C`C.

theorem theorem21_mixed_convex_affine_alternative {n k l : } (C : Set (Fin n )) (hC : Convex C) (fStrict : Fin k (Fin n ) EReal) (hfStrict : i : Fin k, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fStrict i)) (hdomStrict : i : Fin k, euclideanRelativeInterior_fin n C effectiveDomain (Set.univ : Set (Fin n )) (fStrict i)) (fAffine : Fin l (Fin n ) ) (hAffine : j : Fin l, g : (Fin n ) →ᵃ[] , fAffine j = g) (hFeasRi : x, x euclideanRelativeInterior_fin n C j : Fin l, fAffine j x 0) : Xor' ( x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0)) ( lamStrict : Fin k , lamAffine : Fin l , ( i : Fin k, 0 lamStrict i) ( j : Fin l, 0 lamAffine j) ( i : Fin k, lamStrict i 0) ( x, x C (0 : EReal) ( i : Fin k, ((lamStrict i : ) : EReal) * fStrict i x) + j : Fin l, ((lamAffine j : ) : EReal) * ((fAffine j x : ) : EReal))) := by -- Route correction: split first on primal feasibility; then use the dedicated -- branch lemma for `¬primal`, with a separate `k + l = 0` contradiction branch. rw [xor_def] by_cases hPrimal : x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0) · left refine hPrimal, ?_ -- Any candidate dual certificate contradicts the strict primal witness. intro hDual exact helperForTheorem_21_2_primal_dual_mutual_exclusion C fStrict fAffine hPrimal hDual · right refine ?_, hPrimal -- If `k + l > 0`, invoke the full `¬primal` branch argument. by_cases hklPos : 0 < k + l · exact helperForTheorem_21_2_notPrimal_branch_dual_exists C hC hklPos fStrict hfStrict hdomStrict fAffine hAffine hFeasRi hPrimal · -- If `k + l = 0`, the `ri`-feasible affine witness already gives primal feasibility, -- contradicting `hPrimal`. have hklZero : k + l = 0 := Nat.eq_zero_of_not_pos hklPos have hPrimalFromNoIndices : x, x C ( i : Fin k, fStrict i x < (0 : EReal)) ( j : Fin l, fAffine j x 0) := helperForTheorem_21_2_primal_of_no_indices C fStrict fAffine hFeasRi hklZero exact False.elim (hPrimal hPrimalFromNoIndices)

Theorem 21.3 geometry shell

Helper for Theorem 21.3: the nonpositive sublevel set of a closed proper convex function on is closed and convex.

lemma helperForTheorem_21_3_nonpositiveSublevel_closed_convex {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) : IsClosed {x : Fin n | f x (0 : EReal)} Convex {x : Fin n | f x (0 : EReal)} := by have hclosed_epi : IsClosed (epigraph (S := (Set.univ : Set (Fin n ))) f) := by have hepigraph_univ : epigraph (S := (Set.univ : Set (Fin n ))) f = {p : (Fin n ) × | f p.1 (p.2 : EReal)} := by ext p constructor · intro hp exact hp.2 · intro hp exact by trivial, hp simpa [hepigraph_univ] using hfClosed have hclosed_real_sublevel : α : , IsClosed {x : Fin n | f x (α : EReal)} := closed_sublevel_of_closed_epigraph (f := f) hclosed_epi have hlsc : LowerSemicontinuous f := (lowerSemicontinuous_iff_closed_sublevel (f := f)).2 hclosed_real_sublevel have hclosed_sublevel : IsClosed ((f) ⁻¹' Set.Iic (0 : EReal)) := (lowerSemicontinuous_iff_isClosed_preimage (f := f)).1 hlsc (0 : EReal) have hconv : ConvexFunction f := by simpa [ConvexFunctionOn] using hfProper.1 have hconv_sublevel : Convex ((f) ⁻¹' Set.Iic (0 : EReal)) := (convexFunction_level_sets_convex (f := f) hconv (α := (0 : EReal))).2 constructor · simpa [Set.preimage, Set.Iic] using hclosed_sublevel · simpa [Set.preimage, Set.Iic] using hconv_sublevel

Helper for Theorem 21.3: every real sublevel set of a closed proper convex function on is closed and convex. This is the level-Unknown identifier `α`α version used in the shifted-shell route.

lemma helperForTheorem_21_3_sublevel_closed_convex {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) (α : ) : IsClosed {x : Fin n | f x (α : EReal)} Convex {x : Fin n | f x (α : EReal)} := by have hclosed_epi : IsClosed (epigraph (S := (Set.univ : Set (Fin n ))) f) := by have hepigraph_univ : epigraph (S := (Set.univ : Set (Fin n ))) f = {p : (Fin n ) × | f p.1 (p.2 : EReal)} := by ext p constructor · intro hp exact hp.2 · intro hp exact by trivial, hp simpa [hepigraph_univ] using hfClosed have hclosed_real_sublevel : β : , IsClosed {x : Fin n | f x (β : EReal)} := closed_sublevel_of_closed_epigraph (f := f) hclosed_epi have hlsc : LowerSemicontinuous f := (lowerSemicontinuous_iff_closed_sublevel (f := f)).2 hclosed_real_sublevel have hclosed_sublevel : IsClosed ((f) ⁻¹' Set.Iic (α : EReal)) := (lowerSemicontinuous_iff_isClosed_preimage (f := f)).1 hlsc (α : EReal) have hconv : ConvexFunction f := by simpa [ConvexFunctionOn] using hfProper.1 have hconv_sublevel : Convex ((f) ⁻¹' Set.Iic (α : EReal)) := (convexFunction_level_sets_convex (f := f) hconv (α := (α : EReal))).2 constructor · simpa [Set.preimage, Set.Iic] using hclosed_sublevel · simpa [Set.preimage, Set.Iic] using hconv_sublevel

Helper for Theorem 21.3: intersecting Unknown identifier `C`C with one nonpositive sublevel preserves closedness and convexity.

lemma helperForTheorem_21_3_inter_nonpositiveSublevel_closed_convex {n : } {I : Type*} (C : Set (Fin n )) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (i : I) : IsClosed (C {x : Fin n | f i x (0 : EReal)}) Convex (C {x : Fin n | f i x (0 : EReal)}) := by rcases helperForTheorem_21_3_nonpositiveSublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) with hsub_closed, hsub_convex exact hCclosed.inter hsub_closed, hCconvex.inter hsub_convex

Helper for Theorem 21.3: a proper convex function on Unknown identifier `univ`univ can be viewed as a proper convex EReal : TypeEReal-valued function in the Section 14 recession-function API.

lemma helperForTheorem_21_3_properConvexEReal_of_properConvexFunctionOn_univ {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) : ProperConvexERealFunction (F := (Fin n )) f := by refine ?_, ?_ · constructor · intro x exact hfProper.2.2 x (by simp) · rcases hfProper.2.1 with p, hp refine p.1, ?_ exact ne_of_lt (lt_of_le_of_lt hp.2 (by simp)) · intro x y a b ha hb hab have hnotbot : z : Fin n , f z ( : EReal) := by intro z exact hfProper.2.2 z (by simp) let w : Fin 2 := fun i => Fin.cases a (fun _ => b) i let z : Fin 2 Fin n := fun i => Fin.cases x (fun _ => y) i have hw : i : Fin 2, 0 w i := by intro i fin_cases i · simpa [w] using ha · simpa [w] using hb have hsumw : Finset.univ.sum (fun i : Fin 2 => w i) = 1 := by simpa [w, Fin.sum_univ_two] using hab have hjensen := jensen_inequality_of_convexFunctionOn_univ (f := f) hfProper.1 hnotbot 2 w z hw hsumw simpa [w, z, Fin.sum_univ_two, add_comm, add_left_comm, add_assoc] using hjensen

Helper for Theorem 21.3: closed epigraph implies lower semicontinuity.

lemma helperForTheorem_21_3_lowerSemicontinuous_of_closedEpigraph {n : } (f : (Fin n ) EReal) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) : LowerSemicontinuous f := by have hclosed_epi : IsClosed (epigraph (S := (Set.univ : Set (Fin n ))) f) := by have hepigraph_univ : epigraph (S := (Set.univ : Set (Fin n ))) f = {p : (Fin n ) × | f p.1 (p.2 : EReal)} := by ext p constructor · intro hp exact hp.2 · intro hp exact by trivial, hp simpa [hepigraph_univ] using hfClosed have hclosed_real_sublevel : α : , IsClosed {x : Fin n | f x (α : EReal)} := closed_sublevel_of_closed_epigraph (f := f) hclosed_epi exact (lowerSemicontinuous_iff_closed_sublevel (f := f)).2 hclosed_real_sublevel

Helper for Theorem 21.3: a proper convex function on Unknown identifier `univ`univ has a nonempty real sublevel.

lemma helperForTheorem_21_3_exists_nonempty_real_sublevel {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) : α : , ({x : Fin n | f x (α : EReal)} : Set (Fin n )).Nonempty := by rcases hfProper.2.1 with p, hp refine p.2, p.1, ?_ simpa using hp.2

Helper for Theorem 21.3: for closed proper convex data, recessionConeEReal.{u_2} {F : Type u_2} [AddCommGroup F] (f : F EReal) : Set FrecessionConeEReal coincides with the recession cone of some nonempty real sublevel set.

lemma helperForTheorem_21_3_recessionConeEReal_eq_recessionCone_some_nonempty_sublevel {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) : α : , ({x : Fin n | f x (α : EReal)} : Set (Fin n )).Nonempty recessionConeEReal (F := (Fin n )) f = Set.recessionCone {x : Fin n | f x (α : EReal)} := by rcases helperForTheorem_21_3_exists_nonempty_real_sublevel f hfProper with α, hα_nonempty have hfProperEReal : ProperConvexERealFunction (F := (Fin n )) f := helperForTheorem_21_3_properConvexEReal_of_properConvexFunctionOn_univ (f := f) hfProper have hlsc : LowerSemicontinuous f := helperForTheorem_21_3_lowerSemicontinuous_of_closedEpigraph f hfClosed refine α, hα_nonempty, Set.Subset.antisymm ?_ ?_ · exact section14_recessionConeEReal_subset_recessionCone_sublevel (E := (Fin n )) (f := f) hfProperEReal.2 (α := α) · exact section14_recessionCone_sublevel_subset_recessionConeEReal (E := (Fin n )) (f := f) hfProperEReal hlsc (α := α) hα_nonempty

Helper for Theorem 21.3: recessionConeEReal.{u_2} {F : Type u_2} [AddCommGroup F] (f : F EReal) : Set FrecessionConeEReal is closed in finite dimensions for closed proper convex data.

lemma helperForTheorem_21_3_recessionConeEReal_isClosed_fin {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) : IsClosed (recessionConeEReal (F := (Fin n )) f) := by rcases helperForTheorem_21_3_recessionConeEReal_eq_recessionCone_some_nonempty_sublevel f hfProper hfClosed with α, _hα_nonempty, hEq rw [hEq] let e := EuclideanSpace.equiv (Fin n) let S' : Set (EuclideanSpace (Fin n)) := e.symm '' {x : Fin n | f x (α : EReal)} have hS'closed : IsClosed S' := by simpa [S'] using (Homeomorph.isClosed_image e.symm.toHomeomorph).2 ((helperForTheorem_21_3_sublevel_closed_convex (f := f) (hfProper := hfProper) (hfClosed := hfClosed) (α := α)).1) have hRecS'closed : IsClosed (Set.recessionCone S') := recessionCone_isClosed_of_closed (C := S') hS'closed have hImageS : e '' S' = ({x : Fin n | f x (α : EReal)} : Set (Fin n )) := by ext x constructor · intro hx rcases hx with y, hy, hyx rcases hy with z, hz, hyz have hzEq : z = x := by calc z = e (e.symm z) := by simp _ = e y := by simpa [hyz] _ = x := hyx simpa [hzEq] using hz · intro hx refine e.symm x, ?_, ?_ · exact x, hx, by simp · simp have hRecEq : Set.recessionCone ({x : Fin n | f x (α : EReal)} : Set (Fin n )) = e '' Set.recessionCone S' := by have hEq' := recessionCone_image_linearEquiv (e := e.toLinearEquiv) (C := S') simpa [hImageS] using hEq' rw [hRecEq] exact (Homeomorph.isClosed_image e.toHomeomorph).2 hRecS'closed

Helper for Theorem 21.3: a recession direction of the nonpositive sublevel set of a closed proper convex function makes every ray nonincreasing.

lemma helperForTheorem_21_3_nonpositiveSublevel_ray_antitone {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) (hsub_nonempty : ({x : Fin n | f x (0 : EReal)} : Set (Fin n )).Nonempty) {d : Fin n } (hd : d Set.recessionCone {x : Fin n | f x (0 : EReal)}) : x : Fin n , t : , 0 t f (x + t d) f x := by have hclosed_epi : IsClosed (epigraph (S := (Set.univ : Set (Fin n ))) f) := by have hepigraph_univ : epigraph (S := (Set.univ : Set (Fin n ))) f = {p : (Fin n ) × | f p.1 (p.2 : EReal)} := by ext p constructor · intro hp exact hp.2 · intro hp exact by trivial, hp simpa [hepigraph_univ] using hfClosed have hclosed_real_sublevel : α : , IsClosed {x : Fin n | f x (α : EReal)} := closed_sublevel_of_closed_epigraph (f := f) hclosed_epi have hlsc : LowerSemicontinuous f := (lowerSemicontinuous_iff_closed_sublevel (f := f)).2 hclosed_real_sublevel have hfProperEReal : ProperConvexERealFunction (F := (Fin n )) f := helperForTheorem_21_3_properConvexEReal_of_properConvexFunctionOn_univ (f := f) hfProper intro x t ht by_cases ht0 : t = 0 · simpa [ht0] have htd : t d Set.recessionCone {x : Fin n | f x (0 : EReal)} := smul_mem_recessionCone_of_mem hd ht have htd_recFun : t d recessionConeEReal (F := (Fin n )) f := section14_recessionCone_sublevel_subset_recessionConeEReal (E := (Fin n )) (f := f) hfProperEReal hlsc hsub_nonempty htd by_cases hxdom : x erealDom f · exact (section14_step_le_of_mem_recessionCone (g := f) htd_recFun hxdom).1 · have hx_top : f x = ( : EReal) := by by_contra hxtop exact hxdom ((lt_top_iff_ne_top).2 hxtop) simpa [hx_top] using (le_top : f (x + t d) ( : EReal))

Helper for Theorem 21.3: a recession direction of any nonempty real sublevel set of a closed proper convex function makes every ray nonincreasing. This is the shifted-level version needed for Unknown identifier `ε`ε-shell arguments.

lemma helperForTheorem_21_3_sublevel_ray_antitone {n : } (f : (Fin n ) EReal) (hfProper : ProperConvexFunctionOn (Set.univ : Set (Fin n )) f) (hfClosed : IsClosed {p : (Fin n ) × | f p.1 (p.2 : EReal)}) (α : ) (hsub_nonempty : ({x : Fin n | f x (α : EReal)} : Set (Fin n )).Nonempty) {d : Fin n } (hd : d Set.recessionCone {x : Fin n | f x (α : EReal)}) : x : Fin n , t : , 0 t f (x + t d) f x := by have hclosed_epi : IsClosed (epigraph (S := (Set.univ : Set (Fin n ))) f) := by have hepigraph_univ : epigraph (S := (Set.univ : Set (Fin n ))) f = {p : (Fin n ) × | f p.1 (p.2 : EReal)} := by ext p constructor · intro hp exact hp.2 · intro hp exact by trivial, hp simpa [hepigraph_univ] using hfClosed have hclosed_real_sublevel : β : , IsClosed {x : Fin n | f x (β : EReal)} := closed_sublevel_of_closed_epigraph (f := f) hclosed_epi have hlsc : LowerSemicontinuous f := (lowerSemicontinuous_iff_closed_sublevel (f := f)).2 hclosed_real_sublevel have hfProperEReal : ProperConvexERealFunction (F := (Fin n )) f := helperForTheorem_21_3_properConvexEReal_of_properConvexFunctionOn_univ (f := f) hfProper intro x t ht by_cases ht0 : t = 0 · simpa [ht0] have htd : t d Set.recessionCone {x : Fin n | f x (α : EReal)} := smul_mem_recessionCone_of_mem hd ht have htd_recFun : t d recessionConeEReal (F := (Fin n )) f := section14_recessionCone_sublevel_subset_recessionConeEReal (E := (Fin n )) (f := f) hfProperEReal hlsc (α := α) hsub_nonempty htd by_cases hxdom : x erealDom f · exact (section14_step_le_of_mem_recessionCone (g := f) htd_recFun hxdom).1 · have hx_top : f x = ( : EReal) := by by_contra hxtop exact hxdom ((lt_top_iff_ne_top).2 hxtop) simpa [hx_top] using (le_top : f (x + t d) ( : EReal))

Helper for Theorem 21.3: any nonzero direction lying in the recession cone of Unknown identifier `C`C and in every nonpositive sublevel set would contradict the original no-common-recession hypothesis.

lemma helperForTheorem_21_3_noCommonRecession_contradiction_of_common_nonpositiveSublevel {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) {d : Fin n } (hd_ne : d 0) (hdC : d Set.recessionCone C) (hdSub : i : I, d Set.recessionCone {x : Fin n | f i x (0 : EReal)}) (hsub_nonempty : i : I, ({x : Fin n | f i x (0 : EReal)} : Set (Fin n )).Nonempty) : False := by apply hNoCommonRecession refine d, hd_ne, hdC, ?_ intro i x t ht exact helperForTheorem_21_3_nonpositiveSublevel_ray_antitone (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (hsub_nonempty := hsub_nonempty i) (hd := hdSub i) x t ht

Helper for Theorem 21.3: the no-common-recession contradiction is invariant under replacing the nonpositive sublevel sets {sorry 0} : ?m.2{Unknown identifier `fᵢ`fᵢ 0} by any common real level sets {sorry sorry} : ?m.2{Unknown identifier `fᵢ`fᵢ Unknown identifier `α`α}.

lemma helperForTheorem_21_3_noCommonRecession_contradiction_of_common_sublevel {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (α : ) {d : Fin n } (hd_ne : d 0) (hdC : d Set.recessionCone C) (hdSub : i : I, d Set.recessionCone {x : Fin n | f i x (α : EReal)}) (hsub_nonempty : i : I, ({x : Fin n | f i x (α : EReal)} : Set (Fin n )).Nonempty) : False := by apply hNoCommonRecession refine d, hd_ne, hdC, ?_ intro i x t ht exact helperForTheorem_21_3_sublevel_ray_antitone (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := α) (hsub_nonempty := hsub_nonempty i) (hd := hdSub i) x t ht
-- Proof sketch: derive the two-way alternative by applying the finite-family convex -- alternative to finite subfamilies and excluding common recession directions; then use -- a Carathéodory/Helly reduction to obtain a certificate supported on at most `n + 1` -- indices when the dual branch holds.

Helper for Theorem 21.3: if the index type is empty, primal feasibility is immediate from nonemptiness of Unknown identifier `C`C.

lemma helperForTheorem_21_3_primal_of_isEmpty {n : } {I : Type*} (C : Set (Fin n )) (hCnonempty : C.Nonempty) (f : I (Fin n ) EReal) (hI : IsEmpty I) : x : Fin n , x C i : I, f i x (0 : EReal) := by -- Extract a point in `C`; all index-quantified inequalities are vacuous. rcases hCnonempty with x, hxC refine x, hxC, ?_ intro i exact False.elim (hI.false i)

Helper for Theorem 21.3: if the index type is empty, no dual certificate can exist, because every finitely-supported multiplier is zero and thus cannot dominate a positive Unknown identifier `ε`ε.

lemma helperForTheorem_21_3_dual_impossible_of_isEmpty {n : } {I : Type*} (C : Set (Fin n )) (hCnonempty : C.Nonempty) (f : I (Fin n ) EReal) (hI : IsEmpty I) : ¬ lam : I →₀ , ( i : I, 0 lam i) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical intro hDual rcases hDual with lam, -, ε, , hineq rcases hCnonempty with x0, hx0C -- Every coordinate of `lam` is vacuous, so `lam = 0` and the weighted sum is zero. have hlamZero : lam = 0 := by ext i exact False.elim (hI.false i) have hsumZero : Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x0) = (0 : EReal) := by simp [hlamZero] -- Evaluating the dual inequality at `x0 ∈ C` yields `ε ≤ 0`, impossible for `ε > 0`. have hεle0 : ((ε : ) : EReal) (0 : EReal) := by have hAtPoint : ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x0) := hineq x0 hx0C simpa [hsumZero] using hAtPoint have hεPosEReal : (0 : EReal) < ((ε : ) : EReal) := by exact_mod_cast exact (not_le_of_gt hεPosEReal) hεle0

Helper for Theorem 21.3: a primal witness excludes every dual certificate.

lemma helperForTheorem_21_3_primal_excludes_dual {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hPrimal : x : Fin n , x C i : I, f i x (0 : EReal)) (hDual : lam : I →₀ , ( i : I, 0 lam i) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) : False := by rcases hPrimal with x0, hx0C, hx0Nonpos rcases hDual with lam, hlamNonneg, ε, , hineq -- At the primal witness, each weighted term is nonpositive, so the finite sum is `≤ 0`. have hsumNonpos : Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x0) (0 : EReal) := by refine Finset.sum_nonpos ?_ intro i hi exact mul_nonpos_of_nonneg_of_nonpos (by exact_mod_cast hlamNonneg i) (hx0Nonpos i) have hεle0 : ((ε : ) : EReal) (0 : EReal) := by exact le_trans (hineq x0 hx0C) hsumNonpos have hεPosEReal : (0 : EReal) < ((ε : ) : EReal) := by exact_mod_cast exact (not_le_of_gt hεPosEReal) hεle0

Helper for Theorem 21.3: package a finite-index margin certificate into the exact Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp dual-certificate shape used in the theorem statement.

lemma helperForTheorem_21_3_finiteDual_margin_to_finsuppDual_margin {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hfinite : m : , idx : Fin m I, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x) : lam : I →₀ , ( i : I, 0 lam i) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical rcases hfinite with m, idx, hidx, w, hw_nonneg, ε, , hmargin let wF : Fin m →₀ := Finsupp.equivFunOnFinite.symm w let lam : I →₀ := Finsupp.embDomain idx, hidx wF refine lam, ?_, ε, , ?_ · -- Route correction: prove coefficient nonnegativity by expanding `mapDomain` pointwise. intro i by_cases hi : i Set.range idx · rcases hi with j, rfl have hwF_nonneg : 0 wF j := by simpa [wF] using hw_nonneg j have hlam_apply : lam (idx j) = wF j := by simpa [lam] using Finsupp.embDomain_apply_self idx, hidx wF j simpa [hlam_apply] using hwF_nonneg · have hlam_zero : lam i = 0 := by simpa [lam] using Finsupp.embDomain_notin_range idx, hidx wF i hi simpa [hlam_zero] · intro x hxC -- Route correction: transport the weighted sum through `embDomain`, then expand -- from `Finsupp.sum` to a finite-type sum over `Fin m`. have hsumEq : Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by calc Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) = lam.sum (fun i a => ((a : ) : EReal) * f i x) := by rfl _ = wF.sum (fun j a => ((a : ) : EReal) * f (idx j) x) := by simpa [lam] using (Finsupp.sum_embDomain (v := wF) (f := idx, hidx) (g := fun i a => ((a : ) : EReal) * f i x)) _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by calc wF.sum (fun j a => ((a : ) : EReal) * f (idx j) x) = j : Fin m, ((wF j : ) : EReal) * f (idx j) x := by simpa using (Finsupp.sum_fintype wF (fun j a => ((a : ) : EReal) * f (idx j) x) (by intro j; simp)) _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by simp [wF] simpa [hsumEq] using hmargin x hxC

Helper for Theorem 21.3: convert a Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp dual-margin certificate into a finite indexed certificate with injective indexing.

lemma helperForTheorem_21_3_finsuppDual_margin_to_finiteDual_margin {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hDual : lam : I →₀ , ( i : I, 0 lam i) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) : m : , idx : Fin m I, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by classical rcases hDual with lam, hlamNonneg, ε, , hmargin -- Route correction: isolate the algebraic repackaging (`Finsupp` ↔ finite indexing) -- from the analytic extraction/sparsification bridge that remains upstream. let s : Finset I := lam.support let m : := s.card let e : s Fin m := Finset.equivFin s let idx : Fin m I := fun j => (e.symm j : I) let w : Fin m := fun j => lam (idx j) have hidx : Function.Injective idx := by intro j1 j2 hEq have hSubtypeEq : e.symm j1 = e.symm j2 := by exact Subtype.ext hEq exact e.symm.injective hSubtypeEq have hwNonneg : j : Fin m, 0 w j := by intro j exact hlamNonneg (idx j) refine m, idx, hidx, w, hwNonneg, ε, , ?_ intro x hxC -- Reindex the finite support sum along the equivalence `Fin m ≃ lam.support`. have hsumEq : ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) = Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := by calc ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) = j : Fin m, ((lam (idx j) : ) : EReal) * f (idx j) x := by simp [w] _ = i : s, ((lam i : ) : EReal) * f i x := by refine (Fintype.sum_equiv e.symm (fun j : Fin m => ((lam (idx j) : ) : EReal) * f (idx j) x) (fun i : s => ((lam i : ) : EReal) * f i x) ?_) intro j simp [idx] _ = Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := by simpa using (Finset.sum_attach s (fun i : I => ((lam i : ) : EReal) * f i x)) have hmarginOnSupport : ((ε : ) : EReal) Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := by simpa [s] using hmargin x hxC calc ((ε : ) : EReal) Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := hmarginOnSupport _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := hsumEq.symm

Helper for Theorem 21.3: package a sparse finite-index margin certificate into a support-bounded Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp certificate, preserving the cardinal bound .

lemma helperForTheorem_21_3_sparseFiniteDual_margin_to_supportBoundedFinsupp_margin {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hfiniteSparse : m : , m n + 1 idx : Fin m I, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical rcases hfiniteSparse with m, hm_le, idx, hidx, w, hw_nonneg, ε, , hmargin let wF : Fin m →₀ := Finsupp.equivFunOnFinite.symm w let lam : I →₀ := Finsupp.embDomain idx, hidx wF refine lam, ?_, ?_, ε, , ?_ · intro i by_cases hi : i Set.range idx · rcases hi with j, rfl have hwF_nonneg : 0 wF j := by simpa [wF] using hw_nonneg j have hlam_apply : lam (idx j) = wF j := by simpa [lam] using Finsupp.embDomain_apply_self idx, hidx wF j simpa [hlam_apply] using hwF_nonneg · have hlam_zero : lam i = 0 := by simpa [lam] using Finsupp.embDomain_notin_range idx, hidx wF i hi simpa [hlam_zero] · have hsupport : lam.support = Finset.map idx, hidx wF.support := by simpa [lam] using Finsupp.support_embDomain (f := idx, hidx) (v := wF) have hcard_le_m : lam.support.card m := by calc lam.support.card = (Finset.map idx, hidx wF.support).card := by simpa [hsupport] _ = wF.support.card := by simpa using (Finset.card_map (f := idx, hidx) (s := wF.support)) _ Fintype.card (Fin m) := Finset.card_le_univ wF.support _ = m := by simp exact le_trans hcard_le_m hm_le · intro x hxC have hsumEq : Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by calc Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) = lam.sum (fun i a => ((a : ) : EReal) * f i x) := by rfl _ = wF.sum (fun j a => ((a : ) : EReal) * f (idx j) x) := by simpa [lam] using (Finsupp.sum_embDomain (v := wF) (f := idx, hidx) (g := fun i a => ((a : ) : EReal) * f i x)) _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by calc wF.sum (fun j a => ((a : ) : EReal) * f (idx j) x) = j : Fin m, ((wF j : ) : EReal) * f (idx j) x := by simpa using (Finsupp.sum_fintype wF (fun j a => ((a : ) : EReal) * f (idx j) x) (by intro j; simp)) _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by simp [wF] simpa [hsumEq] using hmargin x hxC

Helper for Theorem 21.3: once the sparse-support endpoint is available, it matches the exact bridge target shape without additional repackaging.

lemma helperForTheorem_21_3_finish_bridge_from_sparseFinsupp_margin {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hDualSparse : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by -- This helper isolates the endpoint shape, so the bridge lemma only tracks extraction. exact hDualSparse

Helper for Theorem 21.3: finite intersections of closed sets remain closed.

lemma helperForTheorem_21_3_isClosed_finiteIntersection {n : } {I : Type*} (C : I Set (Fin n )) (t : Finset I) (hClosed : i t, IsClosed (C i)) : IsClosed ( i t, C i) := by classical induction t using Finset.induction_on with | empty => simpa using (isClosed_univ : IsClosed (Set.univ : Set (Fin n ))) | @insert i t hi hih => have hSet : ( j insert i t, C j) = C i j t, C j := by ext x simp [This simp argument is unused: hi Hint: Omit it from the simp argument list. simp ̵[̵h̵i̵]̵ Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`hi] rw [hSet] exact (hClosed i (by simp)).inter (hih (by intro j hj exact hClosed j (by simp [hj])))

Helper for Theorem 21.3: finite intersections of convex sets remain convex.

lemma helperForTheorem_21_3_convex_finiteIntersection {n : } {I : Type*} (C : I Set (Fin n )) (t : Finset I) (hConv : i t, Convex (C i)) : Convex ( i t, C i) := by classical induction t using Finset.induction_on with | empty => simpa using (convex_univ : Convex (Set.univ : Set (Fin n ))) | @insert i t hi hih => have hSet : ( j insert i t, C j) = C i j t, C j := by ext x simp [This simp argument is unused: hi Hint: Omit it from the simp argument list. simp ̵[̵h̵i̵]̵ Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`hi] rw [hSet] exact (hConv i (by simp)).inter (hih (by intro j hj exact hConv j (by simp [hj])))

Helper for Theorem 21.3: in Fin sorry : TypeFin Unknown identifier `n`n , boundedness is equivalent to trivial recession cone for nonempty closed convex sets.

lemma helperForTheorem_21_3_bounded_iff_recessionCone_eq_singleton_zero_fin {n : } (S : Set (Fin n )) (hSne : S.Nonempty) (hSclosed : IsClosed S) (hSconv : Convex S) : Bornology.IsBounded S Set.recessionCone S = ({0} : Set (Fin n )) := by let e := EuclideanSpace.equiv (Fin n) let S' : Set (EuclideanSpace (Fin n)) := e.symm '' S have hS'ne : S'.Nonempty := by rcases hSne with x, hx refine e.symm x, ?_ refine x, hx, ?_ simp have hS'closed : IsClosed S' := by simpa [S'] using (Homeomorph.isClosed_image e.symm.toHomeomorph).2 hSclosed have hS'conv : Convex S' := by simpa [S'] using (Convex.linear_image hSconv (e.symm.toLinearEquiv : (Fin n ) →ₗ[] EuclideanSpace (Fin n))) have hImageS : e '' S' = S := by ext x constructor · intro hx rcases hx with y, hy, hyx rcases hy with z, hz, hyz have hzEq : z = x := by calc z = e (e.symm z) := by simp _ = e y := by simpa [hyz] _ = x := hyx simpa [hzEq] using hz · intro hx refine e.symm x, ?_, ?_ · refine x, hx, ?_ simp · simp have hRecEq : Set.recessionCone S = e '' Set.recessionCone S' := by have hEq := recessionCone_image_linearEquiv (e := e.toLinearEquiv) (C := S') simpa [hImageS] using hEq have hZeroImage : e '' ({0} : Set (EuclideanSpace (Fin n))) = ({0} : Set (Fin n )) := by ext y constructor · intro hy rcases hy with x, hx, hxy have hx0 : x = 0 := by simpa [Set.mem_singleton_iff] using hx subst hx0 simp at hxy simpa [hxy] · intro hy have hy0 : y = 0 := by simpa [Set.mem_singleton_iff] using hy subst hy0 refine 0, ?_, ?_ · simp · simp constructor · intro hSbdd have hS'bounded : Bornology.IsBounded S' := by simpa [S'] using (e.symm.lipschitz.isBounded_image hSbdd) have hRecS' : Set.recessionCone S' = ({0} : Set (EuclideanSpace (Fin n))) := (bounded_iff_recessionCone_eq_singleton_zero (C := S') hS'ne hS'closed hS'conv).1 hS'bounded calc Set.recessionCone S = e '' Set.recessionCone S' := hRecEq _ = e '' ({0} : Set (EuclideanSpace (Fin n))) := by simp [hRecS'] _ = ({0} : Set (Fin n )) := hZeroImage · intro hRecS have hRecEqSymm : Set.recessionCone S' = e.symm '' Set.recessionCone S := by simpa [S'] using recessionCone_image_linearEquiv (e := e.symm.toLinearEquiv) (C := S) have hZeroImageSymm : e.symm '' ({0} : Set (Fin n )) = ({0} : Set (EuclideanSpace (Fin n))) := by ext y constructor · intro hy rcases hy with x, hx, hxy have hx0 : x = 0 := by simpa [Set.mem_singleton_iff] using hx subst hx0 simp at hxy simpa [hxy] · intro hy have hy0 : y = 0 := by simpa [Set.mem_singleton_iff] using hy subst hy0 refine 0, ?_, ?_ · simp · simp have hRecS' : Set.recessionCone S' = ({0} : Set (EuclideanSpace (Fin n))) := by calc Set.recessionCone S' = e.symm '' Set.recessionCone S := hRecEqSymm _ = e.symm '' ({0} : Set (Fin n )) := by simp [hRecS] _ = ({0} : Set (EuclideanSpace (Fin n))) := hZeroImageSymm have hS'bounded : Bornology.IsBounded S' := (bounded_iff_recessionCone_eq_singleton_zero (C := S') hS'ne hS'closed hS'conv).2 hRecS' have hSboundedImage : Bornology.IsBounded (e '' S') := e.lipschitz.isBounded_image hS'bounded simpa [hImageS] using hSboundedImage

Helper for Theorem 21.3: transport closedness of recession cones from Euclidean-space coordinates to the Fin sorry : TypeFin Unknown identifier `n`n model.

lemma helperForTheorem_21_3_recessionCone_isClosed_fin {n : } (S : Set (Fin n )) (hSclosed : IsClosed S) : IsClosed (Set.recessionCone S) := by let e := EuclideanSpace.equiv (Fin n) let S' : Set (EuclideanSpace (Fin n)) := e.symm '' S have hS'closed : IsClosed S' := by simpa [S'] using (Homeomorph.isClosed_image e.symm.toHomeomorph).2 hSclosed have hRecS'closed : IsClosed (Set.recessionCone S') := recessionCone_isClosed_of_closed (C := S') hS'closed have hImageS : e '' S' = S := by ext x constructor · intro hx rcases hx with y, hy, hyx rcases hy with z, hz, hyz have hzEq : z = x := by calc z = e (e.symm z) := by simp _ = e y := by simpa [hyz] _ = x := hyx simpa [hzEq] using hz · intro hx refine e.symm x, ?_, ?_ · exact x, hx, by simp · simp have hRecEq : Set.recessionCone S = e '' Set.recessionCone S' := by have hEq := recessionCone_image_linearEquiv (e := e.toLinearEquiv) (C := S') simpa [hImageS] using hEq have hImageClosed : IsClosed (e '' Set.recessionCone S') := by exact (Homeomorph.isClosed_image e.toHomeomorph).2 hRecS'closed simpa [hRecEq] using hImageClosed

Helper for Theorem 21.3: transport recessionCone_iInter_eq_iInter.{u_1} {n : } {ι : Type u_1} (C : ι Set (EuclideanSpace (Fin n))) (hCclosed : (i : ι), IsClosed (C i)) (hCconv : (i : ι), Convex (C i)) (hCne : (⋂ i, C i).Nonempty) : (⋂ i, C i).recessionCone = i, (C i).recessionConerecessionCone_iInter_eq_iInter from Euclidean-space coordinates to the Fin sorry : TypeFin Unknown identifier `n`n model.

lemma helperForTheorem_21_3_recessionCone_iInter_eq_iInter_fin {n : } {ι : Type*} (C : ι Set (Fin n )) (hCclosed : i : ι, IsClosed (C i)) (hCconv : i : ι, Convex (C i)) (hCne : ( i : ι, C i).Nonempty) : Set.recessionCone ( i : ι, C i) = i : ι, Set.recessionCone (C i) := by let e := EuclideanSpace.equiv (Fin n) let C' : ι Set (EuclideanSpace (Fin n)) := fun i => e.symm '' C i have hC'closed : i : ι, IsClosed (C' i) := by intro i simpa [C'] using (Homeomorph.isClosed_image e.symm.toHomeomorph).2 (hCclosed i) have hC'conv : i : ι, Convex (C' i) := by intro i simpa [C'] using (Convex.linear_image (hCconv i) (e.symm.toLinearEquiv : (Fin n ) →ₗ[] EuclideanSpace (Fin n))) have hC'ne : ( i : ι, C' i).Nonempty := by rcases hCne with x, hx have hxAll : i : ι, x C i := by simpa [Set.mem_iInter] using hx refine e.symm x, ?_ refine Set.mem_iInter.mpr ?_ intro i exact x, hxAll i, by simp have hRecEuclid : Set.recessionCone ( i : ι, C' i) = i : ι, Set.recessionCone (C' i) := recessionCone_iInter_eq_iInter (C := C') hC'closed hC'conv hC'ne have hImageInter : e '' ( i : ι, C' i) = i : ι, C i := by ext x constructor · intro hx rcases hx with y, hy, hyx have hyAll : i : ι, y C' i := by simpa [Set.mem_iInter] using hy refine Set.mem_iInter.mpr ?_ intro i rcases hyAll i with z, hz, hyz have hzEq : z = x := by calc z = e (e.symm z) := by simp _ = e y := by simpa [hyz] _ = x := hyx simpa [hzEq] using hz · intro hx have hxAll : i : ι, x C i := by simpa [Set.mem_iInter] using hx refine e.symm x, ?_, ?_ · refine Set.mem_iInter.mpr ?_ intro i exact x, hxAll i, by simp · simp have hRecImage : Set.recessionCone ( i : ι, C i) = e '' Set.recessionCone ( i : ι, C' i) := by have hEq := recessionCone_image_linearEquiv (e := e.toLinearEquiv) (C := ( i : ι, C' i)) simpa [hImageInter] using hEq have hImageInterRec : e '' ( i : ι, Set.recessionCone (C' i)) = i : ι, Set.recessionCone (C i) := by ext x constructor · intro hx rcases hx with y, hy, hyx have hyAll : i : ι, y Set.recessionCone (C' i) := by simpa [Set.mem_iInter] using hy refine Set.mem_iInter.mpr ?_ intro i have hyi : y Set.recessionCone (C' i) := hyAll i have hRecImage_i : Set.recessionCone (C i) = e '' Set.recessionCone (C' i) := by have hEq_i := recessionCone_image_linearEquiv (e := e.toLinearEquiv) (C := C' i) have hImage_i : e '' C' i = C i := by ext z constructor · intro hz rcases hz with w, hw, hwz rcases hw with u, hu, hwu have huEq : u = z := by calc u = e (e.symm u) := by simp _ = e w := by simpa [hwu] _ = z := hwz simpa [huEq] using hu · intro hz refine e.symm z, ?_, ?_ · exact z, hz, by simp · simp simpa [hImage_i] using hEq_i have hxInImage : x e '' Set.recessionCone (C' i) := y, hyi, hyx simpa [hRecImage_i] using hxInImage · intro hx have hxAll : i : ι, x Set.recessionCone (C i) := by simpa [Set.mem_iInter] using hx refine e.symm x, ?_, ?_ · refine Set.mem_iInter.mpr ?_ intro i have hRecImageSymm_i : Set.recessionCone (C' i) = e.symm '' Set.recessionCone (C i) := by simpa [C'] using (recessionCone_image_linearEquiv (e := e.symm.toLinearEquiv) (C := C i)) have hxInImage : e.symm x e.symm '' Set.recessionCone (C i) := x, hxAll i, by simp simpa [hRecImageSymm_i] using hxInImage · simp calc Set.recessionCone ( i : ι, C i) = e '' Set.recessionCone ( i : ι, C' i) := hRecImage _ = e '' ( i : ι, Set.recessionCone (C' i)) := by simp [hRecEuclid] _ = i : ι, Set.recessionCone (C i) := hImageInterRec

Helper for Theorem 21.3: recession cone of an intersection of two closed convex sets in Fin sorry : TypeFin Unknown identifier `n`n is the intersection of recession cones.

lemma helperForTheorem_21_3_recessionCone_inter_eq_fin {n : } {A B : Set (Fin n )} (hAclosed : IsClosed A) (hBclosed : IsClosed B) (hAconv : Convex A) (hBconv : Convex B) (hABne : (A B).Nonempty) : Set.recessionCone (A B) = Set.recessionCone A Set.recessionCone B := by let C : Bool Set (Fin n ) := fun b => if b then A else B have hCclosed : b : Bool, IsClosed (C b) := by intro b cases b <;> simp [C, hAclosed, hBclosed] have hCconv : b : Bool, Convex (C b) := by intro b cases b <;> simp [C, hAconv, hBconv] have hCne : ( b : Bool, C b).Nonempty := by rcases hABne with x, hx refine x, ?_ refine Set.mem_iInter.mpr ?_ intro b cases b with | false => simpa [C] using hx.2 | true => simpa [C] using hx.1 have hRec : Set.recessionCone ( b : Bool, C b) = b : Bool, Set.recessionCone (C b) := helperForTheorem_21_3_recessionCone_iInter_eq_iInter_fin (C := C) hCclosed hCconv hCne have hInterEq : ( b : Bool, C b) = A B := by ext x constructor · intro hx refine ?_, ?_ · simpa [C] using Set.mem_iInter.mp hx true · simpa [C] using Set.mem_iInter.mp hx false · intro hx refine Set.mem_iInter.mpr ?_ intro b cases b with | false => simpa [C] using hx.2 | true => simpa [C] using hx.1 have hRecInterEq : ( b : Bool, Set.recessionCone (C b)) = Set.recessionCone A Set.recessionCone B := by ext x constructor · intro hx refine ?_, ?_ · simpa [C] using Set.mem_iInter.mp hx true · simpa [C] using Set.mem_iInter.mp hx false · intro hx refine Set.mem_iInter.mpr ?_ intro b cases b with | false => simpa [C] using hx.2 | true => simpa [C] using hx.1 calc Set.recessionCone (A B) = Set.recessionCone ( b : Bool, C b) := by rw [hInterEq] _ = b : Bool, Set.recessionCone (C b) := hRec _ = Set.recessionCone A Set.recessionCone B := hRecInterEq

Helper for Theorem 21.3: the recession cone of a finite nonempty intersection is the finite intersection of the recession cones.

lemma helperForTheorem_21_3_recessionFiniteInter_eq_finiteRecessionInter {n : } {I : Type*} (C : I Set (Fin n )) (t : Finset I) (hClosed : i t, IsClosed (C i)) (hConv : i t, Convex (C i)) (hNonemptyInter : ( i t, C i).Nonempty) : Set.recessionCone ( i t, C i) = i t, Set.recessionCone (C i) := by by_cases ht : t.Nonempty · have htne : (t : Set I).Nonempty := ht have hNonemptySubtype : ( i : (t : Set I), C i.1).Nonempty := by simpa using hNonemptyInter have hClosedSubtype : i : (t : Set I), IsClosed (C i.1) := by intro i exact hClosed i.1 i.2 have hConvSubtype : i : (t : Set I), Convex (C i.1) := by intro i exact hConv i.1 i.2 have hRecSubtype : Set.recessionCone ( i : (t : Set I), C i.1) = i : (t : Set I), Set.recessionCone (C i.1) := helperForTheorem_21_3_recessionCone_iInter_eq_iInter_fin (C := fun i : (t : Set I) => C i.1) hClosedSubtype hConvSubtype hNonemptySubtype have hInterEq : ( i : (t : Set I), C i.1) = ( i t, C i) := by ext x simp have hRecInterEq : ( i : (t : Set I), Set.recessionCone (C i.1)) = ( i t, Set.recessionCone (C i)) := by ext x simp calc Set.recessionCone ( i t, C i) = Set.recessionCone ( i : (t : Set I), C i.1) := by rw [hInterEq] _ = i : (t : Set I), Set.recessionCone (C i.1) := hRecSubtype _ = i t, Set.recessionCone (C i) := hRecInterEq · have htEmpty : t = := Finset.not_nonempty_iff_eq_empty.mp ht subst htEmpty ext x simp [Set.recessionCone]

Helper for Theorem 21.3: compactness on the unit sphere yields a finite subfamily whose recession-cone intersection is already {0} : ?m.2{0}.

lemma helperForTheorem_21_3_finite_recession_subfamily_of_global_singleton {n : } {I : Type*} (C : I Set (Fin n )) (hClosed : i : I, IsClosed (C i)) (hNoCommon : ( i : I, Set.recessionCone (C i)) = ({0} : Set (Fin n ))) : t : Finset I, ( i t, Set.recessionCone (C i)) = ({0} : Set (Fin n )) := by classical let sphereOne : Set (Fin n ) := Metric.sphere (0 : Fin n ) 1 have hSphereInterEmpty : sphereOne ( i : I, Set.recessionCone (C i)) = ( : Set (Fin n )) := by refine Set.eq_empty_iff_forall_notMem.2 ?_ intro x hx rcases hx with hxSphere, hxInter have hxZeroSet : x ({0} : Set (Fin n )) := by simpa [hNoCommon] using hxInter have hx0 : x = 0 := by simpa [Set.mem_singleton_iff] using hxZeroSet have hNormEq : x = 1 := by simpa [sphereOne, Metric.sphere, dist_eq_norm] using hxSphere have : (0 : ) = 1 := by simpa [hx0] using hNormEq norm_num at this have hClosedRec : i : I, IsClosed (Set.recessionCone (C i)) := by intro i exact helperForTheorem_21_3_recessionCone_isClosed_fin (S := C i) (hClosed i) have hcompact : IsCompact sphereOne := by simpa [sphereOne] using (isCompact_sphere (0 : Fin n ) (1 : )) rcases hcompact.elim_finite_subfamily_closed (t := fun i : I => Set.recessionCone (C i)) hClosedRec hSphereInterEmpty with u, huEmpty refine u, ?_ apply Set.Subset.antisymm · intro d hd by_cases hd0 : d = 0 · simpa [hd0] · have hnormPos : 0 < d := norm_pos_iff.mpr hd0 have hInvPos : 0 < d⁻¹ := inv_pos.mpr hnormPos have hNormedMemFinite : (d⁻¹ : ) d i u, Set.recessionCone (C i) := by refine Set.mem_iInter₂.mpr ?_ intro i hi have hdi : d Set.recessionCone (C i) := (Set.mem_iInter₂.mp hd) i hi exact smul_mem_recessionCone_of_mem hdi hInvPos.le have hNormedOnSphere : (d⁻¹ : ) d sphereOne := by have hnormNe : d 0 := ne_of_gt hnormPos have hmul : d⁻¹ * d = 1 := inv_mul_cancel₀ hnormNe have hnormEq : (d⁻¹ : ) d = 1 := by calc (d⁻¹ : ) d = (d⁻¹ : ) * d := by simpa using norm_smul (d⁻¹ : ) d _ = d⁻¹ * d := by simp _ = 1 := hmul simpa [sphereOne, Metric.sphere, dist_eq_norm] using hnormEq have hNormedMemInter : (d⁻¹ : ) d sphereOne ( i u, Set.recessionCone (C i)) := hNormedOnSphere, hNormedMemFinite have hFalse : False := by simpa [huEmpty] using hNormedMemInter exact False.elim hFalse · intro d hd have hd0 : d = 0 := by simpa [Set.mem_singleton_iff] using hd subst hd0 refine Set.mem_iInter₂.mpr ?_ intro i hi x hx t ht simpa using hx

Helper for Theorem 21.3: the global no-common-recession hypothesis already has a finite restricted subfamily witness. This separates the compactness-on-directions reduction from the later infeasibility/margin extraction.

lemma helperForTheorem_21_3_exists_finite_restricted_noCommonRecession_subfamily_of_globalNoCommon {n : } {I : Type*} (C : Set (Fin n )) (hCclosed : IsClosed C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) : u : Finset I, ¬ d : Fin n , d 0 d Set.recessionCone C ( i : (u : Set I), x : Fin n , t : , 0 t f i.1 (x + t d) f i.1 x) := by classical let sphereOne : Set (Fin n ) := Metric.sphere (0 : Fin n ) 1 let K : Set (Fin n ) := sphereOne Set.recessionCone C let D : I Set (Fin n ) := fun i => recessionConeEReal (F := (Fin n )) (f i) have hDclosed : i : I, IsClosed (D i) := by intro i simpa [D] using helperForTheorem_21_3_recessionConeEReal_isClosed_fin (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) have hKInterEmpty : K ( i : I, D i) = ( : Set (Fin n )) := by refine Set.eq_empty_iff_forall_notMem.2 ?_ intro d hd rcases hd with hdK, hdAll have hd_ne : d 0 := by intro hd0 have hNormEq : d = 1 := by simpa [K, sphereOne, Metric.sphere, dist_eq_norm] using hdK.1 have : (0 : ) = 1 := by simpa [hd0] using hNormEq norm_num at this have hmono : i : I, x : Fin n , t : , 0 t f i (x + t d) f i x := by intro i x t ht have hdRecE : d recessionConeEReal (F := (Fin n )) (f i) := by simpa [D] using Set.mem_iInter.mp hdAll i rcases helperForTheorem_21_3_recessionConeEReal_eq_recessionCone_some_nonempty_sublevel (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) with α, hα_nonempty, hEq have hdSub : d Set.recessionCone {x : Fin n | f i x (α : EReal)} := by simpa [hEq] using hdRecE exact helperForTheorem_21_3_sublevel_ray_antitone (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := α) (hsub_nonempty := hα_nonempty) (hd := hdSub) x t ht exact hNoCommonRecession d, hd_ne, hdK.2, hmono have hKcompact : IsCompact K := by simpa [K] using (isCompact_sphere (0 : Fin n ) (1 : )).inter_right (helperForTheorem_21_3_recessionCone_isClosed_fin (S := C) hCclosed) rcases hKcompact.elim_finite_subfamily_closed (t := D) hDclosed hKInterEmpty with u, huEmpty refine u, ?_ intro hbad rcases hbad with d, hd_ne, hdC, hdmono have hnormPos : 0 < d := norm_pos_iff.mpr hd_ne have hInvPos : 0 < d⁻¹ := inv_pos.mpr hnormPos have hdNormedK : (d⁻¹ : ) d K := by refine ?_, ?_ · have hnormNe : d 0 := ne_of_gt hnormPos have hmul : d⁻¹ * d = 1 := inv_mul_cancel₀ hnormNe have hnormEq : (d⁻¹ : ) d = 1 := by calc (d⁻¹ : ) d = (d⁻¹ : ) * d := by simpa using norm_smul (d⁻¹ : ) d _ = d⁻¹ * d := by simp _ = 1 := hmul simpa [K, sphereOne, Metric.sphere, dist_eq_norm] using hnormEq · exact smul_mem_recessionCone_of_mem hdC hInvPos.le have hdNormedD : (d⁻¹ : ) d i u, D i := by refine Set.mem_iInter₂.mpr ?_ intro i hi have hdiRecE : d recessionConeEReal (F := (Fin n )) (f i) := by refine (section14_mem_recessionConeEReal_iff (F := (Fin n )) (g := f i) (y := d)).2 ?_ intro x hxdom have hle : f i (x + d) f i x := by simpa [one_smul] using hdmono i, hi x 1 (by norm_num) exact EReal.sub_nonpos.mpr hle rcases helperForTheorem_21_3_recessionConeEReal_eq_recessionCone_some_nonempty_sublevel (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) with α, _hα_nonempty, hEq have hdiSub : d Set.recessionCone {x : Fin n | f i x (α : EReal)} := by simpa [hEq] using hdiRecE have hdNormedSub : (d⁻¹ : ) d Set.recessionCone {x : Fin n | f i x (α : EReal)} := smul_mem_recessionCone_of_mem hdiSub hInvPos.le simpa [D, hEq] using hdNormedSub have : False := by simpa [K, huEmpty] using (show (d⁻¹ : ) d K ( i u, D i) from hdNormedK, hdNormedD) exact this

Helper for Theorem 21.3: if the global primal system is infeasible, some finite subsystem is already infeasible. This isolates the infinite-to-finite reduction from the remaining finite-family analytic core.

lemma helperForTheorem_21_3_exists_finite_infeasible_subfamily_of_notPrimal {n : } {I : Type*} (C : Set (Fin n )) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (hInonempty : ¬ IsEmpty I) (hNotPrimal : ¬ x : Fin n , x C i : I, f i x (0 : EReal)) : t : Finset I, ¬ ( i t, C {x : Fin n | f i x (0 : EReal)}).Nonempty := by classical let Ci : I Set (Fin n ) := fun i => C {x : Fin n | f i x (0 : EReal)} have hCi_closed : i : I, IsClosed (Ci i) := by intro i exact (helperForTheorem_21_3_inter_nonpositiveSublevel_closed_convex C hCclosed hCconvex f hfProper hfClosed i).1 have hCi_convex : i : I, Convex (Ci i) := by intro i exact (helperForTheorem_21_3_inter_nonpositiveSublevel_closed_convex C hCclosed hCconvex f hfProper hfClosed i).2 by_contra hNoFinite have hFiniteInterNonempty : t : Finset I, ( i t, Ci i).Nonempty := by intro t by_contra ht exact hNoFinite t, ht have hCi_nonempty : i : I, (Ci i).Nonempty := by intro i simpa [Ci] using hFiniteInterNonempty ({i} : Finset I) have hGlobalEmpty : ( i : I, Ci i) = ( : Set (Fin n )) := by ext x constructor · intro hx haveI : Nonempty I := not_isEmpty_iff.mp hInonempty have hxAll : i : I, x Ci i := by simpa [Set.mem_iInter] using hx have hxPrimal : x C i : I, f i x (0 : EReal) := by refine (hxAll (Classical.choice Nonempty I)).1, ?_ intro i exact (hxAll i).2 exact False.elim (hNotPrimal x, hxPrimal.1, hxPrimal.2) · intro hx simp at hx have hCiNoCommon : ( i : I, Set.recessionCone (Ci i)) = ({0} : Set (Fin n )) := by apply Set.Subset.antisymm · intro d hd by_cases hd0 : d = 0 · simpa [hd0] · haveI : Nonempty I := not_isEmpty_iff.mp hInonempty let i0 : I := Classical.choice Nonempty I have hdCi : i : I, d Set.recessionCone (Ci i) := by simpa [Set.mem_iInter] using hd have hdC : d Set.recessionCone C := by have hCiInterNonempty : (C {x : Fin n | f i0 x (0 : EReal)}).Nonempty := by simpa [Ci] using hCi_nonempty i0 have hRecEq : Set.recessionCone (Ci i0) = Set.recessionCone C Set.recessionCone ({x : Fin n | f i0 x (0 : EReal)}) := by simpa [Ci] using (helperForTheorem_21_3_recessionCone_inter_eq_fin hCclosed (helperForTheorem_21_3_nonpositiveSublevel_closed_convex (f := f i0) (hfProper := hfProper i0) (hfClosed := hfClosed i0)).1 hCconvex (helperForTheorem_21_3_nonpositiveSublevel_closed_convex (f := f i0) (hfProper := hfProper i0) (hfClosed := hfClosed i0)).2 hCiInterNonempty) have hdPair : d Set.recessionCone C Set.recessionCone ({x : Fin n | f i0 x (0 : EReal)}) := by simpa [hRecEq] using hdCi i0 exact hdPair.1 have hdSub : i : I, d Set.recessionCone ({x : Fin n | f i x (0 : EReal)}) := by intro i have hCiInterNonempty : (C {x : Fin n | f i x (0 : EReal)}).Nonempty := by simpa [Ci] using hCi_nonempty i have hRecEq : Set.recessionCone (Ci i) = Set.recessionCone C Set.recessionCone ({x : Fin n | f i x (0 : EReal)}) := by simpa [Ci] using (helperForTheorem_21_3_recessionCone_inter_eq_fin hCclosed (helperForTheorem_21_3_nonpositiveSublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i)).1 hCconvex (helperForTheorem_21_3_nonpositiveSublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i)).2 hCiInterNonempty) have hdPair : d Set.recessionCone C Set.recessionCone ({x : Fin n | f i x (0 : EReal)}) := by simpa [hRecEq] using hdCi i exact hdPair.2 exact False.elim (helperForTheorem_21_3_noCommonRecession_contradiction_of_common_nonpositiveSublevel C f hfProper hfClosed hNoCommonRecession hd0 hdC hdSub (by intro i rcases hCi_nonempty i with x, hx exact x, hx.2)) · intro d hd have hd0 : d = 0 := by simpa [Set.mem_singleton_iff] using hd subst hd0 refine Set.mem_iInter.mpr ?_ Try this: intro i x hx t htintro i intro x hx t ht simpa using hx rcases helperForTheorem_21_3_finite_recession_subfamily_of_global_singleton (C := Ci) hCi_closed hCiNoCommon with t0, ht0Rec let K : Set (Fin n ) := i t0, Ci i have hKnonempty : K.Nonempty := by simpa [K] using hFiniteInterNonempty t0 have hKclosed : IsClosed K := helperForTheorem_21_3_isClosed_finiteIntersection (C := Ci) t0 (by intro i hi; exact hCi_closed i) have hKconvex : Convex K := helperForTheorem_21_3_convex_finiteIntersection (C := Ci) t0 (by intro i hi; exact hCi_convex i) have hRecFinite : Set.recessionCone K = ({0} : Set (Fin n )) := by calc Set.recessionCone K = i t0, Set.recessionCone (Ci i) := by exact helperForTheorem_21_3_recessionFiniteInter_eq_finiteRecessionInter (C := Ci) t0 (by intro i hi; exact hCi_closed i) (by intro i hi; exact hCi_convex i) (by simpa [K] using hKnonempty) _ = ({0} : Set (Fin n )) := ht0Rec have hBoundedFinite : Bornology.IsBounded K := by exact (helperForTheorem_21_3_bounded_iff_recessionCone_eq_singleton_zero_fin (S := K) hKnonempty hKclosed hKconvex).2 hRecFinite have hKcompact : IsCompact K := by exact (Metric.isCompact_iff_isClosed_bounded).2 hKclosed, hBoundedFinite have hEmptyWithGlobal : K ( i : I, Ci i) = ( : Set (Fin n )) := by ext x constructor · intro hx have : x ( i : I, Ci i) := hx.2 simpa [hGlobalEmpty] using this · intro hx simp at hx rcases hKcompact.elim_finite_subfamily_closed (t := Ci) hCi_closed hEmptyWithGlobal with u, huEmpty have hUnionEmpty : ¬ ( i t0 u, Ci i).Nonempty := by intro hne rcases hne with x, hx have hxLeft : x K := by refine Set.mem_iInter₂.mpr ?_ intro i hi exact Set.mem_iInter₂.mp hx i (by exact Finset.mem_union_left u hi) have hxRight : x i u, Ci i := by refine Set.mem_iInter₂.mpr ?_ intro i hi exact Set.mem_iInter₂.mp hx i (by exact Finset.mem_union_right t0 hi) have hxEmpty : x ( : Set (Fin n )) := by have hxPair : x K i u, Ci i := hxLeft, hxRight simpa [K, huEmpty] using hxPair simpa using hxEmpty have hUnionRec : ( i t0 u, Set.recessionCone (Ci i)) = ({0} : Set (Fin n )) := by apply Set.Subset.antisymm · intro d hd have hdT0 : d i t0, Set.recessionCone (Ci i) := by refine Set.mem_iInter₂.mpr ?_ intro i hi exact Set.mem_iInter₂.mp hd i (by exact Finset.mem_union_left u hi) simpa [ht0Rec] using hdT0 · intro d hd have hd0 : d = 0 := by simpa [Set.mem_singleton_iff] using hd subst hd0 refine Set.mem_iInter₂.mpr ?_ intro i hi x hx t ht simpa using hx exact hNoFinite t0 u, hUnionEmpty

Helper for Theorem 21.3: if an upward-closed convex set contains the origin and is disjoint from the strict negative orthant, then it admits a nonnegative nontrivial support normal at the origin.

lemma helperForTheorem_21_3_support_normal_of_upwardClosed_contains_zero_disjoint_negativeOrthant {m : } (U : Set (Fin m )) (hUconv : Convex U) (hzeroMemU : (fun _ : Fin m => (0 : )) U) (hUO_disjoint : Disjoint U {o : Fin m | j : Fin m, o j < 0}) : lam : Fin m , ( j : Fin m, 0 lam j) lam 0 ( u : Fin m , u U 0 j : Fin m, lam j * u j) := by let O : Set (Fin m ) := {o : Fin m | j : Fin m, o j < 0} have hO_nonempty_convex : O.Nonempty Convex O := by simpa [O] using helperForTheorem_21_1_negativeOrthant_nonempty_convex m have hUO_disjoint_intrinsic : Disjoint (intrinsicInterior U) (intrinsicInterior O) := by simpa [O] using hUO_disjoint.mono intrinsicInterior_subset intrinsicInterior_subset have hsepExists : H : Set (Fin m ), HyperplaneSeparatesProperly m H U O := by exact (exists_hyperplaneSeparatesProperly_iff_disjoint_intrinsicInterior (n := m) (C₁ := U) (C₂ := O) fun _ : Fin m => (0 : ), hzeroMemU hO_nonempty_convex.1 hUconv hO_nonempty_convex.2).2 hUO_disjoint_intrinsic rcases hsepExists with H, hHsep rcases hyperplaneSeparatesProperly_oriented m H U O hHsep with b, β, hb_ne_zero, _hHdef, hU_lower, hO_upper, _hNotBothInH have hb_nonneg : j : Fin m, 0 b j := helperForTheorem_21_1_separatorNormal_nonneg_on_negativeOrthant O rfl b β hO_upper have hβ_nonneg : 0 β := helperForTheorem_21_1_separatorBeta_nonneg_on_negativeOrthant O rfl b β hO_upper hb_ne_zero hb_nonneg have hβ_nonpos : β 0 := by simpa [dotProduct] using hU_lower (fun _ : Fin m => (0 : )) hzeroMemU have hβ_eq : β = 0 := le_antisymm hβ_nonpos hβ_nonneg refine b, hb_nonneg, hb_ne_zero, ?_ intro u huU have hβ_le : β u ⬝ᵥ b := hU_lower u huU have hdot_nonneg : 0 u ⬝ᵥ b := by simpa [hβ_eq] using hβ_le simpa [dotProduct, mul_comm, mul_left_comm, mul_assoc] using hdot_nonneg

Helper for Theorem 21.3: if the nonpositive sublevel members of a finite family are all nonempty and have trivial common recession cone, then that finite family already satisfies the restricted no-common-recession condition needed by the shifted-shell argument.

lemma helperForTheorem_21_3_restricted_noCommonRecession_of_finite_nonpositiveMembers_and_trivialRecession {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (t : Finset I) (hRecZero : ( i t, Set.recessionCone (C {x : Fin n | f i x (0 : EReal)})) = ({0} : Set (Fin n ))) : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : (t : Set I), x : Fin n , s : , 0 s f i.1 (x + s d) f i.1 x) := by intro hbad rcases hbad with d, hd_ne, hdC, hdmono have hdC' : x C, s : , 0 s x + s d C := by simpa [Set.recessionCone] using hdC have hdFinite : d i t, Set.recessionCone (C {x : Fin n | f i x (0 : EReal)}) := by refine Set.mem_iInter₂.mpr ?_ intro i hi change x C {x : Fin n | f i x (0 : EReal)}, s : , 0 s x + s d C {x : Fin n | f i x (0 : EReal)} intro x hx s hs have hxC'' : x + s d C := hdC' x hx.1 s hs have hmono_i : f i (x + s d) f i x := hdmono i, hi x s hs exact hxC'', le_trans hmono_i hx.2 have hdZero : d ({0} : Set (Fin n )) := by simpa [hRecZero] using hdFinite have hd0 : d = 0 := by simpa [Set.mem_singleton_iff] using hdZero exact hd_ne hd0

Helper for Theorem 21.3: under the finite restricted no-common-recession package, failure of the zero-level finite primal system forces a positive common level Unknown identifier `ε`ε whose shifted finite system is already infeasible.

lemma helperForTheorem_21_3_exists_positive_shift_infeasible_of_finite_notPrimal_and_noCommonRecession {n : } {I : Type*} (C : Set (Fin n )) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (t : Finset I) (htNonempty : t.Nonempty) (hNoCommonRestricted : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : (t : Set I), x : Fin n , s : , 0 s f i.1 (x + s d) f i.1 x)) (htNotPrimal : ¬ ( i t, C {x : Fin n | f i x (0 : EReal)}).Nonempty) : ε : , 0 < ε ¬ ( i t, C {x : Fin n | f i x (ε : EReal)}).Nonempty := by classical let eps : := fun k => 1 / ((k : ) + 1) let K : Set (Fin n ) := fun k => i t, C {x : Fin n | f i x (eps k : EReal)} by_contra hNoGap push_neg at hNoGap have hpos : k, 0 < eps k := by intro k have hk : 0 < (k : ) + 1 := by linarith simpa [eps] using (one_div_pos.mpr hk) have hKnonempty : k, (K k).Nonempty := by intro k exact hNoGap (eps k) (hpos k) have hKclosed : k, IsClosed (K k) := by intro k refine helperForTheorem_21_3_isClosed_finiteIntersection (C := fun i => C {x : Fin n | f i x (eps k : EReal)}) t ?_ intro i hi exact hCclosed.inter (helperForTheorem_21_3_sublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := eps k)).1 have hKconvex : k, Convex (K k) := by intro k refine helperForTheorem_21_3_convex_finiteIntersection (C := fun i => C {x : Fin n | f i x (eps k : EReal)}) t ?_ intro i hi exact hCconvex.inter (helperForTheorem_21_3_sublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := eps k)).2 have hKrecZero : k, Set.recessionCone (K k) = ({0} : Set (Fin n )) := by intro k have hRecEq : Set.recessionCone (K k) = i t, Set.recessionCone (C {x : Fin n | f i x (eps k : EReal)}) := by exact helperForTheorem_21_3_recessionFiniteInter_eq_finiteRecessionInter (C := fun i => C {x : Fin n | f i x (eps k : EReal)}) t (by intro i hi exact hCclosed.inter (helperForTheorem_21_3_sublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := eps k)).1) (by intro i hi exact hCconvex.inter (helperForTheorem_21_3_sublevel_closed_convex (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := eps k)).2) (hKnonempty k) apply Set.Subset.antisymm · intro d hd by_cases hd0 : d = 0 · simpa [hd0] · have hdAll : i t, d Set.recessionCone (C {x : Fin n | f i x (eps k : EReal)}) := by have hd' : d i t, Set.recessionCone (C {x : Fin n | f i x (eps k : EReal)}) := by simpa [hRecEq] using hd intro i hi exact Set.mem_iInter₂.mp hd' i hi obtain i0, hi0 := htNonempty have hKi0_nonempty : (C {x : Fin n | f i0 x (eps k : EReal)}).Nonempty := by rcases hKnonempty k with x, hx exact x, Set.mem_iInter₂.mp hx i0 hi0 have hdC : d Set.recessionCone C := by have hRecEq_i0 : Set.recessionCone (C {x : Fin n | f i0 x (eps k : EReal)}) = Set.recessionCone C Set.recessionCone ({x : Fin n | f i0 x (eps k : EReal)}) := by simpa using (helperForTheorem_21_3_recessionCone_inter_eq_fin hCclosed (helperForTheorem_21_3_sublevel_closed_convex (f := f i0) (hfProper := hfProper i0) (hfClosed := hfClosed i0) (α := eps k)).1 hCconvex (helperForTheorem_21_3_sublevel_closed_convex (f := f i0) (hfProper := hfProper i0) (hfClosed := hfClosed i0) (α := eps k)).2 hKi0_nonempty) have hdPair : d Set.recessionCone C Set.recessionCone ({x : Fin n | f i0 x (eps k : EReal)}) := by simpa [hRecEq_i0] using hdAll i0 hi0 exact hdPair.1 have hdSub : i : (t : Set I), d Set.recessionCone {x : Fin n | f i.1 x (eps k : EReal)} := by intro i have hCi_nonempty : (C {x : Fin n | f i.1 x (eps k : EReal)}).Nonempty := by rcases hKnonempty k with x, hx exact x, Set.mem_iInter₂.mp hx i.1 i.2 have hRecEq_i : Set.recessionCone (C {x : Fin n | f i.1 x (eps k : EReal)}) = Set.recessionCone C Set.recessionCone ({x : Fin n | f i.1 x (eps k : EReal)}) := by simpa using (helperForTheorem_21_3_recessionCone_inter_eq_fin hCclosed (helperForTheorem_21_3_sublevel_closed_convex (f := f i.1) (hfProper := hfProper i.1) (hfClosed := hfClosed i.1) (α := eps k)).1 hCconvex (helperForTheorem_21_3_sublevel_closed_convex (f := f i.1) (hfProper := hfProper i.1) (hfClosed := hfClosed i.1) (α := eps k)).2 hCi_nonempty) have hdPair : d Set.recessionCone C Set.recessionCone ({x : Fin n | f i.1 x (eps k : EReal)}) := by simpa [hRecEq_i] using hdAll i.1 i.2 exact hdPair.2 have hsub_nonempty_eps : i : (t : Set I), ({x : Fin n | f i.1 x (eps k : EReal)} : Set (Fin n )).Nonempty := by intro i rcases hKnonempty k with x, hx exact x, (Set.mem_iInter₂.mp hx i.1 i.2).2 exact False.elim (helperForTheorem_21_3_noCommonRecession_contradiction_of_common_sublevel (C := C) (f := fun i : (t : Set I) => f i.1) (hfProper := by intro i; exact hfProper i.1) (hfClosed := by intro i; exact hfClosed i.1) (hNoCommonRecession := hNoCommonRestricted) (α := eps k) hd0 hdC hdSub hsub_nonempty_eps) · intro d hd have hd0 : d = 0 := by simpa [Set.mem_singleton_iff] using hd subst hd0 change (0 : Fin n ) Set.recessionCone (K k) intro x hx s hs simpa using hx have hKbounded : k, Bornology.IsBounded (K k) := by intro k exact (helperForTheorem_21_3_bounded_iff_recessionCone_eq_singleton_zero_fin (S := K k) (hKnonempty k) (hKclosed k) (hKconvex k)).2 (hKrecZero k) have hKcompact0 : IsCompact (K 0) := by exact Metric.isCompact_of_isClosed_isBounded (hKclosed 0) (hKbounded 0) have hmono : k, K (k + 1) K k := by intro k x hx have hle : eps (k + 1) eps k := by dsimp [eps] have hk : 0 < (k : ) + 1 := by linarith have hk' : (k : ) + 1 (k : ) + 1 + 1 := by linarith have hle' : 1 / ((k : ) + 1 + 1) 1 / ((k : ) + 1) := one_div_le_one_div_of_le hk hk' simpa [one_div, Nat.cast_add, Nat.cast_one, add_assoc] using hle' refine Set.mem_iInter₂.mpr ?_ intro i hi have hx' : x C {x : Fin n | f i x (eps (k + 1) : EReal)} := Set.mem_iInter₂.mp hx i hi refine hx'.1, ?_ have hxle : f i x (eps (k + 1) : EReal) := by simpa using hx'.2 exact le_trans hxle (by exact_mod_cast hle) have hinter : ( k, K k).Nonempty := IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed K hmono hKnonempty hKcompact0 hKclosed rcases hinter with x, hxAll have hxZero : x i t, C {x : Fin n | f i x (0 : EReal)} := by refine Set.mem_iInter₂.mpr ?_ intro i hi have hx0 : x K 0 := Set.mem_iInter.mp hxAll 0 have hUpper : k, f i x (eps k : EReal) := by intro k have hxk : x K k := Set.mem_iInter.mp hxAll k exact (Set.mem_iInter₂.mp hxk i hi).2 have hfi_neBot : f i x ( : EReal) := (hfProper i).2.2 x (by simp) have hfi_neTop : f i x ( : EReal) := by intro hTop have : ( : EReal) (eps 0 : EReal) := by simpa [hTop] using hUpper 0 simpa using this have hUpperReal : k, (f i x).toReal eps k := by intro k have hUpperE : (((f i x).toReal : ) : EReal) ((eps k : ) : EReal) := by simpa [EReal.coe_toReal hfi_neTop hfi_neBot] using hUpper k exact_mod_cast hUpperE have htoReal_le0 : (f i x).toReal 0 := by have hlim : Filter.Tendsto eps Filter.atTop (nhds (0 : )) := by simpa [eps] using (tendsto_one_div_add_atTop_nhds_zero_nat : Filter.Tendsto (fun n : => 1 / ((n : ) + 1)) Filter.atTop (nhds (0 : ))) exact le_of_tendsto_of_tendsto tendsto_const_nhds hlim (Filter.Eventually.of_forall hUpperReal) refine (Set.mem_iInter₂.mp hx0 i hi).1, ?_ change f i x (0 : EReal) rw [ EReal.coe_toReal hfi_neTop hfi_neBot] exact_mod_cast htoReal_le0 exact htNotPrimal x, hxZero

Helper for Theorem 21.3: under the finite restricted no-common-recession package, failure of the zero-level finite primal system forces a positive common level Unknown identifier `ε`ε whose shifted finite system is already infeasible.

lemma helperForTheorem_21_3_exists_positive_shift_infeasible_of_finite_nonpositiveMembers_and_trivialRecession {n : } {I : Type*} (C : Set (Fin n )) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (t : Finset I) (htNonempty : t.Nonempty) (hRecZero : ( i t, Set.recessionCone (C {x : Fin n | f i x (0 : EReal)})) = ({0} : Set (Fin n ))) (htNotPrimal : ¬ ( i t, C {x : Fin n | f i x (0 : EReal)}).Nonempty) : ε : , 0 < ε ¬ ( i t, C {x : Fin n | f i x (ε : EReal)}).Nonempty := by have hNoCommonRestricted : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : (t : Set I), x : Fin n , s : , 0 s f i.1 (x + s d) f i.1 x) := helperForTheorem_21_3_restricted_noCommonRecession_of_finite_nonpositiveMembers_and_trivialRecession C f t hRecZero exact helperForTheorem_21_3_exists_positive_shift_infeasible_of_finite_notPrimal_and_noCommonRecession C hCclosed hCconvex f hfProper hfClosed t htNonempty hNoCommonRestricted htNotPrimal

Helper for Theorem 21.3: the finite real upper hull of a finite family of proper convex functions over a convex set Unknown identifier `C`C is convex.

lemma helperForTheorem_21_3_convexity_of_finiteValueUpperHull {n m : } (C : Set (Fin n )) (hCconvex : Convex C) (g : Fin m (Fin n ) EReal) (hgProper : j : Fin m, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) : Convex {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} := by intro u hu v hv a b ha hb hab rcases hu with x, hxC, hxUpper rcases hv with y, hyC, hyUpper refine a x + b y, hCconvex hxC hyC ha hb hab, ?_ intro j have hconvEpi : Convex (epigraph (S := (Set.univ : Set (Fin n ))) (g j)) := by simpa using convex_epigraph_of_convexFunctionOn (f := g j) (hf := (hgProper j).1) have hxEpi : (x, u j) epigraph (S := (Set.univ : Set (Fin n ))) (g j) := by exact by trivial, hxUpper j have hyEpi : (y, v j) epigraph (S := (Set.univ : Set (Fin n ))) (g j) := by exact by trivial, hyUpper j have hcomb : a (x, u j) + b (y, v j) epigraph (S := (Set.univ : Set (Fin n ))) (g j) := hconvEpi hxEpi hyEpi ha hb hab have hineq : g j (a x + b y) ((a * u j + b * v j : ) : EReal) := by simpa [epigraph, smul_eq_mul] using hcomb.2 simpa [smul_eq_mul] using hineq

Helper for Theorem 21.3: the finite real upper hull is upward-closed under coordinatewise order.

lemma helperForTheorem_21_3_upperClosed_finiteValueUpperHull {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) {u v : Fin m } (hu : u {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)}) (huv : j : Fin m, u j v j) : v {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} := by rcases hu with x, hxC, hxUpper refine x, hxC, ?_ intro j exact le_trans (hxUpper j) (by exact_mod_cast huv j)

Helper for Theorem 21.3: if the zero-level finite primal system is infeasible, then the origin is not contained in the corresponding finite real upper hull.

lemma helperForTheorem_21_3_zero_not_mem_finiteValueUpperHull_of_infeasible {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) (hNotFeasible : ¬ ( j : Fin m, C {x : Fin n | g j x (0 : EReal)}).Nonempty) : (fun _ : Fin m => (0 : )) {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} := by intro hzeroMem rcases hzeroMem with x, hxC, hxUpper apply hNotFeasible refine x, Set.mem_iInter.mpr ?_ intro j exact hxC, by simpa using hxUpper j

Helper for Theorem 21.3: every positive common real shift that is feasible for a finite family yields the corresponding constant vector in the finite real upper hull.

lemma helperForTheorem_21_3_constant_vector_mem_finiteValueUpperHull {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) (hm : 0 < m) (hAllShiftedFeasible : ε : , 0 < ε ( j : Fin m, C {x : Fin n | g j x (ε : EReal)}).Nonempty) : ε : , 0 < ε (fun _ : Fin m => ε) {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} := by intro ε rcases hAllShiftedFeasible ε with x, hx let j0 : Fin m := 0, hm refine x, ?_, ?_ · exact (Set.mem_iInter.mp hx j0).1 · intro j simpa using (Set.mem_iInter.mp hx j).2

Helper for Theorem 21.3: if every positive common shift is feasible for a finite family, then the origin lies in the closure of the associated finite real upper hull.

lemma helperForTheorem_21_3_zero_mem_closure_finiteValueUpperHull {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) (hm : 0 < m) (hAllShiftedFeasible : ε : , 0 < ε ( j : Fin m, C {x : Fin n | g j x (ε : EReal)}).Nonempty) : (fun _ : Fin m => (0 : )) closure {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} := by let U : Set (Fin m ) := {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} let constVec : Fin m := fun ε _ => ε have hconstMem : ε : , 0 < ε constVec ε U := by intro ε simpa [U, constVec] using helperForTheorem_21_3_constant_vector_mem_finiteValueUpperHull C g hm hAllShiftedFeasible ε have himageSubset : constVec '' Set.Ioi (0 : ) U := by intro u hu rcases hu with ε, , rfl exact hconstMem ε have hcontConst : Continuous constVec := by refine continuous_pi ?_ intro j simpa [constVec] using (continuous_id : Continuous (fun ε : => ε)) have hzeroClosureIoi : (0 : ) closure (Set.Ioi (0 : )) := by simpa [closure_Ioi] have hzeroMemImageClosure : constVec 0 closure (constVec '' Set.Ioi (0 : )) := by have himageClosure : constVec '' closure (Set.Ioi (0 : )) closure (constVec '' Set.Ioi (0 : )) := image_closure_subset_closure_image (f := constVec) (s := Set.Ioi (0 : )) hcontConst exact himageClosure 0, hzeroClosureIoi, rfl have hclosureSubset : closure (constVec '' Set.Ioi (0 : )) closure U := closure_mono himageSubset have hzeroInClosureU : constVec 0 closure U := hclosureSubset hzeroMemImageClosure simpa [U, constVec] using hzeroInClosureU

Helper for Theorem 21.3: the translated finite real upper hull at level Unknown identifier `ε`ε is convex.

lemma helperForTheorem_21_3_convexity_of_shiftedFiniteValueUpperHull {n m : } (C : Set (Fin n )) (hCconvex : Convex C) (g : Fin m (Fin n ) EReal) (hgProper : j : Fin m, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (ε : ) : Convex {u : Fin m | x, x C j : Fin m, g j x ((u j + ε : ) : EReal)} := by intro u hu v hv a b ha hb hab rcases hu with x, hxC, hxUpper rcases hv with y, hyC, hyUpper refine a x + b y, hCconvex hxC hyC ha hb hab, ?_ intro j have hconvEpi : Convex (epigraph (S := (Set.univ : Set (Fin n ))) (g j)) := by simpa using convex_epigraph_of_convexFunctionOn (f := g j) (hf := (hgProper j).1) have hxEpi : (x, u j + ε) epigraph (S := (Set.univ : Set (Fin n ))) (g j) := by exact by trivial, hxUpper j have hyEpi : (y, v j + ε) epigraph (S := (Set.univ : Set (Fin n ))) (g j) := by exact by trivial, hyUpper j have hcomb : a (x, u j + ε) + b (y, v j + ε) epigraph (S := (Set.univ : Set (Fin n ))) (g j) := hconvEpi hxEpi hyEpi ha hb hab have hineq : g j (a x + b y) ((a * (u j + ε) + b * (v j + ε) : ) : EReal) := by simpa [epigraph, smul_eq_mul] using hcomb.2 have hrewrite : a * (u j + ε) + b * (v j + ε) = a * u j + b * v j + ε := by calc a * (u j + ε) + b * (v j + ε) = a * u j + b * v j + (a + b) * ε := by ring _ = a * u j + b * v j + ε := by rw [hab]; ring have htarget : ((a * u j + b * v j + ε : ) : EReal) = (((a u + b v) j + ε : ) : EReal) := by simp [smul_eq_mul, add_comm, This simp argument is unused: add_left_comm Hint: Omit it from the simp argument list. simp [smul_eq_mul, add_comm, a̵d̵d̵_̵l̵e̵f̵t̵_̵c̵o̵m̵m̵,̵ ̵add_assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`add_left_comm, This simp argument is unused: add_assoc Hint: Omit it from the simp argument list. simp [smul_eq_mul, add_comm, add_left_comm,̵ ̵a̵d̵d̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`add_assoc] calc g j (a x + b y) ((a * (u j + ε) + b * (v j + ε) : ) : EReal) := hineq _ = ((a * u j + b * v j + ε : ) : EReal) := by rw [hrewrite] _ = (((a u + b v) j + ε : ) : EReal) := htarget

Helper for Theorem 21.3: the translated finite real upper hull at level Unknown identifier `ε`ε is upward-closed under coordinatewise order.

lemma helperForTheorem_21_3_upperClosed_shiftedFiniteValueUpperHull {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) (ε : ) {u v : Fin m } (hu : u {u : Fin m | x, x C j : Fin m, g j x ((u j + ε : ) : EReal)}) (huv : j : Fin m, u j v j) : v {u : Fin m | x, x C j : Fin m, g j x ((u j + ε : ) : EReal)} := by rcases hu with x, hxC, hxUpper refine x, hxC, ?_ intro j have huv' : u j + ε v j + ε := by simpa [add_comm, add_left_comm, add_assoc] using add_le_add_right (huv j) ε exact le_trans (hxUpper j) (by exact_mod_cast huv')

Helper for Theorem 21.3: a witness to the unshifted finite upper hull yields a witness to the translated upper hull at level Unknown identifier `ε`ε.

lemma helperForTheorem_21_3_nonempty_shiftedFiniteValueUpperHull {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) (ε : ) (hUpperHullNonempty : {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)}.Nonempty) : ({u : Fin m | x, x C j : Fin m, g j x ((u j + ε : ) : EReal)} : Set (Fin m )).Nonempty := by rcases hUpperHullNonempty with u, x, hxC, hxUpper refine fun j => u j - ε, x, hxC, ?_ intro j simpa using hxUpper j

Helper for Theorem 21.3: infeasibility of the common shifted system means the origin does not belong to the translated finite upper hull.

lemma helperForTheorem_21_3_zero_not_mem_shiftedFiniteValueUpperHull_of_shiftGap {n m : } (C : Set (Fin n )) (g : Fin m (Fin n ) EReal) (ε : ) (hShiftGap : ¬ ( j : Fin m, C {x : Fin n | g j x (ε : EReal)}).Nonempty) : (fun _ : Fin m => (0 : )) {u : Fin m | x, x C j : Fin m, g j x ((u j + ε : ) : EReal)} := by intro hzeroMem rcases hzeroMem with x, hxC, hxUpper apply hShiftGap refine x, Set.mem_iInter.mpr ?_ intro j exact hxC, by simpa using hxUpper j

Helper for Theorem 21.3: if an upper-closed convex set Unknown identifier `U`U is nonempty and its closure does not contain the origin, then a strictly positive nonnegative support functional exists on Unknown identifier `U`U.

lemma helperForTheorem_21_3_positive_support_lower_bound_of_upperClosed_zero_not_mem_closure {m : } (U : Set (Fin m )) (hUconv : Convex U) (hUne : U.Nonempty) (hUupper : {u v : Fin m }, u U ( j : Fin m, u j v j) v U) (hzeroNotMemClosureU : (fun _ : Fin m => (0 : )) closure U) : lam : Fin m , δ : , ( j : Fin m, 0 lam j) lam 0 0 < δ ( u : Fin m , u U δ u ⬝ᵥ lam) := by have hClosureNonempty : (closure U).Nonempty := hUne.mono subset_closure have hClosureConv : Convex (closure U) := hUconv.closure rcases cor11_7_1_exists_strict_dotProduct_separator_of_not_mem (n := m) (K := closure U) hClosureNonempty isClosed_closure hClosureConv hzeroNotMemClosureU with b, β, hb_ne_zero, hClosureLe, hβlt0 let lam : Fin m := -b let δ : := -β have hδpos : 0 < δ := by have hβlt0' : β < 0 := by simpa using hβlt0 simpa [δ] using neg_pos.mpr hβlt0' have hlam_nonneg : j : Fin m, 0 lam j := by rcases hUne with u0, hu0 intro j by_contra hjneg have hbpos : 0 < b j := by have : lam j < 0 := lt_of_not_ge hjneg simpa [lam] using neg_pos.mpr this let t : := (β - u0 ⬝ᵥ b + 1) / b j let ej : Fin m := Pi.single j (1 : ) have hu0Leβ : u0 ⬝ᵥ b β := hClosureLe u0 (subset_closure hu0) have htpos : 0 < t := by have hnum : 0 < β - u0 ⬝ᵥ b + 1 := by linarith exact div_pos hnum hbpos let v : Fin m := u0 + t ej have hv_mem : v U := by refine hUupper hu0 ?_ intro i by_cases hij : i = j · subst hij simp [v, ej, t, htpos.le] · simp [v, ej, hij] have hvLe : v ⬝ᵥ b β := hClosureLe v (subset_closure hv_mem) have hvdot : v ⬝ᵥ b = u0 ⬝ᵥ b + t * b j := by calc v ⬝ᵥ b = x : Fin m, (u0 x + t * ej x) * b x := by simp [v, dotProduct] _ = x : Fin m, (u0 x * b x + (t * ej x) * b x) := by refine Finset.sum_congr rfl ?_ intro x hx ring _ = ( x : Fin m, u0 x * b x) + x : Fin m, (t * ej x) * b x := by rw [Finset.sum_add_distrib] _ = u0 ⬝ᵥ b + t * b j := by have hsum_ej : x : Fin m, (t * ej x) * b x = t * b j := by calc x : Fin m, (t * ej x) * b x = x : Fin m, if x = j then t * b j else 0 := by refine Finset.sum_congr rfl ?_ intro x hx by_cases hxj : x = j · subst hxj simp [ej] · simp [ej, hxj] _ = t * b j := by simp have hsum_ej' : x : Fin m, b x * (t * ej x) = t * b j := by simpa [mul_comm, mul_left_comm, mul_assoc] using hsum_ej simp [dotProduct, hsum_ej', mul_comm, This simp argument is unused: mul_left_comm Hint: Omit it from the simp argument list. simp [dotProduct, hsum_ej', mul_comm, mul_l̵e̵f̵t̵_̵c̵o̵m̵m̵,̵ ̵m̵u̵l̵_̵assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_left_comm, This simp argument is unused: mul_assoc Hint: Omit it from the simp argument list. simp [dotProduct, hsum_ej', mul_comm, mul_left_comm,̵ ̵m̵u̵l̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_assoc] have htbj : t * b j = β - u0 ⬝ᵥ b + 1 := by have hbjnz : b j 0 := ne_of_gt hbpos calc t * b j = ((β - u0 ⬝ᵥ b + 1) / b j) * b j := by simp [t] _ = β - u0 ⬝ᵥ b + 1 := by field_simp [hbjnz] have : β + 1 β := by linarith [hvLe] linarith refine lam, δ, hlam_nonneg, ?_, hδpos, ?_ · simpa [lam] using neg_ne_zero.mpr hb_ne_zero · intro u huU have huLe : u ⬝ᵥ b β := hClosureLe u (subset_closure huU) have : -β -(u ⬝ᵥ b) := neg_le_neg huLe simpa [lam, δ, dotProduct_neg] using this

Helper for Theorem 21.3: if the finite real upper hull is empty, Helly yields a sparse subfamily whose every point in Unknown identifier `C`C forces some coordinate to be : ?m.1; taking unit weights then gives an immediate positive-margin certificate.

lemma helperForTheorem_21_3_sparseFiniteDual_margin_of_empty_finiteValueUpperHull {n m : } (C : Set (Fin n )) (hCconvex : Convex C) (g : Fin m (Fin n ) EReal) (hgProper : j : Fin m, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (hm : 0 < m) (hUempty : {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} = ) : p : , p n + 1 idx : Fin p Fin m, Function.Injective idx w : Fin p , ( j : Fin p, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin p, ((w j : ) : EReal) * g (idx j) x := by classical let U : Set (Fin m ) := {u : Fin m | x, x C j : Fin m, g j x (u j : EReal)} let D : Fin m Set (Fin n ) := fun j => C effectiveDomain (Set.univ : Set (Fin n )) (g j) have hDconvex : j : Fin m, Convex (D j) := by intro j exact hCconvex.inter (effectiveDomain_convex (S := (Set.univ : Set (Fin n ))) (f := g j) (hgProper j).1) have hDempty : ¬ ( j : Fin m, D j).Nonempty := by intro hDnonempty rcases hDnonempty with x, hx haveI : Nonempty (Fin m) := Fin.pos_iff_nonempty.mp hm let j0 : Fin m := Classical.choice Nonempty (Fin m) have hxC : x C := (Set.mem_iInter.mp hx j0).1 let u : Fin m := fun j => (g j x).toReal have hu_mem : u U := by refine x, hxC, ?_ intro j have hxj : x D j := Set.mem_iInter.mp hx j have hgj_neTop : g j x ( : EReal) := mem_effectiveDomain_imp_ne_top (S := (Set.univ : Set (Fin n ))) (f := g j) hxj.2 have hgj_neBot : g j x ( : EReal) := (hgProper j).2.2 x (by simp) have hEq : (((g j x).toReal : ) : EReal) = g j x := by simpa using (EReal.coe_toReal hgj_neTop hgj_neBot) simpa [u, hEq] have : u ( : Set (Fin m )) := by simpa [U, hUempty] using hu_mem simpa using this have hSmall : s : Finset (Fin m), s.card n + 1 ¬ ( j s, D j).Nonempty := by by_cases hExists : s : Finset (Fin m), s.card n + 1 ¬ ( j s, D j).Nonempty · exact hExists · exfalso have hAllSmall : s : Finset (Fin m), s.card Module.finrank (Fin n ) + 1 ( j s, D j).Nonempty := by intro s hs by_contra hsEmpty exact hExists s, by simpa [Module.finrank_fin_fun] using hs, hsEmpty have hAll : ( j : Fin m, D j).Nonempty := by have hHelly := Convex.helly_theorem' (𝕜 := ) (E := Fin n ) (F := D) (s := (Finset.univ : Finset (Fin m))) (by intro j hj exact hDconvex j) (by intro s hs hcard exact hAllSmall s (by simpa [Module.finrank_fin_fun] using hcard)) simpa using hHelly exact hDempty hAll rcases hSmall with s, hs_card, hsEmpty let p : := s.card have hp_pos : 0 < p := by by_contra hp have hp0 : p = 0 := Nat.eq_zero_of_not_pos hp have hs0 : s = := Finset.card_eq_zero.mp (by simpa [p] using hp0) have hne : ( j s, D j).Nonempty := by simpa [hs0] exact hsEmpty hne let e : s Fin p := Finset.equivFin s let idx : Fin p Fin m := fun j => (e.symm j : Fin m) have hidx : Function.Injective idx := by intro j1 j2 hEq apply e.symm.injective exact Subtype.ext hEq refine p, ?_, idx, hidx, (fun _ => (1 : )), ?_, 1, by norm_num, ?_ · simpa [p] using hs_card · intro j norm_num · intro x hxC have hsEmpty' : ¬ ( j : Fin p, D (idx j)).Nonempty := by intro hne apply hsEmpty rcases hne with y, hy refine y, Set.mem_iInter₂.mpr ?_ intro j hj let jj : Fin p := e j, hj have hyj : y D (idx jj) := Set.mem_iInter.mp hy jj simpa [idx, jj] using hyj have hnotAll : ¬ j : Fin p, x D (idx j) := by intro hall exact hsEmpty' x, Set.mem_iInter.mpr hall rcases not_forall.mp hnotAll with j0, hj0 have hxNotDom : x effectiveDomain (Set.univ : Set (Fin n )) (g (idx j0)) := by intro hxDom exact hj0 hxC, hxDom have htop : g (idx j0) x = ( : EReal) := not_mem_effectiveDomain_univ_imp_eq_top (f := g (idx j0)) hxNotDom let term : Fin p EReal := fun j => (((1 : ) : EReal) * g (idx j) x) have htermTop : term j0 = ( : EReal) := by simp [term, htop] have htermNeBot : j : Fin p, term j ( : EReal) := by intro j have hgj_neBot : g (idx j) x ( : EReal) := (hgProper (idx j)).2.2 x (by simp) simpa [term] using hgj_neBot have hrestNeBot : Finset.sum (Finset.univ.erase j0) term ( : EReal) := by intro hbot rcases (WithBot.sum_eq_bot_iff (s := Finset.univ.erase j0) (f := term)).1 hbot with j, hjmem, hjbot exact htermNeBot j hjbot have hsumTop : ( j : Fin p, term j) = ( : EReal) := by calc ( j : Fin p, term j) = Finset.sum (Finset.univ.erase j0) term + term j0 := by simpa using (Finset.sum_erase_add (s := Finset.univ) (f := term) (a := j0) (by simp)).symm _ = ( : EReal) := by simp [htermTop, hrestNeBot] have hmarginTop : ((1 : ) : EReal) j : Fin p, term j := by rw [hsumTop] simp simpa [term] using hmarginTop

Helper for Theorem 21.3: if one shifted sublevel is already empty at level Unknown identifier `ε`ε, a single-coordinate witness gives an immediate sparse positive-margin certificate.

lemma helperForTheorem_21_3_sparseFiniteDual_margin_of_single_empty_shifted_sublevel {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (j0 : Fin p) (ε : ) ( : 0 < ε) (hEmpty : ¬ (C {x : Fin n | g j0 x (ε : EReal)}).Nonempty) : m : , m n + 1 idx : Fin m Fin p, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε' : , 0 < ε' x : Fin n , x C ((ε' : ) : EReal) j : Fin m, ((w j : ) : EReal) * g (idx j) x := by refine 1, by simpa using Nat.succ_le_succ (Nat.zero_le n), (fun _ => j0), ?_, (fun _ => 1), ?_, ε, , ?_ · intro a b _ simpa using (Subsingleton.elim a b) · intro j norm_num · intro x hxC have hsumEq : ( j : Fin 1, (((fun _ : Fin 1 => (1 : )) j : ) : EReal) * g ((fun _ : Fin 1 => j0) j) x) = g j0 x := by simp by_contra hmargin have hmargin' : ¬ ((ε : ) : EReal) g j0 x := by simpa [hsumEq] using hmargin have hxlt : g j0 x < (ε : EReal) := lt_of_not_ge hmargin' have hxle : g j0 x (ε : EReal) := hxlt.le exact hEmpty x, hxC, hxle

Helper for Theorem 21.3: after excluding the easy empty-sublevel and empty-upper-hull branches, Helly yields a shifted-infeasible finite subfamily of cardinal at most Unknown identifier `n`sorry + 1 : n + 1.

lemma helperForTheorem_21_3_exists_small_shifted_infeasible_subfamily_fin {n p : } (C : Set (Fin n )) (hCclosed : IsClosed C) (hCconvex : Convex C) (g : Fin p (Fin n ) EReal) (hgProper : j : Fin p, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (hgClosed : j : Fin p, IsClosed {q : (Fin n ) × | g j q.1 (q.2 : EReal)}) (ε : ) (hShiftGap : ¬ ( j : Fin p, C {x : Fin n | g j x (ε : EReal)}).Nonempty) : m : , m n + 1 idx : Fin m Fin p, Function.Injective idx ¬ ( j : Fin m, C {x : Fin n | g (idx j) x (ε : EReal)}).Nonempty := by classical let D : Fin p Set (Fin n ) := fun j => C {x : Fin n | g j x (ε : EReal)} have hDclosed : j : Fin p, IsClosed (D j) := by intro j exact hCclosed.inter (helperForTheorem_21_3_sublevel_closed_convex (f := g j) (hfProper := hgProper j) (hfClosed := hgClosed j) (α := ε)).1 have hDconvex : j : Fin p, Convex (D j) := by intro j exact hCconvex.inter (helperForTheorem_21_3_sublevel_closed_convex (f := g j) (hfProper := hgProper j) (hfClosed := hgClosed j) (α := ε)).2 have hSmall : s : Finset (Fin p), s.card n + 1 ¬ ( j s, D j).Nonempty := by by_cases hExists : s : Finset (Fin p), s.card n + 1 ¬ ( j s, D j).Nonempty · exact hExists · exfalso have hAllSmall : s : Finset (Fin p), s.card Module.finrank (Fin n ) + 1 ( j s, D j).Nonempty := by intro s hs by_contra hsEmpty exact hExists s, by simpa [Module.finrank_fin_fun] using hs, hsEmpty have hAll : ( j : Fin p, D j).Nonempty := by have hHelly := Convex.helly_theorem' (𝕜 := ) (E := Fin n ) (F := D) (s := (Finset.univ : Finset (Fin p))) (by intro j hj exact hDconvex j) (by intro s hs hcard exact hAllSmall s (by simpa [Module.finrank_fin_fun] using hcard)) simpa using hHelly exact hShiftGap hAll rcases hSmall with s, hs_card, hsEmpty let m : := s.card let e : s Fin m := Finset.equivFin s let idx : Fin m Fin p := fun j => (e.symm j : Fin p) have hidx : Function.Injective idx := by intro j1 j2 hEq apply e.symm.injective exact Subtype.ext hEq refine m, by simpa [m] using hs_card, idx, hidx, ?_ intro hne apply hsEmpty rcases hne with x, hx refine x, Set.mem_iInter₂.mpr ?_ intro j hj let jj : Fin m := e j, hj have hxj : x D (idx jj) := Set.mem_iInter.mp hx jj simpa [D, idx, jj] using hxj

Helper for Theorem 21.3: Helly also yields a zero-level infeasible finite subfamily of cardinality at most Unknown identifier `n`sorry + 1 : n + 1. This is the correct reduction for the final finite analytic core, because a mere positive-shift gap is not enough by itself to force a positive dual margin.

lemma helperForTheorem_21_3_exists_small_zero_infeasible_subfamily_fin {n p : } (C : Set (Fin n )) (hCclosed : IsClosed C) (hCconvex : Convex C) (g : Fin p (Fin n ) EReal) (hgProper : j : Fin p, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (hgClosed : j : Fin p, IsClosed {q : (Fin n ) × | g j q.1 (q.2 : EReal)}) (hZeroGap : ¬ ( j : Fin p, C {x : Fin n | g j x (0 : EReal)}).Nonempty) : m : , m n + 1 idx : Fin m Fin p, Function.Injective idx ¬ ( j : Fin m, C {x : Fin n | g (idx j) x (0 : EReal)}).Nonempty := by classical let D : Fin p Set (Fin n ) := fun j => C {x : Fin n | g j x (0 : EReal)} have hDclosed : j : Fin p, IsClosed (D j) := by intro j exact hCclosed.inter (helperForTheorem_21_3_sublevel_closed_convex (f := g j) (hfProper := hgProper j) (hfClosed := hgClosed j) (α := 0)).1 have hDconvex : j : Fin p, Convex (D j) := by intro j exact hCconvex.inter (helperForTheorem_21_3_sublevel_closed_convex (f := g j) (hfProper := hgProper j) (hfClosed := hgClosed j) (α := 0)).2 have hSmall : s : Finset (Fin p), s.card n + 1 ¬ ( j s, D j).Nonempty := by by_cases hExists : s : Finset (Fin p), s.card n + 1 ¬ ( j s, D j).Nonempty · exact hExists · exfalso have hAllSmall : s : Finset (Fin p), s.card Module.finrank (Fin n ) + 1 ( j s, D j).Nonempty := by intro s hs by_contra hsEmpty exact hExists s, by simpa [Module.finrank_fin_fun] using hs, hsEmpty have hAll : ( j : Fin p, D j).Nonempty := by have hHelly := Convex.helly_theorem' (𝕜 := ) (E := Fin n ) (F := D) (s := (Finset.univ : Finset (Fin p))) (by intro j hj exact hDconvex j) (by intro s hs hcard exact hAllSmall s (by simpa [Module.finrank_fin_fun] using hcard)) simpa using hHelly exact hZeroGap hAll rcases hSmall with s, hs_card, hsEmpty let m : := s.card let e : s Fin m := Finset.equivFin s let idx : Fin m Fin p := fun j => (e.symm j : Fin p) have hidx : Function.Injective idx := by intro j1 j2 hEq apply e.symm.injective exact Subtype.ext hEq refine m, by simpa [m] using hs_card, idx, hidx, ?_ intro hne apply hsEmpty rcases hne with x, hx refine x, Set.mem_iInter₂.mpr ?_ intro j hj let jj : Fin m := e j, hj have hxj : x D (idx jj) := Set.mem_iInter.mp hx jj simpa [D, idx, jj] using hxj

Helper for Theorem 21.3: if every active coordinate of Unknown identifier `x`x is finite, the weighted EReal : TypeEReal sum agrees with the coercion of the corresponding real sum of Unknown identifier `toReal`toReal values.

lemma helperForTheorem_21_3_erealWeightedSum_eq_coeRealWeightedSum_of_supportFinite {n p : } (g : Fin p (Fin n ) EReal) (hgProper : j : Fin p, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (lam : Fin p ) (x : Fin n ) (hSupportFinite : j : Fin p, lam j 0 g j x ( : EReal)) : ( j : Fin p, ((lam j : ) : EReal) * g j x) = ((( j : Fin p, lam j * (g j x).toReal) : ) : EReal) := by calc ( j : Fin p, ((lam j : ) : EReal) * g j x) = j : Fin p, (((lam j * (g j x).toReal : ) : EReal)) := by refine Finset.sum_congr rfl ?_ intro j hj by_cases hj0 : lam j = 0 · simp [hj0] · have htop : g j x ( : EReal) := hSupportFinite j hj0 have hbot : g j x ( : EReal) := (hgProper j).2.2 x (by simp) have hterm : (((lam j * (g j x).toReal : ) : EReal)) = ((lam j : EReal) * (((g j x).toReal : ) : EReal)) := by simpa [EReal.coe_mul, mul_comm, mul_left_comm, mul_assoc] calc ((lam j : EReal) * g j x) = ((lam j : EReal) * (((g j x).toReal : ) : EReal)) := by rw [EReal.coe_toReal htop hbot] _ = (((lam j * (g j x).toReal : ) : EReal)) := hterm.symm _ = ((( j : Fin p, lam j * (g j x).toReal) : ) : EReal) := by symm exact helperForTheorem_21_1_coe_finset_sum_real (s := (Finset.univ : Finset (Fin p))) (g := fun j : Fin p => lam j * (g j x).toReal)

Helper for Theorem 21.3: subtracting a finite real constant preserves proper convexity.

lemma helperForTheorem_21_3_shiftedEReal_properConvex {n : } {g : (Fin n ) EReal} (hg : ProperConvexFunctionOn (Set.univ : Set (Fin n )) g) (ε : ) : ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fun x => g x - ((ε : ) : EReal)) := by refine ?_, ?_, ?_ · change Convex (epigraph (Set.univ : Set (Fin n )) (fun x => g x - ((ε : ) : EReal))) intro p hp q hq a b ha hb hab rcases hp with _hpU, hpLe rcases hq with _hqU, hqLe have hpLe' : g p.1 ((p.2 + ε : ) : EReal) := by refine (EReal.sub_le_iff_le_add ?_ ?_).1 hpLe · exact Or.inl (EReal.coe_ne_bot ε) · exact Or.inl (EReal.coe_ne_top ε) have hqLe' : g q.1 ((q.2 + ε : ) : EReal) := by refine (EReal.sub_le_iff_le_add ?_ ?_).1 hqLe · exact Or.inl (EReal.coe_ne_bot ε) · exact Or.inl (EReal.coe_ne_top ε) have hpEpi : (p.1, p.2 + ε) epigraph (Set.univ : Set (Fin n )) g := by exact trivial, hpLe' have hqEpi : (q.1, q.2 + ε) epigraph (Set.univ : Set (Fin n )) g := by exact trivial, hqLe' have hcombo : a (p.1, p.2 + ε) + b (q.1, q.2 + ε) epigraph (Set.univ : Set (Fin n )) g := hg.1 hpEpi hqEpi ha hb hab have hcomboLe : g ((a p.1 + b q.1)) (((a * (p.2 + ε) + b * (q.2 + ε) : )) : EReal) := by simpa [epigraph, smul_eq_mul] using (show g ((a (p.1, p.2 + ε) + b (q.1, q.2 + ε)).1) (((a (p.1, p.2 + ε) + b (q.1, q.2 + ε)).2 : ) : EReal) from (show ((a (p.1, p.2 + ε) + b (q.1, q.2 + ε)) epigraph (Set.univ : Set (Fin n )) g) from hcombo).2) have hcomboLe' : g ((a p.1 + b q.1)) (((a * p.2 + b * q.2 + ε : )) : EReal) := by have hEq : a * (p.2 + ε) + b * (q.2 + ε) = a * p.2 + b * q.2 + ε := by calc a * (p.2 + ε) + b * (q.2 + ε) = a * p.2 + b * q.2 + (a + b) * ε := by ring _ = a * p.2 + b * q.2 + ε := by rw [hab]; ring simpa [hEq] using hcomboLe have hshiftLe : g ((a p.1 + b q.1)) - ((ε : ) : EReal) (((a * p.2 + b * q.2 : )) : EReal) := by refine (EReal.sub_le_iff_le_add ?_ ?_).2 ?_ · exact Or.inl (EReal.coe_ne_bot ε) · exact Or.inl (EReal.coe_ne_top ε) simpa [EReal.coe_add, add_assoc, add_left_comm, add_comm] using hcomboLe' refine trivial, ?_ simpa [smul_eq_mul, epigraph] using hshiftLe · rcases hg.2.1 with p, hp refine (p.1, p.2 - ε), ?_ rcases hp with hpU, hpLe refine hpU, ?_ have hEq : (((p.2 - ε : )) : EReal) + ((ε : ) : EReal) = (p.2 : EReal) := by calc (((p.2 - ε : )) : EReal) + ((ε : ) : EReal) = (((p.2 - ε + ε : )) : EReal) := by rw [ EReal.coe_add] _ = (p.2 : EReal) := by congr 1 ring refine (EReal.sub_le_iff_le_add ?_ ?_).2 ?_ · exact Or.inl (EReal.coe_ne_bot ε) · exact Or.inl (EReal.coe_ne_top ε) exact hEq.symm hpLe · intro x hxU have hne : g x + (((-ε : )) : EReal) ( : EReal) := (EReal.add_ne_bot_iff).2 hg.2.2 x hxU, EReal.coe_ne_bot (-ε) simpa [sub_eq_add_neg] using hne

Helper for Theorem 21.3: once translated-upper-hull geometry yields a real lower bound, the remaining deterministic analytic step is to extend support-finite points of Unknown identifier `C`C to shifted upper-hull points with matching active coordinates.

lemma helperForTheorem_21_3_positive_margin_of_shiftedLowerBound_and_supportExtension {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (hgProper : j : Fin p, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (ε : ) ( : 0 < ε) (lam : Fin p ) (hlam_nonneg : j : Fin p, 0 lam j) (hlam_ne_zero : lam 0) (α : ) (hα_nonneg : 0 α) (hLower : u : Fin p , ( y, y C j : Fin p, g j y ((u j + ε : ) : EReal)) α u ⬝ᵥ lam) (hSupportExtend : x : Fin n , x C ( j : Fin p, lam j 0 g j x ( : EReal)) u : Fin p , ( y, y C j : Fin p, g j y ((u j + ε : ) : EReal)) ( j : Fin p, lam j 0 u j + ε = (g j x).toReal)) : ε' : , 0 < ε' x : Fin n , x C ((ε' : ) : EReal) j : Fin p, ((lam j : ) : EReal) * g j x := by have hsum_nonneg : 0 j : Fin p, lam j := by exact Finset.sum_nonneg (by intro j hj; exact hlam_nonneg j) have hsum_ne_zero : j : Fin p, lam j 0 := by intro hsum0 have hcoord_zero : j : Fin p, lam j = 0 := by intro j have hjle : lam j i : Fin p, lam i := by simpa using (Finset.single_le_sum (by intro i hi; exact hlam_nonneg i) (Finset.mem_univ j)) have : lam j 0 := by simpa [hsum0] using hjle exact le_antisymm this (hlam_nonneg j) exact hlam_ne_zero (funext hcoord_zero) have hsum_pos : 0 < j : Fin p, lam j := lt_of_le_of_ne hsum_nonneg (Ne.symm hsum_ne_zero) let ε' : := α + ε * j : Fin p, lam j have hε'_pos : 0 < ε' := by have hmul_pos : 0 < ε * j : Fin p, lam j := mul_pos hsum_pos dsimp [ε'] linarith refine ε', hε'_pos, ?_ intro x hxC by_cases hTopSupport : j : Fin p, lam j 0 g j x = ( : EReal) · rcases hTopSupport with j0, hj0nz, hj0top have hj0pos : 0 < lam j0 := lt_of_le_of_ne (hlam_nonneg j0) (Ne.symm hj0nz) let term : Fin p EReal := fun j => ((lam j : ) : EReal) * g j x have htermTop : term j0 = ( : EReal) := by have hmulTop : ((lam j0 : ) : EReal) * ( : EReal) = ( : EReal) := by simpa using (EReal.coe_mul_top_of_pos hj0pos) simpa [term, hj0top] using hmulTop have htermNeBot : j : Fin p, term j ( : EReal) := by intro j by_cases hj0 : lam j = 0 · simp [term, hj0] · by_cases hjtop : g j x = ( : EReal) · have hjpos : 0 < lam j := lt_of_le_of_ne (hlam_nonneg j) (Ne.symm hj0) have htermTop' : term j = ( : EReal) := by have hmulTop : ((lam j : ) : EReal) * ( : EReal) = ( : EReal) := by simpa using (EReal.coe_mul_top_of_pos hjpos) simpa [term, hjtop] using hmulTop simpa [htermTop'] · have hbot : g j x ( : EReal) := (hgProper j).2.2 x (by simp) have hEq : term j = (((lam j * (g j x).toReal : ) : EReal)) := by have hterm : (((lam j * (g j x).toReal : ) : EReal)) = ((lam j : EReal) * (((g j x).toReal : ) : EReal)) := by simpa [EReal.coe_mul, mul_comm, mul_left_comm, mul_assoc] calc term j = ((lam j : EReal) * (((g j x).toReal : ) : EReal)) := by simp [term, EReal.coe_toReal hjtop hbot] _ = (((lam j * (g j x).toReal : ) : EReal)) := hterm.symm rw [hEq] exact EReal.coe_ne_bot _ have hrestNeBot : Finset.sum (Finset.univ.erase j0) term ( : EReal) := by intro hbot rcases (WithBot.sum_eq_bot_iff (s := Finset.univ.erase j0) (f := term)).1 hbot with j, hjmem, hjbot exact htermNeBot j hjbot have hsumTop : ( j : Fin p, term j) = ( : EReal) := by calc ( j : Fin p, term j) = Finset.sum (Finset.univ.erase j0) term + term j0 := by simpa using (Finset.sum_erase_add (s := Finset.univ) (f := term) (a := j0) (by simp)).symm _ = ( : EReal) := by simp [htermTop, hrestNeBot] have hmarginTop : ((ε' : ) : EReal) j : Fin p, term j := by rw [hsumTop] simp simpa [term] using hmarginTop · have hSupportFinite : j : Fin p, lam j 0 g j x ( : EReal) := by intro j hjnz hjtop exact hTopSupport j, hjnz, hjtop rcases hSupportExtend x hxC hSupportFinite with u, hu_mem, hu_match have hLowerAtU : α u ⬝ᵥ lam := hLower u hu_mem have hcoord : j : Fin p, lam j * (g j x).toReal = lam j * u j + ε * lam j := by intro j by_cases hj0 : lam j = 0 · simp [hj0] · have huj : u j + ε = (g j x).toReal := hu_match j hj0 calc lam j * (g j x).toReal = lam j * (u j + ε) := by rw [ huj] _ = lam j * u j + ε * lam j := by ring have hsumReal : j : Fin p, lam j * (g j x).toReal = u ⬝ᵥ lam + ε * j : Fin p, lam j := by calc j : Fin p, lam j * (g j x).toReal = j : Fin p, (lam j * u j + ε * lam j) := by refine Finset.sum_congr rfl ?_ intro j hj exact hcoord j _ = ( j : Fin p, lam j * u j) + j : Fin p, (ε * lam j) := by rw [Finset.sum_add_distrib] _ = u ⬝ᵥ lam + ε * j : Fin p, lam j := by simp [dotProduct, Finset.mul_sum, mul_comm, This simp argument is unused: mul_left_comm Hint: Omit it from the simp argument list. simp [dotProduct, Finset.mul_sum, mul_comm, mul_l̵e̵f̵t̵_̵c̵o̵m̵m̵,̵ ̵m̵u̵l̵_̵assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_left_comm, This simp argument is unused: mul_assoc Hint: Omit it from the simp argument list. simp [dotProduct, Finset.mul_sum, mul_comm, mul_left_comm,̵ ̵m̵u̵l̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_assoc] have hrealMargin : ε' j : Fin p, lam j * (g j x).toReal := by rw [hsumReal] dsimp [ε'] linarith have hrealMarginE : ((ε' : ) : EReal) ((( j : Fin p, lam j * (g j x).toReal) : ) : EReal) := by exact_mod_cast hrealMargin calc ((ε' : ) : EReal) ((( j : Fin p, lam j * (g j x).toReal) : ) : EReal) := hrealMarginE _ = j : Fin p, ((lam j : ) : EReal) * g j x := by symm exact helperForTheorem_21_3_erealWeightedSum_eq_coeRealWeightedSum_of_supportFinite g hgProper lam x hSupportFinite

Helper for Theorem 21.3: if the translated finite upper hull admits a lower bound by a strictly positive weight vector on every coordinate, then no support-extension argument is needed. Points outside the common effective domain are automatically handled because some active coordinate contributes : ?m.1, while common-domain points can be plugged directly into the translated hull.

lemma helperForTheorem_21_3_positive_margin_of_shiftedLowerBound_and_fullSupport {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (hgProper : j : Fin p, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (hp : 0 < p) (ε : ) ( : 0 < ε) (lam : Fin p ) (hlam_pos : j : Fin p, 0 < lam j) (α : ) (hα_nonneg : 0 α) (hLower : u : Fin p , ( y, y C j : Fin p, g j y ((u j + ε : ) : EReal)) α u ⬝ᵥ lam) : ε' : , 0 < ε' x : Fin n , x C ((ε' : ) : EReal) j : Fin p, ((lam j : ) : EReal) * g j x := by have hlam_nonneg : j : Fin p, 0 lam j := by intro j exact (hlam_pos j).le have hsum_nonneg : 0 j : Fin p, lam j := by exact Finset.sum_nonneg (by intro j hj; exact hlam_nonneg j) let j0 : Fin p := 0, hp have hsum_pos : 0 < j : Fin p, lam j := by have hj0_le : lam j0 j : Fin p, lam j := by simpa using (Finset.single_le_sum (by intro j hj; exact hlam_nonneg j) (Finset.mem_univ j0)) exact lt_of_lt_of_le (hlam_pos j0) hj0_le let ε' : := α + ε * j : Fin p, lam j have hε'_pos : 0 < ε' := by dsimp [ε'] have hmul_pos : 0 < ε * j : Fin p, lam j := mul_pos hsum_pos linarith refine ε', hε'_pos, ?_ intro x hxC by_cases hAllFinite : j : Fin p, g j x ( : EReal) · let u : Fin p := fun j => (g j x).toReal - ε have hu_mem : y, y C j : Fin p, g j y ((u j + ε : ) : EReal) := by refine x, hxC, ?_ intro j have hbot : g j x ( : EReal) := (hgProper j).2.2 x (by simp) have hEq : (((u j + ε : ) : ) : EReal) = g j x := by have hreal : u j + ε = (g j x).toReal := by dsimp [u] ring calc (((u j + ε : ) : ) : EReal) = ((((g j x).toReal : ) : ) : EReal) := by exact_mod_cast hreal _ = g j x := by rw [EReal.coe_toReal (hAllFinite j) hbot] rw [ hEq] have hLowerAtU : α u ⬝ᵥ lam := hLower u hu_mem have hsumReal : u ⬝ᵥ lam = j : Fin p, lam j * (g j x).toReal - ε * j : Fin p, lam j := by calc u ⬝ᵥ lam = j : Fin p, ((g j x).toReal - ε) * lam j := by simp [u, dotProduct] _ = j : Fin p, ((lam j * (g j x).toReal) - ε * lam j) := by refine Finset.sum_congr rfl ?_ intro j hj ring _ = ( j : Fin p, lam j * (g j x).toReal) - j : Fin p, (ε * lam j) := by rw [Finset.sum_sub_distrib] _ = ( j : Fin p, lam j * (g j x).toReal) - ε * j : Fin p, lam j := by rw [Finset.mul_sum] have hrealMargin : ε' j : Fin p, lam j * (g j x).toReal := by rw [hsumReal] at hLowerAtU dsimp [ε'] linarith have hrealMarginE : ((ε' : ) : EReal) ((( j : Fin p, lam j * (g j x).toReal) : ) : EReal) := by exact_mod_cast hrealMargin calc ((ε' : ) : EReal) ((( j : Fin p, lam j * (g j x).toReal) : ) : EReal) := hrealMarginE _ = j : Fin p, ((lam j : ) : EReal) * g j x := by symm exact helperForTheorem_21_3_erealWeightedSum_eq_coeRealWeightedSum_of_supportFinite g hgProper lam x (fun j _ => hAllFinite j) · push_neg at hAllFinite rcases hAllFinite with j, hjtop have hterm_top : ((lam j : ) : EReal) * g j x = ( : EReal) := by rw [hjtop] exact EReal.coe_mul_top_of_pos (hlam_pos j) have hrem_ne_bot : (Finset.sum (Finset.univ.erase j) (fun i : Fin p => ((lam i : ) : EReal) * g i x)) ( : EReal) := by refine Finset.induction_on (Finset.univ.erase j) ?_ ?_ · simp · intro a s ha hs rw [Finset.sum_insert ha, EReal.add_ne_bot_iff] constructor · have hga_ne_bot : g a x ( : EReal) := (hgProper a).2.2 x (by simp) intro hbot rw [EReal.mul_eq_bot] at hbot simp [hga_ne_bot, not_lt_of_ge (hlam_nonneg a), This simp argument is unused: (hlam_pos a).ne' Hint: Omit it from the simp argument list. simp [hga_ne_bot, not_lt_of_ge (hlam_nonneg a),̵ ̵(̵h̵l̵a̵m̵_̵p̵o̵s̵ ̵a̵)̵.̵n̵e̵'̵] at hbot Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`(hlam_pos a).ne'] at hbot · exact hs have hsum_top : i : Fin p, ((lam i : ) : EReal) * g i x = ( : EReal) := by rw [Finset.sum_eq_add_sum_diff_singleton (Finset.mem_univ j), hterm_top] simpa [Finset.sdiff_singleton_eq_erase] using EReal.top_add_of_ne_bot hrem_ne_bot calc ((ε' : ) : EReal) ( : EReal) := by exact le_top _ = i : Fin p, ((lam i : ) : EReal) * g i x := hsum_top.symm

Helper for Theorem 21.3: in the strictly positive lower-bound branch, any actual translated-upper-hull point whose coordinates are nonpositive off Unknown identifier `j`j forces the Unknown identifier `j`j-th coefficient of the support vector to be strictly positive.

lemma helperForTheorem_21_3_positive_coord_of_positive_shiftedLowerBound_of_almostNonpositive_point {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (ε : ) (lam : Fin p ) (hlam_nonneg : i : Fin p, 0 lam i) (δ : ) (hδ_pos : 0 < δ) (hLower : u : Fin p , ( y, y C i : Fin p, g i y ((u i + ε : ) : EReal)) δ u ⬝ᵥ lam) (j : Fin p) (u : Fin p ) (hu_mem : y, y C i : Fin p, g i y ((u i + ε : ) : EReal)) (hu_nonpos : i : Fin p, i j u i 0) : 0 < lam j := by by_contra hj have hj0 : lam j = 0 := le_antisymm (le_of_not_gt hj) (hlam_nonneg j) have hdot_nonpos : u ⬝ᵥ lam 0 := by calc u ⬝ᵥ lam = i : Fin p, u i * lam i := by simp [dotProduct, mul_comm] _ i : Fin p, 0 := by refine Finset.sum_le_sum ?_ intro i hi by_cases hij : i = j · subst hij simp [hj0] · exact mul_nonpos_of_nonpos_of_nonneg (hu_nonpos i hij) (hlam_nonneg i) _ = 0 := by simp have hdot_ge : δ u ⬝ᵥ lam := hLower u hu_mem linarith

Helper for Theorem 21.3: in the boundary (Unknown identifier `β`sorry 0 : Propβ 0) branch, an actual translated-upper-hull point which is nonpositive off Unknown identifier `j`j shows that any zero coefficient at Unknown identifier `j`j forces Unknown identifier `β`sorry = 0 : Propβ = 0.

lemma helperForTheorem_21_3_beta_eq_zero_of_zero_coord_and_almostNonpositive_point {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (ε : ) (lam : Fin p ) (hlam_nonneg : i : Fin p, 0 lam i) (β : ) (hβ_nonneg : 0 β) (hLower : u : Fin p , ( y, y C i : Fin p, g i y ((u i + ε : ) : EReal)) β u ⬝ᵥ lam) (j : Fin p) (hj0 : lam j = 0) (u : Fin p ) (hu_mem : y, y C i : Fin p, g i y ((u i + ε : ) : EReal)) (hu_nonpos : i : Fin p, i j u i 0) : β = 0 := by have hdot_nonpos : u ⬝ᵥ lam 0 := by calc u ⬝ᵥ lam = i : Fin p, u i * lam i := by simp [dotProduct, mul_comm] _ i : Fin p, 0 := by refine Finset.sum_le_sum ?_ intro i hi by_cases hij : i = j · subst hij simp [hj0] · exact mul_nonpos_of_nonpos_of_nonneg (hu_nonpos i hij) (hlam_nonneg i) _ = 0 := by simp have hdot_ge : β u ⬝ᵥ lam := hLower u hu_mem have : β 0 := le_trans hdot_ge hdot_nonpos exact le_antisymm this hβ_nonneg

The extended translated upper hull used in the last Unknown identifier `Theorem`Theorem 21.3 support-upgrade step. Unlike the real upper hull, this version also records witnesses with some coordinates equal to : ?m.1, which is exactly what the erase-feasible data naturally produces.

def theorem21ShiftedExtendedUpperHull {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (ε : ) : Set (Fin p EReal) := {u : Fin p EReal | x, x C j : Fin p, g j x u j + (ε : EReal)}

Helper for Theorem 21.3: erase-feasibility gives a canonical Unknown identifier `single`sorry - sorry : ?m.5single-Unknown identifier `top`top point of the extended translated upper hull. All deleted coordinates are 0 : 0, while the retained coordinate is allowed to be : ?m.1. This is the precise extended-valued witness behind the remaining full-support upgrade gap.

lemma helperForTheorem_21_3_singleTop_mem_shiftedExtendedUpperHull_of_eraseFeasible {n p : } (C : Set (Fin n )) (g : Fin p (Fin n ) EReal) (ε : ) (hSublevelNonempty : j : Fin p, (C {x : Fin n | g j x (ε : EReal)}).Nonempty) (hEraseFeasible : j : Fin p, ( i : {i : Fin p // i j}, C {x : Fin n | g i.1 x (ε : EReal)}).Nonempty) (j : Fin p) : let uTop : Fin p EReal := fun i => if i = j then ( : EReal) else 0 uTop theorem21ShiftedExtendedUpperHull C g ε uTop j = ( : EReal) i : Fin p, i j uTop i = 0 := by classical let uTop : Fin p EReal := fun i => if i = j then ( : EReal) else 0 by_cases hExistsOther : i : Fin p, i j · rcases hExistsOther with i0, hi0 rcases hEraseFeasible j with x, hx have hx_i0 : x C {x : Fin n | g i0 x (ε : EReal)} := Set.mem_iInter.mp hx i0, hi0 have hxC : x C := hx_i0.1 refine ?_, by simp [This simp argument is unused: uTop Hint: Omit it from the simp argument list. simp ̵[̵u̵T̵o̵p̵]̵ Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`uTop], ?_ · refine x, hxC, ?_ intro i by_cases hij : i = j · subst hij simp [This simp argument is unused: uTop Hint: Omit it from the simp argument list. simp ̵[̵u̵T̵o̵p̵]̵ Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`uTop] · have hxi : x C {x : Fin n | g i x (ε : EReal)} := Set.mem_iInter.mp hx i, hij simpa [uTop, hij] using hxi.2 · intro i hi simp [This simp argument is unused: uTop Hint: Omit it from the simp argument list. simp [u̵T̵o̵p̵,̵ ̵hi] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`uTop, hi] · rcases hSublevelNonempty j with x, hxC, _hxj refine ?_, by simp [This simp argument is unused: uTop Hint: Omit it from the simp argument list. simp ̵[̵u̵T̵o̵p̵]̵ Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`uTop], ?_ · refine x, hxC, ?_ intro i have hij : i = j := by by_contra hij exact hExistsOther i, hij subst hij simp [This simp argument is unused: uTop Hint: Omit it from the simp argument list. simp ̵[̵u̵T̵o̵p̵]̵ Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`uTop] · intro i hi simp [This simp argument is unused: uTop Hint: Omit it from the simp argument list. simp [u̵T̵o̵p̵,̵ ̵hi] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`uTop, hi]

Helper for Theorem 21.3: the EReal : TypeEReal weighted sum of the canonical Unknown identifier `single`sorry - sorry : ?m.5single-Unknown identifier `top`top vector is 0 : 0 as soon as the corresponding coefficient vanishes.

lemma helperForTheorem_21_3_erealWeightedSum_singleTop_eq_zero_of_zero_coord {p : } (lam : Fin p ) (j : Fin p) (hj0 : lam j = 0) : ( i : Fin p, ((lam i : ) : EReal) * (if i = j then ( : EReal) else 0)) = 0 := by calc ( i : Fin p, ((lam i : ) : EReal) * (if i = j then ( : EReal) else 0)) = i : Fin p, (0 : EReal) := by refine Finset.sum_congr rfl ?_ intro i hi by_cases hij : i = j · subst hij simp [hj0] · simp [hij] _ = 0 := by simp

Helper for Theorem 21.3: the genuine remaining finite minimal-core gap is to show that the translated-upper-hull separation data can be upgraded to a separator whose coefficients are strictly positive on every coordinate. Once this is available, the margin extraction is formal and no support-extension bridge is needed.

lemma helperForTheorem_21_3_nontrivial_shiftedLowerBound_data_of_shiftedUpperHull_geometry {n p : } (C : Set (Fin n )) (hCconvex : Convex C) (g : Fin p (Fin n ) EReal) (hgProper : j : Fin p, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (g j)) (ε : ) (hShiftGap : ¬ ( j : Fin p, C {x : Fin n | g j x (ε : EReal)}).Nonempty) (hUpperHullNonempty : {u : Fin p | x, x C j : Fin p, g j x (u j : EReal)}.Nonempty) : lam : Fin p , ( j : Fin p, 0 lam j) lam 0 (( β : , 0 β ( u : Fin p , ( y, y C j : Fin p, g j y ((u j + ε : ) : EReal)) β u ⬝ᵥ lam)) ( δ : , 0 < δ ( u : Fin p , ( y, y C j : Fin p, g j y ((u j + ε : ) : EReal)) δ u ⬝ᵥ lam))) := by let T : Set (Fin p ) := {u : Fin p | x, x C j : Fin p, g j x ((u j + ε : ) : EReal)} have hTconv : Convex T := by simpa [T] using helperForTheorem_21_3_convexity_of_shiftedFiniteValueUpperHull C hCconvex g hgProper ε have hTupper : {u v : Fin p }, u T ( j : Fin p, u j v j) v T := by intro u v hu huv exact helperForTheorem_21_3_upperClosed_shiftedFiniteValueUpperHull C g ε hu huv have hTne : T.Nonempty := by simpa [T] using helperForTheorem_21_3_nonempty_shiftedFiniteValueUpperHull C g ε hUpperHullNonempty have hzeroNotMemT : (fun _ : Fin p => (0 : )) T := by simpa [T] using helperForTheorem_21_3_zero_not_mem_shiftedFiniteValueUpperHull_of_shiftGap C g ε hShiftGap by_cases hzeroMemClosureT : (fun _ : Fin p => (0 : )) closure T · rcases helperForTheorem_21_2_boundary_support_oriented_data_on_strictFeasibleAffineUpperHull T hTconv (by intro u v hu huv exact hTupper hu huv) hTne hzeroMemClosureT hzeroNotMemT with lam, β, hlam_nonneg, hlam_ne_zero, hβ_nonneg, hLowerT, _hOupper refine lam, hlam_nonneg, hlam_ne_zero, Or.inl ?_ refine β, hβ_nonneg, ?_ intro u hu exact hLowerT u hu · rcases helperForTheorem_21_3_positive_support_lower_bound_of_upperClosed_zero_not_mem_closure T hTconv hTne (by intro u v hu huv exact hTupper hu huv) hzeroMemClosureT with lam, δ, hlam_nonneg, hlam_ne_zero, hδ_pos, hLowerT refine lam, hlam_nonneg, hlam_ne_zero, Or.inr ?_ refine δ, hδ_pos, ?_ intro u hu exact hLowerT u hu

Original-route bridge for Theorem 21.3: this is the genuine remaining second half of Rockafellar's proof. After adjoining the indicator of Unknown identifier `C`C, one should define and its positively homogeneous hull Unknown identifier `k`k, prove from ¬sorry : Prop¬Unknown identifier `primal`primal plus no-common-recession that , hence , and then feed the Carathéodory/conjugate argument already formalized below.

lemma helperForTheorem_21_3_indicatorEpigraphClosed {n : } (C : Set (Fin n )) (hCclosed : IsClosed C) : IsClosed {p : (Fin n ) × | indicatorFunction C p.1 (p.2 : EReal)} := by have hEq : {p : (Fin n ) × | indicatorFunction C p.1 (p.2 : EReal)} = ((fun p : (Fin n ) × => p.1) ⁻¹' C) ((fun p : (Fin n ) × => p.2) ⁻¹' Set.Ici (0 : )) := by ext p by_cases hx : p.1 C · simp [indicatorFunction, hx] · simp [indicatorFunction, hx] have hClosedMem : IsClosed (((fun p : (Fin n ) × => p.1) ⁻¹' C)) := by exact hCclosed.preimage continuous_fst have hClosedLower : IsClosed (((fun p : (Fin n ) × => p.2) ⁻¹' Set.Ici (0 : ))) := by exact isClosed_Ici.preimage continuous_snd rw [hEq] exact hClosedMem.inter hClosedLower

The indicator monotonicity used in the Unknown identifier `C`C-augmentation route is exactly recession-cone membership in Unknown identifier `C`C.

lemma helperForTheorem_21_3_indicatorMonotoneAlong_d_implies_recessionMembership {n : } (C : Set (Fin n )) {d : Fin n } (hmono : x : Fin n , t : , 0 t indicatorFunction C (x + t d) indicatorFunction C x) : d Set.recessionCone C := by intro x hx t ht have hStep : indicatorFunction C (x + t d) indicatorFunction C x := hmono x t ht have hxValue : indicatorFunction C x = (0 : EReal) := by simp [indicatorFunction, hx] have hLeZero : indicatorFunction C (x + t d) (0 : EReal) := by simpa [hxValue] using hStep by_cases hxt : x + t d C · exact hxt · have hImpossible : ( : EReal) (0 : EReal) := by simpa [indicatorFunction, hxt] using hLeZero exact False.elim ((not_top_le_coe 0) hImpossible)

Original-route helper for Theorem 21.3: in the Unknown identifier `C`sorry = sorry ^ sorry : PropC = Unknown identifier `R`R^Unknown identifier `n`n case, Rockafellar's satisfies under ¬sorry : Prop¬ Unknown identifier `primal`primal and the no-common-recession hypothesis.

lemma helperForTheorem_21_3_originalRoute_univ_convexHullConjugate_zero_neg {n : } {I : Type*} (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone (Set.univ : Set (Fin n )) ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (hInonempty : ¬ IsEmpty I) (hNotPrimal : ¬ x : Fin n , i : I, f i x (0 : EReal)) : convexHullFunctionFamily (fun i : I => fenchelConjugate n (f i)) 0 < (0 : EReal) := by classical let h : (Fin n ) EReal := convexHullFunctionFamily (fun i : I => fenchelConjugate n (f i)) let k : (Fin n ) EReal := positivelyHomogeneousConvexFunctionGenerated h have hI : Nonempty I := not_isEmpty_iff.mp hInonempty have hfConjProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fenchelConjugate n (f i)) := by intro i exact proper_fenchelConjugate_of_proper (n := n) (f := f i) (hfProper i) have hhMinor := convexHullFunctionFamily_greatest_convex_minorant (f := fun i : I => fenchelConjugate n (f i)) have hhConvOn : ConvexFunctionOn (Set.univ : Set (Fin n )) h := by simpa [h] using hhMinor.1 have hhLe : i : I, h fun x => fenchelConjugate n (f i) x := by simpa [h] using hhMinor.2.1 have hhFinite : x : Fin n , h x ( : EReal) := by simpa [h] using (convexHullFunctionFamily_convex_and_exists_ne_top (hf := hfConjProper) hI).2 have hkmax : ( C : ConvexCone ((Fin n ) × ), (C : Set ((Fin n ) × )) = epigraph (S := (Set.univ : Set (Fin n ))) k (0 : (Fin n ) × ) epigraph (S := (Set.univ : Set (Fin n ))) k) (ConvexFunctionOn (Set.univ : Set (Fin n )) k PositivelyHomogeneous k k 0 0 k h) ( u : (Fin n ) EReal, PositivelyHomogeneous u ConvexFunctionOn (Set.univ : Set (Fin n )) u u 0 0 u h u k) := by simpa [h, k] using (maximality_posHomogeneousHull (n := n) (h := h) hhConvOn) have hkConvOn : ConvexFunctionOn (Set.univ : Set (Fin n )) k := hkmax.2.1.1 have hkPos : PositivelyHomogeneous k := hkmax.2.1.2.1 have hk0le : k 0 0 := hkmax.2.1.2.2.1 have hkLe : k h := hkmax.2.1.2.2.2 have hkConv : ConvexFunction k := by simpa [ConvexFunction] using hkConvOn have hk0_ne_top : k 0 ( : EReal) := by intro hk0_top have : ( : EReal) (0 : EReal) := by simpa [hk0_top] using hk0le exact (not_top_le_coe 0) this have hfenchel_h : fenchelConjugate n h = fun x => sSup (Set.range fun i : I => convexFunctionClosure (f i) x) := by simpa [h] using (section16_fenchelConjugate_convexHullFunctionFamily_fenchelConjugate_eq_sSup_convexFunctionClosure (f := f) hfProper) have hsublevel_empty : {x : Fin n | fenchelConjugate n h x (0 : EReal)} = ( : Set (Fin n )) := by ext x constructor · intro hx have hxle : fenchelConjugate n h x (0 : EReal) := hx apply False.elim apply hNotPrimal refine x, ?_ intro i have hi_le : convexFunctionClosure (f i) x fenchelConjugate n h x := by rw [hfenchel_h] exact le_sSup i, rfl have hClosedConv_i : ClosedConvexFunction (f i) := by refine ?_, helperForTheorem_21_3_lowerSemicontinuous_of_closedEpigraph (f := f i) (hfClosed := hfClosed i) simpa [ConvexFunction] using (hfProper i).1 have hbot_i : y : Fin n , f i y ( : EReal) := by intro y exact (hfProper i).2.2 y (by simp) have hclosure_i : convexFunctionClosure (f i) = f i := convexFunctionClosure_eq_of_closedConvexFunction (f := f i) hClosedConv_i hbot_i exact le_trans (by simpa [hclosure_i] using hi_le) hxle · intro hx exact False.elim hx have hnotTop : ¬ x : Fin n , k x = := by intro hall exact hk0_ne_top (hall 0) obtain Ck, _hCkclosed, _hCkconv, hcl, hCkEq := clConv_eq_supportFunctionEReal_setOf_forall_dotProduct_le (n := n) k hkPos hkConv hnotTop have hCkEq' : Ck = {xStar : Fin n | fenchelConjugate n h xStar (0 : EReal)} := by calc Ck = {xStar : Fin n | x : Fin n , ((dotProduct x xStar : ) : EReal) k x} := hCkEq _ = {xStar : Fin n | x : Fin n , ((dotProduct x xStar : ) : EReal) h x} := by simpa [k, h] using (section13_setOf_forall_dotProduct_le_posHomGenerated_eq (n := n) (f := h) hhConvOn) _ = {xStar : Fin n | fenchelConjugate n h xStar (0 : EReal)} := by simpa using (section13_setOf_forall_dotProduct_le_eq_setOf_fenchelConjugate_le_zero (n := n) h) have hclBot : clConv n k = fun _ : Fin n => ( : EReal) := by funext x calc clConv n k x = supportFunctionEReal Ck x := by simpa using congrArg (fun g : (Fin n ) EReal => g x) hcl _ = supportFunctionEReal ( : Set (Fin n )) x := by simp [hCkEq', hsublevel_empty] _ = ( : EReal) := by simp [supportFunctionEReal] have hrecEq : recessionFunctionEReal (F := (Fin n )) k = recessionFunction k := by funext y simp [recessionFunctionEReal, recessionFunction, erealDom, effectiveDomain_eq] have hdomK_univ : effectiveDomain (Set.univ : Set (Fin n )) k = Set.univ := by let domK : Set (Fin n ) := effectiveDomain (Set.univ : Set (Fin n )) k have hk0_dom : (0 : Fin n ) domK := by have hk0_lt : k 0 < ( : EReal) := (lt_top_iff_ne_top).2 hk0_ne_top simpa [domK, effectiveDomain_eq] using (show (0 : Fin n ) {x : Fin n | x Set.univ k x < ( : EReal)} from by simp, hk0_lt) by_cases hn : n = 0 · subst hn haveI : Subsingleton (Fin 0 ) := inferInstance ext x constructor · intro _hx simp · intro _hx have hx0 : x = 0 := Subsingleton.elim x 0 simpa [domK, hx0] using hk0_dom · have hnpos : 0 < n := Nat.pos_of_ne_zero hn by_contra hdomK_ne have hdomK_conv : Convex domK := by simpa [domK] using (effectiveDomain_convex (S := (Set.univ : Set (Fin n ))) (f := k) (hf := hkConvOn)) have hdomK_cone : IsConeSet n domK := by intro x hx t ht have hxlt : k x < ( : EReal) := by simpa [domK, effectiveDomain_eq] using hx have htxlt : k (t x) < ( : EReal) := by by_cases hbot : k x = ( : EReal) · have hEq : k (t x) = ( : EReal) := by calc k (t x) = ((t : ) : EReal) * k x := by simpa using (hkPos x t ht) _ = ((t : ) : EReal) * ( : EReal) := by rw [hbot] _ = ( : EReal) := by exact EReal.mul_bot_of_pos (by exact_mod_cast ht) simpa [hEq] · have hneTop : k x ( : EReal) := (lt_top_iff_ne_top).1 hxlt lift k x to using hneTop, hbot with r hr have hEq : k (t x) = (((t * r : )) : EReal) := by calc k (t x) = ((t : ) : EReal) * k x := by simpa using (hkPos x t ht) _ = ((t : ) : EReal) * ((r : ) : EReal) := by rw [ hr] _ = (((t * r : )) : EReal) := by simp [EReal.coe_mul] have hfinite_mul : (((t * r : )) : EReal) < ( : EReal) := by have hne_mul : (((t : ) : EReal) * ((r : ) : EReal)) ( : EReal) := by refine (EReal.mul_ne_top _ _).2 ?_ refine Or.inl (EReal.coe_ne_bot _), Or.inr (EReal.coe_ne_bot _), Or.inl (EReal.coe_ne_top _), Or.inr (EReal.coe_ne_top _) have hne : ((((t * r : )) : EReal)) ( : EReal) := by simpa [EReal.coe_mul] using hne_mul exact (lt_top_iff_ne_top).2 hne exact hEq hfinite_mul simpa [domK, effectiveDomain_eq] using (show t x {y : Fin n | y Set.univ k y < ( : EReal)} from by simp, htxlt) have hdomK_convCone : IsConvexCone n domK := hdomK_cone, hdomK_conv rcases exists_subset_homogeneous_closedHalfspace_of_isConvexCone_ne_univ (n := n) hnpos domK hdomK_convCone hdomK_ne with b, hbne, hdomKsub apply hNoCommonRecession refine b, hbne, ?_, ?_ · intro x hx t ht simp · intro i x t ht have hdomConj_sub : effectiveDomain (Set.univ : Set (Fin n )) (fenchelConjugate n (f i)) domK := by intro xStar hxStar have hxStar_lt : fenchelConjugate n (f i) xStar < ( : EReal) := by simpa [effectiveDomain_eq] using hxStar have hk_le_i : k xStar fenchelConjugate n (f i) xStar := le_trans (hkLe xStar) (hhLe i xStar) have hk_ne_top : k xStar ( : EReal) := by intro hk_top have : ( : EReal) fenchelConjugate n (f i) xStar := by simpa [hk_top] using hk_le_i exact (lt_top_iff_ne_top.mp hxStar_lt) ((top_le_iff).1 this) have hk_lt : k xStar < ( : EReal) := (lt_top_iff_ne_top).2 hk_ne_top simpa [domK, effectiveDomain_eq] using (show xStar {y : Fin n | y Set.univ k y < ( : EReal)} from by simp, hk_lt) have hdot_nonpos : xStar effectiveDomain (Set.univ : Set (Fin n )) (fenchelConjugate n (f i)), dotProduct xStar b 0 := by intro xStar hxStar exact hdomKsub (hdomConj_sub hxStar) have hSuppLeZero : supportFunctionEReal (effectiveDomain (Set.univ : Set (Fin n )) (fenchelConjugate n (f i))) b ((0 : ) : EReal) := by exact (section13_supportFunctionEReal_le_coe_iff (C := effectiveDomain (Set.univ : Set (Fin n )) (fenchelConjugate n (f i))) (y := b) (μ := 0)).2 hdot_nonpos have hClosedConv_i : ClosedConvexFunction (f i) := by refine ?_, helperForTheorem_21_3_lowerSemicontinuous_of_closedEpigraph (f := f i) (hfClosed := hfClosed i) simpa [ConvexFunction] using (hfProper i).1 have hRecFun_i : supportFunctionEReal (effectiveDomain (Set.univ : Set (Fin n )) (fenchelConjugate n (f i))) = recessionFunction (f i) := by exact section13_supportFunctionEReal_dom_fenchelConjugate_eq_recessionFunction (f := f i) hClosedConv_i (hfProper i) have hRecCone_i : b recessionConeEReal (F := (Fin n )) (f i) := by have hrec_le : recessionFunction (f i) b (0 : EReal) := by simpa [hRecFun_i] using hSuppLeZero have hrecE_le : recessionFunctionEReal (F := (Fin n )) (f i) b (0 : EReal) := by simpa [recessionFunctionEReal, recessionFunction, erealDom, effectiveDomain_eq] using hrec_le simpa [recessionConeEReal] using hrecE_le rcases helperForTheorem_21_3_recessionConeEReal_eq_recessionCone_some_nonempty_sublevel (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) with α, hα_nonempty, hRecEq_i have hSubRec : b Set.recessionCone {y : Fin n | f i y (α : EReal)} := by simpa [hRecEq_i] using hRecCone_i exact helperForTheorem_21_3_sublevel_ray_antitone (f := f i) (hfProper := hfProper i) (hfClosed := hfClosed i) (α := α) hα_nonempty hSubRec x t ht have hclEqClosure : clConv n k = convexFunctionClosure k := by calc clConv n k = fenchelConjugate n (fenchelConjugate n k) := by symm simpa using (fenchelConjugate_biconjugate_eq_clConv (n := n) (f := k)) _ = convexFunctionClosure k := by simpa using (section16_fenchelConjugate_biconjugate_eq_convexFunctionClosure (n := n) (f := k) hkConv) have hri_univ : euclideanRelativeInterior n (Set.univ : Set (EuclideanSpace (Fin n))) = Set.univ := by simpa using (euclideanRelativeInterior_affineSubspace_eq n ( : AffineSubspace (EuclideanSpace (Fin n)))) have h0ri : (0 : EuclideanSpace (Fin n)) euclideanRelativeInterior n ((fun x : EuclideanSpace (Fin n) => (x : Fin n )) ⁻¹' effectiveDomain (Set.univ : Set (Fin n )) k) := by simpa [hdomK_univ, hri_univ] have hk0_bot : k 0 = ( : EReal) := by by_cases hproperK : ProperConvexFunctionOn (Set.univ : Set (Fin n )) k · have hkagree : convexFunctionClosure k 0 = k 0 := (convexFunctionClosure_closed_properConvexFunctionOn_and_agrees_on_ri (f := k) hproperK).2 0 h0ri have hcl0 : convexFunctionClosure k 0 = ( : EReal) := by have := congrArg (fun g : (Fin n ) EReal => g 0) hclEqClosure simpa [hclBot] using this.symm exact hkagree.symm.trans hcl0 · have himproperK : ImproperConvexFunctionOn (Set.univ : Set (Fin n )) k := hkConvOn, hproperK have hkagree : convexFunctionClosure k 0 = k 0 := convexFunctionClosure_agrees_on_ri_of_improper (f := k) himproperK 0 h0ri have hcl0 : convexFunctionClosure k 0 = ( : EReal) := by have := congrArg (fun g : (Fin n ) EReal => g 0) hclEqClosure simpa [hclBot] using this.symm exact hkagree.symm.trans hcl0 by_contra hh0_nonneg have hh0_nonneg' : (0 : EReal) h 0 := le_of_not_gt hh0_nonneg have hk0_repr : k 0 = sInf {z : EReal | lam : , 0 lam z = rightScalarMultiple h lam (0 : Fin n )} := by simpa [k, h] using (infimumRepresentation_posHomogeneousHull (n := n) (h := h) hhConvOn hhFinite).1 (0 : Fin n ) rcases hhFinite with x0, hx0_ne_top have hx0_dom : x0 effectiveDomain (Set.univ : Set (Fin n )) h := by have hx0_lt : h x0 < ( : EReal) := (lt_top_iff_ne_top).2 hx0_ne_top simpa [effectiveDomain_eq] using (show x0 {x : Fin n | x Set.univ h x < ( : EReal)} from by simp, hx0_lt) have hne_epi_h : Set.Nonempty (epigraph (Set.univ : Set (Fin n )) h) := (nonempty_epigraph_iff_nonempty_effectiveDomain (S := (Set.univ : Set (Fin n ))) (f := h)).2 x0, hx0_dom have hsInf_nonneg : (0 : EReal) sInf {z : EReal | lam : , 0 lam z = rightScalarMultiple h lam (0 : Fin n )} := by refine le_sInf ?_ intro z hz rcases hz with lam, hlam, rfl by_cases hlam0 : lam = 0 · simp [hlam0, rightScalarMultiple_zero_eval (f := h) hne_epi_h (0 : Fin n )] · have hlam_pos : 0 < lam := lt_of_le_of_ne hlam (Ne.symm hlam0) have hmul_nonneg : (0 : EReal) ((lam : ) : EReal) * h 0 := by exact mul_nonneg (by exact_mod_cast le_of_lt hlam_pos) hh0_nonneg' simpa [rightScalarMultiple_pos (f := h) (lam := lam) hhConvOn hlam_pos] using hmul_nonneg have hk0_nonneg : (0 : EReal) k 0 := by simpa [hk0_repr] using hsInf_nonneg have : (0 : EReal) ( : EReal) := by simpa [hk0_bot] using hk0_nonneg exact (not_le_of_gt (EReal.bot_lt_coe 0)) this

Package a sparse nonnegative margin witness on Unknown identifier `R`sorry ^ sorry : ?m.5R^Unknown identifier `n`n into the support-bounded Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp format, allowing a noninjective finite index map and aggregating duplicates fiberwise.

lemma helperForTheorem_21_3_noninjectiveSparseDual_margin_on_univ_to_supportBoundedFinsupp_margin {n : } {I : Type*} (f : I (Fin n ) EReal) (hfinite : m : , m n + 1 idx : Fin m I, w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical rcases hfinite with m, hm, idx, w, hw_nonneg, ε, , hmargin let s : Finset I := Finset.univ.image idx let μ : I := fun i => (Finset.univ.filter (fun j : Fin m => idx j = i)).sum w let t : Finset I := s.filter (fun i => μ i 0) let m' : := t.card let e : t Fin m' := t.equivFin let idx' : Fin m' I := fun j => (e.symm j).1 let w' : Fin m' := fun j => μ (idx' j) have hμ_nonneg : i : I, 0 μ i := by intro i refine Finset.sum_nonneg ?_ intro j hj exact hw_nonneg j have hm'le : m' n + 1 := by calc m' = t.card := rfl _ s.card := by simpa [t] using (Finset.card_filter_le (s := s) (p := fun i => μ i 0)) _ m := by simpa [s] using (Finset.card_image_le (s := (Finset.univ : Finset (Fin m))) (f := idx)) _ n + 1 := hm have hidx' : Function.Injective idx' := by intro j1 j2 hEq have hSubtypeEq : e.symm j1 = e.symm j2 := by exact Subtype.ext hEq exact e.symm.injective hSubtypeEq have hw'_nonneg : j : Fin m', 0 w' j := by intro j exact hμ_nonneg (idx' j) have hmargin' : x : Fin n , ((ε : ) : EReal) j : Fin m', ((w' j : ) : EReal) * f (idx' j) x := by intro x have hmaps : j (Finset.univ : Finset (Fin m)), idx j s := by intro j hj exact Finset.mem_image_of_mem idx hj have hfiber : i : I, ((μ i : ) : EReal) * f i x = Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal) * f (idx j) x) := by intro i have hsum_mul_right : s0 : Finset (Fin m), (Finset.sum s0 (fun j => ((w j : ) : EReal))) * f i x = Finset.sum s0 (fun j => ((w j : ) : EReal) * f i x) := by intro s0 refine Finset.induction_on s0 ?_ ?_ · simp · intro a s ha hs have hs_nonneg : (0 : EReal) Finset.sum s (fun j => ((w j : ) : EReal)) := by refine Finset.sum_nonneg ?_ intro j hj exact_mod_cast hw_nonneg j have ha_nonneg : (0 : EReal) ((w a : ) : EReal) := by exact_mod_cast hw_nonneg a calc (Finset.sum (insert a s) (fun j => ((w j : ) : EReal))) * f i x = ((((w a : ) : EReal) + Finset.sum s (fun j => ((w j : ) : EReal))) * f i x) := by simp [Finset.sum_insert, ha] _ = (((w a : ) : EReal) * f i x) + (Finset.sum s (fun j => ((w j : ) : EReal)) * f i x) := by exact EReal.right_distrib_of_nonneg ha_nonneg hs_nonneg _ = (((w a : ) : EReal) * f i x) + Finset.sum s (fun j => ((w j : ) : EReal) * f i x) := by rw [hs] _ = Finset.sum (insert a s) (fun j => ((w j : ) : EReal) * f i x) := by simp [Finset.sum_insert, ha] have hμ_coe : ((μ i : ) : EReal) = Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal)) := by simpa [μ] using (helperForTheorem_21_1_coe_finset_sum_real (s := Finset.univ.filter (fun j : Fin m => idx j = i)) (g := w)) calc ((μ i : ) : EReal) * f i x = (Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal))) * f i x := by rw [hμ_coe] _ = Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal) * f (idx j) x) := by calc (Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal))) * f i x = Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal) * f i x) := by exact hsum_mul_right (Finset.univ.filter (fun j : Fin m => idx j = i)) _ = Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal) * f (idx j) x) := by refine Finset.sum_congr rfl ?_ intro j hj have hji : idx j = i := (Finset.mem_filter.1 hj).2 simp [hji] have hsum_s : Finset.sum s (fun i => ((μ i : ) : EReal) * f i x) = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by calc Finset.sum s (fun i => ((μ i : ) : EReal) * f i x) = Finset.sum s (fun i => Finset.sum (Finset.univ.filter (fun j : Fin m => idx j = i)) (fun j => ((w j : ) : EReal) * f (idx j) x)) := by refine Finset.sum_congr rfl ?_ intro i hi exact hfiber i _ = Finset.sum (Finset.univ : Finset (Fin m)) (fun j => ((w j : ) : EReal) * f (idx j) x) := by simpa [s] using (Finset.sum_fiberwise_of_maps_to (s := (Finset.univ : Finset (Fin m))) (t := s) (g := idx) (f := fun j : Fin m => ((w j : ) : EReal) * f (idx j) x) hmaps) _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := by simp have hsum_t : Finset.sum t (fun i => ((μ i : ) : EReal) * f i x) = Finset.sum s (fun i => ((μ i : ) : EReal) * f i x) := by have hsum' : Finset.sum (s.filter (fun i => μ i 0)) (fun i => ((μ i : ) : EReal) * f i x) = Finset.sum s (fun i => ((μ i : ) : EReal) * f i x) := by refine (Finset.sum_filter_of_ne (s := s) (p := fun i => μ i 0) (f := fun i => ((μ i : ) : EReal) * f i x) ?_) intro i hi hne by_contra exact hne (by simp []) simpa [t] using hsum' have hsum_reindex : ( j : Fin m', ((w' j : ) : EReal) * f (idx' j) x) = Finset.sum t (fun i => ((μ i : ) : EReal) * f i x) := by calc ( j : Fin m', ((w' j : ) : EReal) * f (idx' j) x) = i : t, ((μ i.1 : ) : EReal) * f i.1 x := by refine (Fintype.sum_equiv e.symm (fun j : Fin m' => ((w' j : ) : EReal) * f (idx' j) x) (fun i : t => ((μ i.1 : ) : EReal) * f i.1 x) ?_) intro j simp [w', idx'] _ = Finset.sum t (fun i => ((μ i : ) : EReal) * f i x) := by simpa using (Finset.sum_attach t (fun i : I => ((μ i : ) : EReal) * f i x)) calc ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := hmargin x _ = Finset.sum s (fun i => ((μ i : ) : EReal) * f i x) := hsum_s.symm _ = Finset.sum t (fun i => ((μ i : ) : EReal) * f i x) := hsum_t.symm _ = j : Fin m', ((w' j : ) : EReal) * f (idx' j) x := hsum_reindex.symm have hfiniteInjective : m'' : , m'' n + 1 idx'' : Fin m'' I, Function.Injective idx'' w'' : Fin m'' , ( j : Fin m'', 0 w'' j) ε : , 0 < ε x : Fin n , x (Set.univ : Set (Fin n )) ((ε : ) : EReal) j : Fin m'', ((w'' j : ) : EReal) * f (idx'' j) x := by refine m', hm'le, idx', hidx', w', hw'_nonneg, ε, , ?_ intro x _hx exact hmargin' x rcases helperForTheorem_21_3_sparseFiniteDual_margin_to_supportBoundedFinsupp_margin (C := (Set.univ : Set (Fin n ))) (f := f) hfiniteInjective with lam, hlam_nonneg, hcard, ε, , hmarginU refine lam, hlam_nonneg, hcard, ε, , ?_ intro x exact hmarginU x (by simp)

Local pre-copy of the original-route Carathéodory step, placed before the univ-case bridge so the file can follow Rockafellar's proof order without depending on later declarations.

lemma helperForTheorem_21_3_sparse_conjugate_origin_witness_of_convexHullConjugate_zero_neg {n : } {I : Type*} (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hHullZeroNeg : convexHullFunctionFamily (fun i : I => fenchelConjugate n (f i)) 0 < (0 : EReal)) : m : , m n + 1 idx : Fin m I, xStar : Fin m Fin n , w : Fin m , IsConvexWeights m w ( j : Fin m, w j 0) (0 : Fin n ) = convexCombination n m xStar w AffineIndependent xStar ( j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)) < (0 : EReal) := by classical have hfConj : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fenchelConjugate n (f i)) := by intro i exact proper_fenchelConjugate_of_proper (n := n) (f := f i) (hfProper i) have hrepr : convexHullFunctionFamily (fun i : I => fenchelConjugate n (f i)) 0 = sInf {z : EReal | m : Nat, m n + 1 (idx : Fin m I) (xStar : Fin m Fin n ) (w : Fin m ), IsConvexWeights m w ( j : Fin m, w j 0) (0 : Fin n ) = convexCombination n m xStar w AffineIndependent xStar z = j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)} := by simpa using (convexHullFunctionFamily_eq_sInf_affineIndependent_convexCombination_le_add_one (f := fun i : I => fenchelConjugate n (f i)) (hf := hfConj) (x := (0 : Fin n ))) have hsInfNeg : sInf {z : EReal | m : Nat, m n + 1 (idx : Fin m I) (xStar : Fin m Fin n ) (w : Fin m ), IsConvexWeights m w ( j : Fin m, w j 0) (0 : Fin n ) = convexCombination n m xStar w AffineIndependent xStar z = j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)} < (0 : EReal) := by simpa [hrepr] using hHullZeroNeg rcases (sInf_lt_iff.mp hsInfNeg) with z, hzmem, hzlt rcases hzmem with m, hm, idx, xStar, w, hw, hwnz, hx0, hAff, hzEq refine m, hm, idx, xStar, w, hw, hwnz, hx0, hAff, ?_ simpa [hzEq] using hzlt

Local pre-copy of the original-route margin extraction step, placed before the univ-case bridge so the theorem at 4307 : 4307 can stay on the textbook route.

lemma helperForTheorem_21_3_margin_on_univ_of_sparse_conjugate_origin_witness {n m : } {I : Type*} (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (idx : Fin m I) (xStar : Fin m Fin n ) (w : Fin m ) (hw : IsConvexWeights m w) (hwnz : j : Fin m, w j 0) (hx0 : (0 : Fin n ) = convexCombination n m xStar w) (hObjNeg : ( j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)) < (0 : EReal)) : ε : , 0 < ε x : Fin n , ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by classical have hw_nonneg : j : Fin m, 0 w j := hw.1 have hw_pos : j : Fin m, 0 < w j := by intro j exact lt_of_le_of_ne (hw_nonneg j) (Ne.symm (hwnz j)) let obj : EReal := j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) have hObjEq : obj = j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) := rfl have hObjLtZero : obj < (0 : EReal) := by simpa [obj] using hObjNeg have hObjNeTop : obj := by exact ne_of_lt (lt_of_lt_of_le hObjLtZero le_top) have hConjNeBot : j : Fin m, fenchelConjugate n (f (idx j)) (xStar j) ( : EReal) := by intro j exact (proper_fenchelConjugate_of_proper (n := n) (f := f (idx j)) (hfProper (idx j))).2.2 (xStar j) (by simp) have hTermNeBot : j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) ( : EReal) := by intro j refine (EReal.mul_ne_bot ((w j : ) : EReal) (fenchelConjugate n (f (idx j)) (xStar j))).2 ?_ refine ?_, ?_, ?_, ?_ · left exact EReal.coe_ne_bot _ · right exact hConjNeBot j · left exact EReal.coe_ne_top _ · left exact (EReal.coe_nonneg).2 (hw_nonneg j) have hObjNeBot : obj ( : EReal) := by have hsum_ne_bot : ( j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)) ( : EReal) := by exact sum_ne_bot_of_ne_bot (s := Finset.univ) (f := fun j : Fin m => ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)) (by intro j hj; exact hTermNeBot j) simpa [obj] using hsum_ne_bot let ε : := -obj.toReal have hε_pos : 0 < ε := by have hObjLtZero' : ((obj.toReal : ) : EReal) < (0 : EReal) := by simpa [EReal.coe_toReal hObjNeTop hObjNeBot] using hObjLtZero have hObjToRealLtZero : obj.toReal < 0 := by exact (EReal.coe_lt_coe_iff).1 hObjLtZero' dsimp [ε] linarith refine ε, hε_pos, ?_ intro x have hsum_vec : j : Fin m, w j xStar j = (0 : Fin n ) := by simpa [convexCombination] using hx0.symm have hsum_dot_real : j : Fin m, x ⬝ᵥ (w j xStar j) = 0 := by calc j : Fin m, x ⬝ᵥ (w j xStar j) = x ⬝ᵥ ( j : Fin m, w j xStar j) := by symm simpa using (dotProduct_sum (u := x) (s := (Finset.univ : Finset (Fin m))) (v := fun j : Fin m => w j xStar j)) _ = 0 := by simp [hsum_vec] have hterm : j : Fin m, (((x ⬝ᵥ (w j xStar j) : ) : EReal)) ((w j : ) : EReal) * f (idx j) x + ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) := by intro j let gj : (Fin n ) EReal := fun y => ((w j : ) : EReal) * f (idx j) y have hgj_conj : fenchelConjugate n gj = rightScalarMultiple (fenchelConjugate n (f (idx j))) (w j) := by simpa [gj] using (section16_fenchelConjugate_scaling (n := n) (f := f (idx j)) (hf := hfProper (idx j)) (hlam := hw_nonneg j)).1 have hconvStar : ConvexFunctionOn (Set.univ : Set (Fin n )) (fenchelConjugate n (f (idx j))) := by have hconv' : ConvexFunction (fenchelConjugate n (f (idx j))) := (fenchelConjugate_closedConvex (n := n) (f := f (idx j))).2 simpa [ConvexFunction] using hconv' have hEval : fenchelConjugate n gj (w j xStar j) = ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) := by rw [hgj_conj] calc rightScalarMultiple (fenchelConjugate n (f (idx j))) (w j) (w j xStar j) = ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) ((w j)⁻¹ (w j xStar j)) := by exact rightScalarMultiple_pos (f := fenchelConjugate n (f (idx j))) (lam := w j) hconvStar (hw_pos j) (w j xStar j) _ = ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) := by have hwj_ne : w j 0 := hwnz j simp [hwj_ne] have hbasic : (((x ⬝ᵥ (w j xStar j) : ) : EReal) - gj x) fenchelConjugate n gj (w j xStar j) := by unfold fenchelConjugate exact le_sSup x, rfl have hbasic' : (((x ⬝ᵥ (w j xStar j) : ) : EReal)) gj x + fenchelConjugate n gj (w j xStar j) := by have hgj_ne_bot : gj x ( : EReal) := by dsimp [gj] refine (EReal.mul_ne_bot ((w j : ) : EReal) (f (idx j) x)).2 ?_ refine ?_, ?_, ?_, ?_ · left exact EReal.coe_ne_bot _ · right exact (hfProper (idx j)).2.2 x (by simp) · left exact EReal.coe_ne_top _ · left exact (EReal.coe_nonneg).2 (hw_nonneg j) have hconj_ne_bot : fenchelConjugate n gj (w j xStar j) ( : EReal) := by rw [hEval] refine (EReal.mul_ne_bot ((w j : ) : EReal) (fenchelConjugate n (f (idx j)) (xStar j))).2 ?_ refine ?_, ?_, ?_, ?_ · left exact EReal.coe_ne_bot _ · right exact hConjNeBot j · left exact EReal.coe_ne_top _ · left exact (EReal.coe_nonneg).2 (hw_nonneg j) calc (((x ⬝ᵥ (w j xStar j) : ) : EReal)) fenchelConjugate n gj (w j xStar j) + gj x := by exact (EReal.sub_le_iff_le_add (Or.inl hgj_ne_bot) (Or.inr hconj_ne_bot)).1 hbasic _ = gj x + fenchelConjugate n gj (w j xStar j) := by rw [add_comm] simpa [gj, hEval, add_comm, add_left_comm, add_assoc] using hbasic' have hsum_terms : ( j : Fin m, (((x ⬝ᵥ (w j xStar j) : ) : EReal))) j : Fin m, (((w j : ) : EReal) * f (idx j) x + ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j)) := by refine Finset.sum_le_sum ?_ intro j hj exact hterm j have hsum_nonneg : (0 : EReal) ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + obj := by have hsum_dot_real' : j : Fin m, w j * (x ⬝ᵥ xStar j) = 0 := by simpa [dotProduct_smul, smul_eq_mul, mul_comm, mul_left_comm, mul_assoc] using hsum_dot_real have hleft_zero : ( j : Fin m, ((w j : ) : EReal) * (((x ⬝ᵥ xStar j : ) : EReal))) = (0 : EReal) := by calc ( j : Fin m, ((w j : ) : EReal) * (((x ⬝ᵥ xStar j : ) : EReal))) = j : Fin m, (((w j * (x ⬝ᵥ xStar j) : ) : EReal)) := by refine Finset.sum_congr rfl ?_ intro j hj simp [EReal.coe_mul] _ = ((( j : Fin m, w j * (x ⬝ᵥ xStar j) : ) : ) : EReal) := by symm exact helperForTheorem_21_1_coe_finset_sum_real (s := (Finset.univ : Finset (Fin m))) (g := fun j : Fin m => w j * (x ⬝ᵥ xStar j)) _ = (0 : EReal) := by exact_mod_cast hsum_dot_real' have hsum_rhs : ( j : Fin m, (((w j : ) : EReal) * f (idx j) x + ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j))) = ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + obj := by calc ( j : Fin m, (((w j : ) : EReal) * f (idx j) x + ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j))) = ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + j : Fin m, ((w j : ) : EReal) * fenchelConjugate n (f (idx j)) (xStar j) := by simp [Finset.sum_add_distrib] _ = ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + obj := by simp [obj] have hsum_terms' : ( j : Fin m, ((w j : ) : EReal) * (((x ⬝ᵥ xStar j : ) : EReal))) ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + obj := by calc ( j : Fin m, ((w j : ) : EReal) * (((x ⬝ᵥ xStar j : ) : EReal))) = ( j : Fin m, (((x ⬝ᵥ (w j xStar j) : ) : EReal))) := by refine Finset.sum_congr rfl ?_ intro j hj simp [dotProduct_smul, smul_eq_mul, EReal.coe_mul, This simp argument is unused: mul_comm Hint: Omit it from the simp argument list. simp [dotProduct_smul, smul_eq_mul, EReal.coe_mul, mul_c̵o̵m̵m̵,̵ ̵m̵u̵l_̵l̵eft_comm, mul_assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_comm, This simp argument is unused: mul_left_comm Hint: Omit it from the simp argument list. simp [dotProduct_smul, smul_eq_mul, EReal.coe_mul, mul_comm, mul_l̵e̵f̵t̵_̵c̵o̵m̵m̵,̵ ̵m̵u̵l̵_̵assoc] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_left_comm, This simp argument is unused: mul_assoc Hint: Omit it from the simp argument list. simp [dotProduct_smul, smul_eq_mul, EReal.coe_mul, mul_comm, mul_left_comm,̵ ̵m̵u̵l̵_̵a̵s̵s̵o̵c̵] Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`mul_assoc] _ ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + obj := by simpa [hsum_rhs] using hsum_terms simpa [hleft_zero] using hsum_terms' have hmargin : (-obj : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by have hsum_nonneg' : (0 : EReal) ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) + obj := by simpa [add_comm, add_left_comm, add_assoc] using hsum_nonneg have hsub : ((0 : EReal) - obj) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by exact (EReal.sub_le_iff_le_add (a := (0 : EReal)) (b := obj) (c := j : Fin m, ((w j : ) : EReal) * f (idx j) x) (Or.inl hObjNeBot) (Or.inl hObjNeTop)).2 hsum_nonneg' simpa using hsub have hε_eq : ((ε : ) : EReal) = -obj := by simp [ε, EReal.coe_toReal hObjNeTop hObjNeBot] simpa [hε_eq] using hmargin

Local pre-copy of the original-route sparse dual extraction, placed before the univ-case bridge so the bridge itself can use the textbook route.

lemma helperForTheorem_21_3_sparse_dual_margin_on_univ_of_convexHullConjugate_zero_neg {n : } {I : Type*} (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hHullZeroNeg : convexHullFunctionFamily (fun i : I => fenchelConjugate n (f i)) 0 < (0 : EReal)) : m : , m n + 1 idx : Fin m I, w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by rcases helperForTheorem_21_3_sparse_conjugate_origin_witness_of_convexHullConjugate_zero_neg f hfProper hHullZeroNeg with m, hm, idx, xStar, w, hw, hwnz, hx0, _hAff, hObjNeg rcases helperForTheorem_21_3_margin_on_univ_of_sparse_conjugate_origin_witness f hfProper idx xStar w hw hwnz hx0 hObjNeg with ε, , hmargin exact m, hm, idx, w, hw.1, ε, , hmargin

Original-route univ-case core for Theorem 21.3. This is the sole remaining second-half bridge after the indicatorFunction sorry : (Fin ?m.1 ) ERealindicatorFunction Unknown identifier `C`C augmentation has been factored out. It should follow the textbook route through

, the positively homogeneous hull Unknown identifier `k`k, Theorems 13.5 and 16.5, the proof that , and finally the sparse Carathéodory/conjugate machinery already proved below.

lemma helperForTheorem_21_3_originalRoute_univ_notPrimal_to_supportBoundedFinsupp_margin {n : } {I : Type*} (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone (Set.univ : Set (Fin n )) ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (hInonempty : ¬ IsEmpty I) (hNotPrimal : ¬ x : Fin n , i : I, f i x (0 : EReal)) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical have hHullZeroNeg : convexHullFunctionFamily (fun i : I => fenchelConjugate n (f i)) 0 < (0 : EReal) := helperForTheorem_21_3_originalRoute_univ_convexHullConjugate_zero_neg f hfProper hfClosed hNoCommonRecession hInonempty hNotPrimal rcases helperForTheorem_21_3_sparse_dual_margin_on_univ_of_convexHullConjugate_zero_neg f hfProper hHullZeroNeg with m, hm, idx, w, hw, ε, , hmargin exact helperForTheorem_21_3_noninjectiveSparseDual_margin_on_univ_to_supportBoundedFinsupp_margin (f := f) m, hm, idx, w, hw, ε, , hmargin

Project the sparse witness produced on the augmented index type Option sorry : Type u_1Option Unknown identifier `I`I (none = indicatorFunction Unknown identifier `C`C) back to the original family indexed by Unknown identifier `I`I.

lemma helperForTheorem_21_3_project_augmentedSupportBoundedFinsupp_margin {n : } {I : Type*} [DecidableEq I] (C : Set (Fin n )) (f : I (Fin n ) EReal) (hAug : lamAug : Option I →₀ , ( j : Option I, 0 lamAug j) lamAug.support.card n + 1 ε : , 0 < ε x : Fin n , ((ε : ) : EReal) Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * ((match j with | none => indicatorFunction C | some i => f i) x))) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical rcases hAug with lamAug, hlamAug_nonneg, hcardAug, ε, , hmarginAug let fAug : Option I (Fin n ) EReal := fun j => match j with | none => indicatorFunction C | some i => f i let lamCore : Option I →₀ := lamAug.erase none let someEmb : I Option I := Option.some, by intro a b h; cases h; rfl let lam : I →₀ := Finsupp.comapDomain Option.some lamCore someEmb.injective.injOn refine lam, ?_, ?_, ε, , ?_ · intro i have : lam i = lamAug (some i) := by simp [lam, lamCore] simpa [this] using hlamAug_nonneg (some i) · have hsubRange : lamCore.support Set.range (Option.some : I Option I) := by intro j hj cases j with | none => have : False := by simpa [lamCore, Finsupp.support_erase] using hj exact False.elim this | some i => exact i, rfl have hemb : Finsupp.embDomain someEmb lam = lamCore := by simpa [lam] using (Finsupp.embDomain_comapDomain (f := someEmb) (g := lamCore) hsubRange) have hsupportMap : lam.support.map someEmb = lamCore.support := by simpa [Finsupp.support_embDomain] using congrArg Finsupp.support hemb have hcardEq : lam.support.card = lamCore.support.card := by simpa using congrArg Finset.card hsupportMap calc lam.support.card = lamCore.support.card := hcardEq _ lamAug.support.card := by simpa [lamCore, Finsupp.support_erase] using (Finset.card_erase_le (a := none) (s := lamAug.support)) _ n + 1 := hcardAug · intro x hxC have hIndicatorZero : fAug none x = (0 : EReal) := by simp [fAug, indicatorFunction, hxC] have hsubRange : lamCore.support Set.range (Option.some : I Option I) := by intro j hj cases j with | none => have : False := by simpa [lamCore, Finsupp.support_erase] using hj exact False.elim this | some i => exact i, rfl have hBij : Set.BijOn (Option.some : I Option I) ((Option.some : I Option I) ⁻¹' lamCore.support) lamCore.support := by refine ?_, ?_, ?_ · intro i hi exact hi · exact someEmb.injective.injOn · intro j hj rcases hsubRange hj with i, rfl exact i, hj, rfl have hsumProj : Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) = Finset.sum lamCore.support (fun j => ((lamCore j : ) : EReal) * fAug j x) := by change lam.sum (fun i a => ((a : ) : EReal) * f i x) = lamCore.sum (fun j a => ((a : ) : EReal) * fAug j x) simpa [lam, fAug, Function.comp] using (Finsupp.sum_comapDomain Option.some lamCore (fun j a => ((a : ) : EReal) * fAug j x) hBij) have hcoreEqAug : j : Option I, ((lamCore j : ) : EReal) * fAug j x = ((lamAug j : ) : EReal) * fAug j x := by intro j cases j with | none => simp [lamCore, hIndicatorZero] | some i => simp [lamCore] have hsumErase : Finset.sum lamCore.support (fun j => ((lamCore j : ) : EReal) * fAug j x) = Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * fAug j x) := by by_cases hnone : none lamAug.support · calc Finset.sum lamCore.support (fun j => ((lamCore j : ) : EReal) * fAug j x) = Finset.sum (lamAug.support.erase none) (fun j => ((lamAug j : ) : EReal) * fAug j x) := by rw [show lamCore.support = lamAug.support.erase none by simp [lamCore, Finsupp.support_erase]] refine Finset.sum_congr rfl ?_ intro j hj exact hcoreEqAug j _ = ((lamAug none : ) : EReal) * fAug none x + Finset.sum (lamAug.support.erase none) (fun j => ((lamAug j : ) : EReal) * fAug j x) := by simp [hIndicatorZero] _ = Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * fAug j x) := by exact Finset.add_sum_erase (s := lamAug.support) (a := none) (f := fun j => ((lamAug j : ) : EReal) * fAug j x) hnone · have hEraseEq : lamCore = lamAug := by exact Finsupp.erase_of_notMem_support hnone simpa [hEraseEq] have hsumAugMatch : Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * ((match j with | none => indicatorFunction C | some i => f i) x)) = Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * fAug j x) := by refine Finset.sum_congr rfl ?_ intro j hj cases j <;> rfl calc ((ε : ) : EReal) Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * ((match j with | none => indicatorFunction C | some i => f i) x)) := hmarginAug x _ = Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * fAug j x) := hsumAugMatch _ = Finset.sum lamCore.support (fun j => ((lamCore j : ) : EReal) * fAug j x) := hsumErase.symm _ = Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := hsumProj.symm

Original-route bridge for Theorem 21.3: this is the genuine remaining second half of Rockafellar's proof. After adjoining the indicator of Unknown identifier `C`C, one reduces to the Unknown identifier `C`sorry = sorry ^ sorry : PropC = Unknown identifier `R`R^Unknown identifier `n`n core above and then projects the sparse witness back from the augmented index type Option sorry : Type u_1Option Unknown identifier `I`I.

lemma helperForTheorem_21_3_originalRoute_notPrimal_to_supportBoundedFinsupp_margin {n : } {I : Type*} (C : Set (Fin n )) (hCnonempty : C.Nonempty) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (_hInonempty : ¬ IsEmpty I) (hNotPrimal : ¬ x : Fin n , x C i : I, f i x (0 : EReal)) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by classical let fAug : Option I (Fin n ) EReal := fun j => match j with | none => indicatorFunction C | some i => f i have hfAugProper : j : Option I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (fAug j) := by intro j cases j with | none => simpa [fAug] using (properConvexFunctionOn_indicator_of_convex_of_nonempty (C := C) hCconvex hCnonempty) | some i => simpa [fAug] using hfProper i have hfAugClosed : j : Option I, IsClosed {p : (Fin n ) × | fAug j p.1 (p.2 : EReal)} := by intro j cases j with | none => simpa [fAug] using helperForTheorem_21_3_indicatorEpigraphClosed C hCclosed | some i => simpa [fAug] using hfClosed i have hNoCommonRecessionAug : ¬ d : Fin n , d 0 d Set.recessionCone (Set.univ : Set (Fin n )) ( j : Option I, x : Fin n , t : , 0 t fAug j (x + t d) fAug j x) := by intro hBad rcases hBad with d, hdne, _hdUniv, hmonoAug have hdC : d Set.recessionCone C := by exact helperForTheorem_21_3_indicatorMonotoneAlong_d_implies_recessionMembership C (by intro x t ht simpa [fAug] using hmonoAug none x t ht) apply hNoCommonRecession refine d, hdne, hdC, ?_ intro i x t ht simpa [fAug] using hmonoAug (some i) x t ht have hNotPrimalAug : ¬ x : Fin n , j : Option I, fAug j x (0 : EReal) := by intro hBad rcases hBad with x, hxAll have hxC : x C := by by_cases hx : x C · exact hx · have : ( : EReal) (0 : EReal) := by simpa [fAug, indicatorFunction, hx] using hxAll none exact False.elim ((not_top_le_coe 0) this) exact hNotPrimal x, hxC, by intro i simpa [fAug] using hxAll (some i) have hAug : lamAug : Option I →₀ , ( j : Option I, 0 lamAug j) lamAug.support.card n + 1 ε : , 0 < ε x : Fin n , ((ε : ) : EReal) Finset.sum lamAug.support (fun j => ((lamAug j : ) : EReal) * ((match j with | none => indicatorFunction C | some i => f i) x)) := by let hAugRaw := helperForTheorem_21_3_originalRoute_univ_notPrimal_to_supportBoundedFinsupp_margin fAug hfAugProper hfAugClosed hNoCommonRecessionAug (by intro hEmpty exact hEmpty.false none) hNotPrimalAug dsimp [fAug] at hAugRaw exact hAugRaw exact helperForTheorem_21_3_project_augmentedSupportBoundedFinsupp_margin C f hAug

Helper for Theorem 21.3: bridge ¬sorry : Prop¬Unknown identifier `primal`primal plus no-common-recession assumptions to a support-bounded Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp dual-margin certificate. This now delegates to the original Unknown identifier `k`sorry / sorry / sorry / sorry : ?m.15k / Unknown identifier `h`h / Unknown identifier `conjugate`conjugate / Unknown identifier `Carathéodory`Carathéodory route.

lemma helperForTheorem_21_3_notPrimal_to_finsuppDual_margin_with_supportBound_bridge {n : } {I : Type*} (C : Set (Fin n )) (hCnonempty : C.Nonempty) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (hInonempty : ¬ IsEmpty I) (hNotPrimal : ¬ x : Fin n , x C i : I, f i x (0 : EReal)) : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by exact helperForTheorem_21_3_originalRoute_notPrimal_to_supportBoundedFinsupp_margin C hCnonempty hCclosed hCconvex f hfProper hfClosed hNoCommonRecession hInonempty hNotPrimal

Helper for Theorem 21.3: forgetting the support-card bound of a sparse Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp dual-margin certificate yields the plain dual certificate used in alternative (Unknown identifier `b`b).

lemma helperForTheorem_21_3_supportBoundedFinsupp_margin_forget_bound {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hDualSparse : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) : lam : I →₀ , ( i : I, 0 lam i) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by -- Route correction: separate the purely algebraic "forget bound" step from the -- unresolved analytic extraction of the sparse witness itself. rcases hDualSparse with lam, hlamNonneg, _hcard, ε, , hmargin exact lam, hlamNonneg, ε, , hmargin

Helper for Theorem 21.3: convert a support-bounded Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp margin certificate into a finite-index certificate with injective indexing and the same Unknown identifier `m`sorry sorry + 1 : Propm Unknown identifier `n`n + 1 bound.

lemma helperForTheorem_21_3_supportBoundedFinsupp_to_finiteDual_margin {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hDualSparse : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) : m : , m n + 1 idx : Fin m I, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by classical rcases hDualSparse with lam, hlamNonneg, hcard_le, ε, , hmargin let s : Finset I := lam.support let m : := s.card let e : s Fin m := Finset.equivFin s let idx : Fin m I := fun j => (e.symm j : I) let w : Fin m := fun j => lam (idx j) -- The cardinal bound transfers directly from `lam.support.card`. have hm_le : m n + 1 := by simpa [m, s] using hcard_le -- The reindexing map through `e.symm` is injective. have hidx : Function.Injective idx := by intro j1 j2 hEq have hSubtypeEq : e.symm j1 = e.symm j2 := by exact Subtype.ext hEq exact e.symm.injective hSubtypeEq -- Nonnegativity is preserved by transport of coefficients. have hwNonneg : j : Fin m, 0 w j := by intro j exact hlamNonneg (idx j) refine m, hm_le, idx, hidx, w, hwNonneg, ε, , ?_ intro x hxC -- Reindex the support sum via the equivalence `Fin m ≃ lam.support`. have hsumEq : ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) = Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := by calc ( j : Fin m, ((w j : ) : EReal) * f (idx j) x) = j : Fin m, ((lam (idx j) : ) : EReal) * f (idx j) x := by simp [w] _ = i : s, ((lam i : ) : EReal) * f i x := by refine (Fintype.sum_equiv e.symm (fun j : Fin m => ((lam (idx j) : ) : EReal) * f (idx j) x) (fun i : s => ((lam i : ) : EReal) * f i x) ?_) intro j simp [idx] _ = Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := by simpa using (Finset.sum_attach s (fun i : I => ((lam i : ) : EReal) * f i x)) -- The margin inequality is preserved by the same reindexing identity. have hmarginOnSupport : ((ε : ) : EReal) Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := by simpa [s] using hmargin x hxC calc ((ε : ) : EReal) Finset.sum s (fun i => ((lam i : ) : EReal) * f i x) := hmarginOnSupport _ = j : Fin m, ((w j : ) : EReal) * f (idx j) x := hsumEq.symm

Helper for Theorem 21.3: one sparse Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp dual-margin witness can be projected to both downstream dual formats used later in this section (finite/injective and plain Finsupp.{u_9, u_10} (α : Type u_9) (M : Type u_10) [Zero M] : Type (max u_10 u_9)Finsupp).

lemma helperForTheorem_21_3_supportBoundedFinsupp_margin_to_finiteAndPlainDual {n : } {I : Type*} (C : Set (Fin n )) (f : I (Fin n ) EReal) (hDualSparse : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) : ( m : , m n + 1 idx : Fin m I, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x) ( lam : I →₀ , ( i : I, 0 lam i) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x)) := by -- Route correction: bundle the two already-proved algebraic projections of the same -- sparse witness so later `¬primal` lemmas do not duplicate this split. constructor · exact helperForTheorem_21_3_supportBoundedFinsupp_to_finiteDual_margin C f hDualSparse · exact helperForTheorem_21_3_supportBoundedFinsupp_margin_forget_bound C f hDualSparse

Helper for Theorem 21.3: extract a finite-index margin certificate from ¬sorry : Prop¬Unknown identifier `primal`primal.

lemma helperForTheorem_21_3_notPrimal_to_finiteDual_margin {n : } {I : Type*} (C : Set (Fin n )) (hCnonempty : C.Nonempty) (hCclosed : IsClosed C) (hCconvex : Convex C) (f : I (Fin n ) EReal) (hfProper : i : I, ProperConvexFunctionOn (Set.univ : Set (Fin n )) (f i)) (hfClosed : i : I, IsClosed {p : (Fin n ) × | f i p.1 (p.2 : EReal)}) (hNoCommonRecession : ¬ d : Fin n , d 0 d Set.recessionCone C ( i : I, x : Fin n , t : , 0 t f i (x + t d) f i x)) (hInonempty : ¬ IsEmpty I) (hNotPrimal : ¬ x : Fin n , x C i : I, f i x (0 : EReal)) : m : , m n + 1 idx : Fin m I, Function.Injective idx w : Fin m , ( j : Fin m, 0 w j) ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) j : Fin m, ((w j : ) : EReal) * f (idx j) x := by -- Route correction: pivot the unresolved endpoint to a support-bounded `Finsupp` -- certificate, then convert that format to the required finite/injective shape. have hDualSparse : lam : I →₀ , ( i : I, 0 lam i) lam.support.card n + 1 ε : , 0 < ε x : Fin n , x C ((ε : ) : EReal) Finset.sum lam.support (fun i => ((lam i : ) : EReal) * f i x) := by -- Route correction: consume the dedicated bridge helper and keep this lemma focused -- on finite/injective reindexing and coefficient transport. exact helperForTheorem_21_3_notPrimal_to_finsuppDual_margin_with_supportBound_bridge C hCnonempty hCclosed hCconvex f hfProper hfClosed hNoCommonRecession hInonempty hNotPrimal -- Route correction: project the sparse witness through the shared dual-format bundle and -- keep this lemma focused on extracting the finite/injective branch. exact (helperForTheorem_21_3_supportBoundedFinsupp_margin_to_finiteAndPlainDual C f hDualSparse).1
end Section21end Chap04