Skip to content

Commit 8c30986

Browse files
feat: port LinearAlgebra.ProjectiveSpace.Independence (#3728)
Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>
1 parent 45cc41e commit 8c30986

File tree

3 files changed

+142
-14
lines changed

3 files changed

+142
-14
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,7 @@ import Mathlib.LinearAlgebra.Pi
14511451
import Mathlib.LinearAlgebra.Prod
14521452
import Mathlib.LinearAlgebra.Projection
14531453
import Mathlib.LinearAlgebra.ProjectiveSpace.Basic
1454+
import Mathlib.LinearAlgebra.ProjectiveSpace.Independence
14541455
import Mathlib.LinearAlgebra.Quotient
14551456
import Mathlib.LinearAlgebra.QuotientPi
14561457
import Mathlib.LinearAlgebra.Ray

Mathlib/LinearAlgebra/Dfinsupp.lean

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -550,24 +550,26 @@ See also `CompleteLattice.Independent.linearIndependent'`. -/
550550
theorem Independent.linearIndependent [NoZeroSMulDivisors R N] (p : ι → Submodule R N)
551551
(hp : Independent p) {v : ι → N} (hv : ∀ i, v i ∈ p i) (hv' : ∀ i, v i ≠ 0) :
552552
LinearIndependent R v := by
553-
classical
554-
rw [linearIndependent_iff]
555-
intro l hl
556-
let a :=
557-
Dfinsupp.mapRange.linearMap (fun i => LinearMap.toSpanSingleton R (p i) ⟨v i, hv i⟩)
558-
l.toDfinsupp
559-
have ha : a = 0 := by
560-
apply hp.dfinsupp_lsum_injective
561-
rwa [← lsum_comp_mapRange_toSpanSingleton _ hv] at hl
562-
ext i
563-
apply smul_left_injective R (hv' i)
564-
have : l i • v i = a i := rfl
565-
simp only [coe_zero, Pi.zero_apply, ZeroMemClass.coe_zero, smul_eq_zero, ha] at this
566-
simpa
553+
let _ := Classical.decEq ι
554+
let _ := Classical.decEq R
555+
rw [linearIndependent_iff]
556+
intro l hl
557+
let a :=
558+
Dfinsupp.mapRange.linearMap (fun i => LinearMap.toSpanSingleton R (p i) ⟨v i, hv i⟩)
559+
l.toDfinsupp
560+
have ha : a = 0 := by
561+
apply hp.dfinsupp_lsum_injective
562+
rwa [← lsum_comp_mapRange_toSpanSingleton _ hv] at hl
563+
ext i
564+
apply smul_left_injective R (hv' i)
565+
have : l i • v i = a i := rfl
566+
simp only [coe_zero, Pi.zero_apply, ZeroMemClass.coe_zero, smul_eq_zero, ha] at this
567+
simpa
567568
#align complete_lattice.independent.linear_independent CompleteLattice.Independent.linearIndependent
568569

569570
theorem independent_iff_linearIndependent_of_ne_zero [NoZeroSMulDivisors R N] {v : ι → N}
570571
(h_ne_zero : ∀ i, v i ≠ 0) : (Independent fun i => R ∙ v i) ↔ LinearIndependent R v :=
572+
let _ := Classical.decEq ι
571573
fun hv => hv.linearIndependent _ (fun i => Submodule.mem_span_singleton_self <| v i) h_ne_zero,
572574
fun hv => hv.independent_span_singleton⟩
573575
#align complete_lattice.independent_iff_linear_independent_of_ne_zero CompleteLattice.independent_iff_linearIndependent_of_ne_zero
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/-
2+
Copyright (c) 2022 Michael Blyth. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Michael Blyth
5+
6+
! This file was ported from Lean 3 source module linear_algebra.projective_space.independence
7+
! leanprover-community/mathlib commit 1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.LinearAlgebra.ProjectiveSpace.Basic
12+
13+
/-!
14+
# Independence in Projective Space
15+
16+
In this file we define independence and dependence of families of elements in projective space.
17+
18+
## Implementation Details
19+
20+
We use an inductive definition to define the independence of points in projective
21+
space, where the only constructor assumes an independent family of vectors from the
22+
ambient vector space. Similarly for the definition of dependence.
23+
24+
## Results
25+
26+
- A family of elements is dependent if and only if it is not independent.
27+
- Two elements are dependent if and only if they are equal.
28+
29+
# Future Work
30+
31+
- Define collinearity in projective space.
32+
- Prove the axioms of a projective geometry are satisfied by the dependence relation.
33+
- Define projective linear subspaces.
34+
-/
35+
36+
37+
variable {ι K V : Type _} [Field K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V}
38+
39+
namespace Projectivization
40+
41+
/-- A linearly independent family of nonzero vectors gives an independent family of points
42+
in projective space. -/
43+
inductive Independent : (ι → ℙ K V) → Prop
44+
| mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) :
45+
Independent fun i => mk K (f i) (hf i)
46+
#align projectivization.independent Projectivization.Independent
47+
48+
/-- A family of points in a projective space is independent if and only if the representative
49+
vectors determined by the family are linearly independent. -/
50+
theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by
51+
refine' ⟨_, fun h => _⟩
52+
· rintro ⟨ff, hff, hh⟩
53+
choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i)
54+
convert hh.units_smul a
55+
ext i
56+
exact (ha i).symm
57+
· convert Independent.mk _ _ h
58+
· simp only [mk_rep, Function.comp_apply]
59+
· intro i
60+
apply rep_nonzero
61+
#align projectivization.independent_iff Projectivization.independent_iff
62+
63+
/-- A family of points in projective space is independent if and only if the family of
64+
submodules which the points determine is independent in the lattice-theoretic sense. -/
65+
theorem independent_iff_completeLattice_independent :
66+
Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by
67+
refine' ⟨_, fun h => _⟩
68+
· rintro ⟨f, hf, hi⟩
69+
simp only [submodule_mk]
70+
exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi
71+
· rw [independent_iff]
72+
refine' h.linearIndependent (Projectivization.submodule ∘ f) (fun i => _) fun i => _
73+
· simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _
74+
· exact rep_nonzero (f i)
75+
#align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent
76+
77+
/-- A linearly dependent family of nonzero vectors gives a dependent family of points
78+
in projective space. -/
79+
inductive Dependent : (ι → ℙ K V) → Prop
80+
| mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (h : ¬LinearIndependent K f) :
81+
Dependent fun i => mk K (f i) (hf i)
82+
#align projectivization.dependent Projectivization.Dependent
83+
84+
/-- A family of points in a projective space is dependent if and only if their
85+
representatives are linearly dependent. -/
86+
theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f) := by
87+
refine' ⟨_, fun h => _⟩
88+
· rintro ⟨ff, hff, hh1⟩
89+
contrapose! hh1
90+
choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i)
91+
convert hh1.units_smul a⁻¹
92+
ext i
93+
simp only [← ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply]
94+
· convert Dependent.mk _ _ h
95+
· simp only [mk_rep, Function.comp_apply]
96+
· exact fun i => rep_nonzero (f i)
97+
#align projectivization.dependent_iff Projectivization.dependent_iff
98+
99+
/-- Dependence is the negation of independence. -/
100+
theorem dependent_iff_not_independent : Dependent f ↔ ¬Independent f := by
101+
rw [dependent_iff, independent_iff]
102+
#align projectivization.dependent_iff_not_independent Projectivization.dependent_iff_not_independent
103+
104+
/-- Independence is the negation of dependence. -/
105+
theorem independent_iff_not_dependent : Independent f ↔ ¬Dependent f := by
106+
rw [dependent_iff_not_independent, Classical.not_not]
107+
#align projectivization.independent_iff_not_dependent Projectivization.independent_iff_not_dependent
108+
109+
/-- Two points in a projective space are dependent if and only if they are equal. -/
110+
@[simp]
111+
theorem dependent_pair_iff_eq (u v : ℙ K V) : Dependent ![u, v] ↔ u = v := by
112+
rw [dependent_iff_not_independent, independent_iff, linearIndependent_fin2,
113+
Function.comp_apply, Matrix.cons_val_one, Matrix.head_cons, Ne.def]
114+
simp only [Matrix.cons_val_zero, not_and, not_forall, Classical.not_not, Function.comp_apply,
115+
← mk_eq_mk_iff' K _ _ (rep_nonzero u) (rep_nonzero v), mk_rep, imp_iff_right_iff]
116+
exact Or.inl (rep_nonzero v)
117+
#align projectivization.dependent_pair_iff_eq Projectivization.dependent_pair_iff_eq
118+
119+
/-- Two points in a projective space are independent if and only if the points are not equal. -/
120+
@[simp]
121+
theorem independent_pair_iff_neq (u v : ℙ K V) : Independent ![u, v] ↔ u ≠ v := by
122+
rw [independent_iff_not_dependent, dependent_pair_iff_eq u v]
123+
#align projectivization.independent_pair_iff_neq Projectivization.independent_pair_iff_neq
124+
125+
end Projectivization

0 commit comments

Comments
 (0)