Skip to content

Commit 803a372

Browse files
Whysoserioushahb-mehta
authored andcommitted
feat(Projectivization/Colinear): Define colinearity for points in projective spaces (leanprover-community#39786)
1 parent 4d43cf1 commit 803a372

5 files changed

Lines changed: 137 additions & 1 deletion

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,6 +5113,7 @@ public import Mathlib.LinearAlgebra.Projection
51135113
public import Mathlib.LinearAlgebra.Projectivization.Action
51145114
public import Mathlib.LinearAlgebra.Projectivization.Basic
51155115
public import Mathlib.LinearAlgebra.Projectivization.Cardinality
5116+
public import Mathlib.LinearAlgebra.Projectivization.Collinear
51165117
public import Mathlib.LinearAlgebra.Projectivization.Constructions
51175118
public import Mathlib.LinearAlgebra.Projectivization.Independence
51185119
public import Mathlib.LinearAlgebra.Projectivization.Subspace

Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ section DivisionRing
5353
variable [DivisionRing K] [AddCommGroup V] [Module K V] {V₂ : Type v'} [AddCommGroup V₂]
5454
[Module K V₂]
5555

56+
theorem finrank_le_iff_rank_le [FiniteDimensional K V] {n : ℕ} :
57+
finrank K V ≤ n ↔ Module.rank K V ≤ n := by
58+
simp [← Cardinal.toNat_le_iff_le_of_lt_aleph0 (rank_lt_aleph0 K V), finrank]
59+
60+
theorem finrank_lt_iff_rank_lt [FiniteDimensional K V] {n : ℕ} :
61+
finrank K V < n ↔ Module.rank K V < n := by
62+
simp [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0 (rank_lt_aleph0 K V), finrank]
63+
5664
theorem _root_.LinearIndependent.lt_aleph0_of_finiteDimensional {ι : Type w} [FiniteDimensional K V]
5765
{v : ι → V} (h : LinearIndependent K v) : #ι < ℵ₀ :=
5866
h.lt_aleph0_of_finite
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/-
2+
Copyright (c) 2026 Yunzhou Xie. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Edison Xie, Bhavik Mehta
5+
-/
6+
module
7+
8+
public import Mathlib.LinearAlgebra.Projectivization.Subspace
9+
public import Mathlib.LinearAlgebra.Projectivization.Independence
10+
public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas
11+
public import Mathlib.LinearAlgebra.FiniteDimensional.Basic
12+
13+
/-!
14+
15+
# Collinearity in Projective Space
16+
17+
This file defines collinearity of points in projective space and proves
18+
the uniqueness of the line through two distinct points.
19+
20+
## Main Results
21+
22+
* `Projectivization.IsCollinear`: A family of points in projective space is collinear if there
23+
exists a submodule of dimension at most 2 containing all points in the family.
24+
* `Projectivization.line_unique`: Given two distinct points in projective space, there is a unique
25+
line (submodule of dimension 2) containing both points.
26+
27+
## Tags
28+
Projective space, collinearity, projective geometry
29+
30+
-/
31+
32+
@[expose] public section
33+
34+
variable {K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V]
35+
(M : Submodule K V) (S : Set (Projectivization K V))
36+
37+
namespace Projectivization
38+
39+
/-- If there exists a submodule of dimension at most `2` containing all points in
40+
`S`, then `S` is collinear. The finite-dimensionality is required so that this notion is
41+
meaningful even when `V` is infinite-dimensional. -/
42+
def IsCollinear : Prop := ∃ (M : Subspace K V), Module.Finite K M.submodule ∧
43+
Module.finrank K M.submodule ≤ 2 ∧ S ⊆ M
44+
45+
lemma IsCollinear_iff : IsCollinear S ↔ ∃ (M : Subspace K V), Module.Finite K M.submodule ∧
46+
Module.finrank K M.submodule ≤ 2 ∧ S ⊆ M := Iff.rfl
47+
48+
lemma IsCollinear_iff_rank :
49+
IsCollinear S ↔
50+
∃ (M : Subspace K V), Module.rank K M.submodule ≤ 2 ∧ S ⊆ M := by
51+
rw [IsCollinear_iff]
52+
refine ⟨fun ⟨M, hM1, hM2, hM3⟩ ↦ ⟨M, ?_, hM3⟩, fun ⟨M, hM1, hM2⟩ ↦ ⟨M, ?_, ?_, hM2⟩⟩
53+
· exact FiniteDimensional.finrank_le_iff_rank_le (K := K) (V := M.submodule) (n := 2)|>.1 hM2
54+
· exact Module.rank_lt_aleph0_iff.1 (hM1.trans_lt (by norm_num))
55+
· exact Module.finrank_le_of_rank_le hM1
56+
57+
@[simp]
58+
lemma isCollinear_empty : IsCollinear (∅ : Set (Projectivization K V)) := by
59+
rw [IsCollinear_iff_rank]
60+
use ⊥
61+
rw [map_bot]
62+
simp
63+
64+
open scoped LinearAlgebra.Projectivization
65+
66+
lemma isCollinear_subset (s t : Set (ℙ K V)) (hst : s ⊆ t) (h : IsCollinear t) : IsCollinear s := by
67+
obtain ⟨M, hMfin, hM1, hM2⟩ := h
68+
exact ⟨M, hMfin, hM1, hst.trans hM2⟩
69+
70+
@[simp]
71+
lemma isCollinear_singleton' (a : ℙ K V) : IsCollinear {a} := by
72+
induction a using ind with | h v hv =>
73+
refine ⟨(Submodule.span K {v}).projectivization, ?_, ?_, ?_⟩
74+
· rw [Subspace.submodule.apply_symm_apply]
75+
exact Module.Finite.span_of_finite _ (Set.toFinite _)
76+
· rw [Subspace.submodule.apply_symm_apply, finrank_span_singleton hv]
77+
omega
78+
· simp [Submodule.mem_span_of_mem]
79+
80+
lemma isCollinear_subsingleton (hS : S.Subsingleton) :
81+
IsCollinear S := by
82+
obtain hS' | ⟨x, hx⟩ := hS.eq_empty_or_singleton <;> simp_all
83+
84+
lemma isCollinear_pair (a b : ℙ K V) : IsCollinear {a, b} := by
85+
if h : a = b then simp [h] else
86+
induction a using Projectivization.ind with | h v hv =>
87+
induction b using Projectivization.ind with | h w hw =>
88+
rw [← ne_eq, ← independent_pair_iff_ne, independent_mk_iff_LinearIndependent] at h
89+
refine ⟨(Submodule.span K {v, w}).projectivization, ?_, ?_, fun s hs ↦ hs.casesOn ?_ ?_⟩
90+
· rw [Subspace.submodule.apply_symm_apply]
91+
exact Module.Finite.span_of_finite _ (Set.toFinite _)
92+
· rw [Subspace.submodule.apply_symm_apply, ← Matrix.range_cons_cons_empty v w ![]]
93+
simp [finrank_span_eq_card h]
94+
all_goals rintro rfl; simp [Submodule.mem_span_of_mem]
95+
96+
lemma isCollinear_of_card_eq_two (hS : S.ncard = 2) : IsCollinear S := by
97+
obtain ⟨x, y, _, rfl⟩ := Set.ncard_eq_two.1 hS
98+
exact isCollinear_pair x y
99+
100+
lemma line_unique' {u v : V} (hu : u ≠ 0) (hv : v ≠ 0) (huv : LinearIndependent K ![u, v])
101+
(p : Submodule K V) (hp1 : Module.finrank K p = 2)
102+
(hp2 : mk K u hu ∈ p.projectivization) (hp3 : mk K v hv ∈ p.projectivization) :
103+
p = Submodule.span K {u, v} := by
104+
have h1 : Submodule.span K {u, v} ≤ p := by
105+
refine Submodule.span_le.2 fun x hx ↦ ?_
106+
simp only [Submodule.mk_mem_projectivization_iff] at hp2 hp3
107+
refine hx.casesOn ?_ ?_ <;> simp_all
108+
have : Module.Finite K p := Module.finite_of_finrank_eq_succ hp1
109+
refine Submodule.eq_of_le_of_finrank_eq h1 ?_ |>.symm
110+
rw [hp1, ← Matrix.range_cons_cons_empty _ _ ![]]
111+
simp [finrank_span_eq_card huv]
112+
113+
lemma line_unique {x y : ℙ K V} (hxy : x ≠ y) (p q : Submodule K V) (hp1 : Module.finrank K p = 2)
114+
(hq1 : Module.finrank K q = 2) (hp2 : x ∈ p.projectivization) (hp3 : y ∈ p.projectivization)
115+
(hq2 : x ∈ q.projectivization) (hq3 : y ∈ q.projectivization) : p = q := by
116+
induction x using ind with | h v hv =>
117+
induction y using ind with | h w hw =>
118+
rw [← independent_pair_iff_ne, independent_mk_iff_LinearIndependent] at hxy
119+
rw [line_unique' hv hw hxy p hp1 hp2 hp3, line_unique' hv hw hxy q hq1 hq2 hq3]
120+
121+
end Projectivization

Mathlib/LinearAlgebra/Projectivization/Independence.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ambient vector space. Similarly for the definition of dependence.
2525
2626
## Future Work
2727
28-
- Define collinearity in projective space.
2928
- Prove the axioms of a projective geometry are satisfied by the dependence relation.
3029
- Define projective linear subspaces.
3130
-/

Mathlib/LinearAlgebra/Projectivization/Subspace.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ theorem mem_submodule_iff (s : Projectivization.Subspace K V) {v : V} (hv : v
247247
v ∈ submodule s ↔ Projectivization.mk K v hv ∈ s :=
248248
fun h => h hv, fun h _ => h⟩
249249

250+
@[simp]
251+
lemma bot_coe : ((⊥ : Subspace K V) : Set (Projectivization K V)) = ∅ := by
252+
ext x
253+
simp only [SetLike.mem_coe, Set.mem_empty_iff_false, iff_false]
254+
induction x using ind with | h v hv =>
255+
rwa [← Subspace.mem_submodule_iff _ hv, Subspace.submodule.map_bot, Submodule.mem_bot]
256+
250257
end Subspace
251258

252259
end Projectivization

0 commit comments

Comments
 (0)