Add lean source and binary files (part 72)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- lean/OAI/Geometry/ProjectionBody/ProductFacetProjection.leanAdded+39
- lean/OAI/Geometry/ProjectionBody/ProductFacets.leanAdded+101
- lean/OAI/Geometry/ProjectionBody/ProductVolumes.leanAdded+41
- lean/OAI/Geometry/ProjectionBody/ProductZonotopeBridge.leanAdded+74
- lean/OAI/Geometry/ProjectionBody/ProjectionKernel.leanAdded+21
- lean/OAI/Geometry/ProjectionBody/SimplexBrightness.leanAdded+99
- lean/OAI/Geometry/ProjectionBody/SimplexFacetCharts.leanAdded+81
- lean/OAI/Geometry/ProjectionBody/SimplexFacets.leanAdded+97
- lean/OAI/Geometry/ProjectionBody/SimplexVolume.leanAdded+188
- lean/OAI/Geometry/ProjectionBody/Specification.leanAdded+40
- lean/OAI/Geometry/ProjectionBody/UnitSupport.leanAdded+43
- lean/OAI/Geometry/ProjectionBody/ZonotopeBridge.leanAdded+68
- lean/OAI/Geometry/ProjectionVolume/AffineBrightness.leanAdded+191
- lean/OAI/Geometry/ProjectionVolume/AffineCovariance.leanAdded+86
- lean/OAI/Geometry/ProjectionVolume/ApproximationBounds.leanAdded+122
- lean/OAI/Geometry/ProjectionVolume/AreaNormalVectors.leanAdded+71
- lean/OAI/Geometry/ProjectionVolume/Arithmetic.leanAdded+41
- lean/OAI/Geometry/ProjectionVolume/AugmentedDeterminant.leanAdded+106
- lean/OAI/Geometry/ProjectionVolume/BallBrightness.leanAdded+91
- lean/OAI/Geometry/ProjectionVolume/Basic.leanAdded+27
- lean/OAI/Geometry/ProjectionVolume/Brightness.leanAdded+133
- lean/OAI/Geometry/ProjectionVolume/CoordinateDrop.leanAdded+75
- lean/OAI/Geometry/ProjectionVolume/CounterexampleComparison.leanAdded+17
- lean/OAI/Geometry/ProjectionVolume/CubeBrightness.leanAdded+191
- lean/OAI/Geometry/ProjectionVolume/CubeFibers.leanAdded+119
- lean/OAI/Geometry/ProjectionVolume/EuclideanVolume.leanAdded+37
- lean/OAI/Geometry/ProjectionVolume/ExposedBounds.leanAdded+55
- lean/OAI/Geometry/ProjectionVolume/ExposedProduct.leanAdded+104
- lean/OAI/Geometry/ProjectionVolume/Extrusion.leanAdded+220
- lean/OAI/Geometry/ProjectionVolume/FacetAreas.leanAdded+166
- lean/OAI/Geometry/ProjectionVolume/FacetBijection.leanAdded+69
- lean/OAI/Geometry/ProjectionVolume/FacetDimension.leanAdded+98
- lean/OAI/Geometry/ProjectionVolume/FacetExhaustiveness.leanAdded+117
- lean/OAI/Geometry/ProjectionVolume/FacetLinearImage.leanAdded+99
- lean/OAI/Geometry/ProjectionVolume/FacetPrism.leanAdded+106
- lean/OAI/Geometry/ProjectionVolume/FacetUniqueness.leanAdded+77
- lean/OAI/Geometry/ProjectionVolume/FiniteApproximation.leanAdded+45
- lean/OAI/Geometry/ProjectionVolume/FiniteVertices.leanAdded+84
- lean/OAI/Geometry/ProjectionVolume/GeneralProduct.leanAdded+88
- lean/OAI/Geometry/ProjectionVolume/InnerSequence.leanAdded+116
- lean/OAI/Geometry/ProjectionVolume/LinearApproximation.leanAdded+59
- lean/OAI/Geometry/ProjectionVolume/Main.leanAdded+26
- lean/OAI/Geometry/ProjectionVolume/Model.leanAdded+49
- lean/OAI/Geometry/ProjectionVolume/OuterApproximation.leanAdded+156
- lean/OAI/Geometry/ProjectionVolume/PolarRepresentation.leanAdded+181
- lean/OAI/Geometry/ProjectionVolume/PolytopeCauchy.leanAdded+108
- lean/OAI/Geometry/ProjectionVolume/PolytopeDefinitions.leanAdded+43
- lean/OAI/Geometry/ProjectionVolume/PolytopeFaceGeometry.leanAdded+155
- lean/OAI/Geometry/ProjectionVolume/PolytopeFacets.leanAdded+80
- lean/OAI/Geometry/ProjectionVolume/PolytopeFront.leanAdded+263
123456789101112131415161718192021222324252627282930313233343536373839import OAI.Geometry.ProjectionBody.ProductFacetGraphsimport OAI.Geometry.ProjectionBody.GraphProjection
namespace OAI
noncomputable sectionopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
/-- The true projected area scale of each product facet chart. -/theorem productFacetProjection_normDet (i : Bool × Option (Fin 10)) {u : E 20} (hu : ‖u‖ = 1) : ((project u).toLinearMap.comp (productFacetLinear i)).normDet = |productFunctional i u| := by rcases i with ⟨b, i⟩ cases b · cases i with | none => rw [productFacetLinear_first_sum, graphProjection_normDet _ _ hu, firstSumGraph_normal_inner] rfl | some i => rw [productFacetLinear_first_coordinate, coordinateProjection_normDet _ hu] simp [firstBlock] · cases i with | none => rw [productFacetLinear_second_sum, graphProjection_normDet _ _ hu, secondSumGraph_normal_inner] rfl | some i => rw [productFacetLinear_second_coordinate, coordinateProjection_normDet _ hu] simp [secondBlock]
end ProjectionCounterexample
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101import OAI.Geometry.ProjectionBody.SimplexFacetsimport Mathlib.Tactic.Tauto
namespace OAI
noncomputable sectionopen Set
namespace ProjectionCounterexample
def firstBlockLinear : E 20 →ₗ[ℝ] E 10 where toFun := firstBlock map_add' _ _ := rfl map_smul' _ _ := rfl
def secondBlockLinear : E 20 →ₗ[ℝ] E 10 where toFun := secondBlock map_add' _ _ := rfl map_smul' _ _ := rfl
/-- The twenty-two bounding inequalities of the actual Cartesian product. -/def productFunctional : Bool × Option (Fin 10) → E 20 →ₗ[ℝ] ℝ | (false, i) => (simplexFunctional 10 i).comp firstBlockLinear | (true, i) => (simplexFunctional 10 i).comp secondBlockLinear
def productLevel (i : Bool × Option (Fin 10)) : ℝ := simplexLevel i.2
@[simp] theorem productFunctional_first (i : Option (Fin 10)) (x : E 20) : productFunctional (false, i) x = simplexFunctional 10 i (firstBlock x) := rfl
@[simp] theorem productFunctional_second (i : Option (Fin 10)) (x : E 20) : productFunctional (true, i) x = simplexFunctional 10 i (secondBlock x) := rfl
theorem productBody_eq_halfspaceBody : productBody = halfspaceBody productFunctional productLevel := by ext x change (firstBlock x ∈ simplex 10 ∧ secondBlock x ∈ simplex 10) ↔ _ rw [simplex_eq_halfspaceBody] constructor · rintro ⟨hx, hy⟩ ⟨b, i⟩ cases b · exact hx i · exact hy i · intro hx exact ⟨fun i => hx (false, i), fun i => hx (true, i)⟩
theorem blocks_eq_zero_iff (x : E 20) : firstBlock x = 0 ∧ secondBlock x = 0 ↔ x = 0 := by constructor · rintro ⟨hfirst, hsecond⟩ ext i refine Fin.addCases (n := 10) (m := 10) (fun j => ?_) (fun j => ?_) i · exact congrArg (fun y : E 10 => y j) hfirst · exact congrArg (fun y : E 10 => y j) hsecond · rintro rfl exact ⟨rfl, rfl⟩
theorem product_has_positive_slope {u : E 20} (hu : u ≠ 0) : ∃ i, 0 < productFunctional i u := by by_cases hfirst : firstBlock u = 0 · have hsecond : secondBlock u ≠ 0 := by intro hsecond exact hu ((blocks_eq_zero_iff u).mp ⟨hfirst, hsecond⟩) obtain ⟨i, hi⟩ := simplex_has_positive_slope hsecond exact ⟨(true, i), hi⟩ · obtain ⟨i, hi⟩ := simplex_has_positive_slope hfirst exact ⟨(false, i), hi⟩
theorem product_boundingFace_first (i : Option (Fin 10)) : boundingFace productFunctional productLevel (false, i) = {x | firstBlock x ∈ boundingFace (simplexFunctional 10) simplexLevel i ∧ secondBlock x ∈ simplex 10} := by ext x simp only [boundingFace, ← productBody_eq_halfspaceBody, productBody, mem_ofPred_eq, productFunctional_first, productLevel, simplex_eq_halfspaceBody] tauto
theorem product_boundingFace_second (i : Option (Fin 10)) : boundingFace productFunctional productLevel (true, i) = {x | firstBlock x ∈ simplex 10 ∧ secondBlock x ∈ boundingFace (simplexFunctional 10) simplexLevel i} := by ext x simp only [boundingFace, ← productBody_eq_halfspaceBody, productBody, mem_ofPred_eq, productFunctional_second, productLevel, simplex_eq_halfspaceBody] tauto
theorem product_functional_balance (u : E 20) : ∑ i, productFunctional i u = 0 := by simp [Fintype.sum_prod_type]
theorem product_absolute_slopes (u : E 20) : ∑ i, |productFunctional i u| = ((∑ i, |firstBlock u i|) + |∑ i, firstBlock u i|) + ((∑ i, |secondBlock u i|) + |∑ i, secondBlock u i|) := by simp [Fintype.sum_prod_type, add_comm]
end ProjectionCounterexample
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041import OAI.Geometry.ProjectionBody.SimplexVolumeimport OAI.Geometry.ProjectionBody.ProductFacetCharts
namespace OAI
noncomputable sectionopen Set MeasureTheory
namespace ProjectionCounterexample
theorem volume_productBody : volume productBody = ENNReal.ofReal (1 / ((Nat.factorial 10 : ℝ) * Nat.factorial 10)) := by simpa only [productBody, simplex_eq_coordinates, firstBlock, secondBlock, Set.mem_ofPred_eq, WithLp.ofLp_toLp] using volume_euclideanSimplexProduct 10 10
theorem volume_productFacetDomain (b : Bool) : volume (productFacetDomain b) = ENNReal.ofReal (1 / ((Nat.factorial 9 : ℝ) * Nat.factorial 10)) := by cases b · simpa only [productFacetDomain, simplex_eq_coordinates, Set.preimage, Set.mem_prod, Set.mem_ofPred_eq, DiagonalZonotope.finAddEquivProd_apply, WithLp.ofLp_toLp] using volume_euclideanSimplexProduct 9 10 · simpa only [productFacetDomain, simplex_eq_coordinates, Set.preimage, Set.mem_prod, Set.mem_ofPred_eq, DiagonalZonotope.finAddEquivProd_apply, WithLp.ofLp_toLp, mul_comm] using volume_euclideanSimplexProduct 10 9
theorem productFacetDomain_compact (b : Bool) : IsCompact (productFacetDomain b) := by cases b · exact (@EuclideanSpace.finAddEquivProd ℝ _ 9 10).toHomeomorph.isCompact_preimage.mpr ((simplex_compact 9).prod (simplex_compact 10)) · exact (@EuclideanSpace.finAddEquivProd ℝ _ 10 9).toHomeomorph.isCompact_preimage.mpr ((simplex_compact 10).prod (simplex_compact 9))
end ProjectionCounterexample
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374import OAI.Geometry.ProjectionBody.ZonotopeBridgeimport OAI.Geometry.Zonotope.Product
namespace OAI
noncomputable sectionopen Setopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
/-- The sum of the two block support functions, with a common scale. -/def blockSupport {n m : ℕ} (u : E (n + m)) : ℝ := DiagonalZonotope.support (WithLp.ofLp (EuclideanSpace.finAddEquivProd u).1) + DiagonalZonotope.support (WithLp.ofLp (EuclideanSpace.finAddEquivProd u).2)
lemma blockSupport_zero (n m : ℕ) : blockSupport (0 : E (n + m)) = 0 := by simp [blockSupport, DiagonalZonotope.support]
lemma blockSupport_smul {n m : ℕ} (u : E (n + m)) (a : ℝ) : blockSupport (a • u) = |a| * blockSupport u := by simp only [blockSupport, map_smul, Prod.smul_fst, Prod.smul_snd] change DiagonalZonotope.support (a • WithLp.ofLp (EuclideanSpace.finAddEquivProd u).1) + DiagonalZonotope.support (a • WithLp.ofLp (EuclideanSpace.finAddEquivProd u).2) = _ rw [DiagonalZonotope.support_smul, DiagonalZonotope.support_smul, mul_add]
/-- A proved block brightness formula identifies the product projection zonotope. -/theorem projectionBody_eq_productZonotope {n m : ℕ} (P : Set (E (n + m))) (c : ℝ) (hc : 0 < c) (hbrightness : ∀ u : E (n + m), ‖u‖ = 1 → projectionVolume P u = c * blockSupport u) : projectionBody P = DiagonalZonotope.euclideanProduct n m c := by calc projectionBody P = {x : E (n + m) | ∀ u : E (n + m), ‖u‖ = 1 → ⟪u, x⟫ ≤ c * blockSupport u} := by ext x constructor · intro hx u hu rw [← hbrightness u hu] exact hx u hu · intro hx u hu rw [hbrightness u hu] exact hx u hu _ = {x : E (n + m) | ∀ u : E (n + m), ⟪u, x⟫ ≤ c * blockSupport u} := by apply unit_support_halfspaces_eq · simp [blockSupport_zero] · intro a ha u rw [blockSupport_smul, abs_of_nonneg ha] ring _ = DiagonalZonotope.euclideanProduct n m c := (DiagonalZonotope.euclideanProduct_eq_halfspaces n m c hc).symm
/-- Body structure and attained orthogonal-projection support values for a block formula. -/theorem projection_productZonotope_is_body_and_attains {n m : ℕ} (P : Set (E (n + m))) (c : ℝ) (hc : 0 < c) (hbrightness : ∀ u : E (n + m), ‖u‖ = 1 → projectionVolume P u = c * blockSupport u) : IsConvexBody (projectionBody P) ∧ ∀ u : E (n + m), ‖u‖ = 1 → ∃ x ∈ projectionBody P, ⟪u, x⟫ = projectionVolume P u := by have hbody := projectionBody_eq_productZonotope P c hc hbrightness constructor · rw [hbody] exact ⟨DiagonalZonotope.isCompact_euclideanProduct n m c, DiagonalZonotope.convex_euclideanProduct n m c, DiagonalZonotope.euclideanProduct_interior_nonempty n m c hc.ne'⟩ · intro u hu obtain ⟨x, hx, heq⟩ := DiagonalZonotope.euclideanProduct_support_attained n m c u refine ⟨x, hbody.symm ▸ hx, ?_⟩ rw [hbrightness u hu] exact heq
end ProjectionCounterexample
end
end OAI123456789101112131415161718192021import OAI.Geometry.ProjectionBody.Definitions
namespace OAI
noncomputable section
namespace ProjectionCounterexample
@[simp] theorem project_self {d : ℕ} (u : E d) : project u u = 0 := Submodule.starProjection_orthogonalComplement_singleton_eq_zero u
theorem project_ker {d : ℕ} (u : E d) : (project u).toLinearMap.ker = Submodule.span ℝ {u} := by change (ℝ ∙ u)ᗮ.starProjection.ker = ℝ ∙ u rw [Submodule.ker_starProjection, Submodule.orthogonal_orthogonal]
end ProjectionCounterexample
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899import OAI.Geometry.ProjectionBody.SimplexFacetChartsimport OAI.Geometry.ProjectionBody.GraphProjectionimport OAI.Geometry.ProjectionBody.SimplexVolumeimport OAI.Geometry.ProjectionBody.AffineChartMeasureimport OAI.Geometry.ProjectionBody.BrightnessSumimport OAI.Geometry.ProjectionBody.ProjectionKernel
namespace OAI
noncomputable sectionopen Set MeasureTheory Measureopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
theorem volume_simplex (n : ℕ) : volume (simplex n) = ENNReal.ofReal (1 / (n.factorial : ℝ)) := by rw [simplex_eq_coordinates] exact volume_unit_euclideanSimplex n
theorem simplexFacetProjection_normDet {n : ℕ} (i : Option (Fin (n + 1))) {u : E (n + 1)} (hu : ‖u‖ = 1) : ((project u).toLinearMap.comp (simplexFacetLinear n i)).normDet = |simplexFunctional (n + 1) i u| := by cases i with | none => change ((project u).toLinearMap.comp (graphLinear (Fin.last n) (allOnes n))).normDet = _ rw [graphProjection_normDet _ _ hu] have hnormal : graphNormal (Fin.last n) (allOnes n) = allOnes (n + 1) := by ext j induction j using Fin.lastCases <;> simp [graphNormal, insertZero, Fin.insertNth_last'] simp [hnormal] | some i => change ((project u).toLinearMap.comp (insertZero i).toLinearMap).normDet = _ rw [coordinateProjection_normDet i hu] simp
theorem simplex_projected_facet_volume {n : ℕ} (i : Option (Fin (n + 1))) {u : E (n + 1)} (hu : ‖u‖ = 1) : μHE[n] (project u '' boundingFace (simplexFunctional (n + 1)) simplexLevel i) = ENNReal.ofReal ((1 / (n.factorial : ℝ)) * |simplexFunctional (n + 1) i u|) := by rw [simplex_facet_eq_affine_image] have h := measure_projected_affine_chart (simplexFacetLinear n i) (simplexFacetCenter n i) (project u).toLinearMap (simplex n) simp only [finrank_euclideanSpace_fin, ContinuousLinearMap.coe_coe] at h rw [h, simplexFacetProjection_normDet i hu, volume_simplex, ← ENNReal.ofReal_mul (abs_nonneg _), mul_comm]
theorem simplex_projected_facet_measurable {n : ℕ} (i : Option (Fin (n + 1))) (u : E (n + 1)) : MeasurableSet (project u '' boundingFace (simplexFunctional (n + 1)) simplexLevel i) := by rw [simplex_facet_eq_affine_image] apply IsCompact.measurableSet apply IsCompact.image _ (project u).continuous apply (simplex_compact n).image exact continuous_const.add (simplexFacetLinear n i).continuous_of_finiteDimensional
theorem simplex_projected_facet_intersection_null {n : ℕ} (hn : 0 < n) (i j : Option (Fin (n + 1))) (hij : i ≠ j) (u : E (n + 1)) : μHE[n] (project u '' (boundingFace (simplexFunctional (n + 1)) simplexLevel i ∩ boundingFace (simplexFunctional (n + 1)) simplexLevel j)) = 0 := by have hS : boundingFace (simplexFunctional (n + 1)) simplexLevel i ⊆ (fun x => simplexFacetCenter n i + simplexFacetLinear n i x) '' (univ : Set (E n)) := by rw [simplex_facet_eq_affine_image] exact Set.image_mono (subset_univ _) simpa only [finrank_euclideanSpace_fin, ContinuousLinearMap.coe_coe] using measure_projected_transverse_intersection (simplexFacetLinear n i) (simplexFacetCenter n i) (project u).toLinearMap (simplexFunctional (n + 1) j) (simplexLevel j) _ _ hS (fun _ h => h.2) (simplex_facet_transverse hn i j hij)
/-- Actual orthogonal projection volume of the convex-hull standard simplex. -/theorem simplex_projectionVolume {n : ℕ} (hn : 0 < n) {u : E (n + 1)} (hu : ‖u‖ = 1) : projectionVolume (simplex (n + 1)) u = ((∑ i, |u i|) + |∑ i, u i|) / (2 * (n.factorial : ℝ)) := by have hu0 : u ≠ 0 := by intro h; simp [h] at hu have h := real_measure_image_halfspaceBody (simplexFunctional (n + 1)) simplexLevel (project u).toLinearMap μHE[n] (project_self u) (simplex_has_positive_slope hu0) (project_ker u) (fun i => simplex_projected_facet_measurable i u) (fun i j hij => simplex_projected_facet_intersection_null hn i j hij u) (1 / (n.factorial : ℝ)) (by positivity) (simplex_functional_balance u) (fun i => simplex_projected_facet_volume i hu) rw [← simplex_eq_halfspaceBody, simplex_absolute_slopes] at h simp only [ContinuousLinearMap.coe_coe] at h unfold projectionVolume simp only [Nat.add_sub_cancel] rw [h] ring
end ProjectionCounterexample
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081import OAI.Geometry.ProjectionBody.GraphChartimport OAI.Geometry.ProjectionBody.SimplexFacets
namespace OAI
noncomputable sectionopen Setopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
def allOnes (n : ℕ) : E n := WithLp.toLp 2 (fun _ => 1)
@[simp] theorem allOnes_apply {n : ℕ} (i : Fin n) : allOnes n i = 1 := rfl
@[simp] theorem inner_allOnes {n : ℕ} (x : E n) : ⟪allOnes n, x⟫ = ∑ i, x i := by simp [PiLp.inner_apply, allOnes]
/-- Linear part of each simplex facet chart. -/def simplexFacetLinear (n : ℕ) : Option (Fin (n + 1)) → E n →ₗ[ℝ] E (n + 1) | none => graphLinear (Fin.last n) (allOnes n) | some i => (insertZero i).toLinearMap
def simplexFacetCenter (n : ℕ) : Option (Fin (n + 1)) → E (n + 1) | none => EuclideanSpace.single (Fin.last n) 1 | some _ => 0
theorem simplexFacetChart_none (n : ℕ) (x : E n) : simplexFacetCenter n none + simplexFacetLinear n none x = sumFacetMap n x := by ext j induction j using Fin.lastCases · simp [simplexFacetCenter, simplexFacetLinear, graphLinear, sub_eq_add_neg] · simp [simplexFacetCenter, simplexFacetLinear, graphLinear, insertZero, Fin.insertNth_last']
theorem simplex_facet_eq_affine_image (n : ℕ) (i : Option (Fin (n + 1))) : boundingFace (simplexFunctional (n + 1)) simplexLevel i = (fun x => simplexFacetCenter n i + simplexFacetLinear n i x) '' simplex n := by cases i with | none => simp_rw [simplex_boundingFace_sum, simplexFacetChart_none] exact sum_facet_eq_image n | some i => rw [simplex_boundingFace_coordinate, coordinate_facet_eq_image] simp [simplexFacetCenter, simplexFacetLinear]
/-- Every defining hyperplane other than the chart's own hyperplane is transverse.The positive dimension excludes the degenerate segment-endpoint case. -/theorem simplex_facet_transverse {n : ℕ} (hn : 0 < n) (i j : Option (Fin (n + 1))) (hij : i ≠ j) : (simplexFunctional (n + 1) j).comp (simplexFacetLinear n i) ≠ 0 := by intro heq let k : Fin n := ⟨0, hn⟩ cases i with | none => cases j with | none => exact hij rfl | some j => induction j using Fin.lastCases with | last => have h := LinearMap.congr_fun heq (EuclideanSpace.single k 1) simp [simplexFacetLinear, graphLinear] at h | cast j => have h := LinearMap.congr_fun heq (EuclideanSpace.single j 1) simp [simplexFacetLinear, graphLinear, insertZero, Fin.insertNth_last'] at h | some i => cases j with | none => have h := LinearMap.congr_fun heq (EuclideanSpace.single k 1) simp [simplexFacetLinear, sum_insertZero] at h | some j => have hji : j ≠ i := fun h => hij (congrArg some h.symm) obtain ⟨k, rfl⟩ := Fin.exists_succAbove_eq hji have h := LinearMap.congr_fun heq (EuclideanSpace.single k 1) simp [simplexFacetLinear] at h
end ProjectionCounterexample
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697import OAI.Geometry.ProjectionBody.ConvexGeometryimport OAI.Geometry.ProjectionBody.FacetCoverimport Mathlib.Analysis.InnerProductSpace.Projection.Basic
namespace OAI
noncomputable sectionopen Set
namespace ProjectionCounterexample
/-- Coordinate linear functional on the Euclidean space. -/def coordinateFunctional {d : ℕ} (i : Fin d) : E d →ₗ[ℝ] ℝ where toFun x := x i map_add' _ _ := rfl map_smul' _ _ := rfl
@[simp] theorem coordinateFunctional_apply {d : ℕ} (i : Fin d) (x : E d) : coordinateFunctional i x = x i := rfl
/-- Outward defining functionals: the sum facet, then the coordinate facets. -/def simplexFunctional (d : ℕ) : Option (Fin d) → E d →ₗ[ℝ] ℝ | none => ∑ i, coordinateFunctional i | some i => -coordinateFunctional i
def simplexLevel {d : ℕ} : Option (Fin d) → ℝ | none => 1 | some _ => 0
@[simp] theorem simplexFunctional_none (d : ℕ) (x : E d) : simplexFunctional d none x = ∑ i, x i := by simp [simplexFunctional]
@[simp] theorem simplexFunctional_some {d : ℕ} (i : Fin d) (x : E d) : simplexFunctional d (some i) x = -x i := rfl
theorem simplex_eq_halfspaceBody (d : ℕ) : simplex d = halfspaceBody (simplexFunctional d) simplexLevel := by rw [simplex_eq_coordinates] ext x constructor · rintro ⟨hx, hs⟩ i cases i with | none => simpa [simplexLevel] using hs | some i => simpa [simplexLevel] using neg_nonpos.mpr (hx i) · intro hx constructor · intro i have := hx (some i) simpa [simplexLevel] using this · have := hx none simpa [simplexLevel] using this
/-- Every nonzero direction has a visible defining facet of the simplex. -/theorem simplex_has_positive_slope {d : ℕ} {u : E d} (hu : u ≠ 0) : ∃ i, 0 < simplexFunctional d i u := by by_contra h have hall (i : Option (Fin d)) : simplexFunctional d i u ≤ 0 := le_of_not_gt (fun hi => h ⟨i, hi⟩) have hcoords (i : Fin d) : 0 ≤ u i := by have := hall (some i) simpa using this have hsum : ∑ i, u i = 0 := by apply le_antisymm · simpa using hall none · exact Finset.sum_nonneg fun i _ => hcoords i have hzero : ∀ i : Fin d, u i = 0 := by simpa using (Finset.sum_eq_zero_iff_of_nonneg (fun i _ => hcoords i)).mp hsum apply hu ext i exact hzero i
theorem simplex_functional_balance {d : ℕ} (u : E d) : ∑ i, simplexFunctional d i u = 0 := by simp [Fintype.sum_option, Finset.sum_neg_distrib]
theorem simplex_absolute_slopes {d : ℕ} (u : E d) : ∑ i, |simplexFunctional d i u| = (∑ i, |u i|) + |∑ i, u i| := by simp [Fintype.sum_option, add_comm]
theorem simplex_boundingFace_coordinate {d : ℕ} (i : Fin d) : boundingFace (simplexFunctional d) simplexLevel (some i) = {x ∈ simplex d | x i = 0} := by ext x simp [boundingFace, ← simplex_eq_halfspaceBody, simplexLevel]
theorem simplex_boundingFace_sum (d : ℕ) : boundingFace (simplexFunctional d) simplexLevel none = {x ∈ simplex d | ∑ i, x i = 1} := by ext x simp [boundingFace, ← simplex_eq_halfspaceBody, simplexLevel]
end ProjectionCounterexample
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188import Mathlib.Logic.Equiv.Fin.Basicimport Mathlib.Analysis.SpecialFunctions.Integrals.Basicimport Mathlib.MeasureTheory.Measure.Haar.InnerProductSpaceimport Mathlib.MeasureTheory.Constructions.Piimport Mathlib.Tactic.Linarithimport Mathlib.Tactic.Ringimport Mathlib.Tactic.Positivityimport Mathlib.Tactic.FunPropimport Mathlib.Tactic.Measurabilityimport Mathlib.Tactic.SplitIfs
namespace OAI
/-!# Volumes of standard simplices and their products
The simplex-volume calculation below uses Tonelli's theorem and induction on thedimension. At first coordinate `t`, the remaining section is a simplex of radius`r - t`; its volume is integrated over `0 ≤ t ≤ r`. The Euclidean versions usethe measure-preserving equivalence between coordinate space and `EuclideanSpace`.The product formula is proved using the product Lebesgue measure under thecanonical splitting of `Fin (p + q)`.-/
open MeasureTheory Setopen scoped BigOperators ENNReal
namespace ProjectionCounterexample
/-- The coordinate standard simplex with nonnegative coordinates and sum at most `r`. -/def coordinateSimplex (n : ℕ) (r : ℝ) : Set (Fin n → ℝ) := {x | (∀ i, 0 ≤ x i) ∧ ∑ i, x i ≤ r}
theorem coordinateSimplex_measurableSet (n : ℕ) (r : ℝ) : MeasurableSet (coordinateSimplex n r) := by unfold coordinateSimplex measurability
theorem coordinateSimplex_eq_empty_of_neg (n : ℕ) {r : ℝ} (hr : r < 0) : coordinateSimplex n r = ∅ := by apply Set.eq_empty_iff_forall_notMem.mpr intro x hx have hsum : 0 ≤ ∑ i, x i := Finset.sum_nonneg fun i _ => hx.1 i exact (not_lt_of_ge (hsum.trans hx.2)) hr
theorem integral_simplex_slice (n : ℕ) {r : ℝ} (hr : 0 ≤ r) : (∫⁻ t in Icc 0 r, ENNReal.ofReal ((r - t) ^ n / (n.factorial : ℝ))) = ENNReal.ofReal (r ^ (n + 1) / ((n + 1).factorial : ℝ)) := by have hi : IntegrableOn (fun t : ℝ => (r - t) ^ n / (n.factorial : ℝ)) (Icc 0 r) := ContinuousOn.integrableOn_Icc (by fun_prop) have hn : 0 ≤ᵐ[volume.restrict (Icc 0 r)] (fun t : ℝ => (r - t) ^ n / (n.factorial : ℝ)) := by filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht exact div_nonneg (pow_nonneg (sub_nonneg.mpr ht.2) n) (by positivity) rw [← ofReal_integral_eq_lintegral_ofReal hi hn, integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le hr, intervalIntegral.integral_div, intervalIntegral.integral_comp_sub_left (fun t : ℝ => t ^ n) r] simp only [sub_self, sub_zero, integral_pow, zero_pow (Nat.succ_ne_zero n), sub_zero] congr 1 rw [Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, Nat.cast_one, div_div]
theorem volume_coordinateSimplex (n : ℕ) (r : ℝ) (hr : 0 ≤ r) : volume (coordinateSimplex n r) = ENNReal.ofReal (r ^ n / (n.factorial : ℝ)) := by induction n generalizing r with | zero => have h : coordinateSimplex 0 r = univ := by ext x simp [coordinateSimplex, hr] simp [h, Measure.volume_pi_eq_dirac (0 : Fin 0 → ℝ)] | succ n ih => let e := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => ℝ) 0 have he (p : ℝ × (Fin n → ℝ)) : e.symm p = Fin.cons p.1 p.2 := by ext i refine Fin.cases ?_ (fun j => ?_) i <;> simp [e, MeasurableEquiv.piFinSuccAbove] have hslice (t : ℝ) : Prod.mk t ⁻¹' (e.symm ⁻¹' coordinateSimplex (n + 1) r) = if t ∈ Icc 0 r then coordinateSimplex n (r - t) else ∅ := by ext x simp only [mem_preimage, he, coordinateSimplex, mem_ofPred_eq, Fin.forall_fin_succ, Fin.cons_zero, Fin.cons_succ, Fin.sum_univ_succ] split_ifs with ht · simp only [mem_ofPred_eq] constructor · rintro ⟨⟨_, hx⟩, hs⟩ exact ⟨hx, by linarith⟩ · rintro ⟨hx, hs⟩ exact ⟨⟨ht.1, hx⟩, by linarith⟩ · simp only [mem_empty_iff_false, iff_false] rintro ⟨⟨ht0, hx⟩, hs⟩ apply ht have hsum : 0 ≤ ∑ i, x i := Finset.sum_nonneg fun i _ => hx i exact ⟨ht0, by linarith⟩ rw [← (volume_preserving_piFinSuccAbove (fun _ : Fin (n + 1) => ℝ) 0).symm.measure_preimage_equiv] change volume (e.symm ⁻¹' coordinateSimplex (n + 1) r) = _ rw [Measure.volume_eq_prod, Measure.prod_apply ((coordinateSimplex_measurableSet (n + 1) r).preimage e.symm.measurable)] simp_rw [hslice] have hfun : (fun t : ℝ => volume (if t ∈ Icc 0 r then coordinateSimplex n (r - t) else ∅)) = (Icc 0 r).indicator (fun t : ℝ => ENNReal.ofReal ((r - t) ^ n / (n.factorial : ℝ))) := by funext t by_cases ht : t ∈ Icc 0 r · simp [ht, ih (r - t) (sub_nonneg.mpr ht.2)] · simp [ht] rw [hfun, lintegral_indicator measurableSet_Icc] exact integral_simplex_slice n hr
/-- The standard simplex has ordinary Lebesgue volume `1 / n!`. -/theorem volume_unit_coordinateSimplex (n : ℕ) : volume (coordinateSimplex n 1) = ENNReal.ofReal (1 / (n.factorial : ℝ)) := by simpa using volume_coordinateSimplex n 1 zero_le_one
/-- Exact volume of a possibly degenerate linear image of the coordinate simplex. -/theorem volume_linearImage_unit_coordinateSimplex (n : ℕ) (f : (Fin n → ℝ) →ₗ[ℝ] (Fin n → ℝ)) : volume (f '' coordinateSimplex n 1) = ENNReal.ofReal (|LinearMap.det f| / (n.factorial : ℝ)) := by rw [Measure.addHaar_image_linearMap, volume_unit_coordinateSimplex, ← ENNReal.ofReal_mul (abs_nonneg _)] congr 1 ring
/-- The same volume statement in Euclidean space with its canonical Euclidean measure. -/theorem volume_unit_euclideanSimplex (n : ℕ) : volume {x : EuclideanSpace ℝ (Fin n) | (∀ i, 0 ≤ x i) ∧ ∑ i, x i ≤ 1} = ENNReal.ofReal (1 / (n.factorial : ℝ)) := by have hs : MeasurableSet {x : EuclideanSpace ℝ (Fin n) | (∀ i, 0 ≤ x i) ∧ ∑ i, x i ≤ 1} := by measurability rw [← (PiLp.volume_preserving_toLp (Fin n)).measure_preimage hs.nullMeasurableSet] exact volume_unit_coordinateSimplex n
/-- Real-valued version of the Euclidean simplex volume. -/theorem realVolume_unit_euclideanSimplex (n : ℕ) : (volume {x : EuclideanSpace ℝ (Fin n) | (∀ i, 0 ≤ x i) ∧ ∑ i, x i ≤ 1}).toReal = 1 / (n.factorial : ℝ) := by rw [volume_unit_euclideanSimplex, ENNReal.toReal_ofReal] positivity
/-- The coordinate product, with the first `p` and last `q` coordinates separated. -/def coordinateSimplexProduct (p q : ℕ) : Set (Fin (p + q) → ℝ) := {x | (fun i : Fin p => x (Fin.castAdd q i)) ∈ coordinateSimplex p 1 ∧ (fun i : Fin q => x (Fin.natAdd p i)) ∈ coordinateSimplex q 1}
/-- The product-volume identity uses the actual product Lebesgue measure. -/theorem volume_coordinateSimplexProduct (p q : ℕ) : volume (coordinateSimplexProduct p q) = ENNReal.ofReal (1 / ((p.factorial : ℝ) * (q.factorial : ℝ))) := by let e : (Fin (p + q) → ℝ) ≃ᵐ ((Fin p → ℝ) × (Fin q → ℝ)) := (MeasurableEquiv.piCongrLeft (fun _ : Fin (p + q) => ℝ) finSumFinEquiv).symm.trans (MeasurableEquiv.sumPiEquivProdPi (fun _ => ℝ)) have he (x : Fin (p + q) → ℝ) : e x = ((fun i : Fin p => x (Fin.castAdd q i)), (fun i : Fin q => x (Fin.natAdd p i))) := by rfl have hm : MeasurePreserving e := (volume_measurePreserving_piCongrLeft (fun _ : Fin (p + q) => ℝ) finSumFinEquiv).symm.trans (volume_measurePreserving_sumPiEquivProdPi (fun _ => ℝ)) have hs : coordinateSimplexProduct p q = e ⁻¹' (coordinateSimplex p 1 ×ˢ coordinateSimplex q 1) := by ext x simp [coordinateSimplexProduct, he] rw [hs, hm.measure_preimage_equiv, Measure.volume_eq_prod, Measure.prod_prod, volume_unit_coordinateSimplex, volume_unit_coordinateSimplex, ← ENNReal.ofReal_mul (by positivity : 0 ≤ 1 / (p.factorial : ℝ))] congr 1 ring
/-- Product-simplex volume in the canonical Euclidean coordinates. -/theorem volume_euclideanSimplexProduct (p q : ℕ) : volume {x : EuclideanSpace ℝ (Fin (p + q)) | ((∀ i : Fin p, 0 ≤ x (Fin.castAdd q i)) ∧ ∑ i : Fin p, x (Fin.castAdd q i) ≤ 1) ∧ ((∀ i : Fin q, 0 ≤ x (Fin.natAdd p i)) ∧ ∑ i : Fin q, x (Fin.natAdd p i) ≤ 1)} = ENNReal.ofReal (1 / ((p.factorial : ℝ) * (q.factorial : ℝ))) := by rw [← (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin (p + q))).symm.measure_preimage_equiv] exact volume_coordinateSimplexProduct p q
end ProjectionCounterexample
end OAI12345678910111213141516171819202122232425262728293031323334353637383940import OAI.Geometry.ProjectionBody.Counterexample
namespace OAI
open Setopen scoped RealInnerProductSpace
namespace ProjectionCounterexample.Specification
theorem product_is_convex_body : IsConvexBody productBody := productBody_convexBody
theorem projection_support_attained : ∀ P : Set (E 20), P = simplex 20 ∨ P = productBody → IsConvexBody (projectionBody P) ∧ ∀ u : E 20, ‖u‖ = 1 → ∃ x ∈ projectionBody P, ⟪u, x⟫ = projectionVolume P u := by intro P hP rcases hP with rfl | rfl · exact simplex_twenty_projection_support · exact product_projection_support
theorem simplex_ratio : ratio (simplex 20) = ((21 : ℝ) * (20 : ℝ) ^ 20) / (Nat.factorial 20 : ℝ) := simplex_twenty_ratio
theorem product_ratio : ratio productBody / ratio (simplex 20) = (22355476 : ℝ) / 22020096 ∧ (1 : ℝ) < ratio productBody / ratio (simplex 20) := by constructor · exact product_to_simplex_ratio · rw [product_to_simplex_ratio] exact numerical_strict_excess
theorem simplex_upper_bound_false : ¬ (∀ P : Set (E 20), IsConvexBody P → ratio P ≤ ratio (simplex 20)) := universal_simplex_upper_bound_false
end ProjectionCounterexample.Specification
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243import Mathlib.Analysis.InnerProductSpace.Basic
namespace OAI
noncomputable sectionopen Setopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
/-- For a positively homogeneous support bound, unit directions determine alldirections. This connects the unit-sphere definition with anexplicit zonotope's halfspace description. -/theorem unit_support_halfspaces_eq {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] (f : V → ℝ) (hzero : 0 ≤ f 0) (hscale : ∀ (a : ℝ), 0 ≤ a → ∀ u, f (a • u) = a * f u) : {x : V | ∀ u, ‖u‖ = 1 → ⟪u, x⟫ ≤ f u} = {x : V | ∀ u, ⟪u, x⟫ ≤ f u} := by ext x constructor · intro hx u by_cases hu : u = 0 · simpa [hu] using hzero have hnorm : ‖u‖ ≠ 0 := norm_ne_zero_iff.mpr hu let v : V := ‖u‖⁻¹ • u have hv : ‖v‖ = 1 := by simp [v, norm_smul, hnorm] have huv : ‖u‖ • v = u := by simp [v, smul_smul, hnorm] calc ⟪u, x⟫ = ‖u‖ * ⟪v, x⟫ := by rw [← real_inner_smul_left, huv] _ ≤ ‖u‖ * f v := mul_le_mul_of_nonneg_left (hx v hv) (norm_nonneg u) _ = f u := by rw [← hscale ‖u‖ (norm_nonneg u) v, huv] · intro hx u _ exact hx u
end ProjectionCounterexample
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768import OAI.Geometry.ProjectionBody.Definitionsimport OAI.Geometry.ProjectionBody.UnitSupportimport OAI.Geometry.Zonotope.Euclidean
namespace OAI
/-!Generic bridge from a *proved* directional projection-volume formula to theexplicit zonotope. The brightness formula is an explicit hypothesis of thesehelper lemmas; no final counterexample theorem assumes it.-/noncomputable sectionopen Setopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
/-- A unit-direction brightness formula identifies the actual projection body. -/theorem projectionBody_eq_zonotope {d : ℕ} (P : Set (E d)) (c : ℝ) (hc : 0 < c) (hbrightness : ∀ u : E d, ‖u‖ = 1 → projectionVolume P u = c * DiagonalZonotope.support (WithLp.ofLp u)) : projectionBody P = DiagonalZonotope.euclidean c := by calc projectionBody P = {x : E d | ∀ u : E d, ‖u‖ = 1 → ⟪u, x⟫ ≤ c * DiagonalZonotope.support (WithLp.ofLp u)} := by ext x constructor · intro hx u hu rw [← hbrightness u hu] exact hx u hu · intro hx u hu rw [hbrightness u hu] exact hx u hu _ = {x : E d | ∀ u : E d, ⟪u, x⟫ ≤ c * DiagonalZonotope.support (WithLp.ofLp u)} := by apply unit_support_halfspaces_eq · simp [DiagonalZonotope.support] · intro a ha u change c * DiagonalZonotope.support (a • WithLp.ofLp u) = _ rw [DiagonalZonotope.support_smul, abs_of_nonneg ha] ring _ = DiagonalZonotope.euclidean c := (DiagonalZonotope.euclidean_eq_halfspaces c hc).symm
/-- The brightness hypothesis gives both a genuine body and support attainment. -/theorem projection_zonotope_is_body_and_attains {d : ℕ} (P : Set (E d)) (c : ℝ) (hc : 0 < c) (hbrightness : ∀ u : E d, ‖u‖ = 1 → projectionVolume P u = c * DiagonalZonotope.support (WithLp.ofLp u)) : IsConvexBody (projectionBody P) ∧ ∀ u : E d, ‖u‖ = 1 → ∃ x ∈ projectionBody P, ⟪u, x⟫ = projectionVolume P u := by have hbody := projectionBody_eq_zonotope P c hc hbrightness constructor · rw [hbody] exact ⟨DiagonalZonotope.isCompact_euclidean c, DiagonalZonotope.convex_euclidean c, DiagonalZonotope.euclidean_interior_nonempty c hc.ne'⟩ · intro u hu obtain ⟨x, hx, heq⟩ := DiagonalZonotope.euclidean_support_attained c u refine ⟨x, hbody.symm ▸ hx, ?_⟩ rw [hbrightness u hu] exact heq
end ProjectionCounterexample
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191import OAI.Geometry.ProjectionVolume.Basicimport Mathlib.Analysis.InnerProductSpace.NormDetimport Mathlib.LinearAlgebra.Matrix.Determinant.Basicimport Mathlib.Tactic.FieldSimpimport Mathlib.Tactic.FunPropimport Mathlib.Tactic.Ring
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace
noncomputable section
namespace Paper092
private def normalFrameVector {n : ℕ} {ι : Type uι} [Fintype ι] (u : Euclidean n) (b : OrthonormalBasis ι ℝ (normalHyperplane u)) : Unit ⊕ ι → Euclidean n | .inl _ => ‖u‖⁻¹ • u | .inr i => b i
private theorem normalFrameVector_orthonormal {n : ℕ} {ι : Type uι} [Fintype ι] (u : Euclidean n) (hu : u ≠ 0) (b : OrthonormalBasis ι ℝ (normalHyperplane u)) : Orthonormal ℝ (normalFrameVector u b) := by classical have hn : ‖‖u‖⁻¹ • u‖ = 1 := by simp [norm_smul, hu] have hb (i : ι) : ⟪u, (b i : Euclidean n)⟫ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp (b i).property rw [orthonormal_iff_ite] intro i j rcases i with i | i <;> rcases j with j | j · simp [normalFrameVector, hn] · simp [normalFrameVector, real_inner_smul_left, hb] · have hbi : ⟪(b i : Euclidean n), u⟫ = 0 := by rw [real_inner_comm, hb] simp [normalFrameVector, real_inner_smul_right, hbi] · simpa only [normalFrameVector, Sum.inr.injEq, Submodule.coe_inner] using b.inner_eq_ite i j
private def normalFrame {n : ℕ} {ι : Type uι} [Fintype ι] (u : Euclidean n) (hu : u ≠ 0) (b : OrthonormalBasis ι ℝ (normalHyperplane u)) : OrthonormalBasis (Unit ⊕ ι) ℝ (Euclidean n) := OrthonormalBasis.mk (normalFrameVector_orthonormal u hu b) ((normalFrameVector_orthonormal u hu b).linearIndependent.span_eq_top_of_card_eq_finrank' (by have h := (Submodule.span ℝ ({u} : Set (Euclidean n))).finrank_add_finrank_orthogonal rw [finrank_span_singleton hu] at h change 1 + Module.finrank ℝ (normalHyperplane u) = _ at h rw [Module.finrank_eq_card_basis b.toBasis] at h simpa only [Fintype.card_sum, Fintype.card_unique] using h)).ge
@[simp] private theorem normalFrame_inl {n : ℕ} {ι : Type uι} [Fintype ι] (u : Euclidean n) (hu : u ≠ 0) (b : OrthonormalBasis ι ℝ (normalHyperplane u)) (i : Unit) : normalFrame u hu b (.inl i) = ‖u‖⁻¹ • u := by simp [normalFrame, normalFrameVector]
@[simp] private theorem normalFrame_inr {n : ℕ} {ι : Type uι} [Fintype ι] (u : Euclidean n) (hu : u ≠ 0) (b : OrthonormalBasis ι ℝ (normalHyperplane u)) (i : ι) : normalFrame u hu b (.inr i) = (b i : Euclidean n) := by simp [normalFrame, normalFrameVector]
def projectionTransport {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (u : Euclidean n) : normalHyperplane (L.symm u) →ₗ[ℝ] normalHyperplane u := (normalHyperplane u).orthogonalProjectionOnto.toLinearMap ∘ₗ L.toLinearMap ∘ₗ (normalHyperplane (L.symm u)).subtype
private theorem projectionTransport_matrix {n : ℕ} {ι : Type uι} [Fintype ι] [DecidableEq ι] (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (u : Euclidean n) (hu : u ≠ 0) (hv : L.symm u ≠ 0) (bv : OrthonormalBasis ι ℝ (normalHyperplane (L.symm u))) (bu : OrthonormalBasis ι ℝ (normalHyperplane u)) : L.toLinearMap.toMatrix (normalFrame (L.symm u) hv bv).toBasis (normalFrame u hu bu).toBasis = Matrix.fromBlocks (Matrix.of (fun _ _ : Unit => ‖u‖ / ‖L.symm u‖)) (Matrix.of (fun (_ : Unit) j => ⟪‖u‖⁻¹ • u, L (bv j)⟫)) 0 ((projectionTransport L u).toMatrix bv.toBasis bu.toBasis) := by ext i j simp only [LinearMap.toMatrix_apply, OrthonormalBasis.coe_toBasis, OrthonormalBasis.coe_toBasis_repr_apply, OrthonormalBasis.repr_apply_apply] rcases i with i | i <;> rcases j with j | j · simp only [normalFrame_inl] change ⟪‖u‖⁻¹ • u, L (‖L.symm u‖⁻¹ • L.symm u)⟫ = ‖u‖ / ‖L.symm u‖ rw [map_smul, L.apply_symm_apply, real_inner_smul_left, real_inner_smul_right, real_inner_self_eq_norm_sq] field_simp · simp only [normalFrame_inl, normalFrame_inr] rfl · have hbi : ⟪(bu i : Euclidean n), u⟫ = 0 := by rw [real_inner_comm] exact Submodule.mem_orthogonal_singleton_iff_inner_right.mp (bu i).property simp only [normalFrame_inr, normalFrame_inl] change ⟪(bu i : Euclidean n), L (‖L.symm u‖⁻¹ • L.symm u)⟫ = 0 rw [map_smul, L.apply_symm_apply, real_inner_smul_right, hbi, mul_zero] · simp only [normalFrame_inr] change ⟪(bu i : Euclidean n), L (bv j)⟫ = ((projectionTransport L u).toMatrix bv.toBasis bu.toBasis) i j rw [LinearMap.toMatrix_apply] rw [bu.coe_toBasis_repr_apply, bu.repr_apply_apply] change ⟪(bu i : Euclidean n), L (bv j)⟫ = ⟪bu i, (normalHyperplane u).orthogonalProjectionOnto (L (bv j))⟫ exact (Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left _ _).symm
theorem projectionTransport_normDet {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (u : Euclidean n) (hu : u ≠ 0) : (projectionTransport L u).normDet = |L.toLinearMap.det| * ‖L.symm u‖ / ‖u‖ := by have hv : L.symm u ≠ 0 := by simpa using hu let bv := (stdOrthonormalBasis ℝ (normalHyperplane (L.symm u))).reindex (finCongr (normalHyperplane_finrank (L.symm u) hv)) let bu := (stdOrthonormalBasis ℝ (normalHyperplane u)).reindex (finCongr (normalHyperplane_finrank u hu)) have hL : |L.toLinearMap.det| = |(L.toLinearMap.toMatrix (normalFrame (L.symm u) hv bv).toBasis (normalFrame u hu bu).toBasis).det| := by rw [← L.toLinearMap.normDet_eq_abs_det] simpa only [Real.norm_eq_abs] using L.toLinearMap.normDet_eq_norm_det_toMatrix (normalFrame (L.symm u) hv bv) (normalFrame u hu bu) rw [projectionTransport_matrix L u hu hv bv bu, Matrix.det_fromBlocks_zero₂₁, Matrix.det_unique, Matrix.of_apply, abs_mul, abs_of_nonneg (div_nonneg (norm_nonneg _) (norm_nonneg _))] at hL have hA := (projectionTransport L u).normDet_eq_norm_det_toMatrix bv bu rw [Real.norm_eq_abs] at hA rw [← hA] at hL rw [hL] field_simp
theorem projectionTransport_project {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (u x : Euclidean n) : projectionTransport L u ((normalHyperplane (L.symm u)).orthogonalProjectionOnto x) = (normalHyperplane u).orthogonalProjectionOnto (L x) := by have hmem := (normalHyperplane (L.symm u)).sub_starProjection_mem_orthogonal x have hspan : (normalHyperplane (L.symm u))ᗮ = Submodule.span ℝ ({L.symm u} : Set (Euclidean n)) := by simp [normalHyperplane] rw [hspan] at hmem obtain ⟨t, ht⟩ := Submodule.mem_span_singleton.mp hmem have huorth : L (x - (normalHyperplane (L.symm u)).starProjection x) ∈ (normalHyperplane u)ᗮ := by rw [← ht, map_smul, L.apply_symm_apply] simpa only [normalHyperplane, Submodule.orthogonal_orthogonal] using (Submodule.span ℝ ({u} : Set (Euclidean n))).smul_mem t (Submodule.mem_span_singleton_self u) have hz := (normalHyperplane u).orthogonalProjectionOnto_apply_of_mem_orthogonal huorth rw [map_sub, map_sub] at hz exact (sub_eq_zero.mp hz).symm
theorem projection_image_linearEquiv {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (K : Set (Euclidean n)) (u : Euclidean n) : (normalHyperplane u).orthogonalProjectionOnto '' (L '' K) = projectionTransport L u '' ((normalHyperplane (L.symm u)).orthogonalProjectionOnto '' K) := by simp only [Set.image_image, projectionTransport_project]
theorem projectionVolume_linearEquiv_image {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (K : Set (Euclidean n)) (u : Euclidean n) (hu : u ≠ 0) : projectionVolume (L '' K) u = ENNReal.ofReal (|L.toLinearMap.det| * ‖L.symm u‖ / ‖u‖) * projectionVolume K (L.symm u) := by have hv : L.symm u ≠ 0 := by simpa using hu have hrank : Module.finrank ℝ (normalHyperplane (L.symm u)) = Module.finrank ℝ (normalHyperplane u) := by rw [normalHyperplane_finrank (L.symm u) hv, normalHyperplane_finrank u hu] have h := (projectionTransport L u).euclideanHausdorffMeasure_image_eq_normDet_mul_volume ((normalHyperplane (L.symm u)).orthogonalProjectionOnto '' K) rw [hrank, InnerProductSpace.euclideanHausdorffMeasure_eq_volume, projectionTransport_normDet L u hu] at h simpa only [projectionVolume, projection_image_linearEquiv] using h
theorem brightness_linearEquiv_image {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (K : Set (Euclidean n)) (u : Euclidean n) : brightness (L '' K) u = |L.toLinearMap.det| * brightness K (L.symm u) := by by_cases hu : u = 0 · simp [hu, brightness] have hn : 0 ≤ |L.toLinearMap.det| * ‖L.symm u‖ / ‖u‖ := div_nonneg (mul_nonneg (abs_nonneg _) (norm_nonneg _)) (norm_nonneg _) rw [brightness, projectionVolume_linearEquiv_image L K u hu, ENNReal.toReal_mul, ENNReal.toReal_ofReal hn, brightness] field_simp
end Paper092
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586import OAI.Geometry.ProjectionVolume.AffineBrightnessimport OAI.Geometry.ProjectionVolume.Translationimport OAI.Geometry.ProjectionVolume.SimplexValueimport Mathlib.Analysis.InnerProductSpace.Adjointimport Mathlib.MeasureTheory.Measure.Lebesgue.EqHaarimport Mathlib.Tactic.FieldSimpimport Mathlib.Tactic.Ring
namespace OAI
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
namespace Paper092
theorem det_adjoint {n : ℕ} (A : Euclidean n →ₗ[ℝ] Euclidean n) : A.adjoint.det = A.det := by let b := stdOrthonormalBasis ℝ (Euclidean n) rw [← LinearMap.det_toMatrix b.toBasis A.adjoint, LinearMap.toMatrix_adjoint, Matrix.det_conjTranspose, LinearMap.det_toMatrix] simp
theorem projectionBody_linearEquiv_image {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (K : Set (Euclidean n)) : projectionBody (L '' K) = (|L.toLinearMap.det| • L.symm.toLinearMap.adjoint) '' projectionBody K := by have hb := brightness_linearEquiv_image L K let c := |L.toLinearMap.det| have hc : 0 < c := abs_pos.mpr L.isUnit_det'.ne_zero ext y constructor · intro hy let z := c⁻¹ • L.toLinearMap.adjoint y refine ⟨z, ?_, ?_⟩ · intro u have h := hy (L u) rw [hb, L.symm_apply_apply] at h change ⟪u, c⁻¹ • L.toLinearMap.adjoint y⟫ ≤ brightness K u rw [inner_smul_right, LinearMap.adjoint_inner_right] calc c⁻¹ * ⟪L u, y⟫ ≤ c⁻¹ * (c * brightness K u) := mul_le_mul_of_nonneg_left h (inv_nonneg.mpr hc.le) _ = brightness K u := by field_simp · change c • L.symm.toLinearMap.adjoint z = y have hcancel : L.symm.toLinearMap.adjoint (L.toLinearMap.adjoint y) = y := by change (L.symm.toLinearMap.adjoint.comp L.toLinearMap.adjoint) y = y rw [← LinearMap.adjoint_comp] simp simp [z, map_smul, hcancel, smul_smul, hc.ne'] · rintro ⟨z, hz, rfl⟩ u change ⟪u, c • L.symm.toLinearMap.adjoint z⟫ ≤ _ rw [inner_smul_right, LinearMap.adjoint_inner_right, hb] exact mul_le_mul_of_nonneg_left (hz (L.symm u)) hc.le
theorem det_projectionBody_transform {n : ℕ} (hn : 0 < n) (L : Euclidean n ≃ₗ[ℝ] Euclidean n) : |(|L.toLinearMap.det| • L.symm.toLinearMap.adjoint).det| = |L.toLinearMap.det| ^ (n - 1) := by rw [LinearMap.det_smul, det_adjoint, LinearEquiv.det_coe_symm, finrank_euclideanSpace_fin, abs_mul, abs_pow, abs_abs, abs_inv] obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_zero_of_lt hn) simp [pow_succ, L.isUnit_det'.ne_zero]
theorem normalizedProjectionVolume_linearEquiv_image {n : ℕ} (hn : 0 < n) (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (K : Set (Euclidean n)) : normalizedProjectionVolume (L '' K) = normalizedProjectionVolume K := by have hc : |L.toLinearMap.det| ≠ 0 := abs_ne_zero.mpr L.isUnit_det'.ne_zero have hvol : volume (L '' K) = ENNReal.ofReal |L.toLinearMap.det| * volume K := volume.addHaar_image_linearMap L.toLinearMap K unfold normalizedProjectionVolume rw [projectionBody_linearEquiv_image L K, volume.addHaar_image_linearMap, det_projectionBody_transform hn L, ENNReal.toReal_mul, ENNReal.toReal_ofReal (pow_nonneg (abs_nonneg _) _), hvol, ENNReal.toReal_mul, ENNReal.toReal_ofReal (abs_nonneg _), mul_pow] exact mul_div_mul_left _ _ (pow_ne_zero _ hc)
theorem standardSimplex_affine_image_normalizedProjectionVolume {n : ℕ} (hn : 0 < n) (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) : normalizedProjectionVolume (v +ᵥ (L '' standardSimplex n)) = simplexConstant n := by rw [normalizedProjectionVolume_vadd, normalizedProjectionVolume_linearEquiv_image hn, standardSimplex_normalizedProjectionVolume n hn]
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122import OAI.Geometry.ProjectionVolume.BallBrightnessimport OAI.Geometry.ProjectionVolume.SupportLimitimport OAI.Geometry.ProjectionVolume.InnerSequence
namespace OAI
open Set Metric Filter MeasureTheoryopen scoped Pointwise Topology RealInnerProductSpace
namespace Paper092
theorem volume_smul_real {d : ℕ} (P : Set (Euclidean d)) {c : ℝ} (hc : 0 ≤ c) : (volume (c • P)).toReal = c ^ d * (volume P).toReal := by rw [Measure.addHaar_smul, finrank_euclideanSpace_fin, abs_pow, abs_of_nonneg hc, ENNReal.toReal_mul, ENNReal.toReal_ofReal (pow_nonneg hc _)]
theorem volume_real_mono {d : ℕ} {P K : Set (Euclidean d)} (hK : IsCompact K) (h : P ⊆ K) : (volume P).toReal ≤ (volume K).toReal := ENNReal.toReal_mono hK.measure_lt_top.ne (measure_mono h)
theorem approximation_brightness_bound {d : ℕ} (hd : 2 ≤ d) {P K : Set (Euclidean d)} (hP : IsCompact P) (hK : IsCompact K) {scale R : ℝ} (hscale : 1 ≤ scale) (hR : 0 ≤ R) (hPK : P ⊆ K) (hKP : K ⊆ scale • P) (hKR : K ⊆ closedBall 0 R) (u : Euclidean d) (hu : ‖u‖ = 1) : 0 ≤ brightness K u - brightness P u ∧ brightness K u - brightness P u ≤ (scale ^ (d - 1) - 1) * (euclideanUnitBallVolume (d - 1) * R ^ (d - 1)) := by have hmono := brightness_mono hPK hK u have hupper : brightness K u ≤ scale ^ (d - 1) * brightness P u := by have hh := brightness_mono hKP (hP.smul scale) u simpa only [brightness_body_smul, abs_of_nonneg (zero_le_one.trans hscale)] using hh have hbound : brightness P u ≤ euclideanUnitBallVolume (d - 1) * R ^ (d - 1) := hmono.trans (by simpa only [hu, one_mul] using brightness_le_ball_bound hd hR hKR u) have hpow : 1 ≤ scale ^ (d - 1) := one_le_pow₀ hscale refine ⟨sub_nonneg.mpr hmono, ?_⟩ calc brightness K u - brightness P u ≤ (scale ^ (d - 1) - 1) * brightness P u := by nlinarith _ ≤ _ := mul_le_mul_of_nonneg_left hbound (sub_nonneg.mpr hpow)
theorem approximation_projectionBody_sandwich {d : ℕ} {P K : Set (Euclidean d)} (hP : IsCompact P) (hK : IsCompact K) {scale : ℝ} (hscale : 0 < scale) (hPK : P ⊆ K) (hKP : K ⊆ scale • P) : projectionBody P ⊆ projectionBody K ∧ projectionBody K ⊆ scale ^ (d - 1) • projectionBody P := by refine ⟨projectionBody_mono hPK hK, ?_⟩ have hh := projectionBody_mono hKP (hP.smul scale) simpa only [projectionBody_body_smul P scale hscale.ne', abs_of_pos hscale] using hh
theorem approximation_volume_sandwich {d : ℕ} {P K : Set (Euclidean d)} (hP : IsCompact P) (hK : IsCompact K) {scale : ℝ} (hscale : 0 ≤ scale) (hPK : P ⊆ K) (hKP : K ⊆ scale • P) : (volume P).toReal ≤ (volume K).toReal ∧ (volume K).toReal ≤ scale ^ d * (volume P).toReal := by refine ⟨volume_real_mono hK hPK, ?_⟩ exact (volume_real_mono (hP.smul scale) hKP).trans_eq (volume_smul_real P hscale)
theorem approximation_projectionBody_volume_sandwich {d : ℕ} {P K : Set (Euclidean d)} (hP : IsCompact P) (hK : IsCompact K) {scale : ℝ} (hscale : 0 < scale) (hPK : P ⊆ K) (hKP : K ⊆ scale • P) : (volume (projectionBody P)).toReal ≤ (volume (projectionBody K)).toReal ∧ (volume (projectionBody K)).toReal ≤ scale ^ (d * (d - 1)) * (volume (projectionBody P)).toReal := by obtain ⟨hPiPK, hPiKP⟩ := approximation_projectionBody_sandwich hP hK hscale hPK hKP have hh := approximation_volume_sandwich (projectionBody_isCompact P) (projectionBody_isCompact K) (pow_nonneg hscale.le _) hPiPK hPiKP simpa only [← pow_mul, Nat.mul_comm (d - 1) d] using hh
theorem approximation_brightness_uniform {d : ℕ} (hd : 2 ≤ d) {P : ℕ → Set (Euclidean d)} {K : Set (Euclidean d)} (hP : ∀ m, IsCompact (P m)) (hK : IsCompact K) {scale : ℕ → ℝ} (hscale : ∀ m, 1 ≤ scale m) (hscalelim : Tendsto scale atTop (𝓝 1)) {R : ℝ} (hR : 0 ≤ R) (hKR : K ⊆ closedBall 0 R) (hPK : ∀ m, P m ⊆ K) (hKP : ∀ m, K ⊆ scale m • P m) : TendstoUniformlyOn (fun m u => brightness (P m) u) (brightness K) atTop (sphere 0 1) := by let C := euclideanUnitBallVolume (d - 1) * R ^ (d - 1) have hcont : Continuous (fun r : ℝ => (r ^ (d - 1) - 1) * C) := by fun_prop have hlim : Tendsto (fun m => (scale m ^ (d - 1) - 1) * C) atTop (𝓝 0) := by simpa only [Function.comp_def, one_pow, sub_self, zero_mul] using (hcont.tendsto 1).comp hscalelim apply Metric.tendstoUniformlyOn_iff.mpr intro ε hε filter_upwards [hlim.eventually (Iio_mem_nhds hε)] with m hm intro u hu have hunit : ‖u‖ = 1 := mem_sphere_zero_iff_norm.mp hu have hb := approximation_brightness_bound hd (hP m) hK (hscale m) hR (hPK m) (hKP m) hKR u hunit rw [Real.dist_eq, abs_of_nonneg hb.1] exact hb.2.trans_lt hm
theorem tendsto_of_multiplicative_sandwich {f q : ℕ → ℝ} {L : ℝ} (hq : ∀ m, 0 < q m) (hqlim : Tendsto q atTop (𝓝 1)) (hupper : ∀ m, f m ≤ L) (hlower : ∀ m, L ≤ q m * f m) : Tendsto f atTop (𝓝 L) := by have hlim : Tendsto (fun m => L / q m) atTop (𝓝 L) := by have hcont : ContinuousAt (fun x : ℝ => L / x) 1 := by fun_prop (disch := norm_num) simpa only [Function.comp_def, div_one] using hcont.tendsto.comp hqlim apply tendsto_of_tendsto_of_tendsto_of_le_of_le hlim tendsto_const_nhds · intro m exact (div_le_iff₀ (hq m)).mpr (by simpa only [mul_comm] using hlower m) · exact hupper
theorem approximation_volume_tendsto {d : ℕ} {P : ℕ → Set (Euclidean d)} {K : Set (Euclidean d)} (hP : ∀ m, IsCompact (P m)) (hK : IsCompact K) {scale : ℕ → ℝ} (hscale : ∀ m, 0 < scale m) (hscalelim : Tendsto scale atTop (𝓝 1)) (hPK : ∀ m, P m ⊆ K) (hKP : ∀ m, K ⊆ scale m • P m) : Tendsto (fun m => (volume (P m)).toReal) atTop (𝓝 (volume K).toReal) ∧ Tendsto (fun m => (volume (projectionBody (P m))).toReal) atTop (𝓝 (volume (projectionBody K)).toReal) := by have hq (k : ℕ) : Tendsto (fun m => scale m ^ k) atTop (𝓝 1) := by have hcont : Continuous (fun x : ℝ => x ^ k) := by fun_prop simpa only [Function.comp_def, one_pow] using (hcont.tendsto 1).comp hscalelim constructor · apply tendsto_of_multiplicative_sandwich (fun m => pow_pos (hscale m) d) (hq d) · exact fun m => (approximation_volume_sandwich (hP m) hK (hscale m).le (hPK m) (hKP m)).1 · exact fun m => (approximation_volume_sandwich (hP m) hK (hscale m).le (hPK m) (hKP m)).2 · apply tendsto_of_multiplicative_sandwich (fun m => pow_pos (hscale m) (d * (d - 1))) (hq (d * (d - 1))) · exact fun m => (approximation_projectionBody_volume_sandwich (hP m) hK (hscale m) (hPK m) (hKP m)).1 · exact fun m => (approximation_projectionBody_volume_sandwich (hP m) hK (hscale m) (hPK m) (hKP m)).2
end Paper092
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071import OAI.Geometry.ProjectionVolume.FacetLinearImageimport OAI.Geometry.ProjectionVolume.GeneralProductimport OAI.Geometry.ProjectionVolume.SimplexPolytope
namespace OAI
universe uι uκ
noncomputable sectionopen Set MeasureTheoryopen scoped RealInnerProductSpace
namespace Paper092
theorem affineHyperplane_linearImage_areaNormal {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : (μHE[n - 1] (L '' F)).toReal • linearImageNormal L v = (|L.toLinearMap.det| • L.symm.toLinearMap.adjoint) ((μHE[n - 1] F).toReal • v) := by rw [affineHyperplane_linearImage_area_real L v hv c F hplane, linearImageNormal, smul_smul, LinearMap.smul_apply, map_smul, smul_smul] congr 1 field_simp [norm_ne_zero_iff.mpr (inverseAdjoint_ne_zero L v hv)]
theorem simplexFacet_coordinate_areaNormal (n : ℕ) (i : Fin (n + 1)) : (μHE[n] (simplexFacet (n + 1) (some i))).toReal • (-EuclideanSpace.single i (1 : ℝ)) = -(1 / (n.factorial : ℝ)) • EuclideanSpace.single i (1 : ℝ) := by rw [simplexFacet_coordinate_area, ENNReal.toReal_ofReal (by positivity)] exact (smul_neg _ _).trans (neg_smul _ _).symm
theorem simplexFacet_diagonal_areaNormal (n : ℕ) : (μHE[n] (simplexFacet (n + 1) none)).toReal • diagonalUnitNormal (n + 1) = (1 / (n.factorial : ℝ)) • diagonalVector (n + 1) := by rw [simplexFacet_diagonal_area, ENNReal.toReal_ofReal (by positivity), diagonalUnitNormal, smul_smul] congr 1 have hs : Real.sqrt ((n : ℝ) + 1) ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr (by positivity)) push_cast field_simp
namespace HPolytope
theorem product_areaNormal_inl {r s : ℕ} (hr : 0 < r) {ι : Type uι} {κ : Type uκ} [Fintype ι] [Fintype κ] (A : HPolytope r ι) (B : HPolytope s κ) (i : ι) : splitEuclideanProduct r s ((A.product B).faceArea (.inl i) • (A.product B).normal (.inl i)) = ((volume B.body).toReal • (A.faceArea i • A.normal i), 0) := by rw [product_faceArea_inl hr] change splitEuclideanProduct r s ((A.faceArea i * (volume B.body).toReal) • productLiftLeft r s (A.normal i)) = _ simp [productLiftLeft, smul_smul, mul_comm]
theorem product_areaNormal_inr {r s : ℕ} (hs : 0 < s) {ι : Type uι} {κ : Type uκ} [Fintype ι] [Fintype κ] (A : HPolytope r ι) (B : HPolytope s κ) (i : κ) : splitEuclideanProduct r s ((A.product B).faceArea (.inr i) • (A.product B).normal (.inr i)) = (0, (volume A.body).toReal • (B.faceArea i • B.normal i)) := by rw [product_faceArea_inr hs] change splitEuclideanProduct r s (((volume A.body).toReal * B.faceArea i) • productLiftRight r s (B.normal i)) = _ simp [productLiftRight, smul_smul]
end HPolytopeend Paper092
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041import OAI.Geometry.ProjectionVolume.Modelimport Mathlib.Tactic.FieldSimpimport Mathlib.Tactic.Linarithimport Mathlib.Tactic.NormNumimport Mathlib.Tactic.Positivity
namespace OAI
namespace Paper092
theorem simplex_constant_product_ratio (r s : ℕ) (hr : 0 < r) (hs : 0 < s) : simplexConstant r * simplexConstant s / simplexConstant (r + s) = ((r + 1 : ℝ) * (s + 1) / (r + s + 1)) * (Nat.choose (r + s) r : ℝ) * ((r : ℝ) ^ r * (s : ℝ) ^ s / ((r + s : ℕ) : ℝ) ^ (r + s)) := by have hfac := Nat.choose_mul_factorial_mul_factorial (show r ≤ r + s by omega) simp only [Nat.add_sub_cancel_left] at hfac have hfac' : (Nat.choose (r + s) r : ℝ) * r.factorial * s.factorial = ((r + s).factorial : ℝ) := by exact_mod_cast hfac have hr0 : (r.factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero r have hs0 : (s.factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero s have hrs0 : ((r + s : ℕ) : ℝ) ≠ 0 := by positivity have hrs1 : (r : ℝ) + s + 1 ≠ 0 := by positivity have hfrs0 : ((r + s).factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero (r + s) unfold simplexConstant push_cast field_simp nlinarith [hfac']
theorem dimension_twenty_ratio : simplexConstant 10 * simplexConstant 10 / simplexConstant 20 = (22355476 : ℝ) / 22020096 := by norm_num [simplexConstant, Nat.factorial]
theorem dimension_twenty_strict : simplexConstant 20 < simplexConstant 10 * simplexConstant 10 := by norm_num [simplexConstant, Nat.factorial]
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106import OAI.Geometry.ProjectionVolume.ProjectionJacobian
namespace OAI
universe uι
open Setopen scoped RealInnerProductSpace
namespace Paper092
noncomputable def augmentedTangentMatrix {d : ℕ} {ι : Type uι} [Fintype ι] (v : Euclidean d) (b : OrthonormalBasis ι ℝ (normalHyperplane v)) (B : OrthonormalBasis (ι ⊕ Fin 1) ℝ (Euclidean d)) (u : Euclidean d) : Matrix (ι ⊕ Fin 1) (ι ⊕ Fin 1) ℝ := fun i j => ⟪B i, Sum.elim (fun k => (b k : Euclidean d)) (fun _ => u) j⟫
theorem abs_det_augmentedTangentMatrix {d : ℕ} {ι : Type uι} [Fintype ι] [DecidableEq ι] (v : Euclidean d) (hv : ‖v‖ = 1) (b : OrthonormalBasis ι ℝ (normalHyperplane v)) (B : OrthonormalBasis (ι ⊕ Fin 1) ℝ (Euclidean d)) (u : Euclidean d) : |(augmentedTangentMatrix v b B u).det| = |⟪u, v⟫| := by let w : ι ⊕ Fin 1 → Euclidean d := Sum.elim (fun k => (b k : Euclidean d)) (fun _ => u) let a : ι → ℝ := fun i => ⟪u, (b i : Euclidean d)⟫ let M := augmentedTangentMatrix v b B u have hgram : Matrix.gram ℝ w = Matrix.fromBlocks (1 : Matrix ι ι ℝ) (Matrix.of fun i (_ : Fin 1) => a i) (Matrix.of fun (_ : Fin 1) j => a j) (Matrix.of fun (_ _ : Fin 1) => ‖u‖ ^ 2) := by ext i j rcases i with i | i <;> rcases j with j | j · exact b.inner_eq_ite i j · change ⟪(b i : Euclidean d), u⟫ = ⟪u, (b i : Euclidean d)⟫ exact real_inner_comm _ _ · rfl · exact real_inner_self_eq_norm_sq u have hsum : (∑ i, a i ^ 2) = ‖u‖ ^ 2 - ⟪u, v⟫ ^ 2 := by have h := b.sum_sq_inner_left ((normalHyperplane v).orthogonalProjectionOnto u) simp only [Submodule.inner_orthogonalProjectionOnto_eq_of_mem_right] at h change (∑ i, a i ^ 2) = ‖(normalHyperplane v).orthogonalProjectionOnto u‖ ^ 2 at h rw [h] change ‖(normalHyperplane v).starProjection u‖ ^ 2 = _ rw [normal_starProjection_unit v u hv, ← real_inner_self_eq_norm_sq] simp only [inner_sub_left, inner_sub_right, real_inner_smul_left, real_inner_smul_right, real_inner_self_eq_norm_sq, norm_smul, Real.norm_eq_abs, hv, mul_one, sq_abs] rw [real_inner_comm v u] ring have hgdet : (Matrix.gram ℝ w).det = ⟪u, v⟫ ^ 2 := by rw [hgram, Matrix.det_fromBlocks_one₁₁, Matrix.det_unique] change ‖u‖ ^ 2 - (∑ i, a i * a i) = ⟪u, v⟫ ^ 2 simp_rw [← pow_two] rw [hsum] ring have hfactor : M.transpose * M = Matrix.gram ℝ w := by ext i j change (∑ k, ⟪B k, w i⟫ * ⟪B k, w j⟫) = ⟪w i, w j⟫ calc (∑ k, ⟪B k, w i⟫ * ⟪B k, w j⟫) = ∑ k, ⟪w i, B k⟫ * ⟪B k, w j⟫ := by apply Finset.sum_congr rfl intro k _ rw [real_inner_comm (B k) (w i)] _ = ⟪w i, w j⟫ := B.sum_inner_mul_inner _ _ have hsquare : M.det ^ 2 = ⟪u, v⟫ ^ 2 := by calc M.det ^ 2 = (M.transpose * M).det := by rw [Matrix.det_mul, Matrix.det_transpose, pow_two] _ = (Matrix.gram ℝ w).det := congrArg Matrix.det hfactor _ = ⟪u, v⟫ ^ 2 := hgdet change |M.det| = _ nlinarith [sq_abs M.det, sq_abs ⟪u, v⟫, abs_nonneg M.det, abs_nonneg ⟪u, v⟫]
noncomputable def tangentColumns {n : ℕ} (v : Euclidean (n + 1)) (b : OrthonormalBasis (Fin n) ℝ (normalHyperplane v)) (u : Euclidean (n + 1)) : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ := fun i j => (Fin.append (fun k => (b k : Euclidean (n + 1))) (fun _ : Fin 1 => u) j) i
theorem abs_det_tangentColumns {n : ℕ} (v : Euclidean (n + 1)) (hv : ‖v‖ = 1) (b : OrthonormalBasis (Fin n) ℝ (normalHyperplane v)) (u : Euclidean (n + 1)) : |(tangentColumns v b u).det| = |⟪u, v⟫| := by let e : Fin n ⊕ Fin 1 ≃ Fin (n + 1) := finSumFinEquiv let B : OrthonormalBasis (Fin n ⊕ Fin 1) ℝ (Euclidean (n + 1)) := (EuclideanSpace.basisFun (Fin (n + 1)) ℝ).reindex e.symm have hB (i : Fin n ⊕ Fin 1) : B i = EuclideanSpace.single (e i) 1 := by rw [OrthonormalBasis.reindex_apply] exact EuclideanSpace.basisFun_apply (Fin (n + 1)) ℝ (e i) have hm : augmentedTangentMatrix v b B u = (tangentColumns v b u).submatrix e e := by ext i j change ⟪B i, Sum.elim (fun k => (b k : Euclidean (n + 1))) (fun _ => u) j⟫ = (Fin.append (fun k => (b k : Euclidean (n + 1))) (fun _ : Fin 1 => u) (e j)) (e i) rw [hB] rcases j with j | j · simp [e, EuclideanSpace.inner_single_left] · simp [e, EuclideanSpace.inner_single_left] have h := abs_det_augmentedTangentMatrix v hv b B u rw [hm, Matrix.det_submatrix_equiv_self] at h exact h
theorem hyperplaneProjection_normDet_eq_abs_augmented_det {n : ℕ} (u v : Euclidean (n + 1)) (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (b : OrthonormalBasis (Fin n) ℝ (normalHyperplane v)) : (hyperplaneProjection u v).normDet = |(tangentColumns v b u).det| := by rw [hyperplaneProjection_normDet u v hu hv, abs_det_tangentColumns v hv b u]
end Paper092
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import OAI.Geometry.ProjectionVolume.Brightnessimport Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBallsimport Mathlib.Analysis.Normed.Module.Ball.Pointwise
namespace OAI
open Set Metric MeasureTheoryopen scoped Pointwise RealInnerProductSpace
namespace Paper092
noncomputable def euclideanUnitBallVolume (d : ℕ) : ℝ := (volume (closedBall (0 : Euclidean d) 1)).toReal
theorem projection_image_closedBall {d : ℕ} (u : Euclidean d) (R : ℝ) : (normalHyperplane u).orthogonalProjectionOnto '' closedBall (0 : Euclidean d) R = closedBall (0 : normalHyperplane u) R := by ext y constructor · rintro ⟨x, hx, rfl⟩ apply mem_closedBall_zero_iff.mpr exact ((normalHyperplane u).norm_orthogonalProjectionOnto_apply_le x).trans (mem_closedBall_zero_iff.mp hx) · intro hy refine ⟨y.val, ?_, (normalHyperplane u).orthogonalProjectionOnto_mem_subspace_eq_self y⟩ simpa only [mem_closedBall, dist_zero_right, Submodule.norm_coe] using hy
theorem projectionVolume_closedBall_real {d : ℕ} (hd : 2 ≤ d) (u : Euclidean d) (hu : u ≠ 0) (R : ℝ) (hR : 0 ≤ R) : (projectionVolume (closedBall (0 : Euclidean d) R) u).toReal = euclideanUnitBallVolume (d - 1) * R ^ (d - 1) := by let : Nontrivial (normalHyperplane u) := Module.nontrivial_of_finrank_pos (by rw [normalHyperplane_finrank u hu] omega) let : Nontrivial (Euclidean (d - 1)) := Module.nontrivial_of_finrank_pos (by rw [finrank_euclideanSpace_fin] omega) have hunit : (volume (closedBall (0 : normalHyperplane u) 1)) = volume (closedBall (0 : Euclidean (d - 1)) 1) := by rw [InnerProductSpace.volume_closedBall, InnerProductSpace.volume_closedBall, normalHyperplane_finrank u hu, finrank_euclideanSpace_fin] have hball : R • closedBall (0 : normalHyperplane u) 1 = closedBall 0 R := by rw [_root_.smul_closedBall _ _ zero_le_one, smul_zero, Real.norm_eq_abs, abs_of_nonneg hR, mul_one] unfold projectionVolume rw [projection_image_closedBall, ← hball, Measure.addHaar_smul, normalHyperplane_finrank u hu, abs_pow, abs_of_nonneg hR, ENNReal.toReal_mul, ENNReal.toReal_ofReal (pow_nonneg hR _), hunit] exact mul_comm _ _
theorem brightness_closedBall {d : ℕ} (hd : 2 ≤ d) (R : ℝ) (hR : 0 ≤ R) (u : Euclidean d) : brightness (closedBall (0 : Euclidean d) R) u = ‖u‖ * (euclideanUnitBallVolume (d - 1) * R ^ (d - 1)) := by by_cases hu : u = 0 · simp [hu, brightness] · unfold brightness rw [projectionVolume_closedBall_real hd u hu R hR]
theorem brightness_le_ball_bound {d : ℕ} (hd : 2 ≤ d) {K : Set (Euclidean d)} {R : ℝ} (hR : 0 ≤ R) (hK : K ⊆ closedBall 0 R) (u : Euclidean d) : brightness K u ≤ ‖u‖ * (euclideanUnitBallVolume (d - 1) * R ^ (d - 1)) := by exact (brightness_mono hK (isCompact_closedBall _ _) u).trans_eq (brightness_closedBall hd R hR u)
theorem ball_subset_projectionBody {d : ℕ} (hd : 2 ≤ d) {K : Set (Euclidean d)} (hK : IsCompact K) {a : ℝ} (ha : 0 ≤ a) (hball : closedBall 0 a ⊆ K) : closedBall (0 : Euclidean d) (euclideanUnitBallVolume (d - 1) * a ^ (d - 1)) ⊆ projectionBody K := by intro y hy u calc ⟪u, y⟫ ≤ ‖u‖ * ‖y‖ := real_inner_le_norm _ _ _ ≤ ‖u‖ * (euclideanUnitBallVolume (d - 1) * a ^ (d - 1)) := mul_le_mul_of_nonneg_left (mem_closedBall_zero_iff.mp hy) (norm_nonneg u) _ = brightness (closedBall (0 : Euclidean d) a) u := (brightness_closedBall hd a ha u).symm _ ≤ brightness K u := brightness_mono hball hK u
theorem projectionBody_subset_ball {d : ℕ} (hd : 2 ≤ d) {K : Set (Euclidean d)} {R : ℝ} (hR : 0 ≤ R) (hK : K ⊆ closedBall 0 R) : projectionBody K ⊆ closedBall (0 : Euclidean d) (euclideanUnitBallVolume (d - 1) * R ^ (d - 1)) := by intro y hy have hc : 0 ≤ euclideanUnitBallVolume (d - 1) * R ^ (d - 1) := by exact mul_nonneg ENNReal.toReal_nonneg (pow_nonneg hR _) have h := (hy y).trans (brightness_le_ball_bound hd hR hK y) rw [real_inner_self_eq_norm_sq] at h apply mem_closedBall_zero_iff.mpr nlinarith [norm_nonneg y]
end Paper092
end OAI123456789101112131415161718192021222324252627import OAI.Geometry.ProjectionVolume.Model
namespace OAI
noncomputable section
open Set MeasureTheoryopen scoped RealInnerProductSpace
namespace Paper092
theorem normalHyperplane_volume_is_canonical {n : ℕ} (u : Euclidean n) : (volume : Measure (normalHyperplane u)) = (stdOrthonormalBasis ℝ (normalHyperplane u)).toBasis.addHaar := rfl
theorem normalHyperplane_finrank {n : ℕ} (u : Euclidean n) (hu : u ≠ 0) : Module.finrank ℝ (normalHyperplane u) = n - 1 := by have h := (Submodule.span ℝ ({u} : Set (Euclidean n))).finrank_add_finrank_orthogonal simp only [finrank_span_singleton hu, finrank_euclideanSpace_fin] at h change Module.finrank ℝ ((Submodule.span ℝ ({u} : Set (Euclidean n)))ᗮ) = n - 1 omega
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133import OAI.Geometry.ProjectionVolume.Basic
namespace OAI
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
namespace Paper092
theorem normalHyperplane_smul {n : ℕ} (u : Euclidean n) {c : ℝ} (hc : c ≠ 0) : normalHyperplane (c • u) = normalHyperplane u := by unfold normalHyperplane rw [Submodule.span_singleton_smul_eq (isUnit_iff_ne_zero.mpr hc)]
theorem projectionVolume_smul {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) {c : ℝ} (hc : c ≠ 0) : projectionVolume K (c • u) = projectionVolume K u := by exact congrArg (fun V : Submodule ℝ (Euclidean n) => (volume : Measure V) (V.orthogonalProjectionOnto '' K)) (normalHyperplane_smul u hc)
theorem brightness_smul {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) (c : ℝ) : brightness K (c • u) = |c| * brightness K u := by by_cases hc : c = 0 · simp [hc, brightness] · rw [brightness, projectionVolume_smul K u hc, norm_smul, Real.norm_eq_abs, brightness] ring
theorem brightness_neg {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : brightness K (-u) = brightness K u := by simpa using brightness_smul K u (-1)
theorem brightness_nonneg {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : 0 ≤ brightness K u := mul_nonneg (norm_nonneg u) ENNReal.toReal_nonneg
theorem zero_mem_projectionBody {n : ℕ} (K : Set (Euclidean n)) : 0 ∈ projectionBody K := by intro u simpa using brightness_nonneg K u
theorem neg_mem_projectionBody_iff {n : ℕ} (K : Set (Euclidean n)) (y : Euclidean n) : -y ∈ projectionBody K ↔ y ∈ projectionBody K := by constructor · intro h u simpa [brightness_neg] using h (-u) · intro h u simpa [brightness_neg] using h (-u)
theorem projectionBody_neg_eq {n : ℕ} (K : Set (Euclidean n)) : -projectionBody K = projectionBody K := by ext y simp [neg_mem_projectionBody_iff]
theorem projectionVolume_lt_top {n : ℕ} {K : Set (Euclidean n)} (hK : IsCompact K) (u : Euclidean n) : projectionVolume K u < ⊤ := by exact (hK.image (normalHyperplane u).orthogonalProjectionOnto.continuous).measure_lt_top
theorem projectionVolume_mono {n : ℕ} {A B : Set (Euclidean n)} (h : A ⊆ B) (u : Euclidean n) : projectionVolume A u ≤ projectionVolume B u := measure_mono (image_mono h)
theorem brightness_mono {n : ℕ} {A B : Set (Euclidean n)} (h : A ⊆ B) (hB : IsCompact B) (u : Euclidean n) : brightness A u ≤ brightness B u := mul_le_mul_of_nonneg_left (ENNReal.toReal_mono (projectionVolume_lt_top hB u).ne (projectionVolume_mono h u)) (norm_nonneg u)
theorem projectionBody_mono {n : ℕ} {A B : Set (Euclidean n)} (h : A ⊆ B) (hB : IsCompact B) : projectionBody A ⊆ projectionBody B := fun _ hy u => (hy u).trans (brightness_mono h hB u)
theorem projectionBody_isClosed {n : ℕ} (K : Set (Euclidean n)) : IsClosed (projectionBody K) := by rw [projectionBody, ofPred_forall] exact isClosed_iInter fun u => isClosed_le (innerSL ℝ u).continuous continuous_const
theorem projectionBody_convex {n : ℕ} (K : Set (Euclidean n)) : Convex ℝ (projectionBody K) := by rw [projectionBody, ofPred_forall] exact convex_iInter fun u => (convex_Iic (brightness K u)).linear_preimage (innerSL ℝ u).toLinearMap
theorem projectionBody_norm_le {n : ℕ} (K : Set (Euclidean n)) {y : Euclidean n} (hy : y ∈ projectionBody K) : ‖y‖ ≤ ∑ i : Fin n, brightness K (EuclideanSpace.basisFun (Fin n) ℝ i) := by let b := EuclideanSpace.basisFun (Fin n) ℝ calc ‖y‖ = ‖∑ i : Fin n, inner ℝ (b i) y • b i‖ := by rw [b.sum_repr'] _ ≤ ∑ i : Fin n, ‖inner ℝ (b i) y • b i‖ := norm_sum_le _ _ _ = ∑ i : Fin n, |inner ℝ (b i) y| := by simp [norm_smul, Real.norm_eq_abs] _ ≤ ∑ i : Fin n, brightness K (b i) := by apply Finset.sum_le_sum intro i _ apply abs_le.mpr constructor · have h := hy (-b i) simpa [brightness_neg] using neg_le_neg h · exact hy (b i)
theorem projectionBody_isCompact {n : ℕ} (K : Set (Euclidean n)) : IsCompact (projectionBody K) := by apply Metric.isCompact_iff_isClosed_bounded.mpr refine ⟨projectionBody_isClosed K, isBounded_iff_forall_norm_le.mpr ?_⟩ exact ⟨_, fun _ hy => projectionBody_norm_le K hy⟩
theorem projectionVolume_body_smul {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) (hu : u ≠ 0) (c : ℝ) : projectionVolume (c • K) u = ENNReal.ofReal (|c| ^ (n - 1)) * projectionVolume K u := by unfold projectionVolume rw [image_smul_comm _ c K (fun x => map_smul _ c x), Measure.addHaar_smul, normalHyperplane_finrank u hu, abs_pow]
theorem brightness_body_smul {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) (c : ℝ) : brightness (c • K) u = |c| ^ (n - 1) * brightness K u := by by_cases hu : u = 0 · simp [hu, brightness] · rw [brightness, projectionVolume_body_smul K u hu c, ENNReal.toReal_mul, ENNReal.toReal_ofReal (pow_nonneg (abs_nonneg c) _), brightness] ring
theorem projectionBody_body_smul {n : ℕ} (K : Set (Euclidean n)) (c : ℝ) (hc : c ≠ 0) : projectionBody (c • K) = |c| ^ (n - 1) • projectionBody K := by have hq : 0 < |c| ^ (n - 1) := pow_pos (abs_pos.mpr hc) _ ext y rw [mem_smul_set_iff_inv_smul_mem₀ hq.ne'] constructor · intro h u have hh := mul_le_mul_of_nonneg_left (h u) (inv_nonneg.mpr hq.le) simpa [brightness_body_smul, inner_smul_right, mul_assoc, hq.ne'] using hh · intro h u have hh := mul_le_mul_of_nonneg_left (h u) hq.le simpa [brightness_body_smul, inner_smul_right, mul_assoc, hq.ne'] using hh
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import OAI.Geometry.ProjectionVolume.FacetAreasimport OAI.Geometry.ProjectionVolume.SimplexNormalsimport OAI.Geometry.ProjectionVolume.ProjectionJacobian
namespace OAI
open Setopen scoped RealInnerProductSpace
namespace Paper092
def coordinateDrop (n : ℕ) (i : Fin (n + 1)) : Euclidean (n + 1) →ₗ[ℝ] Euclidean n where toFun y := WithLp.toLp 2 (i.removeNth y) map_add' x y := by ext j; rfl map_smul' a x := by ext j; rfl
theorem coordinateDrop_apply (n : ℕ) (i : Fin (n + 1)) (y : Euclidean (n + 1)) (j : Fin n) : coordinateDrop n i y j = y (i.succAbove j) := rfl
theorem coordinateDrop_facetEmbedding (n : ℕ) (i : Fin (n + 1)) (c : ℝ) (x : Euclidean n) : coordinateDrop n i (facetEmbedding n i c x) = x := by ext j exact facetEmbedding_apply_succAbove n i c x j
theorem facetEmbedding_mem_diagonal_tangent (n : ℕ) (i : Fin (n + 1)) (x : Euclidean n) : facetEmbedding n i (-1) x ∈ normalHyperplane (diagonalVector (n + 1)) := by apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr rw [diagonalVector_inner, Fin.sum_univ_succAbove _ i] simp only [facetEmbedding_apply_same, facetEmbedding_apply_succAbove, neg_one_mul, neg_add_cancel]
noncomputable def diagonalTangentEmbedding (n : ℕ) (i : Fin (n + 1)) : Euclidean n →ₗ[ℝ] normalHyperplane (diagonalVector (n + 1)) := (facetEmbedding n i (-1)).codRestrict _ (facetEmbedding_mem_diagonal_tangent n i)
noncomputable def diagonalCoordinateDrop (n : ℕ) (i : Fin (n + 1)) : normalHyperplane (diagonalVector (n + 1)) →ₗ[ℝ] Euclidean n := (coordinateDrop n i).comp (normalHyperplane (diagonalVector (n + 1))).subtype
theorem diagonalCoordinateDrop_comp_embedding (n : ℕ) (i : Fin (n + 1)) : (diagonalCoordinateDrop n i).comp (diagonalTangentEmbedding n i) = LinearMap.id := by ext x j exact congrArg (fun y : Euclidean n => y j) (coordinateDrop_facetEmbedding n i (-1) x)
theorem diagonalCoordinateDrop_normDet (n : ℕ) (i : Fin (n + 1)) : (diagonalCoordinateDrop n i).normDet = 1 / Real.sqrt (n + 1) := by have hn : 0 < Real.sqrt (n + 1 : ℝ) := Real.sqrt_pos.mpr (by positivity) have hw : diagonalVector (n + 1) ≠ 0 := by intro h have hh := diagonalVector_norm (n + 1) simp only [h, norm_zero, Nat.cast_add, Nat.cast_one] at hh exact hn.ne' hh.symm have hdim : Module.finrank ℝ (Euclidean n) = Module.finrank ℝ (normalHyperplane (diagonalVector (n + 1))) := by rw [finrank_euclideanSpace_fin, normalHyperplane_finrank _ hw, Nat.add_sub_cancel] have h := LinearMap.normDet_comp_of_finrank_eq (diagonalTangentEmbedding n i) (diagonalCoordinateDrop n i) hdim rw [diagonalCoordinateDrop_comp_embedding] at h have he : (diagonalTangentEmbedding n i).normDet = Real.sqrt (n + 1) := by rw [diagonalTangentEmbedding, LinearMap.normDet_codRestrict, facetEmbedding_normDet_neg_one] rw [he] at h have hh : 1 = (diagonalCoordinateDrop n i).normDet * Real.sqrt (n + 1) := by simpa using h exact (eq_div_iff hn.ne').mpr hh.symm
theorem coordinateDrop_diagonalFacet (n : ℕ) (i : Fin (n + 1)) : coordinateDrop n i '' simplexFacet (n + 1) none = standardSimplex n := by rw [← diagonalFacetChart_image n i, image_image] have he : (fun x => coordinateDrop n i (diagonalFacetChart n i x)) = id := by funext x ext j simp [coordinateDrop, diagonalFacetChart] rw [he, image_id]
end Paper092
end OAI1234567891011121314151617import OAI.Geometry.ProjectionVolume.ProductCounterexampleimport OAI.Geometry.ProjectionVolume.SimplexValue
namespace OAI
namespace Paper092
theorem standardSimplex_normalizedProjectionVolume_lt_productWitness : normalizedProjectionVolume (standardSimplex 20) < normalizedProjectionVolume productWitness := by rw [standardSimplex_normalizedProjectionVolume 20 (by norm_num), productWitness_normalizedProjectionVolume] exact dimension_twenty_strict
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191import OAI.Geometry.ProjectionVolume.PolytopeCauchyimport OAI.Geometry.ProjectionVolume.EuclideanVolumeimport OAI.Geometry.ProjectionVolume.FacetAreas
namespace OAI
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
noncomputable section
namespace Paper092
def euclideanCube (d : ℕ) : Set (Euclidean d) := WithLp.toLp 2 '' Icc (0 : Fin d → ℝ) 1
theorem mem_euclideanCube {d : ℕ} (x : Euclidean d) : x ∈ euclideanCube d ↔ (∀ i, 0 ≤ x i) ∧ ∀ i, x i ≤ 1 := by constructor · rintro ⟨y, hy, rfl⟩ exact hy · intro hx exact ⟨WithLp.ofLp x, hx, WithLp.toLp_ofLp 2 x⟩
theorem euclideanCube_isCompact (d : ℕ) : IsCompact (euclideanCube d) := isCompact_Icc.image (PiLp.continuous_toLp 2 _)
theorem euclideanCube_volume (d : ℕ) : volume (euclideanCube d) = 1 := by rw [euclideanCube, volume_euclidean_image] simp [Real.volume_Icc_pi]
def cubeNormal {d : ℕ} : Fin d ⊕ Fin d → Euclidean d | .inl i => -EuclideanSpace.single i 1 | .inr i => EuclideanSpace.single i 1
def cubeOffset {d : ℕ} : Fin d ⊕ Fin d → ℝ | .inl _ => 0 | .inr _ => 1
theorem cube_constraints (d : ℕ) : {x : Euclidean d | ∀ i, ⟪cubeNormal i, x⟫ ≤ cubeOffset i} = euclideanCube d := by ext x simp [mem_euclideanCube, Sum.forall, cubeNormal, cubeOffset, EuclideanSpace.inner_single_left]
def cubePolytope (d : ℕ) : HPolytope d (Fin d ⊕ Fin d) where normal := cubeNormal offset := cubeOffset normal_unit i := by cases i <;> simp [cubeNormal] compact := by rw [cube_constraints]; exact euclideanCube_isCompact d strict_feasible := by refine ⟨WithLp.toLp 2 (fun _ => (1 / 2 : ℝ)), ?_⟩ intro i cases i <;> norm_num [cubeNormal, cubeOffset, EuclideanSpace.inner_single_left] distinct := by intro i j hij rcases i with i | i <;> rcases j with j | j · congr 1 by_contra h have hc := congrArg (fun p : Euclidean d × ℝ => p.1 i) hij simp [cubeNormal, h] at hc · have hc := congrArg Prod.snd hij norm_num [cubeOffset] at hc · have hc := congrArg Prod.snd hij norm_num [cubeOffset] at hc · congr 1 by_contra h have hc := congrArg (fun p : Euclidean d × ℝ => p.1 i) hij simp [cubeNormal, h] at hc
theorem cubePolytope_body (d : ℕ) : (cubePolytope d).body = euclideanCube d := cube_constraints d
theorem cubePolytope_face_lower {d : ℕ} (i : Fin d) : (cubePolytope d).face (.inl i) = {x | x ∈ euclideanCube d ∧ x i = 0} := by ext x change (x ∈ (cubePolytope d).body ∧ ⟪-EuclideanSpace.single i 1, x⟫ = 0) ↔ _ rw [cubePolytope_body] simp [EuclideanSpace.inner_single_left]
theorem cubePolytope_face_upper {d : ℕ} (i : Fin d) : (cubePolytope d).face (.inr i) = {x | x ∈ euclideanCube d ∧ x i = 1} := by ext x change (x ∈ (cubePolytope d).body ∧ ⟪EuclideanSpace.single i 1, x⟫ = 1) ↔ _ rw [cubePolytope_body] simp [EuclideanSpace.inner_single_left]
theorem cube_lower_face_chart (n : ℕ) (i : Fin (n + 1)) : facetEmbedding n i 0 '' euclideanCube n = (cubePolytope (n + 1)).face (.inl i) := by rw [cubePolytope_face_lower] ext y constructor · rintro ⟨x, hx, rfl⟩ change facetEmbedding n i 0 x ∈ euclideanCube (n + 1) ∧ facetEmbedding n i 0 x i = 0 rw [mem_euclideanCube] at hx ⊢ simp [facetEmbedding, Fin.forall_iff_succAbove i, hx] · rintro ⟨hy, hi⟩ refine ⟨WithLp.toLp 2 (i.removeNth y), ?_, ?_⟩ · rw [mem_euclideanCube] at hy ⊢ exact ⟨fun j => hy.1 (i.succAbove j), fun j => hy.2 (i.succAbove j)⟩ · ext j induction j using i.succAboveCases <;> simp [facetEmbedding, hi]
theorem cube_lower_face_area (n : ℕ) (i : Fin (n + 1)) : μHE[n] ((cubePolytope (n + 1)).face (.inl i)) = 1 := by rw [← cube_lower_face_chart] have h := (facetEmbedding n i 0).euclideanHausdorffMeasure_image_eq_normDet_mul_volume (euclideanCube n) simpa only [finrank_euclideanSpace_fin, facetEmbedding_normDet_zero, ENNReal.ofReal_one, euclideanCube_volume, mul_one] using h
theorem cube_upper_face_eq_vadd {d : ℕ} (i : Fin d) : (cubePolytope d).face (.inr i) = EuclideanSpace.single i (1 : ℝ) +ᵥ (cubePolytope d).face (.inl i) := by rw [cubePolytope_face_upper, cubePolytope_face_lower] ext y constructor · rintro ⟨hy, hi⟩ refine ⟨y - EuclideanSpace.single i 1, ⟨?_, ?_⟩, ?_⟩ · rw [mem_euclideanCube] at hy ⊢ constructor <;> intro j · by_cases hj : j = i · subst j; simp [PiLp.sub_apply, hi] · simpa [PiLp.sub_apply, PiLp.single_apply, hj] using hy.1 j · by_cases hj : j = i · subst j; simp [PiLp.sub_apply, hi] · simpa [PiLp.sub_apply, PiLp.single_apply, hj] using hy.2 j · simp [PiLp.sub_apply, hi] · change EuclideanSpace.single i 1 + (y - EuclideanSpace.single i 1) = y abel · rintro ⟨x, ⟨hx, hi⟩, rfl⟩ refine ⟨?_, ?_⟩ · rw [mem_euclideanCube] at hx ⊢ constructor <;> intro j · by_cases hj : j = i · subst j; simp [vadd_eq_add, PiLp.add_apply, hi] · simpa [vadd_eq_add, PiLp.add_apply, PiLp.single_apply, hj] using hx.1 j · by_cases hj : j = i · subst j; simp [vadd_eq_add, PiLp.add_apply, hi] · simpa [vadd_eq_add, PiLp.add_apply, PiLp.single_apply, hj] using hx.2 j · simp [vadd_eq_add, PiLp.add_apply, hi]
theorem cube_upper_face_area (n : ℕ) (i : Fin (n + 1)) : μHE[n] ((cubePolytope (n + 1)).face (.inr i)) = 1 := by rw [cube_upper_face_eq_vadd, measure_vadd, cube_lower_face_area]
theorem cube_faceArea {d : ℕ} (hd : 0 < d) (i : Fin d ⊕ Fin d) : (cubePolytope d).faceArea i = 1 := by obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_of_gt hd) cases i with | inl i => change (μHE[n] ((cubePolytope (n + 1)).face (.inl i))).toReal = 1 rw [cube_lower_face_area, ENNReal.toReal_one] | inr i => change (μHE[n] ((cubePolytope (n + 1)).face (.inr i))).toReal = 1 rw [cube_upper_face_area, ENNReal.toReal_one]
theorem euclideanCube_brightness {d : ℕ} (hd : 0 < d) (u : Euclidean d) : brightness (euclideanCube d) u = ∑ i, |u i| := by rw [← cubePolytope_body, (cubePolytope d).brightness_eq_sum] simp only [cube_faceArea hd, one_mul, Fintype.sum_sum_type] simp only [cubePolytope, cubeNormal, inner_neg_right, abs_neg, EuclideanSpace.inner_single_right, one_mul, starRingEnd_apply, star_trivial] ring
theorem euclideanCube_diagonal_brightness {d : ℕ} (hd : 0 < d) : brightness (euclideanCube d) (WithLp.toLp 2 (1 : Fin d → ℝ)) = d := by rw [euclideanCube_brightness hd] simp
theorem euclideanCube_diagonal_extrusion {d : ℕ} (hd : 0 < d) : (volume (euclideanCube d + segment ℝ (0 : Euclidean d) (WithLp.toLp 2 (1 : Fin d → ℝ)))).toReal = (volume (euclideanCube d)).toReal + brightness (euclideanCube d) (WithLp.toLp 2 (1 : Fin d → ℝ)) := by rw [euclideanCube_volume, ENNReal.toReal_one, euclideanCube_diagonal_brightness hd] rw [euclideanCube, volume_euclidean_cube_add_diagonal d hd] rw [ENNReal.toReal_add (by simp) (by simp), ENNReal.toReal_natCast, ENNReal.toReal_one] ring
theorem euclideanCube_diagonal_projectionBody_support {d : ℕ} (hd : 0 < d) : SupportGeometry.support (projectionBody (euclideanCube d)) (innerSL ℝ (WithLp.toLp 2 (1 : Fin d → ℝ))) = d := by rw [← cubePolytope_body, (cubePolytope d).projectionBody_support, cubePolytope_body, euclideanCube_diagonal_brightness hd]
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119import OAI.Geometry.ProjectionVolume.CubeBrightnessimport Mathlib.Algebra.Order.Group.Pointwise.Interval
namespace OAI
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
noncomputable section
namespace Paper092
def lineFiber {d : ℕ} (K : Set (Euclidean d)) (x u : Euclidean d) : Set ℝ := {t | x + t • u ∈ K}
theorem lineFiber_add_segment {d : ℕ} (K : Set (Euclidean d)) (x u : Euclidean d) : lineFiber (K + segment ℝ 0 u) x u = lineFiber K x u + Icc (0 : ℝ) 1 := by ext t constructor · rintro ⟨y, hy, z, hz, hsum⟩ rw [segment_eq_image] at hz obtain ⟨s, hs, rfl⟩ := hz simp only [smul_zero, zero_add] at hsum refine ⟨t - s, ?_, s, hs, sub_add_cancel t s⟩ change x + (t - s) • u ∈ K have heq : x + (t - s) • u = y := by rw [sub_smul, ← add_sub_assoc, ← hsum, add_sub_cancel_right] rwa [heq] · rintro ⟨r, hr, s, hs, rfl⟩ refine ⟨x + r • u, hr, s • u, ?_, ?_⟩ · rw [segment_eq_image] exact ⟨s, hs, by simp⟩ · rw [add_smul] abel_nf
theorem projection_add_parallel_segment {d : ℕ} (K : Set (Euclidean d)) (u : Euclidean d) : (normalHyperplane u).orthogonalProjectionOnto '' (K + segment ℝ 0 u) = (normalHyperplane u).orthogonalProjectionOnto '' K := by ext y constructor · rintro ⟨z, ⟨x, hx, v, hv, rfl⟩, rfl⟩ rw [segment_eq_image] at hv obtain ⟨t, ht, rfl⟩ := hv simp only [smul_zero, zero_add] refine ⟨x, hx, ?_⟩ exact ((projection_eq_iff_parallel u (x + t • u) x).mpr ⟨t, rfl⟩).symm · rintro ⟨x, hx, rfl⟩ exact ⟨x, ⟨x, hx, 0, left_mem_segment ℝ _ _, add_zero x⟩, rfl⟩
theorem cube_lineFiber_eq_interval {d : ℕ} (hd : 0 < d) (x : Euclidean d) : ∃ a b : ℝ, lineFiber (euclideanCube d) x (WithLp.toLp 2 (1 : Fin d → ℝ)) = Icc a b := by have : Nonempty (Fin d) := ⟨⟨0, hd⟩⟩ let a := Finset.univ.sup' Finset.univ_nonempty (fun i : Fin d => -x i) let b := Finset.univ.inf' Finset.univ_nonempty (fun i : Fin d => 1 - x i) refine ⟨a, b, ?_⟩ ext t simp only [lineFiber, mem_ofPred_eq, mem_euclideanCube, PiLp.add_apply, PiLp.smul_apply, Pi.one_apply, smul_eq_mul, mul_one, mem_Icc, a, b, Finset.sup'_le_iff, Finset.le_inf'_iff, Finset.mem_univ, forall_true_left] constructor · intro h exact ⟨fun i => by linarith [h.1 i], fun i => by linarith [h.2 i]⟩ · intro h exact ⟨fun i => by linarith [h.1 i], fun i => by linarith [h.2 i]⟩
theorem cube_lineFiber_extrusion_intervals {d : ℕ} (hd : 0 < d) (x : Euclidean d) (hne : (lineFiber (euclideanCube d) x (WithLp.toLp 2 (1 : Fin d → ℝ))).Nonempty) : ∃ a b : ℝ, a ≤ b ∧ lineFiber (euclideanCube d) x (WithLp.toLp 2 (1 : Fin d → ℝ)) = Icc a b ∧ lineFiber (euclideanCube d + segment ℝ 0 (WithLp.toLp 2 (1 : Fin d → ℝ))) x (WithLp.toLp 2 (1 : Fin d → ℝ)) = Icc a (b + 1) := by obtain ⟨a, b, hab⟩ := cube_lineFiber_eq_interval hd x have hle : a ≤ b := nonempty_Icc.mp (hab ▸ hne) refine ⟨a, b, hle, hab, ?_⟩ rw [lineFiber_add_segment, hab, Set.Icc_add_Icc hle (by norm_num : (0 : ℝ) ≤ 1), add_zero]
theorem interval_line_image {d : ℕ} (x u : Euclidean d) {a b : ℝ} (hab : a ≤ b) : (fun t : ℝ => x + t • u) '' Icc a b = segment ℝ (x + a • u) (x + b • u) := by let f : ℝ →ᵃ[ℝ] Euclidean d := AffineMap.const ℝ ℝ x + (LinearMap.toSpanSingleton ℝ (Euclidean d) u).toAffineMap have hf (t : ℝ) : f t = x + t • u := rfl simpa only [hf, segment_eq_Icc hab] using image_segment ℝ f a b
theorem interval_line_length_increase {d : ℕ} (x u : Euclidean d) {a b : ℝ} (hab : a ≤ b) : dist (x + a • u) (x + (b + 1) • u) = dist (x + a • u) (x + b • u) + ‖u‖ := by rw [dist_eq_norm, dist_eq_norm] have hsub (s : ℝ) : x + a • u - (x + s • u) = (a - s) • u := by rw [sub_smul] abel_nf rw [hsub, hsub, norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonpos (by linarith : a - (b + 1) ≤ 0), abs_of_nonpos (by linarith : a - b ≤ 0)] ring
def lineFiberLength {d : ℕ} (K : Set (Euclidean d)) (x u : Euclidean d) : ℝ := (μH[1] ((fun t : ℝ => x + t • u) '' lineFiber K x u)).toReal
theorem lineFiberLength_of_eq_Icc {d : ℕ} (K : Set (Euclidean d)) (x u : Euclidean d) {a b : ℝ} (hab : a ≤ b) (h : lineFiber K x u = Icc a b) : lineFiberLength K x u = dist (x + a • u) (x + b • u) := by rw [lineFiberLength, h, interval_line_image x u hab, hausdorffMeasure_segment] rw [edist_dist, ENNReal.toReal_ofReal dist_nonneg]
theorem cube_lineFiberLength_extrusion {d : ℕ} (hd : 0 < d) (x : Euclidean d) (hne : (lineFiber (euclideanCube d) x (WithLp.toLp 2 (1 : Fin d → ℝ))).Nonempty) : lineFiberLength (euclideanCube d + segment ℝ 0 (WithLp.toLp 2 (1 : Fin d → ℝ))) x (WithLp.toLp 2 (1 : Fin d → ℝ)) = lineFiberLength (euclideanCube d) x (WithLp.toLp 2 (1 : Fin d → ℝ)) + ‖WithLp.toLp 2 (1 : Fin d → ℝ)‖ := by obtain ⟨a, b, hab, hcube, hextrusion⟩ := cube_lineFiber_extrusion_intervals hd x hne rw [lineFiberLength_of_eq_Icc _ _ _ (by linarith : a ≤ b + 1) hextrusion, lineFiberLength_of_eq_Icc _ _ _ hab hcube] exact interval_line_length_increase _ _ hab
end Paper092
end
end OAI12345678910111213141516171819202122232425262728293031323334353637import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpaceimport OAI.Geometry.ProjectionVolume.Extrusion
namespace OAI
universe uι
open Set MeasureTheoryopen scoped Pointwise
namespace Paper092
theorem volume_euclidean_image {ι : Type uι} [Fintype ι] (s : Set (ι → ℝ)) : (volume : Measure (EuclideanSpace ℝ ι)) (WithLp.toLp 2 '' s) = volume s := by change volume ((MeasurableEquiv.toLp 2 (ι → ℝ)) '' s) = volume s rw [MeasurableEquiv.image_eq_preimage_symm] exact (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp ι).measure_preimage_equiv s
theorem toLp_image_add_segment {ι : Type uι} [Fintype ι] (s : Set (ι → ℝ)) : WithLp.toLp 2 '' (s + segment ℝ (0 : ι → ℝ) 1) = WithLp.toLp 2 '' s + segment ℝ (0 : EuclideanSpace ℝ ι) (WithLp.toLp 2 (1 : ι → ℝ)) := by let e := (WithLp.linearEquiv 2 ℝ (ι → ℝ)).symm have ha := Set.image_add (s := s) (t := segment ℝ (0 : ι → ℝ) 1) e.toAddEquiv have hs := image_segment ℝ e.toAffineEquiv.toAffineMap (0 : ι → ℝ) 1 simpa [e] using ha.trans (congrArg (fun t => e '' s + t) hs)
theorem volume_euclidean_cube_add_diagonal (d : ℕ) (hd : 0 < d) : volume ((WithLp.toLp 2 '' Icc (0 : Fin d → ℝ) 1) + segment ℝ (0 : EuclideanSpace ℝ (Fin d)) (WithLp.toLp 2 (1 : Fin d → ℝ))) = d + 1 := by rw [← toLp_image_add_segment, volume_euclidean_image] exact volume_Icc_add_segment_one d hd
end Paper092
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import OAI.Geometry.ProjectionVolume.ExposedProduct
namespace OAI
noncomputable sectionopen Setopen scoped RealInnerProductSpace
namespace Paper092
theorem exposedFace_vectorSpan_le_normalHyperplane {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : vectorSpan ℝ (exposedFace K u) ≤ normalHyperplane u := by rw [vectorSpan_def] apply Submodule.span_le.mpr rintro _ ⟨x, hx, y, hy, rfl⟩ apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr change ⟪u, x - y⟫ = 0 rw [inner_sub_right] exact sub_eq_zero.mpr (le_antisymm (hy.2 x hx.1) (hx.2 y hy.1))
theorem exposedFace_finrank_le {n : ℕ} (K : Set (Euclidean n)) {u : Euclidean n} (hu : u ≠ 0) : Module.finrank ℝ (vectorSpan ℝ (exposedFace K u)) ≤ n - 1 := by have h := Submodule.finrank_mono (exposedFace_vectorSpan_le_normalHyperplane K u) rwa [normalHyperplane_finrank u hu] at h
theorem exposedFace_ssubset {n : ℕ} (K : Set (Euclidean n)) (hint : (interior K).Nonempty) {u : Euclidean n} (hu : u ≠ 0) : exposedFace K u ⊂ K := by refine ssubset_iff_subset_ne.mpr ⟨fun _ hx => hx.1, ?_⟩ intro heq obtain ⟨x, hx⟩ := hint obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp hx) have hnorm : 0 < ‖u‖ := norm_pos_iff.mpr hu let t : ℝ := ε / (2 * ‖u‖) have ht : 0 < t := div_pos hε (mul_pos (by norm_num) hnorm) have hdist : dist (x + t • u) x < ε := by rw [dist_eq_norm, add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_pos ht] dsimp [t] field_simp linarith have hy := hball (Metric.mem_ball.mpr hdist) have hface : x ∈ exposedFace K u := heq.symm ▸ interior_subset hx have hle := hface.2 (x + t • u) hy change ⟪u, x + t • u⟫ ≤ ⟪u, x⟫ at hle rw [inner_add_right, real_inner_smul_right, real_inner_self_eq_norm_sq] at hle have hpos := mul_pos ht (sq_pos_of_pos hnorm) linarith
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104import OAI.Geometry.ProjectionVolume.ProductPolytopeimport Mathlib.Analysis.Convex.Exposedimport Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional
namespace OAI
noncomputable sectionopen Set MeasureTheoryopen scoped RealInnerProductSpace
namespace Paper092
def exposedFace {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : Set (Euclidean n) := (innerSL ℝ u).toExposed K
@[simp] theorem exposedFace_zero {n : ℕ} (K : Set (Euclidean n)) : exposedFace K 0 = K := by ext x simp [exposedFace, ContinuousLinearMap.toExposed]
theorem exposedFace_nonempty {n : ℕ} (K : Set (Euclidean n)) (hK : IsCompact K) (hne : K.Nonempty) (u : Euclidean n) : (exposedFace K u).Nonempty := by obtain ⟨x, hx, hmax⟩ := hK.exists_isMaxOn hne (innerSL ℝ u).continuous.continuousOn exact ⟨x, hx, hmax⟩
theorem exposedFace_product {r s : ℕ} (A : Set (Euclidean r)) (B : Set (Euclidean s)) (w : Euclidean (r + s)) : exposedFace (cartesianBody A B) w = cartesianBody (exposedFace A (splitEuclideanProduct r s w).1) (exposedFace B (splitEuclideanProduct r s w).2) := by ext x change (x ∈ cartesianBody A B ∧ ∀ y ∈ cartesianBody A B, ⟪w, y⟫ ≤ ⟪w, x⟫) ↔ (((splitEuclideanProduct r s x).1 ∈ A ∧ ∀ a ∈ A, ⟪(splitEuclideanProduct r s w).1, a⟫ ≤ ⟪(splitEuclideanProduct r s w).1, (splitEuclideanProduct r s x).1⟫) ∧ ((splitEuclideanProduct r s x).2 ∈ B ∧ ∀ b ∈ B, ⟪(splitEuclideanProduct r s w).2, b⟫ ≤ ⟪(splitEuclideanProduct r s w).2, (splitEuclideanProduct r s x).2⟫)) constructor · rintro ⟨⟨hA, hB⟩, hmax⟩ refine ⟨⟨hA, ?_⟩, ⟨hB, ?_⟩⟩ · intro a ha have hm : (splitEuclideanProduct r s).symm (a, (splitEuclideanProduct r s x).2) ∈ cartesianBody A B := by rw [cartesianBody_eq_preimage, Set.mem_preimage, ContinuousLinearEquiv.apply_symm_apply] exact ⟨ha, hB⟩ have h := hmax _ hm rw [splitEuclideanProduct_inner r s, splitEuclideanProduct_inner r s, ContinuousLinearEquiv.apply_symm_apply] at h exact (add_le_add_iff_right _).mp h · intro b hb have hm : (splitEuclideanProduct r s).symm ((splitEuclideanProduct r s x).1, b) ∈ cartesianBody A B := by rw [cartesianBody_eq_preimage, Set.mem_preimage, ContinuousLinearEquiv.apply_symm_apply] exact ⟨hA, hb⟩ have h := hmax _ hm rw [splitEuclideanProduct_inner r s, splitEuclideanProduct_inner r s, ContinuousLinearEquiv.apply_symm_apply] at h exact (add_le_add_iff_left _).mp h · rintro ⟨⟨hA, hmaxA⟩, ⟨hB, hmaxB⟩⟩ refine ⟨⟨hA, hB⟩, ?_⟩ intro y hy rw [splitEuclideanProduct_inner r s, splitEuclideanProduct_inner r s] exact add_le_add (hmaxA _ hy.1) (hmaxB _ hy.2)
theorem cartesianBody_eq_image {r s : ℕ} (A : Set (Euclidean r)) (B : Set (Euclidean s)) : cartesianBody A B = (splitEuclideanProduct r s).symm '' (A ×ˢ B) := by ext x constructor · intro hx exact ⟨splitEuclideanProduct r s x, hx, (splitEuclideanProduct r s).symm_apply_apply x⟩ · rintro ⟨y, hy, rfl⟩ change splitEuclideanProduct r s ((splitEuclideanProduct r s).symm y) ∈ A ×ˢ B simpa using hy
theorem submodule_prod_finrank {r s : ℕ} (P : Submodule ℝ (Euclidean r)) (Q : Submodule ℝ (Euclidean s)) : Module.finrank ℝ (P.prod Q) = Module.finrank ℝ P + Module.finrank ℝ Q := by let e : (P.prod Q) ≃ₗ[ℝ] P × Q := { toFun := fun x => (⟨x.1.1, x.2.1⟩, ⟨x.1.2, x.2.2⟩) invFun := fun x => ⟨(x.1, x.2), ⟨x.1.2, x.2.2⟩⟩ left_inv := fun _ => rfl right_inv := fun _ => rfl map_add' := fun _ _ => rfl map_smul' := fun _ _ => rfl } rw [e.finrank_eq, Module.finrank_prod]
theorem cartesianBody_affine_dimension {r s : ℕ} (A : Set (Euclidean r)) (B : Set (Euclidean s)) (hA : A.Nonempty) (hB : B.Nonempty) : Module.finrank ℝ (vectorSpan ℝ (cartesianBody A B)) = Module.finrank ℝ (vectorSpan ℝ A) + Module.finrank ℝ (vectorSpan ℝ B) := by let e := (splitEuclideanProduct r s).symm.toLinearEquiv rw [cartesianBody_eq_image] change Module.finrank ℝ (vectorSpan ℝ (e.toLinearMap.toAffineMap '' (A ×ˢ B))) = _ rw [← AffineMap.map_vectorSpan] change Module.finrank ℝ ((vectorSpan ℝ (A ×ˢ B)).map e.toLinearMap) = _ rw [e.finrank_map_eq, vectorSpan_prod_eq hA hB, submodule_prod_finrank]
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaarimport Mathlib.Analysis.Convex.Segmentimport Mathlib.Tactic.Linarithimport Mathlib.Tactic.NormNum
namespace OAI
universe uι
open Set MeasureTheoryopen scoped ENNReal Pointwise
namespace Paper092
variable {ι : Type uι} [Fintype ι] [DecidableEq ι]
def unitCube (ι : Type uι) : Set (ι → ℝ) := Icc 0 1
def extrusionCell (i : ι) : Set (ι → ℝ) := {x | (1 ≤ x i ∧ x i ≤ 2) ∧ ∀ j, j ≠ i → x i - 1 ≤ x j ∧ x j ≤ x i}
def shearMatrix (i : ι) : Matrix ι ι ℝ := (1 : Matrix ι ι ℝ).updateCol i (fun _ => 1)
theorem det_shearMatrix (i : ι) : (shearMatrix i).det = 1 := by simpa [shearMatrix, Matrix.one_apply] using Matrix.det_updateCol_sum (1 : Matrix ι ι ℝ) i (fun _ => (1 : ℝ))
def cellMap (i : ι) (x : ι → ℝ) : ι → ℝ := fun j => if j = i then 1 + x i else x i + x j
omit [Fintype ι] intheorem cellMap_mem_iff (i : ι) (x : ι → ℝ) : cellMap i x ∈ extrusionCell i ↔ x ∈ unitCube ι := by simp only [extrusionCell, cellMap, unitCube, mem_ofPred_eq, mem_Icc, Pi.le_def, Pi.zero_apply, Pi.one_apply, ite_true] constructor · rintro ⟨hi, h⟩ constructor <;> intro j · by_cases hj : j = i · subst j; linarith · have := h j hj simp only [ite_eq_right hj] at this linarith · by_cases hj : j = i · subst j; linarith · have := h j hj simp only [ite_eq_right hj] at this linarith · rintro ⟨h0, h1⟩ refine ⟨⟨by linarith [h0 i], by linarith [h1 i]⟩, ?_⟩ intro j hj simp only [ite_eq_right hj] constructor <;> linarith [h0 j, h1 j]
theorem cellMap_eq_matrix (i : ι) (x : ι → ℝ) : cellMap i x = Pi.single i 1 + Matrix.toLin' (shearMatrix i) x := by funext j simp only [cellMap, Pi.add_apply, Matrix.toLin'_apply, Matrix.mulVec, dotProduct, shearMatrix, Matrix.updateCol_apply, Matrix.one_apply] by_cases hj : j = i · subst j have hsum : ∀ k : ι, (if k = i then 1 else if i = k then 1 else 0) * x k = if k = i then x k else 0 := by intro k by_cases hk : k = i · subst k; simp · simp [hk, Ne.symm hk] simp_rw [hsum] simp · have hsum : ∀ k : ι, (if k = i then 1 else if j = k then 1 else 0) * x k = (if k = i then x i else 0) + (if k = j then x j else 0) := by intro k by_cases hki : k = i · subst k; simp [Ne.symm hj] · by_cases hkj : k = j · subst k; simp [hj] · simp [hki, hkj, Ne.symm hkj] simp_rw [hsum] simp [hj, Finset.sum_add_distrib]
theorem cellMap_measurePreserving (i : ι) : MeasurePreserving (cellMap i) volume volume := by have hs : MeasurePreserving (Matrix.toLin' (shearMatrix i)) volume volume := by refine ⟨(Matrix.toLin' (shearMatrix i)).continuous_of_finiteDimensional.measurable, ?_⟩ simpa [det_shearMatrix] using Real.map_matrix_volume_pi_eq_smul_volume_pi (M := shearMatrix i) (by rw [det_shearMatrix]; norm_num) have h := (measurePreserving_add_left (volume : Measure (ι → ℝ)) (Pi.single i 1)).comp hs simpa only [Function.comp_def, ← cellMap_eq_matrix] using h
omit [DecidableEq ι] intheorem extrusionCell_measurable (i : ι) : MeasurableSet (extrusionCell i) := by simp only [extrusionCell, ofPred_and, ofPred_forall] exact ((measurableSet_le measurable_const (measurable_pi_apply i)).inter (measurableSet_le (measurable_pi_apply i) measurable_const)).inter (MeasurableSet.iInter fun j => MeasurableSet.iInter fun _ => (measurableSet_le ((measurable_pi_apply i).sub measurable_const) (measurable_pi_apply j)).inter (measurableSet_le (measurable_pi_apply j) (measurable_pi_apply i)))
omit [DecidableEq ι] intheorem unitCube_volume : volume (unitCube ι) = 1 := by simp [unitCube, Real.volume_Icc_pi]
theorem extrusionCell_volume (i : ι) : volume (extrusionCell i) = 1 := by have hpre : cellMap i ⁻¹' extrusionCell i = unitCube ι := Set.ext (cellMap_mem_iff i) rw [← (cellMap_measurePreserving i).measure_preimage (extrusionCell_measurable i).nullMeasurableSet, hpre, unitCube_volume]
omit [DecidableEq ι] intheorem coordinate_eq_null (i : ι) (c : ℝ) : volume {x : ι → ℝ | x i = c} = 0 := by simpa [volume_pi] using Measure.pi_hyperplane (fun _ : ι => (volume : Measure ℝ)) i c
theorem coordinates_eq_null (i j : ι) (hij : i ≠ j) : volume {x : ι → ℝ | x i = x j} = 0 := by let f : (ι → ℝ) →ₗ[ℝ] ℝ := (LinearMap.proj i : (ι → ℝ) →ₗ[ℝ] ℝ) - LinearMap.proj j have hker : LinearMap.ker f ≠ ⊤ := by intro h have hz : f (Pi.single i 1) = 0 := by apply LinearMap.mem_ker.mp rw [h] exact Submodule.mem_top simp [f, Ne.symm hij] at hz have hset : {x : ι → ℝ | x i = x j} = (LinearMap.ker f : Set (ι → ℝ)) := by ext x change x i = x j ↔ x i - x j = 0 exact sub_eq_zero.symm rw [hset] exact Measure.addHaar_submodule (volume : Measure (ι → ℝ)) (LinearMap.ker f) hker
omit [DecidableEq ι] intheorem cube_cell_aedisjoint (i : ι) : AEDisjoint volume (unitCube ι) (extrusionCell i) := by apply measure_mono_null _ (coordinate_eq_null i 1) rintro x ⟨hx, hi⟩ exact le_antisymm (hx.2 i) hi.1.1
theorem cells_aedisjoint : Pairwise (fun i j : ι => AEDisjoint volume (extrusionCell i) (extrusionCell j)) := by intro i j hij apply measure_mono_null _ (coordinates_eq_null i j hij) rintro x ⟨hi, hj⟩ exact le_antisymm (hj.2 i hij).2 (hi.2 j hij.symm).2
theorem cube_add_diagonal_eq_union [Nonempty ι] : unitCube ι + segment ℝ (0 : ι → ℝ) 1 = unitCube ι ∪ ⋃ i, extrusionCell i := by ext x constructor · rintro ⟨q, hq, z, hz, rfl⟩ change (∀ i, 0 ≤ q i) ∧ (∀ i, q i ≤ 1) at hq rw [segment_eq_image] at hz rcases hz with ⟨t, ht, rfl⟩ simp only [smul_zero, zero_add] by_cases hmax : ∀ i, q i + t ≤ 1 · left constructor <;> intro i · simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Pi.one_apply, mul_one] exact add_nonneg (hq.1 i) ht.1 · simpa only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Pi.one_apply, mul_one] using hmax i · right obtain ⟨i, _, hi⟩ := Finset.exists_max_image Finset.univ q Finset.univ_nonempty refine mem_iUnion.mpr ⟨i, ?_⟩ push Not at hmax obtain ⟨j, hj⟩ := hmax have hji := hi j (Finset.mem_univ j) constructor · constructor · simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Pi.one_apply, mul_one] linarith · simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Pi.one_apply, mul_one] linarith [hq.2 i, ht.2] · intro k _ simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Pi.one_apply, mul_one] constructor · linarith [hq.2 i, hq.1 k] · linarith [hi k (Finset.mem_univ k)] · rintro (hx | hx) · exact ⟨x, hx, 0, left_mem_segment ℝ _ _, add_zero x⟩ · obtain ⟨i, hi⟩ := mem_iUnion.mp hx refine ⟨fun j => x j - (x i - 1), ?_, (x i - 1) • (1 : ι → ℝ), ?_, ?_⟩ · constructor <;> intro j · change 0 ≤ x j - (x i - 1) by_cases hj : j = i · subst j; linarith · linarith [(hi.2 j hj).1] · change x j - (x i - 1) ≤ 1 by_cases hj : j = i · subst j; linarith · linarith [(hi.2 j hj).2] · rw [segment_eq_image] refine ⟨x i - 1, ⟨by linarith [hi.1.1], by linarith [hi.1.2]⟩, ?_⟩ simp · ext j simp
theorem volume_cube_add_diagonal [Nonempty ι] : volume (unitCube ι + segment ℝ (0 : ι → ℝ) 1) = Fintype.card ι + 1 := by rw [cube_add_diagonal_eq_union, measure_union₀ ((MeasurableSet.iUnion extrusionCell_measurable).nullMeasurableSet) (AEDisjoint.iUnion_right_iff.mpr cube_cell_aedisjoint), measure_iUnion₀ cells_aedisjoint (fun i => (extrusionCell_measurable i).nullMeasurableSet), unitCube_volume] simp [extrusionCell_volume, add_comm]
theorem volume_Icc_add_segment_one (d : ℕ) (hd : 0 < d) : volume (Icc (0 : Fin d → ℝ) 1 + segment ℝ (0 : Fin d → ℝ) 1) = d + 1 := by let : Nonempty (Fin d) := ⟨⟨0, hd⟩⟩ simpa [unitCube] using (volume_cube_add_diagonal (ι := Fin d))
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166import OAI.Geometry.ProjectionVolume.ProductVolumeimport OAI.Geometry.ProjectionVolume.SimplexProjectionimport Mathlib.Analysis.InnerProductSpace.NormDetimport Mathlib.LinearAlgebra.Matrix.SchurComplement
namespace OAI
noncomputable section
open Set MeasureTheoryopen scoped BigOperators RealInnerProductSpace ENNReal
namespace Paper092
def facetEmbedding (n : ℕ) (i : Fin (n + 1)) (c : ℝ) : Euclidean n →ₗ[ℝ] Euclidean (n + 1) where toFun x := WithLp.toLp 2 (i.insertNth (c * ∑ j, x j) x) map_add' x y := by ext j induction j using i.succAboveCases <;> simp [PiLp.add_apply, Finset.sum_add_distrib, mul_add] map_smul' a x := by ext j induction j using i.succAboveCases <;> simp [PiLp.smul_apply, smul_eq_mul, Finset.mul_sum, mul_left_comm]
theorem facetEmbedding_apply_same (n : ℕ) (i : Fin (n + 1)) (c : ℝ) (x : Euclidean n) : facetEmbedding n i c x i = c * ∑ j, x j := by simp [facetEmbedding]
theorem facetEmbedding_apply_succAbove (n : ℕ) (i : Fin (n + 1)) (c : ℝ) (x : Euclidean n) (j : Fin n) : facetEmbedding n i c x (i.succAbove j) = x j := by simp [facetEmbedding]
theorem facetEmbedding_inner (n : ℕ) (i : Fin (n + 1)) (c : ℝ) (x y : Euclidean n) : ⟪facetEmbedding n i c x, facetEmbedding n i c y⟫ = ⟪x, y⟫ + c ^ 2 * (∑ j, x j) * (∑ j, y j) := by rw [PiLp.inner_apply, Fin.sum_univ_succAbove _ i] simp only [facetEmbedding_apply_same, facetEmbedding_apply_succAbove, Real.inner_apply, PiLp.inner_apply] ring
theorem facetEmbedding_normDet_sq (n : ℕ) (i : Fin (n + 1)) (c : ℝ) : (facetEmbedding n i c).normDet ^ 2 = 1 + (n : ℝ) * c ^ 2 := by have hsq := (facetEmbedding n i c).normDet_sq_eq_det_gram (EuclideanSpace.basisFun (Fin n) ℝ) simp only [RCLike.ofReal_real_eq_id, id_eq] at hsq have hgram : Matrix.gram ℝ (fun j => facetEmbedding n i c (EuclideanSpace.basisFun (Fin n) ℝ j)) = 1 + Matrix.replicateCol (Fin 1) (fun _ : Fin n => c) * Matrix.replicateRow (Fin 1) (fun _ : Fin n => c) := by ext j k simp only [Matrix.gram_apply, facetEmbedding_inner, (EuclideanSpace.basisFun (Fin n) ℝ).inner_eq_ite] simp [EuclideanSpace.basisFun_apply, PiLp.single_apply, Matrix.one_apply, Matrix.mul_apply, pow_two] rw [hgram] at hsq have hd := Matrix.det_one_add_replicateCol_mul_replicateRow (ι := Fin 1) (fun _ : Fin n => c) (fun _ : Fin n => c) simpa [dotProduct, pow_two, mul_assoc] using hsq.trans hd
theorem facetEmbedding_normDet_zero (n : ℕ) (i : Fin (n + 1)) : (facetEmbedding n i 0).normDet = 1 := by have h := facetEmbedding_normDet_sq n i 0 have hp := (facetEmbedding n i 0).normDet_nonneg nlinarith
theorem facetEmbedding_normDet_neg_one (n : ℕ) (i : Fin (n + 1)) : (facetEmbedding n i (-1)).normDet = Real.sqrt (n + 1) := by have h := facetEmbedding_normDet_sq n i (-1) have hp := (facetEmbedding n i (-1)).normDet_nonneg have hs := Real.sq_sqrt (by positivity : (0 : ℝ) ≤ n + 1) have hsp := Real.sqrt_nonneg ((n : ℝ) + 1) nlinarith
theorem facetEmbedding_zero_image (n : ℕ) (i : Fin (n + 1)) : facetEmbedding n i 0 '' standardSimplex n = simplexFacet (n + 1) (some i) := by ext y constructor · rintro ⟨x, hx, rfl⟩ change facetEmbedding n i 0 x ∈ standardSimplex (n + 1) ∧ facetEmbedding n i 0 x i = 0 rw [mem_standardSimplex_iff] at hx ⊢ simp [facetEmbedding, Fin.forall_iff_succAbove i, hx] · rintro ⟨hy, hi⟩ change y i = 0 at hi refine ⟨WithLp.toLp 2 (i.removeNth y), ?_, ?_⟩ · rw [mem_standardSimplex_iff] at hy ⊢ refine ⟨fun j => hy.1 (i.succAbove j), ?_⟩ have hsum := Fin.add_sum_removeNth i (fun j => y j) simpa [hi, Fin.removeNth] using hsum.trans_le hy.2 · ext j induction j using i.succAboveCases <;> simp [facetEmbedding, hi]
theorem simplexFacet_coordinate_area (n : ℕ) (i : Fin (n + 1)) : Measure.euclideanHausdorffMeasure n (simplexFacet (n + 1) (some i)) = ENNReal.ofReal (1 / (Nat.factorial n : ℝ)) := by rw [← facetEmbedding_zero_image n i] have h := (facetEmbedding n i 0).euclideanHausdorffMeasure_image_eq_normDet_mul_volume (standardSimplex n) simpa only [finrank_euclideanSpace_fin, facetEmbedding_normDet_zero, ENNReal.ofReal_one, one_mul, standardSimplex_volume] using h
def diagonalFacetChart (n : ℕ) (i : Fin (n + 1)) (x : Euclidean n) : Euclidean (n + 1) := WithLp.toLp 2 (i.insertNth (1 - ∑ j, x j) x)
theorem diagonalFacetChart_eq (n : ℕ) (i : Fin (n + 1)) (x : Euclidean n) : diagonalFacetChart n i x = facetEmbedding n i (-1) x + EuclideanSpace.single i 1 := by ext j induction j using i.succAboveCases <;> simp [diagonalFacetChart, facetEmbedding, sub_eq_add_neg, add_comm]
theorem diagonalFacetChart_image (n : ℕ) (i : Fin (n + 1)) : diagonalFacetChart n i '' standardSimplex n = simplexFacet (n + 1) none := by ext y constructor · rintro ⟨x, hx, rfl⟩ rw [mem_standardSimplex_iff] at hx change diagonalFacetChart n i x ∈ standardSimplex (n + 1) ∧ 1 - ∑ j, diagonalFacetChart n i x j = 0 rw [mem_standardSimplex_iff] simp [diagonalFacetChart, Fin.forall_iff_succAbove i] exact ⟨hx.2, hx.1⟩ · rintro ⟨hy, hi⟩ change 1 - ∑ j, y j = 0 at hi have htotal : ∑ j, y j = 1 := by linarith rw [mem_standardSimplex_iff] at hy have hsum := Fin.add_sum_removeNth i (fun j => y j) refine ⟨WithLp.toLp 2 (i.removeNth y), ?_, ?_⟩ · rw [mem_standardSimplex_iff] refine ⟨fun j => hy.1 (i.succAbove j), ?_⟩ change ∑ j, i.removeNth (fun k => y k) j ≤ 1 linarith [hy.1 i] · ext j induction j using i.succAboveCases · simp only [diagonalFacetChart, PiLp.toLp_apply, Fin.insertNth_apply_same] change 1 - ∑ j, i.removeNth (fun k => y k) j = y i linarith · simp [diagonalFacetChart]
theorem simplexFacet_diagonal_area (n : ℕ) : Measure.euclideanHausdorffMeasure n (simplexFacet (n + 1) none) = ENNReal.ofReal (Real.sqrt (n + 1) / (Nat.factorial n : ℝ)) := by let i : Fin (n + 1) := Fin.last n rw [← diagonalFacetChart_image n i] have hset : diagonalFacetChart n i '' standardSimplex n = (IsometryEquiv.vaddConst (EuclideanSpace.single i (1 : ℝ))) '' (facetEmbedding n i (-1) '' standardSimplex n) := by rw [image_image] congr 1 funext x exact diagonalFacetChart_eq n i x rw [hset, (IsometryEquiv.vaddConst (EuclideanSpace.single i (1 : ℝ))).isometry.euclideanHausdorffMeasure_image] have h := (facetEmbedding n i (-1)).euclideanHausdorffMeasure_image_eq_normDet_mul_volume (standardSimplex n) simp only [finrank_euclideanSpace_fin, facetEmbedding_normDet_neg_one, standardSimplex_volume] at h rw [h, ← ENNReal.ofReal_mul (Real.sqrt_nonneg _)] congr 1 ring
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869import OAI.Geometry.ProjectionVolume.FacetExhaustivenessimport OAI.Geometry.ProjectionVolume.FacetUniquenessimport OAI.Geometry.ProjectionVolume.ProductFacetFamilies
namespace OAI
universe uι
noncomputable sectionopen Setopen scoped RealInnerProductSpace
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem face_eq_exposedFace (i : ι) (hne : (P.face i).Nonempty) : P.face i = exposedFace P.body (P.normal i) := by ext x constructor · rintro ⟨hx, hxi⟩ refine ⟨hx, ?_⟩ intro y hy change ⟪P.normal i, y⟫ ≤ ⟪P.normal i, x⟫ rw [hxi] exact hy i · intro hx obtain ⟨y, hy⟩ := hne refine ⟨hx.1, le_antisymm (hx.1 i) ?_⟩ have h := hx.2 y hy.1 change ⟪P.normal i, y⟫ ≤ ⟪P.normal i, x⟫ at h rwa [hy.2] at h
theorem face_isExposed (i : ι) : IsExposed ℝ P.body (P.face i) := by intro hne refine ⟨innerSL ℝ (P.normal i), ?_⟩ exact P.face_eq_exposedFace i hne
theorem exposed_facet_eq_unique_face (hd : 0 < d) (F : Set (Euclidean d)) (hF : IsExposed ℝ P.body F) (hne : F.Nonempty) (hdim : Module.finrank ℝ (vectorSpan ℝ F) = d - 1) : ∃! i, F = P.face i := by obtain ⟨u, rfl⟩ := eq_exposedFace_of_isExposed hF hne have hu : u ≠ 0 := by intro hzero rw [hzero, exposedFace_zero, vectorSpan_finrank_of_interior_nonempty P.body P.body_interior_nonempty] at hdim omega obtain ⟨i, hi⟩ := P.exposedFace_eq_face hu hdim refine ⟨i, hi, ?_⟩ intro j hj apply P.face_index_unique_of_finrank j i · rwa [← hj] · rwa [← hj] · exact hj.symm.trans hi
theorem finite_exposed_facets (hd : 0 < d) : {F : Set (Euclidean d) | IsExposed ℝ P.body F ∧ F.Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ F) = d - 1}.Finite := by apply (Set.finite_range P.face).subset rintro F ⟨hF, hne, hdim⟩ obtain ⟨i, hi, _⟩ := P.exposed_facet_eq_unique_face hd F hF hne hdim exact ⟨i, hi.symm⟩
end Paper092.HPolytope
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798import OAI.Geometry.ProjectionVolume.FacetUniquenessimport OAI.Geometry.ProjectionVolume.ProjectionNullity
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace Classical Pointwise
noncomputable section
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem face_finrank_le (i : ι) : Module.finrank ℝ (vectorSpan ℝ (P.face i)) ≤ d - 1 := by have hn : P.normal i ≠ 0 := by intro h have := P.normal_unit i simp only [h, norm_zero] at this norm_num at this have h := Submodule.finrank_mono (P.face_vectorSpan_le_normalHyperplane i) rwa [normalHyperplane_finrank (P.normal i) hn] at h
theorem face_surface_zero_of_finrank_lt (i : ι) (h : Module.finrank ℝ (vectorSpan ℝ (P.face i)) < d - 1) : μHE[d - 1] (P.face i) = 0 := by have hn : P.normal i ≠ 0 := by intro h have := P.normal_unit i simp only [h, norm_zero] at this norm_num at this have hz := projectionVolume_eq_zero_of_finrank_lt (P.face i) hn h rw [projectionVolume_of_subset_affine_hyperplane (P.normal i) (P.normal i) (P.normal_unit i) (P.normal_unit i) (P.offset i) (P.face i) (fun _ hx => hx.2)] at hz simpa only [real_inner_self_eq_norm_sq, P.normal_unit, one_pow, abs_one, ENNReal.ofReal_one, one_mul] using hz
theorem faceArea_zero_of_not_facet (i : ι) (h : ¬ ((P.face i).Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ (P.face i)) = d - 1)) : P.faceArea i = 0 := by by_cases hne : (P.face i).Nonempty · have hdim : Module.finrank ℝ (vectorSpan ℝ (P.face i)) ≠ d - 1 := fun heq => h ⟨hne, heq⟩ rw [faceArea, P.face_surface_zero_of_finrank_lt i (lt_of_le_of_ne (P.face_finrank_le i) hdim), ENNReal.toReal_zero] · have he : P.face i = ∅ := by ext x constructor · intro hx exact (hne ⟨x, hx⟩).elim · intro hx exact hx.elim simp only [faceArea, he, measure_empty, ENNReal.toReal_zero]
theorem brightness_eq_facet_sum (u : Euclidean d) : brightness P.body u = (1 / 2 : ℝ) * ∑ i ∈ Finset.univ.filter (fun i => (P.face i).Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ (P.face i)) = d - 1), P.faceArea i * |⟪P.normal i, u⟫| := by have hsum : (∑ i, P.faceArea i * |⟪u, P.normal i⟫|) = ∑ i ∈ Finset.univ.filter (fun i => (P.face i).Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ (P.face i)) = d - 1), P.faceArea i * |⟪u, P.normal i⟫| := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro i hi hni have hn : ¬ ((P.face i).Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ (P.face i)) = d - 1) := fun hf => hni (Finset.mem_filter.mpr ⟨hi, hf⟩) rw [P.faceArea_zero_of_not_facet i hn, zero_mul] rw [P.brightness_eq_sum, hsum] simp_rw [real_inner_comm u] ring
theorem projectionBody_eq_facet_sum : projectionBody P.body = ∑ i ∈ Finset.univ.filter (fun i => (P.face i).Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ (P.face i)) = d - 1), segment ℝ (-(P.faceArea i / 2) • P.normal i) ((P.faceArea i / 2) • P.normal i) := by rw [P.projectionBody_eq_facetZonotope] unfold facetZonotope symm apply Finset.sum_subset (Finset.filter_subset _ _) intro i hi hni have hn : ¬ ((P.face i).Nonempty ∧ Module.finrank ℝ (vectorSpan ℝ (P.face i)) = d - 1) := fun hf => hni (Finset.mem_filter.mpr ⟨hi, hf⟩) simp only [P.faceArea_zero_of_not_facet i hn, zero_div, neg_zero, zero_smul, segment_same, Set.singleton_zero]
end Paper092.HPolytope
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117import OAI.Geometry.ProjectionVolume.PolytopeFrontimport OAI.Geometry.ProjectionVolume.ExposedBoundsimport Mathlib.Analysis.Convex.Intrinsic
namespace OAI
universe uι
noncomputable section
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
namespace Paper092
theorem inner_eq_of_mem_intrinsicInterior {d : ℕ} {S : Set (Euclidean d)} {x : Euclidean d} (hx : x ∈ intrinsicInterior ℝ S) (v : Euclidean d) (hmax : ∀ z ∈ S, ⟪v, z⟫ ≤ ⟪v, x⟫) : ∀ z ∈ S, ⟪v, z⟫ = ⟪v, x⟫ := by obtain ⟨xQ, hxQ, rfl⟩ := mem_intrinsicInterior.mp hx obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp hxQ) intro z hz by_cases hzx : z = xQ.val · simp only [hzx] let t : ℝ := ε / (2 * ‖xQ.val - z‖) have hnorm : 0 < ‖xQ.val - z‖ := norm_pos_iff.mpr (sub_ne_zero.mpr (Ne.symm hzx)) have ht : 0 < t := div_pos hε (mul_pos (by norm_num) hnorm) let y : affineSpan ℝ S := ⟨xQ.val + t • (xQ.val - z), by simpa only [vsub_eq_sub, vadd_eq_add, add_comm] using (affineSpan ℝ S).smul_vsub_vadd_mem t xQ.property (subset_affineSpan ℝ S hz) xQ.property⟩ have hyball : y ∈ Metric.ball xQ ε := by change dist (xQ.val + t • (xQ.val - z)) xQ.val < ε rw [dist_eq_norm, add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_pos ht] have heq : t * ‖xQ.val - z‖ = ε / 2 := by dsimp [t] field_simp rw [heq] linarith have hy : y.val ∈ S := hball hyball have hle := hmax y.val hy change ⟪v, xQ.val + t • (xQ.val - z)⟫ ≤ ⟪v, xQ.val⟫ at hle rw [inner_add_right, real_inner_smul_right, inner_sub_right] at hle exact le_antisymm (hmax z hz) (by nlinarith)
namespace HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem exists_active_of_mem_exposedFace {u x : Euclidean d} (hu : u ≠ 0) (hx : x ∈ exposedFace P.body u) : ∃ i, x ∈ P.face i := by obtain ⟨t, ht, hxt, i, _, hi⟩ := P.exists_front_point x u hu hx.1 have hmax := hx.2 (x + t • u) hxt change ⟪u, x + t • u⟫ ≤ ⟪u, x⟫ at hmax rw [inner_add_right, real_inner_smul_right] at hmax have hpos := real_inner_self_pos.mpr hu have ht0 : t = 0 := by nlinarith refine ⟨i, hx.1, ?_⟩ change P.offset i - ⟪P.normal i, x + t • u⟫ = 0 at hi simp only [ht0, zero_smul, add_zero] at hi exact (sub_eq_zero.mp hi).symm
theorem exposedFace_eq_face {u : Euclidean d} (hu : u ≠ 0) (hdim : Module.finrank ℝ (vectorSpan ℝ (exposedFace P.body u)) = d - 1) : ∃ i, exposedFace P.body u = P.face i := by have hconv : Convex ℝ (exposedFace P.body u) := (show IsExposed ℝ P.body (exposedFace P.body u) from ContinuousLinearMap.toExposed.isExposed).convex P.body_convex have hne := exposedFace_nonempty P.body P.compact P.body_nonempty u obtain ⟨x, hx⟩ := (intrinsicInterior_nonempty hconv).mpr hne have hxF : x ∈ exposedFace P.body u := intrinsicInterior_subset hx obtain ⟨i, hxi⟩ := P.exists_active_of_mem_exposedFace hu hxF have hinner : ∀ z ∈ exposedFace P.body u, ⟪P.normal i, z⟫ = P.offset i := by intro z hz apply Eq.trans (inner_eq_of_mem_intrinsicInterior hx (P.normal i) ?_ z hz) hxi.2 intro y hy rw [hxi.2] exact hy.1 i have hle : vectorSpan ℝ (exposedFace P.body u) ≤ normalHyperplane (P.normal i) := by rw [vectorSpan_def] apply Submodule.span_le.mpr rintro _ ⟨a, ha, b, hb, rfl⟩ apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr change ⟪P.normal i, a - b⟫ = 0 rw [inner_sub_right, hinner a ha, hinner b hb, sub_self] have hn : P.normal i ≠ 0 := by intro h have hnorm := P.normal_unit i rw [h, norm_zero] at hnorm norm_num at hnorm have hspan_i : vectorSpan ℝ (exposedFace P.body u) = normalHyperplane (P.normal i) := Submodule.eq_of_le_of_finrank_eq hle (hdim.trans (normalHyperplane_finrank _ hn).symm) have hspan_u : vectorSpan ℝ (exposedFace P.body u) = normalHyperplane u := Submodule.eq_of_le_of_finrank_eq (exposedFace_vectorSpan_le_normalHyperplane P.body u) (hdim.trans (normalHyperplane_finrank u hu).symm) refine ⟨i, Subset.antisymm (fun z hz => ⟨hz.1, hinner z hz⟩) ?_⟩ intro y hy have hyi : y - x ∈ normalHyperplane (P.normal i) := by apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr rw [inner_sub_right, hy.2, hxi.2, sub_self] have hyu : y - x ∈ normalHyperplane u := by rwa [← hspan_u, hspan_i] have heq : ⟪u, y⟫ = ⟪u, x⟫ := by have h := Submodule.mem_orthogonal_singleton_iff_inner_right.mp hyu simpa only [inner_sub_right, sub_eq_zero] using h refine ⟨hy.1, ?_⟩ intro z hz change ⟪u, z⟫ ≤ ⟪u, y⟫ rw [heq] exact hxF.2 z hz
end HPolytopeend Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899import OAI.Geometry.ProjectionVolume.AffineBrightnessimport OAI.Geometry.ProjectionVolume.ProjectionJacobian
namespace OAI
noncomputable sectionopen Set MeasureTheoryopen scoped RealInnerProductSpace
namespace Paper092
def linearImageNormal {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) : Euclidean n := ‖L.symm.toLinearMap.adjoint v‖⁻¹ • L.symm.toLinearMap.adjoint v
theorem inverseAdjoint_ne_zero {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) : L.symm.toLinearMap.adjoint v ≠ 0 := by intro h have hh := L.symm.toLinearMap.adjoint_inner_left (L v) v rw [h, inner_zero_left] at hh change 0 = ⟪v, L.symm (L v)⟫ at hh rw [L.symm_apply_apply, real_inner_self_eq_norm_sq, hv, one_pow] at hh norm_num at hh
theorem linearImageNormal_norm {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) : ‖linearImageNormal L v‖ = 1 := by simp [linearImageNormal, norm_smul, inverseAdjoint_ne_zero L v hv]
theorem linearImageNormal_inner {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v x : Euclidean n) : ⟪linearImageNormal L v, L x⟫ = ⟪v, x⟫ / ‖L.symm.toLinearMap.adjoint v‖ := by rw [linearImageNormal, real_inner_smul_left, LinearMap.adjoint_inner_left] change ‖L.symm.toLinearMap.adjoint v‖⁻¹ * ⟪v, L.symm (L x)⟫ = _ rw [L.symm_apply_apply] ring
theorem linearImageNormal_support_iff {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v x : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) : ⟪linearImageNormal L v, L x⟫ ≤ c / ‖L.symm.toLinearMap.adjoint v‖ ↔ ⟪v, x⟫ ≤ c := by rw [linearImageNormal_inner, div_le_div_iff_of_pos_right (norm_pos_iff.mpr (inverseAdjoint_ne_zero L v hv))]
theorem linearImageNormal_plane {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (c : ℝ) (F : Set (Euclidean n)) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : ∀ y ∈ L '' F, ⟪linearImageNormal L v, y⟫ = c / ‖L.symm.toLinearMap.adjoint v‖ := by rintro y ⟨x, hx, rfl⟩ rw [linearImageNormal_inner, hplane x hx]
theorem affineHyperplane_area_lt_top {n : ℕ} (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hF : IsCompact F) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : μHE[n - 1] F < ⊤ := by have h := projectionVolume_of_subset_affine_hyperplane v v hv hv c F hplane simp only [real_inner_self_eq_norm_sq, hv, one_pow, abs_one, ENNReal.ofReal_one, one_mul] at h rw [← h] exact (hF.image (normalHyperplane v).orthogonalProjectionOnto.continuous).measure_lt_top
theorem affineHyperplane_linearImage_area_real {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : (μHE[n - 1] (L '' F)).toReal = |L.toLinearMap.det| * ‖L.symm.toLinearMap.adjoint v‖ * (μHE[n - 1] F).toReal := by let w := linearImageNormal L v have hw : ‖w‖ = 1 := linearImageNormal_norm L v hv have hi := brightness_of_subset_affine_hyperplane w w hw (c / ‖L.symm.toLinearMap.adjoint v‖) (L '' F) (linearImageNormal_plane L v c F hplane) simp only [real_inner_self_eq_norm_sq, hw, one_pow, abs_one, one_mul] at hi rw [← hi, brightness_linearEquiv_image, brightness_of_subset_affine_hyperplane (L.symm w) v hv c F hplane] have hin : ⟪L.symm w, v⟫ = ‖L.symm.toLinearMap.adjoint v‖ := by change ⟪L.symm.toLinearMap w, v⟫ = _ rw [← LinearMap.adjoint_inner_right] change ⟪linearImageNormal L v, L.symm.toLinearMap.adjoint v⟫ = _ rw [linearImageNormal, real_inner_smul_left, real_inner_self_eq_norm_sq] field_simp [norm_ne_zero_iff.mpr (inverseAdjoint_ne_zero L v hv)] rw [hin, abs_of_nonneg (norm_nonneg _)] ring
theorem affineHyperplane_linearImage_area {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hF : IsCompact F) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : μHE[n - 1] (L '' F) = ENNReal.ofReal (|L.toLinearMap.det| * ‖L.symm.toLinearMap.adjoint v‖) * μHE[n - 1] F := by have hfinite := affineHyperplane_area_lt_top v hv c F hF hplane have hfinite' := affineHyperplane_area_lt_top (linearImageNormal L v) (linearImageNormal_norm L v hv) (c / ‖L.symm.toLinearMap.adjoint v‖) (L '' F) (hF.image L.toContinuousLinearEquiv.continuous) (linearImageNormal_plane L v c F hplane) apply (ENNReal.toReal_eq_toReal_iff' hfinite'.ne (ENNReal.mul_ne_top ENNReal.ofReal_ne_top hfinite.ne)).mp rw [ENNReal.toReal_mul, ENNReal.toReal_ofReal (mul_nonneg (abs_nonneg _) (norm_nonneg _))] exact affineHyperplane_linearImage_area_real L v hv c F hplane
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106import OAI.Geometry.ProjectionVolume.PrismVolume
namespace OAI
noncomputable sectionopen Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
namespace Paper092
theorem vadd_add_set {n : ℕ} (a : Euclidean n) (A B : Set (Euclidean n)) : (a +ᵥ A) + B = a +ᵥ (A + B) := by ext z constructor · rintro ⟨x, ⟨x₀, hx, rfl⟩, y, hy, rfl⟩ exact ⟨x₀ + y, ⟨x₀, hx, y, hy, rfl⟩, (add_assoc a x₀ y).symm⟩ · rintro ⟨z, ⟨x, hx, y, hy, rfl⟩, rfl⟩ exact ⟨a + x, ⟨x, hx, rfl⟩, y, hy, add_assoc a x y⟩
theorem affineHyperplane_unitPrism_volume {n : ℕ} (hn : 0 < n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hF : IsCompact F) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : volume (F + segment ℝ 0 v) = μHE[n - 1] F := by have hv0 : v ≠ 0 := by intro h; simp [h] at hv let H := normalHyperplane v let T : Set (Euclidean n) := (-c) • v +ᵥ F have hT : T ⊆ (H : Set (Euclidean n)) := by rintro x ⟨y, hy, rfl⟩ apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr change ⟪v, (-c) • v + y⟫ = 0 simp [inner_add_right, inner_smul_right, hv, hplane y hy] let b := stdOrthonormalBasis ℝ H let f : Euclidean (Module.finrank ℝ H) →ₗᵢ[ℝ] Euclidean n := H.subtypeₗᵢ.comp b.repr.symm.toLinearIsometry let A : Set (Euclidean (Module.finrank ℝ H)) := f ⁻¹' T have hTcompact : IsCompact T := hF.image (continuous_const.add continuous_id) have hA : MeasurableSet A := hTcompact.measurableSet.preimage f.continuous.measurable have hfimage : f '' A = T := by apply image_preimage_eq_of_subset intro y hy refine ⟨b.repr ⟨y, hT hy⟩, ?_⟩ change ((b.repr.symm (b.repr ⟨y, hT hy⟩) : H) : Euclidean n) = y rw [LinearIsometryEquiv.symm_apply_apply] have hrank : Module.finrank ℝ H = n - 1 := normalHyperplane_finrank v hv0 have hvolA : volume A = μHE[n - 1] F := by have h := f.toLinearMap.euclideanHausdorffMeasure_image_eq_normDet_mul_volume A simp only [finrank_euclideanSpace_fin, LinearIsometry.normDet_eq_one, ENNReal.ofReal_one, one_mul] at h change μHE[Module.finrank ℝ H] (f '' A) = volume A at h rw [hfimage] at h conv_lhs at h => rw [hrank] change μHE[n - 1] ((-c) • v +ᵥ F) = volume A at h rw [measure_vadd] at h exact h.symm have hfperp (x : Euclidean (Module.finrank ℝ H)) : ⟪v, f x⟫ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp (b.repr.symm x).property have h := orthogonalPrism_volume f v hv hfperp (by omega) A hA rw [hfimage, hvolA] at h change volume (((-c) • v +ᵥ F) + segment ℝ 0 v) = _ at h rw [vadd_add_set, measure_vadd] at h exact h
theorem linearImage_unitPrism {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (F : Set (Euclidean n)) : L '' (F + segment ℝ 0 v) = L '' F + segment ℝ 0 (L v) := by rw [Set.image_add] congr 1 simpa using (image_segment ℝ (L.toLinearMap.toAffineMap) (0 : Euclidean n) v)
theorem linearImage_unitPrism_volume {n : ℕ} (hn : 0 < n) (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hF : IsCompact F) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : volume (L '' F + segment ℝ 0 (L v)) = ENNReal.ofReal |L.toLinearMap.det| * μHE[n - 1] F := by rw [← linearImage_unitPrism] change volume (L.toLinearMap '' (F + segment ℝ 0 v)) = _ rw [volume.addHaar_image_linearMap, affineHyperplane_unitPrism_volume hn v hv c F hF hplane]
theorem linearImage_unitPrism_height {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) : ⟪linearImageNormal L v, L v⟫ = 1 / ‖L.symm.toLinearMap.adjoint v‖ := by rw [linearImageNormal_inner, real_inner_self_eq_norm_sq, hv, one_pow]
theorem linearImage_unitPrism_offset {n : ℕ} (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (x : Euclidean n) (hx : ⟪v, x⟫ = c) (t : ℝ) : ⟪linearImageNormal L v, L (x + t • v)⟫ = c / ‖L.symm.toLinearMap.adjoint v‖ + t / ‖L.symm.toLinearMap.adjoint v‖ := by rw [linearImageNormal_inner, inner_add_right, real_inner_smul_right, real_inner_self_eq_norm_sq, hv, one_pow, mul_one, hx, add_div]
theorem linearImage_unitPrism_volume_eq_area_mul_height {n : ℕ} (hn : 0 < n) (L : Euclidean n ≃ₗ[ℝ] Euclidean n) (v : Euclidean n) (hv : ‖v‖ = 1) (c : ℝ) (F : Set (Euclidean n)) (hF : IsCompact F) (hplane : ∀ x ∈ F, ⟪v, x⟫ = c) : (volume (L '' F + segment ℝ 0 (L v))).toReal = (μHE[n - 1] (L '' F)).toReal * (1 / ‖L.symm.toLinearMap.adjoint v‖) := by rw [linearImage_unitPrism_volume hn L v hv c F hF hplane, ENNReal.toReal_mul, ENNReal.toReal_ofReal (abs_nonneg _), affineHyperplane_linearImage_area_real L v hv c F hplane] field_simp [norm_ne_zero_iff.mpr (inverseAdjoint_ne_zero L v hv)]
end Paper092
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677import OAI.Geometry.ProjectionVolume.PolytopeFacets
namespace OAI
universe uι
open Setopen scoped RealInnerProductSpace
noncomputable section
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem face_vectorSpan_le_normalHyperplane (a : ι) : vectorSpan ℝ (P.face a) ≤ normalHyperplane (P.normal a) := by rw [vectorSpan_def] apply Submodule.span_le.mpr rintro _ ⟨x, hx, y, hy, rfl⟩ apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr change ⟪P.normal a, x - y⟫ = 0 rw [inner_sub_right, hx.2, hy.2, sub_self]
theorem face_index_unique_of_finrank (a b : ι) (hne : (P.face a).Nonempty) (hdim : Module.finrank ℝ (vectorSpan ℝ (P.face a)) = d - 1) (heq : P.face a = P.face b) : a = b := by have han : P.normal a ≠ 0 := by intro h have := P.normal_unit a simp only [h, norm_zero] at this norm_num at this have hbn : P.normal b ≠ 0 := by intro h have := P.normal_unit b simp only [h, norm_zero] at this norm_num at this have hWa : vectorSpan ℝ (P.face a) = normalHyperplane (P.normal a) := Submodule.eq_of_le_of_finrank_eq (P.face_vectorSpan_le_normalHyperplane a) (hdim.trans (normalHyperplane_finrank (P.normal a) han).symm) have hWb : vectorSpan ℝ (P.face b) = normalHyperplane (P.normal b) := Submodule.eq_of_le_of_finrank_eq (P.face_vectorSpan_le_normalHyperplane b) ((heq ▸ hdim).trans (normalHyperplane_finrank (P.normal b) hbn).symm) have hH : normalHyperplane (P.normal a) = normalHyperplane (P.normal b) := by rw [← hWa, ← hWb, heq] have hspan : Submodule.span ℝ {P.normal a} = Submodule.span ℝ {P.normal b} := by have h := congrArg Submodule.orthogonal hH simpa only [normalHyperplane, Submodule.orthogonal_orthogonal] using h have hbspan : P.normal b ∈ Submodule.span ℝ {P.normal a} := by rw [hspan] exact Submodule.subset_span (mem_singleton _) obtain ⟨c, hc⟩ := Submodule.mem_span_singleton.mp hbspan have hnorm : |c| = 1 := by have h := congrArg norm hc simpa only [norm_smul, Real.norm_eq_abs, P.normal_unit, mul_one] using h obtain ⟨x, hxa⟩ := hne have hxb : x ∈ P.face b := heq ▸ hxa have hoff : P.offset b = c * P.offset a := by rw [← hxb.2, ← hc, real_inner_smul_left, hxa.2] obtain ⟨p, hp⟩ := P.strict_feasible have haPos : 0 < P.offset a - ⟪P.normal a, p⟫ := sub_pos.mpr (hp a) have hbPos : 0 < c * (P.offset a - ⟪P.normal a, p⟫) := by have h := sub_pos.mpr (hp b) rwa [hoff, ← hc, real_inner_smul_left, ← mul_sub] at h have hcPos : 0 < c := by by_contra h exact (not_lt_of_ge (mul_nonpos_of_nonpos_of_nonneg (le_of_not_gt h) haPos.le)) hbPos have hcOne : c = 1 := by rwa [abs_of_pos hcPos] at hnorm have hn : P.normal a = P.normal b := by simpa only [hcOne, one_smul] using hc have ho : P.offset a = P.offset b := by simpa only [hcOne, one_mul] using hoff.symm exact P.distinct (Prod.ext hn ho)
end Paper092.HPolytope
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445import OAI.Geometry.ProjectionVolume.Basicimport OAI.Geometry.ProjectionVolume.SupportGeometryimport OAI.Geometry.ProjectionVolume.Brightnessimport Mathlib.Analysis.Normed.Affine.Convex
namespace OAI
open Set Metric Filteropen scoped Pointwise Topology RealInnerProductSpace
namespace Paper092
theorem convex_smul_subset_interior {n : ℕ} {K : Set (Euclidean n)} (hK : Convex ℝ K) (h0 : (0 : Euclidean n) ∈ interior K) {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) : r • K ⊆ interior K := by rintro _ ⟨x, hx, rfl⟩ simpa only [smul_zero, add_zero] using hK.combo_self_interior_mem_interior hx h0 hr (sub_pos.mpr hr1) (add_sub_cancel _ _)
theorem exists_inscribed_finset_sandwich {n : ℕ} {K : Set (Euclidean n)} (hc : IsCompact K) (hv : Convex ℝ K) (h0 : (0 : Euclidean n) ∈ interior K) {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) : ∃ t : Finset (Euclidean n), r • K ⊆ interior (convexHull ℝ (t : Set (Euclidean n))) ∧ convexHull ℝ (t : Set (Euclidean n)) ⊆ K ∧ (0 : Euclidean n) ∈ interior (convexHull ℝ (t : Set (Euclidean n))) := by obtain ⟨t, ht, htK⟩ := (hv.smul r).exists_subset_interior_convexHull_finset_of_isCompact (hc.smul r) (mem_nhdsSet_iff_exists.mpr ⟨interior K, isOpen_interior, convex_smul_subset_interior hv h0 hr hr1, interior_subset⟩) refine ⟨t, ht, htK, ht ?_⟩ exact ⟨0, interior_subset h0, smul_zero r⟩
theorem support_mono {n : ℕ} {A B : Set (Euclidean n)} (hne : A.Nonempty) (hc : IsCompact B) (h : A ⊆ B) (u : Euclidean n) : SupportGeometry.support A (innerSL ℝ u) ≤ SupportGeometry.support B (innerSL ℝ u) := SupportGeometry.support_le hne _ fun _ hx => SupportGeometry.le_support hc _ (h hx)
theorem projectionBody_support_le {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : SupportGeometry.support (projectionBody K) (innerSL ℝ u) ≤ brightness K u := SupportGeometry.support_le ⟨0, zero_mem_projectionBody K⟩ _ fun _ hx => hx u
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384import OAI.Geometry.ProjectionVolume.PolytopeDefinitionsimport Mathlib.Analysis.Convex.KreinMilmanimport Mathlib.Tactic.FunPropimport Mathlib.Tactic.Linarith
namespace OAI
universe uι
open Set Filter Topologyopen scoped RealInnerProductSpace
namespace Paper092namespace HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem extreme_active_unique {x y : Euclidean d} (hx : x ∈ P.body.extremePoints ℝ) (ha : ∀ i, ⟪P.normal i, x⟫ = P.offset i → ⟪P.normal i, y⟫ = P.offset i) : y = x := by have hnear : ∀ᶠ t : ℝ in 𝓝 0, ∀ i, ⟪P.normal i, x⟫ < P.offset i → ⟪P.normal i, x + t • (y - x)⟫ < P.offset i := by apply Filter.eventually_all.mpr intro i by_cases hi : ⟪P.normal i, x⟫ < P.offset i · have h : ∀ᶠ t : ℝ in 𝓝 0, ⟪P.normal i, x + t • (y - x)⟫ < P.offset i := (isOpen_lt (by fun_prop) continuous_const).mem_nhds (by simpa using hi) filter_upwards [h] with t ht exact fun _ => ht · exact Filter.Eventually.of_forall fun _ h => (hi h).elim obtain ⟨ε, hε, hsmall⟩ := Metric.eventually_nhds_iff.mp hnear have hpert (t : ℝ) (ht : dist t 0 < ε) : x + t • (y - x) ∈ P.body := by intro i rcases (hx.1 i).lt_or_eq with hi | hi · exact (hsmall ht i hi).le · simp [inner_add_right, inner_smul_right, inner_sub_right, hi, ha i hi] have hp : dist (ε / 2) 0 < ε := by rw [Real.dist_eq, sub_zero, abs_of_pos (half_pos hε)] linarith have hm : dist (-(ε / 2)) 0 < ε := by simpa using hp have hxplus := hx.2 (hpert (ε / 2) hp) (show x - (ε / 2) • (y - x) ∈ P.body by simpa only [neg_smul, ← sub_eq_add_neg] using hpert (-(ε / 2)) hm) (mem_openSegment_add_sub (𝕜 := ℝ) x ((ε / 2) • (y - x))) have hz : (ε / 2) • (y - x) = 0 := add_left_cancel (hxplus.trans (add_zero x).symm) exact sub_eq_zero.mp ((smul_eq_zero.mp hz).resolve_left (ne_of_gt (half_pos hε)))
theorem finite_extremePoints : (P.body.extremePoints ℝ).Finite := by classical let active (x : Euclidean d) : Finset ι := Finset.univ.filter (fun i => ⟪P.normal i, x⟫ = P.offset i) have hi : Set.InjOn active (P.body.extremePoints ℝ) := by intro x hx y _ hxy apply (P.extreme_active_unique hx ?_).symm intro i hix have hm : i ∈ active x := by simp [active, hix] rw [hxy] at hm exact (Finset.mem_filter.mp hm).2 exact (Set.toFinite (Set.univ : Set (Finset ι))).of_injOn (fun _ _ => Set.mem_univ _) hi
theorem eq_convexHull_extremePoints : P.body = convexHull ℝ (P.body.extremePoints ℝ) := by have hc : Convex ℝ P.body := by change Convex ℝ {x : Euclidean d | ∀ i, ⟪P.normal i, x⟫ ≤ P.offset i} simp only [Set.ofPred_forall] exact convex_iInter fun i => (convex_Iic (P.offset i)).linear_preimage (innerSL ℝ (P.normal i)).toLinearMap have h := closure_convexHull_extremePoints P.compact hc change closure (convexHull ℝ (P.body.extremePoints ℝ)) = P.body at h rw [P.finite_extremePoints.isClosed_convexHull ℝ |>.closure_eq] at h exact h.symm
end HPolytope
theorem halfspaces_are_finite_convex_hull {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι) : ∃ S : Finset (Euclidean d), P.body = convexHull ℝ (S : Set (Euclidean d)) := by classical exact ⟨P.finite_extremePoints.toFinset, by simpa using P.eq_convexHull_extremePoints⟩end Paper092
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788import OAI.Geometry.ProjectionVolume.ProductAreaimport OAI.Geometry.ProjectionVolume.ProductReconstructionimport OAI.Geometry.ProjectionVolume.PolytopeCauchy
namespace OAI
universe uι uκ
noncomputable sectionopen Set MeasureTheoryopen scoped BigOperators RealInnerProductSpace Pointwise
namespace Paper092
namespace HPolytope
variable {r s : ℕ} {ι : Type uι} {κ : Type uκ} [Fintype ι] [Fintype κ]
theorem product_faceArea_inl (hr : 0 < r) (A : HPolytope r ι) (B : HPolytope s κ) (i : ι) : (A.product B).faceArea (.inl i) = A.faceArea i * (volume B.body).toReal := by unfold faceArea rw [product_face_inl, cartesianBody_eq_preimage, affineHyperplane_product_area_left hr (A.normal i) (A.normal_unit i) (A.offset i) (A.face i) (A.face_isCompact i) (fun _ hx => hx.2) B.body B.compact.measurableSet, ENNReal.toReal_mul]
theorem product_faceArea_inr (hs : 0 < s) (A : HPolytope r ι) (B : HPolytope s κ) (i : κ) : (A.product B).faceArea (.inr i) = (volume A.body).toReal * B.faceArea i := by unfold faceArea rw [product_face_inr, cartesianBody_eq_preimage, affineHyperplane_product_area_right hs (B.normal i) (B.normal_unit i) (B.offset i) (B.face i) (B.face_isCompact i) (fun _ hx => hx.2) A.body A.compact.measurableSet, ENNReal.toReal_mul]
theorem brightness_product (hr : 0 < r) (hs : 0 < s) (A : HPolytope r ι) (B : HPolytope s κ) (w : Euclidean (r + s)) : brightness (cartesianBody A.body B.body) w = (volume B.body).toReal * brightness A.body (splitEuclideanProduct r s w).1 + (volume A.body).toReal * brightness B.body (splitEuclideanProduct r s w).2 := by classical rw [← product_body A B, (A.product B).brightness_eq_sum, A.brightness_eq_sum, B.brightness_eq_sum, Fintype.sum_sum_type] have hleft (i : ι) : ⟪w, (A.product B).normal (.inl i)⟫ = ⟪(splitEuclideanProduct r s w).1, A.normal i⟫ := by change ⟪w, productLiftLeft r s (A.normal i)⟫ = _ rw [real_inner_comm, inner_productLiftLeft, real_inner_comm] have hright (i : κ) : ⟪w, (A.product B).normal (.inr i)⟫ = ⟪(splitEuclideanProduct r s w).2, B.normal i⟫ := by change ⟪w, productLiftRight r s (B.normal i)⟫ = _ rw [real_inner_comm, inner_productLiftRight, real_inner_comm] simp_rw [product_faceArea_inl hr, product_faceArea_inr hs, hleft, hright] simp_rw [mul_assoc] rw [← Finset.mul_sum] have heq : (∑ i, A.faceArea i * ((volume B.body).toReal * |⟪(splitEuclideanProduct r s w).1, A.normal i⟫|)) = (volume B.body).toReal * ∑ i, A.faceArea i * |⟪(splitEuclideanProduct r s w).1, A.normal i⟫| := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ ring rw [heq] ring
end HPolytope
theorem projectionBody_product {r s : ℕ} (hr : 2 ≤ r) (hs : 2 ≤ s) {ι : Type uι} {κ : Type uκ} [Fintype ι] [Fintype κ] (A : HPolytope r ι) (B : HPolytope s κ) : projectionBody (cartesianBody A.body B.body) = cartesianBody ((volume B.body).toReal • projectionBody A.body) ((volume A.body).toReal • projectionBody B.body) := projectionBody_cartesian_of_brightness A.body B.body A.volume_pos B.volume_pos (A.brightness_product (by omega) (by omega) B)
theorem normalizedProjectionVolume_product {r s : ℕ} (hr : 2 ≤ r) (hs : 2 ≤ s) {ι : Type uι} {κ : Type uκ} [Fintype ι] [Fintype κ] (A : HPolytope r ι) (B : HPolytope s κ) : normalizedProjectionVolume (cartesianBody A.body B.body) = normalizedProjectionVolume A.body * normalizedProjectionVolume B.body := normalized_cartesian_of_projectionBody_eq (by omega) (by omega) A.body B.body A.compact B.compact A.volume_pos B.volume_pos (projectionBody_product hr hs A B)
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116import OAI.Geometry.ProjectionVolume.FiniteApproximationimport Mathlib.Analysis.SpecificLimits.Basicimport Mathlib.Analysis.Normed.Module.Ball.Pointwise
namespace OAI
open Set Metric Filteropen scoped Pointwise Topology
namespace Paper092
noncomputable def inscribedScale (m : ℕ) : ℝ := 1 - 1 / ((m : ℝ) + 2)
theorem inscribedScale_nonneg (m : ℕ) : 0 ≤ inscribedScale m := by unfold inscribedScale apply sub_nonneg.mpr apply (div_le_one (by positivity : 0 < (m : ℝ) + 2)).mpr linarith [Nat.cast_nonneg (α := ℝ) m]
theorem inscribedScale_lt_one (m : ℕ) : inscribedScale m < 1 := by unfold inscribedScale exact sub_lt_self _ (by positivity)
theorem exists_increasing_inscribed_finsets {n : ℕ} {K : Set (Euclidean n)} (hc : IsCompact K) (hv : Convex ℝ K) (h0 : (0 : Euclidean n) ∈ interior K) : ∃ V : ℕ → Finset (Euclidean n), Monotone (fun m => convexHull ℝ (V m : Set (Euclidean n))) ∧ (∀ m, convexHull ℝ (V m : Set (Euclidean n)) ⊆ K) ∧ (∀ m, inscribedScale m • K ⊆ interior (convexHull ℝ (V m : Set (Euclidean n)))) ∧ (∀ m, (0 : Euclidean n) ∈ interior (convexHull ℝ (V m : Set (Euclidean n)))) := by classical have hex := fun m => exists_inscribed_finset_sandwich hc hv h0 (inscribedScale_nonneg m) (inscribedScale_lt_one m) choose t ht htK ht0 using hex let V : ℕ → Finset (Euclidean n) := fun m => (Finset.range (m + 1)).biUnion t have htV (i m : ℕ) (hi : i ≤ m) : (t i : Set (Euclidean n)) ⊆ V m := by intro x hx exact Finset.mem_biUnion.mpr ⟨i, Finset.mem_range.mpr (by omega), hx⟩ refine ⟨V, ?_, ?_, ?_, ?_⟩ · intro i j hij apply convexHull_mono intro x hx obtain ⟨k, hk, hx⟩ := Finset.mem_biUnion.mp hx exact Finset.mem_biUnion.mpr ⟨k, Finset.mem_range.mpr ((Finset.mem_range.mp hk).trans_le (by omega)), hx⟩ · intro m apply convexHull_min _ hv intro x hx obtain ⟨i, _, hx⟩ := Finset.mem_biUnion.mp hx exact htK i (subset_convexHull ℝ (t i : Set (Euclidean n)) hx) · intro m exact (ht m).trans (interior_mono (convexHull_mono (htV m m le_rfl))) · intro m exact interior_mono (convexHull_mono (htV m m le_rfl)) (ht0 m)
theorem add_closedBall_subset_dilate {n : ℕ} {P : Set (Euclidean n)} (hv : Convex ℝ P) {a ε : ℝ} (ha : 0 < a) (he : 0 ≤ ε) (hball : closedBall (0 : Euclidean n) a ⊆ P) : P + closedBall (0 : Euclidean n) ε ⊆ (1 + ε / a) • P := by have heq : (ε / a) • closedBall (0 : Euclidean n) a = closedBall 0 ε := by rw [smul_closedBall _ _ ha.le, smul_zero, Real.norm_eq_abs, abs_of_nonneg (div_nonneg he ha.le), div_mul_cancel₀ _ ha.ne'] rw [← heq, hv.add_smul zero_le_one (div_nonneg he ha.le), one_smul] exact add_subset_add subset_rfl (image_mono hball)
theorem inscribed_thickening {n : ℕ} {K P : Set (Euclidean n)} {R : ℝ} (hR : ∀ x ∈ K, ‖x‖ ≤ R) (m : ℕ) (hP : inscribedScale m • K ⊆ P) : K ⊆ P + closedBall (0 : Euclidean n) (R / ((m : ℝ) + 2)) := by intro x hx refine ⟨inscribedScale m • x, hP ⟨x, hx, rfl⟩, (1 / ((m : ℝ) + 2)) • x, ?_, ?_⟩ · simp only [mem_closedBall, dist_zero_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 1 / ((m : ℝ) + 2))] calc 1 / ((m : ℝ) + 2) * ‖x‖ ≤ 1 / ((m : ℝ) + 2) * R := mul_le_mul_of_nonneg_left (hR x hx) (by positivity) _ = R / ((m : ℝ) + 2) := by ring · change inscribedScale m • x + (1 / ((m : ℝ) + 2)) • x = x rw [← add_smul] simp [inscribedScale]
theorem tendsto_approximation_error (R : ℝ) : Tendsto (fun m : ℕ => R / ((m : ℝ) + 2)) atTop (𝓝 0) := by simpa only [Function.comp_def, Nat.cast_add, Nat.cast_ofNat] using (tendsto_const_div_atTop_nhds_zero_nat R).comp (tendsto_add_atTop_nat 2)
theorem exists_inscribed_polytope_sequence {n : ℕ} {K : Set (Euclidean n)} (hc : IsCompact K) (hv : Convex ℝ K) (h0 : (0 : Euclidean n) ∈ interior K) : ∃ (V : ℕ → Finset (Euclidean n)) (a R : ℝ), 0 < a ∧ 0 < R ∧ K ⊆ closedBall 0 R ∧ Monotone (fun m => convexHull ℝ (V m : Set (Euclidean n))) ∧ (∀ m, closedBall (0 : Euclidean n) a ⊆ convexHull ℝ (V m : Set (Euclidean n))) ∧ (∀ m, convexHull ℝ (V m : Set (Euclidean n)) ⊆ K ∧ K ⊆ convexHull ℝ (V m : Set (Euclidean n)) + closedBall 0 (R / ((m : ℝ) + 2)) ∧ convexHull ℝ (V m : Set (Euclidean n)) + closedBall 0 (R / ((m : ℝ) + 2)) ⊆ (1 + (R / ((m : ℝ) + 2)) / a) • convexHull ℝ (V m : Set (Euclidean n))) ∧ Tendsto (fun m : ℕ => R / ((m : ℝ) + 2)) atTop (𝓝 0) := by obtain ⟨V, hmono, hVK, hscale, hzero⟩ := exists_increasing_inscribed_finsets hc hv h0 obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp (hzero 0)) obtain ⟨R, hRpos, hR⟩ := hc.isBounded.exists_pos_norm_le have hball0 : closedBall (0 : Euclidean n) (r / 2) ⊆ convexHull ℝ (V 0 : Set (Euclidean n)) := (closedBall_subset_ball (by linarith)).trans hball have hballm : ∀ m, closedBall (0 : Euclidean n) (r / 2) ⊆ convexHull ℝ (V m : Set (Euclidean n)) := fun m => hball0.trans (hmono (Nat.zero_le m)) refine ⟨V, r / 2, R, half_pos hr, hRpos, ?_, hmono, hballm, ?_, tendsto_approximation_error R⟩ · intro x hx simpa only [mem_closedBall, dist_zero_right] using hR x hx · intro m exact ⟨hVK m, inscribed_thickening hR m ((hscale m).trans interior_subset), add_closedBall_subset_dilate (convex_convexHull ℝ _) (half_pos hr) (by positivity) (hballm m)⟩
end Paper092
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import OAI.Geometry.ProjectionVolume.SequenceLimits
namespace OAI
open Set Metric Filteropen scoped Pointwise Topology RealInnerProductSpace
namespace Paper092
theorem approximation_linear_image_brightness_uniform {d : ℕ} (hd : 2 ≤ d) {P : ℕ → Set (Euclidean d)} {K : Set (Euclidean d)} (hP : ∀ m, IsCompact (P m)) (hK : IsCompact K) {scale : ℕ → ℝ} (hscale : ∀ m, 1 ≤ scale m) (hscalelim : Tendsto scale atTop (𝓝 1)) (hPK : ∀ m, P m ⊆ K) (hKP : ∀ m, K ⊆ scale m • P m) (L : Euclidean d ≃ₗ[ℝ] Euclidean d) : TendstoUniformlyOn (fun m u => brightness (L '' P m) u) (brightness (L '' K)) atTop (sphere 0 1) := by have hLK : IsCompact (L '' K) := hK.image L.toLinearMap.continuous_of_finiteDimensional obtain ⟨R, hR, hbound⟩ := hLK.isBounded.exists_pos_norm_le have hball : L '' K ⊆ closedBall 0 R := by intro x hx simpa only [mem_closedBall, dist_zero_right] using hbound x hx apply approximation_brightness_uniform hd (fun m => (hP m).image L.toLinearMap.continuous_of_finiteDimensional) hLK hscale hscalelim hR.le hball · exact fun m => image_mono (hPK m) · intro m rw [← image_smul_comm L.toLinearMap (scale m) (P m) (fun x => L.toLinearMap.map_smul (scale m) x)] exact image_mono (hKP m)
theorem approximation_linear_image_support_uniform {d : ℕ} (hd : 2 ≤ d) {P : ℕ → Set (Euclidean d)} {K : Set (Euclidean d)} (hP : ∀ m, IsCompact (P m)) (hv : ∀ m, Convex ℝ (P m)) (hi : ∀ m, (interior (P m)).Nonempty) (hK : IsCompact K) {scale : ℕ → ℝ} (hscale : ∀ m, 1 ≤ scale m) (hscalelim : Tendsto scale atTop (𝓝 1)) (hPK : ∀ m, P m ⊆ K) (hKP : ∀ m, K ⊆ scale m • P m) (L : Euclidean d ≃ₗ[ℝ] Euclidean d) : TendstoUniformlyOn (fun m u => SupportGeometry.support (projectionBody (L '' P m)) (innerSL ℝ u)) (brightness (L '' K)) atTop (sphere 0 1) := by have hint : ∀ m, (interior (L '' P m)).Nonempty := by intro m change (interior (L.toContinuousLinearEquiv.toHomeomorph '' P m)).Nonempty rw [← Homeomorph.image_interior] exact (hi m).image _ have heq : (fun m u => SupportGeometry.support (projectionBody (L '' P m)) (innerSL ℝ u)) = (fun m u => brightness (L '' P m) u) := by funext m u exact projectionBody_support hd (L '' P m) ((hP m).image L.toLinearMap.continuous_of_finiteDimensional) ((hv m).linear_image L.toLinearMap) (hint m) u rw [heq] exact approximation_linear_image_brightness_uniform hd hP hK hscale hscalelim hPK hKP L
end Paper092
end OAI1234567891011121314151617181920212223242526import OAI.Geometry.ProjectionVolume.SimplexCounterexampleimport OAI.Geometry.ProjectionVolume.CounterexampleComparisonimport OAI.Geometry.ProjectionVolume.PolytopeTheoremsimport OAI.Geometry.ProjectionVolume.SupportLimitimport OAI.Geometry.ProjectionVolume.ProjectionInteriorimport OAI.Geometry.ProjectionVolume.SimplexProductimport OAI.Geometry.ProjectionVolume.PolarRepresentationimport OAI.Geometry.ProjectionVolume.CubeBrightnessimport OAI.Geometry.ProjectionVolume.PolytopeFaceGeometryimport OAI.Geometry.ProjectionVolume.InnerSequence
import OAI.Geometry.ProjectionVolume.SequenceLimitsimport OAI.Geometry.ProjectionVolume.LinearApproximationimport OAI.Geometry.ProjectionVolume.FacetLinearImageimport OAI.Geometry.ProjectionVolume.PolytopeFacetsimport OAI.Geometry.ProjectionVolume.SeparationIdentitiesimport OAI.Geometry.ProjectionVolume.ProductFacetFamiliesimport OAI.Geometry.ProjectionVolume.CubeFibersimport OAI.Geometry.ProjectionVolume.CoordinateDropimport OAI.Geometry.ProjectionVolume.AreaNormalVectorsimport OAI.Geometry.ProjectionVolume.FacetPrismimport OAI.Geometry.ProjectionVolume.AugmentedDeterminantimport OAI.Geometry.ProjectionVolume.ProjectionNullityimport OAI.Geometry.ProjectionVolume.PolytopeIncidenceimport OAI.Geometry.ProjectionVolume.FacetBijectionimport OAI.Geometry.ProjectionVolume.FacetDimension12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import Mathlib
namespace OAI
noncomputable section
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
namespace Paper092
noncomputable def simplexConstant (d : ℕ) : ℝ := (d + 1) * (d : ℝ) ^ d / d.factorial
abbrev Euclidean (n : ℕ) := EuclideanSpace ℝ (Fin n)
def normalHyperplane {n : ℕ} (u : Euclidean n) : Submodule ℝ (Euclidean n) := (Submodule.span ℝ ({u} : Set (Euclidean n)))ᗮ
def projectionVolume {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : ENNReal := (volume : Measure (normalHyperplane u)) ((normalHyperplane u).orthogonalProjectionOnto '' K)
def brightness {n : ℕ} (K : Set (Euclidean n)) (u : Euclidean n) : ℝ := ‖u‖ * (projectionVolume K u).toReal
def projectionBody {n : ℕ} (K : Set (Euclidean n)) : Set (Euclidean n) := {y | ∀ u, ⟪u, y⟫ ≤ brightness K u}
def normalizedProjectionVolume {n : ℕ} (K : Set (Euclidean n)) : ℝ := (volume (projectionBody K)).toReal / (volume K).toReal ^ (n - 1)
def standardSimplex (n : ℕ) : Set (Euclidean n) := convexHull ℝ (insert 0 (Set.range fun i : Fin n => EuclideanSpace.single i (1 : ℝ)))
def firstBlock (x : Euclidean 20) : Euclidean 10 := WithLp.toLp 2 (fun i : Fin 10 => x (Fin.castAdd 10 i))
def secondBlock (x : Euclidean 20) : Euclidean 10 := WithLp.toLp 2 (fun i : Fin 10 => x (Fin.natAdd 10 i))
def productWitness : Set (Euclidean 20) := {x | firstBlock x ∈ standardSimplex 10 ∧ secondBlock x ∈ standardSimplex 10}
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156import OAI.Geometry.ProjectionVolume.FiniteApproximationimport OAI.Geometry.ProjectionVolume.PolytopeDefinitions
namespace OAI
open Set Metricopen scoped Pointwise RealInnerProductSpace
namespace Paper092
theorem exists_unit_separating_support {n : ℕ} {K : Set (Euclidean n)} (hc : IsCompact K) (hne : K.Nonempty) (hv : Convex ℝ K) {x : Euclidean n} (hx : x ∉ K) : ∃ u : Euclidean n, ‖u‖ = 1 ∧ SupportGeometry.support K (innerSL ℝ u) < ⟪u, x⟫ := by have hx' := (SupportGeometry.mem_iff_inner_le_support hc hne hv).not.mp hx push Not at hx' obtain ⟨u, hu⟩ := hx' have hu0 : u ≠ 0 := by intro h have hh := (SupportGeometry.le_support hc (innerSL ℝ u) hne.choose_spec).trans_lt hu simp [h] at hh let v := ‖u‖⁻¹ • u have hv1 : ‖v‖ = 1 := by simp [v, norm_smul, hu0] obtain ⟨y, hy, hys⟩ := SupportGeometry.exists_support hc hne (innerSL ℝ v) refine ⟨v, hv1, ?_⟩ rw [← hys] change ⟪v, y⟫ < ⟪v, x⟫ simp only [v, real_inner_smul_left] exact mul_lt_mul_of_pos_left ((SupportGeometry.le_support hc (innerSL ℝ u) hy).trans_lt hu) (inv_pos.mpr (norm_pos_iff.mpr hu0))
theorem unit_support_pos_of_zero_mem_interior {n : ℕ} {K : Set (Euclidean n)} (hc : IsCompact K) (h0 : (0 : Euclidean n) ∈ interior K) (u : Euclidean n) (hu : ‖u‖ = 1) : 0 < SupportGeometry.support K (innerSL ℝ u) := by obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp h0) have hz : (r / 2) • u ∈ K := by apply hball simp only [mem_ball, dist_zero_right, norm_smul, Real.norm_eq_abs, hu, mul_one] rw [abs_of_pos (half_pos hr)] linarith have hh := SupportGeometry.le_support hc (innerSL ℝ u) hz simp only [innerSL_apply_apply, inner_smul_right, real_inner_self_eq_norm_sq, hu, one_pow, mul_one] at hh exact (half_pos hr).trans_le hh
theorem unit_support_le_of_norm_le {n : ℕ} {K : Set (Euclidean n)} (hne : K.Nonempty) {R : ℝ} (hR : ∀ x ∈ K, ‖x‖ ≤ R) (u : Euclidean n) (hu : ‖u‖ = 1) : SupportGeometry.support K (innerSL ℝ u) ≤ R := by apply SupportGeometry.support_le hne intro x hx exact (real_inner_le_norm u x).trans (by simpa [hu] using hR x hx)
theorem norm_le_of_basis_inner_le {n : ℕ} {x : Euclidean n} {R : ℝ} (h : ∀ i : Fin n, |⟪EuclideanSpace.basisFun (Fin n) ℝ i, x⟫| ≤ R) : ‖x‖ ≤ n * R := by let b := EuclideanSpace.basisFun (Fin n) ℝ calc ‖x‖ = ‖∑ i : Fin n, ⟪b i, x⟫ • b i‖ := by rw [b.sum_repr'] _ ≤ ∑ i : Fin n, ‖⟪b i, x⟫ • b i‖ := norm_sum_le _ _ _ = ∑ i : Fin n, |⟪b i, x⟫| := by simp [norm_smul, Real.norm_eq_abs] _ ≤ ∑ i : Fin n, R := Finset.sum_le_sum (fun i _ => h i) _ = n * R := by simp
theorem subset_interior_smul_of_one_lt {n : ℕ} {K : Set (Euclidean n)} (hv : Convex ℝ K) (h0 : (0 : Euclidean n) ∈ interior K) {r : ℝ} (hr : 1 < r) : K ⊆ interior (r • K) := by have heq : (AffineMap.homothety (0 : Euclidean n) r : Euclidean n → Euclidean n) = (fun x => r • x) := by funext x simp [AffineMap.homothety_apply, vsub_eq_sub, vadd_eq_add] change K ⊆ interior ((fun x : Euclidean n => r • x) '' K) rw [← heq] exact hv.subset_interior_image_homothety_of_one_lt h0 r hr
theorem exists_outer_hpolytope_sandwich {n : ℕ} {K : Set (Euclidean n)} (hc : IsCompact K) (hv : Convex ℝ K) (h0 : (0 : Euclidean n) ∈ interior K) {r : ℝ} (hr : 1 < r) : ∃ (F : Finset (Euclidean n)) (P : HPolytope n {u // u ∈ F}), K ⊆ P.body ∧ P.body ⊆ r • K := by classical have hne : K.Nonempty := ⟨0, interior_subset h0⟩ obtain ⟨R, hRp, hR⟩ := hc.isBounded.exists_pos_norm_le let b := EuclideanSpace.basisFun (Fin n) ℝ let U := {u : Euclidean n // ‖u‖ = 1} let V : U → Set (Euclidean n) := fun u => {x | SupportGeometry.support K (innerSL ℝ u.val) < ⟪u.val, x⟫} have hKin := subset_interior_smul_of_one_lt hv h0 hr have hcover : closedBall (0 : Euclidean n) (n * R) \ interior (r • K) ⊆ ⋃ u : U, V u := by intro x hx obtain ⟨u, hu, hsep⟩ := exists_unit_separating_support hc hne hv (fun hxK => hx.2 (hKin hxK)) exact mem_iUnion.mpr ⟨⟨u, hu⟩, hsep⟩ obtain ⟨t, ht⟩ := ((isCompact_closedBall (0 : Euclidean n) (n * R)).diff isOpen_interior).elim_finite_subcover V (fun u => isOpen_lt continuous_const (innerSL ℝ u.val).continuous) hcover let F := t.image Subtype.val ∪ (Finset.univ.image b ∪ Finset.univ.image (fun i : Fin n => -b i)) have htF (u : U) (hu : u ∈ t) : u.val ∈ F := Finset.mem_union_left _ (Finset.mem_image.mpr ⟨u, hu, rfl⟩) have hpF (i : Fin n) : b i ∈ F := Finset.mem_union_right _ (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩)) have hnF (i : Fin n) : -b i ∈ F := Finset.mem_union_right _ (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩)) have hFunit : ∀ u ∈ F, ‖u‖ = 1 := by intro u hu rcases Finset.mem_union.mp hu with hu | hu · obtain ⟨v, _, rfl⟩ := Finset.mem_image.mp hu exact v.property · rcases Finset.mem_union.mp hu with hu | hu · obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hu exact b.norm_eq_one i · obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hu simp let H : Set (Euclidean n) := {x | ∀ u : {u // u ∈ F}, ⟪u.val, x⟫ ≤ SupportGeometry.support K (innerSL ℝ u.val)} have hKH : K ⊆ H := fun x hx u => SupportGeometry.le_support hc (innerSL ℝ u.val) hx have hHbound : ∀ x ∈ H, ‖x‖ ≤ n * R := by intro x hx apply norm_le_of_basis_inner_le intro i have hp := (hx ⟨b i, hpF i⟩).trans (unit_support_le_of_norm_le hne hR (b i) (b.norm_eq_one i)) have hn := (hx ⟨-b i, hnF i⟩).trans (unit_support_le_of_norm_le hne hR (-b i) (by simp)) apply abs_le.mpr refine ⟨?_, hp⟩ simpa only [inner_neg_left, neg_le] using hn have hHr : H ⊆ r • K := by intro x hx by_contra hxout have hxC : x ∈ closedBall (0 : Euclidean n) (n * R) \ interior (r • K) := ⟨by simpa only [mem_closedBall, dist_zero_right] using hHbound x hx, fun h => hxout (interior_subset h)⟩ obtain ⟨u, hut, hux⟩ := mem_iUnion₂.mp (ht hxC) exact (not_lt_of_ge (hx ⟨u.val, htF u hut⟩)) hux have hHclosed : IsClosed H := by dsimp [H] rw [ofPred_forall] exact isClosed_iInter fun u => isClosed_le (innerSL ℝ u.val).continuous continuous_const let P : HPolytope n {u // u ∈ F} := { normal := Subtype.val offset := fun u => SupportGeometry.support K (innerSL ℝ u.val) normal_unit := fun u => hFunit u.val u.property compact := (hc.smul r).of_isClosed_subset hHclosed hHr strict_feasible := ⟨0, fun u => by simpa only [inner_zero_right] using unit_support_pos_of_zero_mem_interior hc h0 u.val (hFunit u.val u.property)⟩ distinct := fun i j hij => Subtype.ext (congrArg Prod.fst hij) } exact ⟨F, P, hKH, hHr⟩
end Paper092
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181import OAI.Geometry.ProjectionVolume.FiniteVerticesimport OAI.Geometry.ProjectionVolume.PolytopeOperationsimport OAI.Geometry.ProjectionVolume.SupportGeometryimport Mathlib.Tactic.FieldSimpimport Mathlib.Tactic.FunPropimport Mathlib.Tactic.Linarith
namespace OAI
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
noncomputable sectionnamespace Paper092
def halfspacePolar {d : ℕ} (K : Set (Euclidean d)) : Set (Euclidean d) := {u | ∀ x ∈ K, ⟪u, x⟫ ≤ 1}
theorem halfspacePolar_convexHull {d : ℕ} (S : Set (Euclidean d)) : halfspacePolar (convexHull ℝ S) = halfspacePolar S := by ext u constructor · intro h x hx exact h x (subset_convexHull ℝ S hx) · intro h x hx have hc : Convex ℝ {y : Euclidean d | ⟪u, y⟫ ≤ 1} := (convex_Iic (1 : ℝ)).linear_preimage (innerSL ℝ u).toLinearMap exact convexHull_min h hc hx
theorem halfspacePolar_isClosed {d : ℕ} (K : Set (Euclidean d)) : IsClosed (halfspacePolar K) := by unfold halfspacePolar simp only [Set.ofPred_forall] exact isClosed_iInter fun x => isClosed_iInter fun _ => isClosed_le (by fun_prop) continuous_const
theorem halfspacePolar_bipolar {d : ℕ} {K : Set (Euclidean d)} (hK : IsClosed K) (hc : Convex ℝ K) (h0 : (0 : Euclidean d) ∈ K) : halfspacePolar (halfspacePolar K) = K := by ext x constructor · intro hx by_contra hnot obtain ⟨f, r, hr, hxgt⟩ := geometric_hahn_banach_closed_point hc hK hnot have hr0 : 0 < r := by simpa using hr 0 h0 obtain ⟨u, hu⟩ := (InnerProductSpace.toDual ℝ (Euclidean d)).surjective f have hf (z : Euclidean d) : ⟪u, z⟫ = f z := by exact congrArg (fun g : StrongDual ℝ (Euclidean d) => g z) hu have hp : r⁻¹ • u ∈ halfspacePolar K := by intro z hz rw [real_inner_smul_left, hf] have := mul_le_mul_of_nonneg_left (hr z hz).le (inv_nonneg.mpr hr0.le) simpa [hr0.ne'] using this have h := hx (r⁻¹ • u) hp rw [real_inner_smul_right, real_inner_comm u x, hf] at h have hh := mul_le_mul_of_nonneg_left h hr0.le have hle : f x ≤ r := by simpa [← mul_assoc, hr0.ne'] using hh exact (not_le_of_gt hxgt) hle · intro hx u hu simpa only [real_inner_comm] using hu x hx
theorem halfspacePolar_isCompact {d : ℕ} {K : Set (Euclidean d)} (h0 : (0 : Euclidean d) ∈ interior K) : IsCompact (halfspacePolar K) := by obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp h0) apply Metric.isCompact_iff_isClosed_bounded.mpr refine ⟨halfspacePolar_isClosed K, isBounded_iff_forall_norm_le.mpr ⟨2 / r, ?_⟩⟩ intro y hy by_cases hz : y = 0 · subst y simp only [norm_zero] positivity have hn : 0 < ‖y‖ := norm_pos_iff.mpr hz have hx : ((r / 2) / ‖y‖) • y ∈ K := by apply hball simp only [Metric.mem_ball, dist_zero_right, norm_smul, Real.norm_eq_abs] rw [abs_of_pos (div_pos (half_pos hr) hn), div_mul_cancel₀ _ hn.ne'] linarith have h := hy _ hx rw [real_inner_smul_right, real_inner_self_eq_norm_sq] at h have heq : (r / 2 / ‖y‖) * ‖y‖ ^ 2 = (r / 2) * ‖y‖ := by field_simp rw [heq] at h apply (le_div_iff₀ hr).mpr nlinarith
theorem finite_polar_has_halfspaces {d : ℕ} (S : Finset (Euclidean d)) (hc : IsCompact (halfspacePolar (S : Set (Euclidean d)))) : ∃ (m : ℕ) (P : HPolytope d (Fin m)), P.body = halfspacePolar (S : Set (Euclidean d)) := by classical let T := S.filter (fun x => x ≠ 0) let J := {x // x ∈ T} have hn (i : J) : 0 < ‖(i : Euclidean d)‖ := norm_pos_iff.mpr (Finset.mem_filter.mp i.property).2 have heq : {x : Euclidean d | ∀ i : J, ⟪‖(i : Euclidean d)‖⁻¹ • (i : Euclidean d), x⟫ ≤ ‖(i : Euclidean d)‖⁻¹} = halfspacePolar (S : Set (Euclidean d)) := by ext x constructor · intro hx y hy by_cases hy0 : y = 0 · simp [hy0] let i : J := ⟨y, Finset.mem_filter.mpr ⟨hy, hy0⟩⟩ have h := mul_le_mul_of_nonneg_left (hx i) (hn i).le rw [real_inner_smul_left] at h dsimp only [i] at h simpa only [← mul_assoc, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hy0), one_mul, real_inner_comm] using h · intro hx i have h := mul_le_mul_of_nonneg_left (hx i (Finset.mem_filter.mp i.property).1) (inv_nonneg.mpr (hn i).le) rw [real_inner_smul_left] simpa only [mul_one, real_inner_comm] using h let P : HPolytope d J := { normal := fun i => ‖(i : Euclidean d)‖⁻¹ • (i : Euclidean d) offset := fun i => ‖(i : Euclidean d)‖⁻¹ normal_unit := fun i => by simp [norm_smul, (hn i).ne'] compact := by rw [heq]; exact hc strict_feasible := ⟨0, fun i => by simpa using inv_pos.mpr (hn i)⟩ distinct := by intro i j h have hnorm : ‖(i : Euclidean d)‖ = ‖(j : Euclidean d)‖ := inv_inj.mp (congrArg Prod.snd h) have hv := congrArg Prod.fst h apply Subtype.ext have hs := congrArg (fun v : Euclidean d => ‖(i : Euclidean d)‖ • v) hv simpa only [smul_smul, ← hnorm, mul_inv_cancel₀ (hn i).ne', one_smul] using hs } refine ⟨Fintype.card J, P.reindex (Fintype.equivFin J).symm, ?_⟩ rw [HPolytope.reindex_body] exact heq
theorem finite_convex_hull_has_halfspaces_centered {d : ℕ} (S : Finset (Euclidean d)) (h0 : (0 : Euclidean d) ∈ interior (convexHull ℝ (S : Set (Euclidean d)))) : ∃ (m : ℕ) (P : HPolytope d (Fin m)), P.body = convexHull ℝ (S : Set (Euclidean d)) := by have hc : IsCompact (halfspacePolar (S : Set (Euclidean d))) := by rw [← halfspacePolar_convexHull] exact halfspacePolar_isCompact h0 obtain ⟨m, P, hP⟩ := finite_polar_has_halfspaces S hc obtain ⟨T, hT⟩ := halfspaces_are_finite_convex_hull P have heq : halfspacePolar (T : Set (Euclidean d)) = convexHull ℝ (S : Set (Euclidean d)) := by calc halfspacePolar (T : Set (Euclidean d)) = halfspacePolar (convexHull ℝ (T : Set (Euclidean d))) := (halfspacePolar_convexHull _).symm _ = halfspacePolar P.body := by rw [hT] _ = halfspacePolar (halfspacePolar (S : Set (Euclidean d))) := by rw [hP] _ = halfspacePolar (halfspacePolar (convexHull ℝ (S : Set (Euclidean d)))) := by rw [halfspacePolar_convexHull] _ = convexHull ℝ (S : Set (Euclidean d)) := halfspacePolar_bipolar (S.finite_toSet.isClosed_convexHull ℝ) (convex_convexHull ℝ _) (interior_subset h0) obtain ⟨n, Q, hQ⟩ := finite_polar_has_halfspaces T (by rw [heq]; exact S.finite_toSet.isCompact_convexHull ℝ) exact ⟨n, Q, hQ.trans heq⟩
theorem finite_convex_hull_has_halfspaces {d : ℕ} (S : Finset (Euclidean d)) (hint : (interior (convexHull ℝ (S : Set (Euclidean d)))).Nonempty) : ∃ (m : ℕ) (P : HPolytope d (Fin m)), P.body = convexHull ℝ (S : Set (Euclidean d)) := by classical obtain ⟨v, hv⟩ := hint let S₀ : Finset (Euclidean d) := S.image (fun x => x - v) have hS₀ : convexHull ℝ (S₀ : Set (Euclidean d)) = (-v) +ᵥ convexHull ℝ (S : Set (Euclidean d)) := by dsimp [S₀] rw [Finset.coe_image] have himage : (fun x : Euclidean d => x - v) '' (S : Set (Euclidean d)) = (-v) +ᵥ (S : Set (Euclidean d)) := by change (fun x : Euclidean d => x - v) '' (S : Set (Euclidean d)) = (fun x => -v + x) '' (S : Set (Euclidean d)) congr 1 funext x abel rw [himage, convexHull_vadd] have h0 : (0 : Euclidean d) ∈ interior (convexHull ℝ (S₀ : Set (Euclidean d))) := by rw [hS₀, interior_vadd] exact ⟨v, hv, by simp⟩ obtain ⟨m, P, hP⟩ := finite_convex_hull_has_halfspaces_centered S₀ h0 refine ⟨m, P.translate v, ?_⟩ rw [HPolytope.translate_body, hP, hS₀] simp
end Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108import OAI.Geometry.ProjectionVolume.PolytopeFrontimport OAI.Geometry.ProjectionVolume.Brightnessimport OAI.Geometry.ProjectionVolume.ProjectionReconstruction
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
noncomputable section
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem velocity_neg (u : Euclidean d) (i : ι) : P.velocity (-u) i = -P.velocity u i := by simp [velocity]
private theorem brightness_eq_filtered_sum (u : Euclidean d) (hu : u ≠ 0) : brightness P.body u = ∑ i, if P.velocity u i < 0 then P.faceArea i * |⟪u, P.normal i⟫| else 0 := by classical rw [P.brightness_eq_front_sum u hu] simp only [face_brightness] rw [← Finset.sum_filter] exact (Finset.sum_subtype (Finset.univ.filter (fun i => P.velocity u i < 0)) (by simp) (fun i => P.faceArea i * |⟪u, P.normal i⟫|)).symm
theorem brightness_eq_sum (u : Euclidean d) : brightness P.body u = (∑ i, P.faceArea i * |⟪u, P.normal i⟫|) / 2 := by classical by_cases hu : u = 0 · simp [hu, brightness] have hplus := P.brightness_eq_filtered_sum u hu have hminus := P.brightness_eq_filtered_sum (-u) (neg_ne_zero.mpr hu) simp only [brightness_neg, velocity_neg, neg_lt_zero, inner_neg_left, abs_neg] at hminus have hpoint (i : ι) : (if P.velocity u i < 0 then P.faceArea i * |⟪u, P.normal i⟫| else 0) + (if 0 < P.velocity u i then P.faceArea i * |⟪u, P.normal i⟫| else 0) = P.faceArea i * |⟪u, P.normal i⟫| := by rcases lt_trichotomy (P.velocity u i) 0 with hi | hi | hi · simp [hi, not_lt_of_gt hi] · have hinner : ⟪u, P.normal i⟫ = 0 := by simpa only [velocity, neg_eq_zero, real_inner_comm] using hi simp [hi, hinner] · simp [hi, not_lt_of_gt hi] have hsum := congrArg (fun f : ι → ℝ => ∑ i, f i) (funext hpoint) simp only [Finset.sum_add_distrib] at hsum rw [← hplus, ← hminus] at hsum linarith
theorem faceArea_nonneg (i : ι) : 0 ≤ P.faceArea i := ENNReal.toReal_nonneg
theorem facetZonotope_isCompact : IsCompact P.facetZonotope := by classical exact Finset.sum_induction _ IsCompact (fun _ _ ha hb => ha.add hb) isCompact_singleton (fun _ _ => SupportGeometry.isCompact_segment _ _)
theorem facetZonotope_nonempty : P.facetZonotope.Nonempty := by classical exact Finset.sum_induction _ Set.Nonempty (fun _ _ ha hb => ha.add hb) (singleton_nonempty 0) (fun _ _ => ⟨_, left_mem_segment ℝ _ _⟩)
theorem facetZonotope_convex : Convex ℝ P.facetZonotope := by classical exact Finset.sum_induction _ (Convex ℝ) (fun _ _ ha hb => ha.add hb) (convex_singleton 0) (fun _ _ => convex_segment _ _)
theorem facetZonotope_support (u : Euclidean d) : SupportGeometry.support P.facetZonotope (innerSL ℝ u) = (∑ i, P.faceArea i * |⟪u, P.normal i⟫|) / 2 := by classical unfold facetZonotope rw [SupportGeometry.support_sum _ _ (fun _ _ => SupportGeometry.isCompact_segment _ _) (fun _ _ => ⟨_, left_mem_segment ℝ _ _⟩)] have hseg (i : ι) : SupportGeometry.support (segment ℝ (-(P.faceArea i / 2) • P.normal i) ((P.faceArea i / 2) • P.normal i)) (innerSL ℝ u) = P.faceArea i * |⟪u, P.normal i⟫| / 2 := by have heq : segment ℝ (-(P.faceArea i / 2) • P.normal i) ((P.faceArea i / 2) • P.normal i) = segment ℝ (-(1 / 2 : ℝ) • (P.faceArea i • P.normal i)) ((1 / 2 : ℝ) • (P.faceArea i • P.normal i)) := by congr 1 <;> simp only [smul_smul] <;> congr 1 <;> ring rw [heq, SupportGeometry.support_centered_segment] change |⟪u, P.faceArea i • P.normal i⟫| / 2 = _ simp only [real_inner_smul_right, abs_mul, abs_of_nonneg (P.faceArea_nonneg i)] simp only [hseg] exact (Finset.sum_div _ _ _).symm
theorem projectionBody_eq_facetZonotope : projectionBody P.body = P.facetZonotope := Paper092.projectionBody_eq_of_brightness_eq_support P.facetZonotope_isCompact P.facetZonotope_nonempty P.facetZonotope_convex (fun u => (P.brightness_eq_sum u).trans (P.facetZonotope_support u).symm)
theorem projectionBody_support (u : Euclidean d) : SupportGeometry.support (projectionBody P.body) (innerSL ℝ u) = brightness P.body u := by rw [P.projectionBody_eq_facetZonotope, P.facetZonotope_support, P.brightness_eq_sum]
end Paper092.HPolytope
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243import OAI.Geometry.ProjectionVolume.Basic
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace Pointwise
noncomputable section
namespace Paper092
structure HPolytope (d : ℕ) (ι : Type uι) [Fintype ι] where normal : ι → Euclidean d offset : ι → ℝ normal_unit : ∀ i, ‖normal i‖ = 1 compact : IsCompact {x : Euclidean d | ∀ i, ⟪normal i, x⟫ ≤ offset i} strict_feasible : ∃ x : Euclidean d, ∀ i, ⟪normal i, x⟫ < offset i distinct : Function.Injective (fun i => (normal i, offset i))
namespace HPolytope
def body {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι) : Set (Euclidean d) := {x | ∀ i, ⟪P.normal i, x⟫ ≤ P.offset i}
def face {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι) (i : ι) : Set (Euclidean d) := {x | x ∈ P.body ∧ ⟪P.normal i, x⟫ = P.offset i}
def faceArea {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι) (i : ι) : ℝ := (μHE[d - 1] (P.face i)).toReal
def facetZonotope {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι) : Set (Euclidean d) := ∑ i, segment ℝ (-(P.faceArea i / 2) • P.normal i) ((P.faceArea i / 2) • P.normal i)
end HPolytopeend Paper092
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155import OAI.Geometry.ProjectionVolume.PolytopeCauchy
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace
noncomputable section
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem projected_seam_null_left (u : Euclidean d) (a b : ι) (hab : a ≠ b) (ha : P.velocity u a < 0) : volume {y : normalHyperplane u | P.velocity u b * P.slack y.val a - P.velocity u a * P.slack y.val b = 0} = 0 := by by_cases hb : P.velocity u b < 0 · exact P.projected_seam_null u a b hab ha hb let f : normalHyperplane u →ᵃ[ℝ] ℝ := P.velocity u b • ((P.slackAffine a).comp (normalHyperplane u).subtype.toAffineMap) - P.velocity u a • ((P.slackAffine b).comp (normalHyperplane u).subtype.toAffineMap) let S : AffineSubspace ℝ (normalHyperplane u) := (affineSpan ℝ ({0} : Set ℝ)).comap f have hmem (y : normalHyperplane u) : y ∈ S ↔ P.velocity u b * P.slack y.val a - P.velocity u a * P.slack y.val b = 0 := by simp [S, f, slackAffine_apply, smul_eq_mul] have hproper : S ≠ ⊤ := by intro htop obtain ⟨x, hx⟩ := P.strict_feasible have hq : ∀ i, 0 < P.slack x i := fun i => sub_pos.mpr (hx i) have hy : (normalHyperplane u).orthogonalProjectionOnto x ∈ S := by rw [htop] exact AffineSubspace.mem_top ℝ _ _ have hz := (hmem _).mp hy rw [seam_projection_invariant] at hz have hpos := mul_nonneg (le_of_not_gt hb) (hq a).le have hneg := mul_neg_of_neg_of_pos ha (hq b) linarith have hset : {y : normalHyperplane u | P.velocity u b * P.slack y.val a - P.velocity u a * P.slack y.val b = 0} = S := by ext y exact (hmem y).symm rw [hset] exact Measure.addHaar_affineSubspace volume S hproper
theorem face_inter_surface_null (a b : ι) (hab : a ≠ b) : μHE[d - 1] (P.face a ∩ P.face b) = 0 := by have ha : P.velocity (P.normal a) a < 0 := by simp [velocity, P.normal_unit] have hp : projectionVolume (P.face a ∩ P.face b) (P.normal a) = 0 := by unfold projectionVolume apply measure_mono_null _ (P.projected_seam_null_left (P.normal a) a b hab ha) rintro y ⟨x, hx, rfl⟩ change P.velocity (P.normal a) b * P.slack ((normalHyperplane (P.normal a)).orthogonalProjectionOnto x) a - P.velocity (P.normal a) a * P.slack ((normalHyperplane (P.normal a)).orthogonalProjectionOnto x) b = 0 rw [seam_projection_invariant, ((P.mem_face_iff_slack a x).mp hx.1).2, ((P.mem_face_iff_slack b x).mp hx.2).2] simp have hv := Paper092.projectionVolume_of_subset_affine_hyperplane (P.normal a) (P.normal a) (P.normal_unit a) (P.normal_unit a) (P.offset a) (P.face a ∩ P.face b) (fun _ hx => hx.1.2) simp only [real_inner_self_eq_norm_sq, P.normal_unit, one_pow, abs_one, ENNReal.ofReal_one, one_mul] at hv exact hv.symm.trans hp
theorem exists_other_active_of_redundant (i : ι) (hred : ∀ x : Euclidean d, (∀ j, j ≠ i → ⟪P.normal j, x⟫ ≤ P.offset j) → ⟪P.normal i, x⟫ ≤ P.offset i) (x : Euclidean d) (hx : x ∈ P.face i) : ∃ j, j ≠ i ∧ ⟪P.normal j, x⟫ = P.offset j := by classical by_contra! hn let S : Set (Euclidean d) := ⋂ j : {j : ι // j ≠ i}, {y | ⟪P.normal j.val, y⟫ < P.offset j.val} have hopen : IsOpen S := isOpen_iInter_of_finite fun j => isOpen_lt (innerSL ℝ (P.normal j.val)).continuous continuous_const have hxS : x ∈ S := by apply mem_iInter.mpr intro j exact lt_of_le_of_ne (hx.1 j.val) (hn j.val j.property) obtain ⟨ε, hε, hball⟩ := Metric.isOpen_iff.mp hopen x hxS have hyball : x + (ε / 2) • P.normal i ∈ Metric.ball x ε := by rw [Metric.mem_ball, dist_eq_norm] simp only [add_sub_cancel_left, norm_smul, Real.norm_eq_abs, P.normal_unit, mul_one, abs_of_pos (div_pos hε (by norm_num : (0 : ℝ) < 2))] linarith have hyS := hball hyball have hy := hred (x + (ε / 2) • P.normal i) (fun j hji => (mem_iInter.mp hyS ⟨j, hji⟩).le) rw [inner_add_right, real_inner_smul_right, real_inner_self_eq_norm_sq, P.normal_unit, one_pow, mul_one, hx.2] at hy linarith
theorem redundant_face_surface_null (i : ι) (hred : ∀ x : Euclidean d, (∀ j, j ≠ i → ⟪P.normal j, x⟫ ≤ P.offset j) → ⟪P.normal i, x⟫ ≤ P.offset i) : μHE[d - 1] (P.face i) = 0 := by classical apply measure_mono_null (t := ⋃ j : {j : ι // j ≠ i}, P.face i ∩ P.face j.val) · intro x hx obtain ⟨j, hji, hj⟩ := P.exists_other_active_of_redundant i hred x hx exact mem_iUnion.mpr ⟨⟨j, hji⟩, hx, hx.1, hj⟩ · apply measure_iUnion_null intro j exact P.face_inter_surface_null i j.val (Ne.symm j.property)
theorem redundant_faceArea_zero (i : ι) (hred : ∀ x : Euclidean d, (∀ j, j ≠ i → ⟪P.normal j, x⟫ ≤ P.offset j) → ⟪P.normal i, x⟫ ≤ P.offset i) : P.faceArea i = 0 := by rw [faceArea, P.redundant_face_surface_null i hred, ENNReal.toReal_zero]
theorem exists_strict_face_point_of_essential (i : ι) (hessential : ¬ ∀ x : Euclidean d, (∀ j, j ≠ i → ⟪P.normal j, x⟫ ≤ P.offset j) → ⟪P.normal i, x⟫ ≤ P.offset i) : ∃ x ∈ P.face i, ∀ j, j ≠ i → ⟪P.normal j, x⟫ < P.offset j := by classical push Not at hessential obtain ⟨y, hy, hyi⟩ := hessential obtain ⟨z, hz⟩ := P.strict_feasible have hden : 0 < ⟪P.normal i, y⟫ - ⟪P.normal i, z⟫ := by linarith [hz i] let t : ℝ := (P.offset i - ⟪P.normal i, z⟫) / (⟪P.normal i, y⟫ - ⟪P.normal i, z⟫) have ht0 : 0 < t := div_pos (sub_pos.mpr (hz i)) hden have ht1 : t < 1 := (div_lt_one hden).mpr (by linarith) have htmul : t * (⟪P.normal i, y⟫ - ⟪P.normal i, z⟫) = P.offset i - ⟪P.normal i, z⟫ := div_mul_cancel₀ _ hden.ne' let x := (1 - t) • z + t • y have hxi : ⟪P.normal i, x⟫ = P.offset i := by dsimp [x] simp only [inner_add_right, real_inner_smul_right] nlinarith have hxj : ∀ j, j ≠ i → ⟪P.normal j, x⟫ < P.offset j := by intro j hji have hleft := mul_lt_mul_of_pos_left (hz j) (sub_pos.mpr ht1) have hright := mul_le_mul_of_nonneg_left (hy j hji) ht0.le dsimp [x] simp only [inner_add_right, real_inner_smul_right] nlinarith refine ⟨x, ⟨?_, hxi⟩, hxj⟩ intro j by_cases hji : j = i · simpa only [hji, hxi] using le_refl (P.offset i) · exact (hxj j hji).le
end Paper092.HPolytope
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980import OAI.Geometry.ProjectionVolume.PolytopeFaceGeometry
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace
noncomputable section
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
theorem affineSpan_face_of_essential (i : ι) (hessential : ¬ ∀ x : Euclidean d, (∀ j, j ≠ i → ⟪P.normal j, x⟫ ≤ P.offset j) → ⟪P.normal i, x⟫ ≤ P.offset i) : (affineSpan ℝ (P.face i) : Set (Euclidean d)) = {y | ⟪P.normal i, y⟫ = P.offset i} := by classical let Q : AffineSubspace ℝ (Euclidean d) := (affineSpan ℝ ({P.offset i} : Set ℝ)).comap (innerₛₗ ℝ (P.normal i)).toAffineMap have hQ (y : Euclidean d) : y ∈ Q ↔ ⟪P.normal i, y⟫ = P.offset i := by simp [Q] have hle : affineSpan ℝ (P.face i) ≤ Q := by apply affineSpan_le.mpr intro y hy exact (hQ y).mpr hy.2 ext y constructor · exact fun hy => (hQ y).mp (hle hy) · intro hy change ⟪P.normal i, y⟫ = P.offset i at hy change y ∈ affineSpan ℝ (P.face i) obtain ⟨x, hx, hxstrict⟩ := P.exists_strict_face_point_of_essential i hessential have hxspan : x ∈ affineSpan ℝ (P.face i) := subset_affineSpan ℝ _ hx by_cases hxy : y = x · simpa only [hxy] using hxspan let S : Set (Euclidean d) := ⋂ j : {j : ι // j ≠ i}, {z | ⟪P.normal j.val, z⟫ < P.offset j.val} have hopen : IsOpen S := isOpen_iInter_of_finite fun j => isOpen_lt (innerSL ℝ (P.normal j.val)).continuous continuous_const have hxS : x ∈ S := mem_iInter.mpr (fun j => hxstrict j.val j.property) obtain ⟨ε, hε, hball⟩ := Metric.isOpen_iff.mp hopen x hxS have hnorm : 0 < ‖y - x‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hxy) let t : ℝ := ε / (2 * ‖y - x‖) have ht : 0 < t := div_pos hε (mul_pos (by norm_num) hnorm) let z := x + t • (y - x) have hzball : z ∈ Metric.ball x ε := by rw [Metric.mem_ball, dist_eq_norm] change ‖x + t • (y - x) - x‖ < ε rw [add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_pos ht] dsimp [t] have heq : ε / (2 * ‖y - x‖) * ‖y - x‖ = ε / 2 := by field_simp rw [heq] linarith have hzS := hball hzball have hzi : ⟪P.normal i, z⟫ = P.offset i := by dsimp [z] simp only [inner_add_right, real_inner_smul_right, inner_sub_right, hy, hx.2, sub_self, mul_zero, add_zero] have hzface : z ∈ P.face i := by refine ⟨?_, hzi⟩ intro j by_cases hji : j = i · simpa only [hji, hzi] using le_refl (P.offset i) · exact (mem_iInter.mp hzS ⟨j, hji⟩).le have hzspan := subset_affineSpan ℝ (P.face i) hzface have hmem := (affineSpan ℝ (P.face i)).smul_vsub_vadd_mem t⁻¹ hzspan hxspan hxspan have heq : t⁻¹ • (z - x) + x = y := by dsimp [z] rw [add_sub_cancel_left, smul_smul, inv_mul_cancel₀ ht.ne', one_smul, sub_add_cancel] simpa only [vsub_eq_sub, vadd_eq_add, heq] using hmem
end Paper092.HPolytope
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263import OAI.Geometry.ProjectionVolume.PolytopeDefinitionsimport OAI.Geometry.ProjectionVolume.SimplexProjectionimport OAI.Geometry.ProjectionVolume.ProjectionJacobian
namespace OAI
universe uι
open Set MeasureTheoryopen scoped RealInnerProductSpace
noncomputable section
namespace Paper092.HPolytope
variable {d : ℕ} {ι : Type uι} [Fintype ι] (P : HPolytope d ι)
def slack (x : Euclidean d) (i : ι) : ℝ := P.offset i - ⟪P.normal i, x⟫
def velocity (u : Euclidean d) (i : ι) : ℝ := -⟪P.normal i, u⟫
theorem slack_add_smul (x u : Euclidean d) (t : ℝ) (i : ι) : P.slack (x + t • u) i = P.slack x i + t * P.velocity u i := by simp only [slack, velocity, inner_add_right, real_inner_smul_right] ring
theorem mem_body_iff_slack (x : Euclidean d) : x ∈ P.body ↔ ∀ i, 0 ≤ P.slack x i := by simp only [body, mem_ofPred_eq, slack, sub_nonneg]
theorem mem_face_iff_slack (i : ι) (x : Euclidean d) : x ∈ P.face i ↔ x ∈ P.body ∧ P.slack x i = 0 := by change (x ∈ P.body ∧ ⟪P.normal i, x⟫ = P.offset i) ↔ _ constructor · rintro ⟨hx, hi⟩ exact ⟨hx, by simp [slack, hi]⟩ · rintro ⟨hx, hi⟩ exact ⟨hx, (sub_eq_zero.mp hi).symm⟩
theorem body_nonempty : P.body.Nonempty := by obtain ⟨x, hx⟩ := P.strict_feasible exact ⟨x, fun i => (hx i).le⟩
theorem body_convex : Convex ℝ P.body := by intro x hx y hy a b ha hb hab i simp only [inner_add_right, real_inner_smul_right] calc a * ⟪P.normal i, x⟫ + b * ⟪P.normal i, y⟫ ≤ a * P.offset i + b * P.offset i := add_le_add (mul_le_mul_of_nonneg_left (hx i) ha) (mul_le_mul_of_nonneg_left (hy i) hb) _ = (a + b) * P.offset i := by ring _ = P.offset i := by rw [hab, one_mul]
theorem velocity_neg_exists (u : Euclidean d) (hu : u ≠ 0) : ∃ i, P.velocity u i < 0 := by by_contra! h obtain ⟨x, hx, hmax⟩ := P.compact.exists_isMaxOn P.body_nonempty (innerSL ℝ u).continuous.continuousOn have hx' : x + u ∈ P.body := by intro i have hi := h i dsimp only [velocity] at hi simp only [inner_add_right] linarith [hx i] have hle := hmax hx' change ⟪u, x + u⟫ ≤ ⟪u, x⟫ at hle rw [inner_add_right] at hle have hpos := real_inner_self_pos.mpr hu linarith
theorem exists_front_point (x u : Euclidean d) (hu : u ≠ 0) (hx : x ∈ P.body) : ∃ t : ℝ, 0 ≤ t ∧ x + t • u ∈ P.body ∧ ∃ i, P.velocity u i < 0 ∧ P.slack (x + t • u) i = 0 := by obtain ⟨t, ht, hq, i, hi, hqi⟩ := Paper092.exists_step_to_boundary (P.slack x) (P.velocity u) ((P.mem_body_iff_slack x).mp hx) (P.velocity_neg_exists u hu) refine ⟨t, ht, ?_, i, hi, ?_⟩ · exact (P.mem_body_iff_slack _).mpr (fun j => by simpa only [slack_add_smul] using hq j) · simpa only [slack_add_smul] using hqi
theorem projection_injective_on_front (u x z : Euclidean d) (hx : x ∈ P.body) (hz : z ∈ P.body) (hxf : ∃ i, P.velocity u i < 0 ∧ P.slack x i = 0) (hzf : ∃ i, P.velocity u i < 0 ∧ P.slack z i = 0) (hp : (normalHyperplane u).orthogonalProjectionOnto x = (normalHyperplane u).orthogonalProjectionOnto z) : x = z := by obtain ⟨t, rfl⟩ := (Paper092.projection_eq_iff_parallel u x z).mp hp obtain ⟨a, ha, hxa⟩ := hxf obtain ⟨b, hb, hzb⟩ := hzf rw [slack_add_smul] at hxa have ht0 : 0 ≤ t := by by_contra ht have hprod := mul_pos_of_neg_of_neg (lt_of_not_ge ht) ha have hz' := (P.mem_body_iff_slack z).mp hz a linarith have ht1 : t ≤ 0 := by by_contra ht have hprod := mul_neg_of_pos_of_neg (lt_of_not_ge ht) hb have hxb := (P.mem_body_iff_slack _).mp hx b rw [slack_add_smul, hzb] at hxb linarith simp [le_antisymm ht1 ht0]
theorem projection_eq_front_cover (u : Euclidean d) (hu : u ≠ 0) : (normalHyperplane u).orthogonalProjectionOnto '' P.body = ⋃ i : {i : ι // P.velocity u i < 0}, (normalHyperplane u).orthogonalProjectionOnto '' P.face i.val := by ext y constructor · rintro ⟨x, hx, rfl⟩ obtain ⟨t, _, hq, i, hi, hqi⟩ := P.exists_front_point x u hu hx refine mem_iUnion.mpr ⟨⟨i, hi⟩, x + t • u, ?_, ?_⟩ · exact (P.mem_face_iff_slack _ _).mpr ⟨hq, hqi⟩ · exact (Paper092.projection_eq_iff_parallel u (x + t • u) x).mpr ⟨t, rfl⟩ · intro hy obtain ⟨i, x, hx, hpx⟩ := mem_iUnion.mp hy exact ⟨x, hx.1, hpx⟩
theorem front_faces_projection_inter_eq (u : Euclidean d) (a b : ι) (ha : P.velocity u a < 0) (hb : P.velocity u b < 0) : ((normalHyperplane u).orthogonalProjectionOnto '' P.face a) ∩ ((normalHyperplane u).orthogonalProjectionOnto '' P.face b) = (normalHyperplane u).orthogonalProjectionOnto '' (P.face a ∩ P.face b) := by apply le_antisymm · rintro y ⟨⟨x, hx, hpx⟩, ⟨z, hz, hpz⟩⟩ have hxa := (P.mem_face_iff_slack _ _).mp hx have hzb := (P.mem_face_iff_slack _ _).mp hz have heq : x = z := P.projection_injective_on_front u x z hxa.1 hzb.1 ⟨a, ha, hxa.2⟩ ⟨b, hb, hzb.2⟩ (hpx.trans hpz.symm) subst z exact ⟨x, ⟨hx, hz⟩, hpx⟩ · exact image_inter_subset _ _ _
def slackAffine (i : ι) : Euclidean d →ᵃ[ℝ] ℝ := AffineMap.const ℝ (Euclidean d) (P.offset i) - (innerₛₗ ℝ (P.normal i)).toAffineMap
theorem slackAffine_apply (i : ι) (x : Euclidean d) : P.slackAffine i x = P.slack x i := rfl
theorem seam_projection_invariant (u x : Euclidean d) (a b : ι) : P.velocity u b * P.slack ((normalHyperplane u).orthogonalProjectionOnto x) a - P.velocity u a * P.slack ((normalHyperplane u).orthogonalProjectionOnto x) b = P.velocity u b * P.slack x a - P.velocity u a * P.slack x b := by obtain ⟨t, ht⟩ := (Paper092.projection_eq_iff_parallel u x ((normalHyperplane u).orthogonalProjectionOnto x)).mp ((normalHyperplane u).orthogonalProjectionOnto_mem_subspace_eq_self ((normalHyperplane u).orthogonalProjectionOnto x)).symm conv_rhs => rw [ht, slack_add_smul, slack_add_smul] ring
private theorem index_eq_of_weighted_slack_zero (a b : ι) (r s : ℝ) (hr : r < 0) (hs : s < 0) (h : ∀ x, r * P.slack x a - s * P.slack x b = 0) : a = b := by have h0 := h 0 simp only [slack, inner_zero_right, sub_zero] at h0 have hn : r • P.normal a = s • P.normal b := by apply ext_inner_right ℝ intro x simp only [real_inner_smul_left] have hx := h x dsimp only [slack] at hx nlinarith have hnorm := congrArg norm hn simp only [norm_smul, Real.norm_eq_abs, P.normal_unit, mul_one, abs_of_neg hr, abs_of_neg hs] at hnorm have hrs : r = s := by linarith rw [hrs] at hn h0 have hn' : P.normal a = P.normal b := smul_right_injective (Euclidean d) (ne_of_lt hs) hn have hc : P.offset a = P.offset b := mul_left_cancel₀ (ne_of_lt hs) (sub_eq_zero.mp h0) exact P.distinct (Prod.ext hn' hc)
theorem projected_seam_null (u : Euclidean d) (a b : ι) (hab : a ≠ b) (ha : P.velocity u a < 0) (hb : P.velocity u b < 0) : volume {y : normalHyperplane u | P.velocity u b * P.slack y.val a - P.velocity u a * P.slack y.val b = 0} = 0 := by let f : normalHyperplane u →ᵃ[ℝ] ℝ := P.velocity u b • ((P.slackAffine a).comp (normalHyperplane u).subtype.toAffineMap) - P.velocity u a • ((P.slackAffine b).comp (normalHyperplane u).subtype.toAffineMap) let S : AffineSubspace ℝ (normalHyperplane u) := (affineSpan ℝ ({0} : Set ℝ)).comap f have hmem (y : normalHyperplane u) : y ∈ S ↔ P.velocity u b * P.slack y.val a - P.velocity u a * P.slack y.val b = 0 := by simp [S, f, slackAffine_apply, smul_eq_mul] have hproper : S ≠ ⊤ := by intro htop apply hab apply P.index_eq_of_weighted_slack_zero a b (P.velocity u b) (P.velocity u a) hb ha intro x have hy : (normalHyperplane u).orthogonalProjectionOnto x ∈ S := by rw [htop] exact AffineSubspace.mem_top ℝ _ _ have hz := (hmem _).mp hy rwa [seam_projection_invariant] at hz have hset : {y : normalHyperplane u | P.velocity u b * P.slack y.val a - P.velocity u a * P.slack y.val b = 0} = S := by ext y exact (hmem y).symm rw [hset] exact Measure.addHaar_affineSubspace volume S hproper
theorem projected_front_faces_aedisjoint (u : Euclidean d) (a b : ι) (hab : a ≠ b) (ha : P.velocity u a < 0) (hb : P.velocity u b < 0) : AEDisjoint volume ((normalHyperplane u).orthogonalProjectionOnto '' P.face a) ((normalHyperplane u).orthogonalProjectionOnto '' P.face b) := by rw [AEDisjoint, P.front_faces_projection_inter_eq u a b ha hb] apply measure_mono_null _ (P.projected_seam_null u a b hab ha hb) rintro y ⟨x, hx, rfl⟩ change P.velocity u b * P.slack ((normalHyperplane u).orthogonalProjectionOnto x) a - P.velocity u a * P.slack ((normalHyperplane u).orthogonalProjectionOnto x) b = 0 rw [seam_projection_invariant, ((P.mem_face_iff_slack a x).mp hx.1).2, ((P.mem_face_iff_slack b x).mp hx.2).2] simp
theorem face_isCompact (i : ι) : IsCompact (P.face i) := P.compact.inter_right (isClosed_eq (innerSL ℝ (P.normal i)).continuous continuous_const)
theorem projected_face_isCompact (u : Euclidean d) (i : ι) : IsCompact ((normalHyperplane u).orthogonalProjectionOnto '' P.face i) := (P.face_isCompact i).image (normalHyperplane u).orthogonalProjectionOnto.continuous
theorem projectionVolume_eq_front_sum (u : Euclidean d) (hu : u ≠ 0) : projectionVolume P.body u = ∑ i : {i : ι // P.velocity u i < 0}, volume ((normalHyperplane u).orthogonalProjectionOnto '' P.face i.val) := by classical unfold projectionVolume rw [P.projection_eq_front_cover u hu] have hd : Pairwise (fun a b : {i : ι // P.velocity u i < 0} => AEDisjoint volume ((normalHyperplane u).orthogonalProjectionOnto '' P.face a.val) ((normalHyperplane u).orthogonalProjectionOnto '' P.face b.val)) := by intro a b hab exact P.projected_front_faces_aedisjoint u a.val b.val (Subtype.coe_injective.ne hab) a.property b.property rw [measure_iUnion₀ hd (fun i => (P.projected_face_isCompact u i.val).measurableSet.nullMeasurableSet)] exact tsum_fintype _
theorem brightness_eq_front_sum (u : Euclidean d) (hu : u ≠ 0) : brightness P.body u = ∑ i : {i : ι // P.velocity u i < 0}, brightness (P.face i.val) u := by classical simp only [brightness] rw [P.projectionVolume_eq_front_sum u hu, ENNReal.toReal_sum] · exact Finset.mul_sum _ _ _ · intro i _ exact (P.projected_face_isCompact u i.val).measure_lt_top.ne
theorem face_brightness (i : ι) (u : Euclidean d) : brightness (P.face i) u = P.faceArea i * |⟪u, P.normal i⟫| := by have h := Paper092.brightness_of_subset_affine_hyperplane u (P.normal i) (P.normal_unit i) (P.offset i) (P.face i) (fun _ hx => hx.2) simpa only [faceArea, mul_comm] using h
end Paper092.HPolytope
end
end OAIlean/OAI/Geometry/ProjectionBody/ProductFacetProjection.leanAdded+39
lean/OAI/Geometry/ProjectionBody/ProductFacets.leanAdded+101
lean/OAI/Geometry/ProjectionBody/ProductVolumes.leanAdded+41
lean/OAI/Geometry/ProjectionBody/ProductZonotopeBridge.leanAdded+74
lean/OAI/Geometry/ProjectionBody/ProjectionKernel.leanAdded+21
lean/OAI/Geometry/ProjectionBody/SimplexBrightness.leanAdded+99
lean/OAI/Geometry/ProjectionBody/SimplexFacetCharts.leanAdded+81
lean/OAI/Geometry/ProjectionBody/SimplexFacets.leanAdded+97
lean/OAI/Geometry/ProjectionBody/SimplexVolume.leanAdded+188
lean/OAI/Geometry/ProjectionBody/Specification.leanAdded+40
lean/OAI/Geometry/ProjectionBody/UnitSupport.leanAdded+43
lean/OAI/Geometry/ProjectionBody/ZonotopeBridge.leanAdded+68
lean/OAI/Geometry/ProjectionVolume/AffineBrightness.leanAdded+191
lean/OAI/Geometry/ProjectionVolume/AffineCovariance.leanAdded+86
lean/OAI/Geometry/ProjectionVolume/ApproximationBounds.leanAdded+122
lean/OAI/Geometry/ProjectionVolume/AreaNormalVectors.leanAdded+71
lean/OAI/Geometry/ProjectionVolume/Arithmetic.leanAdded+41
lean/OAI/Geometry/ProjectionVolume/AugmentedDeterminant.leanAdded+106
lean/OAI/Geometry/ProjectionVolume/BallBrightness.leanAdded+91
lean/OAI/Geometry/ProjectionVolume/Basic.leanAdded+27
lean/OAI/Geometry/ProjectionVolume/Brightness.leanAdded+133
lean/OAI/Geometry/ProjectionVolume/CoordinateDrop.leanAdded+75
lean/OAI/Geometry/ProjectionVolume/CounterexampleComparison.leanAdded+17
lean/OAI/Geometry/ProjectionVolume/CubeBrightness.leanAdded+191
lean/OAI/Geometry/ProjectionVolume/CubeFibers.leanAdded+119
lean/OAI/Geometry/ProjectionVolume/EuclideanVolume.leanAdded+37
lean/OAI/Geometry/ProjectionVolume/ExposedBounds.leanAdded+55
lean/OAI/Geometry/ProjectionVolume/ExposedProduct.leanAdded+104
lean/OAI/Geometry/ProjectionVolume/Extrusion.leanAdded+220
lean/OAI/Geometry/ProjectionVolume/FacetAreas.leanAdded+166
lean/OAI/Geometry/ProjectionVolume/FacetBijection.leanAdded+69
lean/OAI/Geometry/ProjectionVolume/FacetDimension.leanAdded+98
lean/OAI/Geometry/ProjectionVolume/FacetExhaustiveness.leanAdded+117
lean/OAI/Geometry/ProjectionVolume/FacetLinearImage.leanAdded+99
lean/OAI/Geometry/ProjectionVolume/FacetPrism.leanAdded+106
lean/OAI/Geometry/ProjectionVolume/FacetUniqueness.leanAdded+77
lean/OAI/Geometry/ProjectionVolume/FiniteApproximation.leanAdded+45
lean/OAI/Geometry/ProjectionVolume/FiniteVertices.leanAdded+84
lean/OAI/Geometry/ProjectionVolume/GeneralProduct.leanAdded+88
lean/OAI/Geometry/ProjectionVolume/InnerSequence.leanAdded+116
lean/OAI/Geometry/ProjectionVolume/LinearApproximation.leanAdded+59
lean/OAI/Geometry/ProjectionVolume/Main.leanAdded+26
lean/OAI/Geometry/ProjectionVolume/Model.leanAdded+49
lean/OAI/Geometry/ProjectionVolume/OuterApproximation.leanAdded+156
lean/OAI/Geometry/ProjectionVolume/PolarRepresentation.leanAdded+181
lean/OAI/Geometry/ProjectionVolume/PolytopeCauchy.leanAdded+108
lean/OAI/Geometry/ProjectionVolume/PolytopeDefinitions.leanAdded+43
lean/OAI/Geometry/ProjectionVolume/PolytopeFaceGeometry.leanAdded+155
lean/OAI/Geometry/ProjectionVolume/PolytopeFacets.leanAdded+80
lean/OAI/Geometry/ProjectionVolume/PolytopeFront.leanAdded+263