math / data /lean /OAI /Geometry /CylinderCovering /Radial /ProjectionShapes.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.35 kB
import OAI.Geometry.CylinderCovering.Radial.Projection
namespace OAI
noncomputable section
open Set
open scoped InnerProductSpace
namespace RadialProjection
open TriangularCovering
theorem transverse_projection_eq_zero_iff {e w z : Space}
(he : β€–eβ€– = 1) (hw : inner ℝ e w = 0) (hz : inner ℝ e z = 0) :
projection (unit (e + w)) z = 0 ↔ z = 0 := by
have hnorm : β€–e + wβ€– β‰  0 := norm_ne_zero_iff.mpr (sideways_ne_zero he hw)
have hinner : inner ℝ e (unit (e + w)) = β€–e + w‖⁻¹ := by
simp [TriangularCovering.unit, inner_smul_right, inner_add_right,
he, hw]
constructor
Β· intro hp
have heq : z = (inner ℝ (unit (e + w)) z) β€’ unit (e + w) :=
sub_eq_zero.mp hp
have hmul := congrArg (fun v : Space => inner ℝ e v) heq
rw [hz, inner_smul_right, hinner] at hmul
have hc : inner ℝ (unit (e + w)) z = 0 :=
(mul_eq_zero.mp hmul.symm).resolve_right (inv_ne_zero hnorm)
simpa only [hc, zero_smul] using heq
Β· rintro rfl
simp [projection]
def projectedCoordinateAffine (u pβ‚€ a b : Space) : (ℝ Γ— ℝ) →ᡃ[ℝ] Space :=
(projLinear u).toAffineMap.comp (coordinateAffine pβ‚€ a b)
@[simp] theorem projectedCoordinateAffine_apply (u pβ‚€ a b : Space) (p : ℝ Γ— ℝ) :
projectedCoordinateAffine u pβ‚€ a b p =
projection u (pβ‚€ + p.1 β€’ a + p.2 β€’ b) := rfl
theorem coordinateAffine_injective (pβ‚€ : Space) {a b : Space}
(hab : LinearIndependent ℝ (![a,b] : Fin 2 β†’ Space)) :
Function.Injective (coordinateAffine pβ‚€ a b) := by
intro p q hpq
have hsum : p.1 β€’ a + p.2 β€’ b = q.1 β€’ a + q.2 β€’ b := by
change pβ‚€ + p.1 β€’ a + p.2 β€’ b = pβ‚€ + q.1 β€’ a + q.2 β€’ b at hpq
exact add_left_cancel (by simpa only [add_assoc] using hpq)
have hcoords : (![p.1,p.2] : Fin 2 β†’ ℝ) = ![q.1,q.2] :=
hab.fintypeLinearCombination_injective (by
simpa [Fintype.linearCombination_apply, Fin.sum_univ_succ] using hsum)
exact Prod.ext (congrFun hcoords 0) (congrFun hcoords 1)
theorem projectedCoordinateAffine_injective (pβ‚€ : Space) {e w a b : Space}
(he : β€–eβ€– = 1) (hw : inner ℝ e w = 0)
(ha : inner ℝ e a = 0) (hb : inner ℝ e b = 0)
(hab : LinearIndependent ℝ (![a,b] : Fin 2 β†’ Space)) :
Function.Injective (projectedCoordinateAffine (unit (e + w)) pβ‚€ a b) := by
intro p q hpq
apply coordinateAffine_injective pβ‚€ hab
apply sub_eq_zero.mp
apply (transverse_projection_eq_zero_iff he hw ?_).mp
Β· change projLinear (unit (e + w))
(coordinateAffine pβ‚€ a b p - coordinateAffine pβ‚€ a b q) = 0
rw [map_sub]
exact sub_eq_zero.mpr hpq
Β· change inner ℝ e
((pβ‚€ + p.1 β€’ a + p.2 β€’ b) - (pβ‚€ + q.1 β€’ a + q.2 β€’ b)) = 0
simp only [inner_sub_right, inner_add_right, inner_smul_right, ha, hb,
mul_zero, add_zero, sub_self]
theorem projectedCoordinateAffine_convex_iff (pβ‚€ : Space) {e w a b : Space}
(he : β€–eβ€– = 1) (hw : inner ℝ e w = 0)
(ha : inner ℝ e a = 0) (hb : inner ℝ e b = 0)
(hab : LinearIndependent ℝ (![a,b] : Fin 2 β†’ Space)) (S : Set (ℝ Γ— ℝ)) :
Convex ℝ (projectedCoordinateAffine (unit (e + w)) pβ‚€ a b '' S) ↔ Convex ℝ S := by
constructor
Β· intro h
have hpre := h.affine_preimage (projectedCoordinateAffine (unit (e + w)) pβ‚€ a b)
rwa [Set.preimage_image_eq _
(projectedCoordinateAffine_injective pβ‚€ he hw ha hb hab)] at hpre
Β· exact fun h => h.affine_image _
theorem projectedCoordinateAffine_affineIndependent_iff
(pβ‚€ : Space) {e w a b : Space}
(he : β€–eβ€– = 1) (hw : inner ℝ e w = 0)
(ha : inner ℝ e a = 0) (hb : inner ℝ e b = 0)
(hab : LinearIndependent ℝ (![a,b] : Fin 2 β†’ Space))
{ΞΉ : Type*} (p : ΞΉ β†’ ℝ Γ— ℝ) :
AffineIndependent ℝ (projectedCoordinateAffine (unit (e + w)) pβ‚€ a b ∘ p) ↔
AffineIndependent ℝ p :=
(projectedCoordinateAffine (unit (e + w)) pβ‚€ a b).affineIndependent_iff
(projectedCoordinateAffine_injective pβ‚€ he hw ha hb hab)
theorem projectedCoordinateAffine_convexHull (u pβ‚€ a b : Space) (S : Set (ℝ Γ— ℝ)) :
projectedCoordinateAffine u pβ‚€ a b '' convexHull ℝ S =
convexHull ℝ (projectedCoordinateAffine u pβ‚€ a b '' S) :=
(projectedCoordinateAffine u pβ‚€ a b).image_convexHull S
end RadialProjection
end
end OAI