|
| 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 |
0 commit comments