File size: 3,172 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | import OAI.Geometry.ProjectionBody.ConvexGeometry
import OAI.Geometry.ProjectionBody.FacetCover
import Mathlib.Analysis.InnerProductSpace.Projection.Basic
namespace OAI
noncomputable section
open 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 OAI
|