Equations
- EuclideanGeometry.«termℝ²» = Lean.ParserDescr.node `EuclideanGeometry.«termℝ²» 1024 (Lean.ParserDescr.symbol "ℝ²")
Instances For
Oriented angles make sense in 2d.
Note: this can't blindly be added to mathlib as it creates an "instance diamond"
with an instance for modules satisfying is_empty
.
Equations
- Module.orientedEuclideanSpaceFinTwo = { positiveOrientation := (Pi.basisFun ℝ (Fin 2)).orientation }
instance
fact_finrank_euclideanSpace_fin_two :
Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin 2)) = 2)
Two dimensional euclidean space is two-dimensional.
def
EuclideanGeometry.IsCcwConvexPolygon
{V : Type u_1}
{P : Type u_2}
{n : ℕ}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(p : Fin n → P)
:
The statement that a sequence of points form a counter-clockwise convex polygon.
Equations
- EuclideanGeometry.IsCcwConvexPolygon p = ∀ ⦃i j k : Fin n⦄, i < j → j < k → (EuclideanGeometry.oangle (p i) (p j) (p k)).sign = 1
Instances For
theorem
EuclideanGeometry.IsCcwConvexPolygon.sign_oangle
{V : Type u_1}
{P : Type u_2}
{n : ℕ}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{p : Fin n → P}
(hp : IsCcwConvexPolygon p)
{i j k : Fin n}
(hij : i < j)
(hjk : j < k)
:
theorem
EuclideanGeometry.IsCcwConvexPolygon.sign_oangle'
{V : Type u_1}
{P : Type u_2}
{n : ℕ}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{p : Fin n → P}
(hp : IsCcwConvexPolygon p)
{i j k : Fin n}
(hij : i < j)
(hjk : j < k)
:
theorem
EuclideanGeometry.IsCcwConvexPolygon.sign_oangle''
{V : Type u_1}
{P : Type u_2}
{n : ℕ}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{p : Fin n → P}
(hp : IsCcwConvexPolygon p)
{i j k : Fin n}
(hij : i < j)
(hjk : j < k)
:
theorem
EuclideanGeometry.IsCcwConvexPolygon.sign_oangle_finRotate
{V : Type u_1}
{P : Type u_2}
{n : ℕ}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{p : Fin n → P}
(hp : IsCcwConvexPolygon p)
(hn : 3 ≤ n)
(i : Fin n)
:
@[simp]
theorem
EuclideanGeometry.isCcwConvexPolygon_zero
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(p : Fin 0 → P)
:
@[simp]
theorem
EuclideanGeometry.isCcwConvexPolygon_one
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(p : Fin 1 → P)
:
@[simp]
theorem
EuclideanGeometry.isCcwConvexPolygon_two
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(p : Fin 2 → P)
:
theorem
EuclideanGeometry.isCcwConvexPolygon_four'
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{p : Fin 4 → P}
:
@[simp]
theorem
EuclideanGeometry.isCcwConvexPolygon_four
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(A B C D : P)
:
def
EuclideanGeometry.IsConvexPolygon
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{n : ℕ}
(p : Fin n → P)
:
The statement that a sequence of points form a convex polygon.
Equations
- EuclideanGeometry.IsConvexPolygon p = (EuclideanGeometry.IsCcwConvexPolygon p ∨ EuclideanGeometry.IsCcwConvexPolygon fun (i : Fin n) => p (-i))
Instances For
theorem
EuclideanGeometry.isConvexPolygon_three_of_affineIndependent
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{A B C : P}
(hABC : AffineIndependent ℝ ![A, B, C])
:
IsConvexPolygon ![A, B, C]
Three affine independent points always form a convex polygon.
theorem
EuclideanGeometry.isConvexPolygon_three_iff_affineIndependent
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
{A B C : P}
:
theorem
EuclideanGeometry.isConvexPolygon_triangle
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(t : Affine.Triangle ℝ P)
:
noncomputable def
EuclideanGeometry.triangle_area
{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
[Module.Oriented ℝ V (Fin 2)]
[Fact (Module.finrank ℝ V = 2)]
(a b c : P)
:
Equations
- EuclideanGeometry.triangle_area a b c = (positiveOrientation.areaForm (a -ᵥ c)) (b -ᵥ c) / 2