Buckets:
cfahlgren1/math / lean /OAI /LinearAlgebra /MatrixMultiplication /AuxiliarySeparation /Convex /Farkas.lean
| import OAI.LinearAlgebra.MatrixMultiplication.AuxiliarySeparation.Convex.RationalCone | |
| import OAI.LinearAlgebra.MatrixMultiplication.AuxiliarySeparation.Convex.FiniteConeClosed | |
| import Mathlib.Analysis.Convex.Cone.Dual | |
| namespace OAI | |
| /-! | |
| # Finite rational cone duality | |
| A finite family of integral vectors admits a normalized nonnegative linear | |
| functional whenever the negative normalizing vector has no positive integral | |
| multiple in the monoid generated by the family. | |
| -/ | |
| namespace MatrixMultiplication.AuxiliarySeparation | |
| /-- Closed-cone separation followed by rational certificate extraction yields | |
| a normalized nonnegative linear functional. -/ | |
| theorem exists_normalized_nonneg_linear_of_no_nat_certificate_of_isClosed | |
| {I J : Type*} [Fintype I] [Fintype J] | |
| (A : I → J → ℤ) (u : J → ℤ) | |
| (hclosed : IsClosed (PointedCone.hull ℝ | |
| (Set.range (fun i j ↦ (A i j : ℝ))) : Set (J → ℝ))) | |
| (hno : ¬ ∃ D : ℕ, 0 < D ∧ ∃ c : I → ℕ, | |
| ∀ j, ∑ i, (c i : ℤ) * A i j = -(D : ℤ) * u j) : | |
| ∃ L : (J → ℝ) →ₗ[ℝ] ℝ, | |
| L (fun j ↦ (u j : ℝ)) = 1 ∧ | |
| ∀ i, 0 ≤ L (fun j ↦ (A i j : ℝ)) := by | |
| classical | |
| let C : ProperCone ℝ (J → ℝ) := | |
| { toSubmodule := PointedCone.hull ℝ (Set.range (fun i j ↦ (A i j : ℝ))) | |
| isClosed' := hclosed } | |
| have houtside : -(fun j ↦ (u j : ℝ)) ∉ C := by | |
| intro hmem | |
| obtain ⟨x, hx⟩ := | |
| (Submodule.mem_span_range_iff_exists_fun (Nonneg ℝ)).1 hmem | |
| have hreal : ∃ x : I → ℝ, (∀ i, 0 ≤ x i) ∧ | |
| ∀ j, ∑ i, x i * (A i j : ℝ) = ((-u j : ℤ) : ℝ) := by | |
| refine ⟨fun i ↦ (x i : ℝ), fun i ↦ (x i).property, fun j ↦ ?_⟩ | |
| have hj := congrFun hx j | |
| simpa only [Finset.sum_apply, Pi.smul_apply, ← Nonneg.coe_smul, | |
| smul_eq_mul, Pi.neg_apply, Int.cast_neg] using hj | |
| obtain ⟨D, hD, c, hc⟩ := | |
| exists_nat_scaled_int_solution_of_nonneg_real A (fun j ↦ -u j) hreal | |
| exact hno ⟨D, hD, c, fun j ↦ by simpa only [mul_neg, neg_mul] using hc j⟩ | |
| obtain ⟨f, hf, hfu⟩ := C.hyperplane_separation_point houtside | |
| have hpos : 0 < f (fun j ↦ (u j : ℝ)) := by | |
| simpa only [map_neg, neg_neg, neg_lt_zero] using hfu | |
| refine ⟨(f (fun j ↦ (u j : ℝ)))⁻¹ • f.toLinearMap, ?_, fun i ↦ ?_⟩ | |
| · simp only [LinearMap.smul_apply, ContinuousLinearMap.coe_coe, smul_eq_mul] | |
| exact inv_mul_cancel₀ hpos.ne' | |
| · change 0 ≤ (f (fun j ↦ (u j : ℝ)))⁻¹ * f (fun j ↦ (A i j : ℝ)) | |
| exact mul_nonneg (inv_nonneg.mpr hpos.le) | |
| (hf _ (PointedCone.subset_hull (Set.mem_range_self i))) | |
| /-- A finite integral cone either contains a positive integer multiple of the | |
| negative normalizing vector, or admits a linear functional which is | |
| nonnegative on the generators and takes value one on that vector. -/ | |
| theorem exists_normalized_nonneg_linear_of_no_nat_certificate | |
| {I J : Type*} [Fintype I] [Fintype J] | |
| (A : I → J → ℤ) (u : J → ℤ) | |
| (hno : ¬ ∃ D : ℕ, 0 < D ∧ ∃ c : I → ℕ, | |
| ∀ j, ∑ i, (c i : ℤ) * A i j = -(D : ℤ) * u j) : | |
| ∃ L : (J → ℝ) →ₗ[ℝ] ℝ, | |
| L (fun j ↦ (u j : ℝ)) = 1 ∧ | |
| ∀ i, 0 ≤ L (fun j ↦ (A i j : ℝ)) := | |
| exists_normalized_nonneg_linear_of_no_nat_certificate_of_isClosed A u | |
| (isClosed_pointedCone_hull_range _) hno | |
| end MatrixMultiplication.AuxiliarySeparation | |
| end OAI | |
Xet Storage Details
- Size:
- 3.41 kB
- Xet hash:
- 4574829069ad380fcaf19f6c5b5a94eb83f366b4b1058b01a39be9349246e17c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.