Skip to content

Commit 04a0488

Browse files
committed
feat(LinearAlgebra): the Erdős-Kaplansky theorem (#9159)
The dimension of an infinite dimensional dual space is equal to its cardinality. As a consequence (`linearEquiv_dual_iff_finiteDimensional`), a vector space is isomorphic to its dual iff it's finite dimensional. The [main argument](https://github.com/leanprover-community/mathlib4/pull/9159/files#diff-cb173017e1157ddc4b9f868be06c18ec2a38f8cf82e856e18d59ed49f97395d8R146) is from https://mathoverflow.net/a/168624. There is a [slicker proof](https://mathoverflow.net/a/420455/3332) in the field case but Vandermonde determinants don't work in a non-commutative ring. Resolves [TODO item](https://leanprover-community.github.io/mathlib4_docs/Mathlib/LinearAlgebra/Dual.html#TODO) posed by Julian Külshammer - [x] depends on: #8941 - [x] depends on: #8942 Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
1 parent 71bf288 commit 04a0488

File tree

3 files changed

+149
-6
lines changed

3 files changed

+149
-6
lines changed

Mathlib/LinearAlgebra/Dimension.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ protected irreducible_def Module.rank : Cardinal :=
108108
⨆ ι : { s : Set V // LinearIndependent K ((↑) : s → V) }, (#ι.1)
109109
#align module.rank Module.rank
110110

111+
theorem rank_le_card : Module.rank K V ≤ #V :=
112+
(Module.rank_def _ _).trans_le (ciSup_le' fun _ ↦ mk_set_le _)
113+
111114
lemma nonempty_linearIndependent_set : Nonempty {s : Set V // LinearIndependent K ((↑) : s → V)} :=
112115
⟨⟨∅, linearIndependent_empty _ _⟩⟩
113116

@@ -1672,8 +1675,8 @@ theorem rank_finset_sum_le {η} (s : Finset η) (f : η → V →ₗ[K] V') :
16721675
#align linear_map.rank_finset_sum_le LinearMap.rank_finset_sum_le
16731676

16741677
theorem le_rank_iff_exists_linearIndependent {c : Cardinal} {f : V →ₗ[K] V'} :
1675-
c ≤ rank f ↔ ∃ s : Set V, Cardinal.lift.{v'} #s =
1676-
Cardinal.lift.{v} c ∧ LinearIndependent K fun x : s => f x := by
1678+
c ≤ rank f ↔ ∃ s : Set V,
1679+
Cardinal.lift.{v'} #s = Cardinal.lift.{v} c ∧ LinearIndependent K (fun x : s => f x) := by
16771680
rcases f.rangeRestrict.exists_rightInverse_of_surjective f.range_rangeRestrict with ⟨g, hg⟩
16781681
have fg : LeftInverse f.rangeRestrict g := LinearMap.congr_fun hg
16791682
refine' ⟨fun h => _, _⟩

Mathlib/LinearAlgebra/Dual.lean

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ The dual space of an $R$-module $M$ is the $R$-module of $R$-linear maps $M \to
9090
* `Subspace.dualQuotDistrib W` is an equivalence
9191
`Dual K (V₁ ⧸ W) ≃ₗ[K] Dual K V₁ ⧸ W.dualLift.range` from an arbitrary choice of
9292
splitting of `V₁`.
93-
94-
## TODO
95-
96-
Erdős-Kaplansky theorem about the dimension of a dual vector space in case of infinite dimension.
9793
-/
9894

9995
noncomputable section
@@ -408,6 +404,18 @@ theorem toDualEquiv_apply (m : M) : b.toDualEquiv m = b.toDual m :=
408404
rfl
409405
#align basis.to_dual_equiv_apply Basis.toDualEquiv_apply
410406

407+
-- Not sure whether this is true for free modules over a commutative ring
408+
/-- A vector space over a field is isomorphic to its dual if and only if it is finite-dimensional:
409+
a consequence of the Erdős-Kaplansky theorem. -/
410+
theorem linearEquiv_dual_iff_finiteDimensional [Field K] [AddCommGroup V] [Module K V] :
411+
Nonempty (V ≃ₗ[K] Dual K V) ↔ FiniteDimensional K V := by
412+
refine ⟨fun ⟨e⟩ ↦ ?_, fun h ↦ ⟨(Module.Free.chooseBasis K V).toDualEquiv⟩⟩
413+
rw [FiniteDimensional, ← Module.rank_lt_alpeh0_iff]
414+
by_contra!
415+
apply (lift_rank_lt_rank_dual this).ne
416+
have := e.lift_rank_eq
417+
rwa [lift_umax.{uV,uK}, lift_id'.{uV,uK}] at this
418+
411419
/-- Maps a basis for `V` to a basis for the dual space. -/
412420
def dualBasis : Basis ι R (Dual R M) :=
413421
b.map b.toDualEquiv

Mathlib/LinearAlgebra/FreeModule/Rank.lean

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Riccardo Brasca
55
-/
66
import Mathlib.LinearAlgebra.Dimension
7+
import Mathlib.SetTheory.Cardinal.Subfield
78

89
#align_import linear_algebra.free_module.rank from "leanprover-community/mathlib"@"465d4301d8da5945ef1dc1b29fb34c2f2b315ac4"
910

@@ -13,6 +14,10 @@ import Mathlib.LinearAlgebra.Dimension
1314
1415
This file contains some extra results not in `LinearAlgebra.Dimension`.
1516
17+
It also contains a proof of the Erdős-Kaplansky theorem (`rank_dual_eq_card_dual_of_aleph0_le_rank`)
18+
which says that the dimension of an infinite-dimensional dual space over a division ring
19+
has dimension equal to its cardinality.
20+
1621
-/
1722

1823

@@ -57,6 +62,19 @@ theorem rank_finsupp_self (ι : Type w) : Module.rank R (ι →₀ R) = Cardinal
5762
theorem rank_finsupp_self' {ι : Type u} : Module.rank R (ι →₀ R) = #ι := by simp
5863
#align rank_finsupp_self' rank_finsupp_self'
5964

65+
variable {R M}
66+
theorem rank_eq_cardinal_basis {ι : Type w} (b : Basis ι R M) :
67+
Cardinal.lift.{w} (Module.rank R M) = Cardinal.lift.{v} #ι := by
68+
apply Cardinal.lift_injective.{u}
69+
simp_rw [Cardinal.lift_lift]
70+
have := b.repr.lift_rank_eq
71+
rwa [rank_finsupp_self, Cardinal.lift_lift] at this
72+
73+
theorem rank_eq_cardinal_basis' {ι : Type v} (b : Basis ι R M) : Module.rank R M = #ι :=
74+
Cardinal.lift_injective.{v} (rank_eq_cardinal_basis b)
75+
76+
variable (R M)
77+
6078
/-- The rank of the direct sum is the sum of the ranks. -/
6179
@[simp]
6280
theorem rank_directSum {ι : Type v} (M : ι → Type w) [∀ i : ι, AddCommGroup (M i)]
@@ -123,3 +141,117 @@ theorem rank_tensorProduct' (N : Type v) [AddCommGroup N] [Module R N] [Module.F
123141
#align rank_tensor_product' rank_tensorProduct'
124142

125143
end CommRing
144+
145+
section DivisionRing
146+
147+
variable (K : Type u) [DivisionRing K]
148+
149+
/-- Key lemma towards the Erdős-Kaplansky theorem from https://mathoverflow.net/a/168624 -/
150+
theorem max_aleph0_card_le_rank_fun_nat : max ℵ₀ #K ≤ Module.rank K (ℕ → K) := by
151+
have aleph0_le : ℵ₀ ≤ Module.rank K (ℕ → K) := (rank_finsupp_self K ℕ).symm.trans_le
152+
(Finsupp.lcoeFun.rank_le_of_injective <| by exact FunLike.coe_injective)
153+
refine max_le aleph0_le ?_
154+
obtain card_K | card_K := le_or_lt #K ℵ₀
155+
· exact card_K.trans aleph0_le
156+
by_contra!
157+
obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ℕ → K)
158+
let L := Subfield.closure (Set.range (fun i : ιK × ℕ ↦ bK i.1 i.2))
159+
have hLK : #L < #K
160+
· refine (Subfield.cardinal_mk_closure_le_max _).trans_lt
161+
(max_lt_iff.mpr ⟨mk_range_le.trans_lt ?_, card_K⟩)
162+
rwa [mk_prod, ← aleph0, lift_uzero, ← rank_eq_cardinal_basis' bK, mul_aleph0_eq aleph0_le]
163+
letI := Module.compHom K (RingHom.op L.subtype)
164+
obtain ⟨⟨ιL, bL⟩⟩ := Module.Free.exists_basis (R := Lᵐᵒᵖ) (M := K)
165+
have card_ιL : ℵ₀ ≤ #ιL
166+
· contrapose! hLK
167+
haveI := @Fintype.ofFinite _ (lt_aleph0_iff_finite.mp hLK)
168+
rw [bL.repr.toEquiv.cardinal_eq, mk_finsupp_of_fintype,
169+
← MulOpposite.opEquiv.cardinal_eq] at card_K ⊢
170+
apply power_nat_le
171+
contrapose! card_K
172+
exact (power_lt_aleph0 card_K <| nat_lt_aleph0 _).le
173+
obtain ⟨e⟩ := lift_mk_le'.mp (card_ιL.trans_eq (lift_uzero #ιL).symm)
174+
have rep_e := bK.total_repr (bL ∘ e)
175+
rw [Finsupp.total_apply, Finsupp.sum] at rep_e
176+
set c := bK.repr (bL ∘ e)
177+
set s := c.support
178+
let f i (j : s) : L := ⟨bK j i, Subfield.subset_closure ⟨(j, i), rfl⟩⟩
179+
have : ¬LinearIndependent Lᵐᵒᵖ f := fun h ↦ by
180+
have := h.cardinal_lift_le_rank
181+
rw [lift_uzero, (LinearEquiv.piCongrRight fun _ ↦ MulOpposite.opLinearEquiv Lᵐᵒᵖ).rank_eq,
182+
rank_fun'] at this
183+
exact (nat_lt_aleph0 _).not_le this
184+
obtain ⟨t, g, eq0, i, hi, hgi⟩ := not_linearIndependent_iff.mp this
185+
refine hgi (linearIndependent_iff'.mp (bL.linearIndependent.comp e e.injective) t g ?_ i hi)
186+
clear_value c s
187+
simp_rw [← rep_e, Finset.sum_apply, Pi.smul_apply, Finset.smul_sum]
188+
rw [Finset.sum_comm]
189+
refine Finset.sum_eq_zero fun i hi ↦ ?_
190+
replace eq0 := congr_arg L.subtype (congr_fun eq0 ⟨i, hi⟩)
191+
rw [Finset.sum_apply, map_sum] at eq0
192+
have : SMulCommClass Lᵐᵒᵖ K K := ⟨fun _ _ _ ↦ mul_assoc _ _ _⟩
193+
simp_rw [smul_comm _ (c i), ← Finset.smul_sum]
194+
erw [eq0, smul_zero]
195+
196+
variable {K}
197+
198+
open Function in
199+
theorem rank_fun_infinite {ι : Type v} [hι : Infinite ι] : Module.rank K (ι → K) = #(ι → K) := by
200+
obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ι → K)
201+
obtain ⟨e⟩ := lift_mk_le'.mp ((aleph0_le_mk_iff.mpr hι).trans_eq (lift_uzero #ι).symm)
202+
have := LinearMap.lift_rank_le_of_injective _ <|
203+
LinearMap.funLeft_injective_of_surjective K K _ (invFun_surjective e.injective)
204+
rw [lift_umax.{u,v}, lift_id'.{u,v}] at this
205+
have key := (lift_le.{v}.mpr <| max_aleph0_card_le_rank_fun_nat K).trans this
206+
rw [lift_max, lift_aleph0, max_le_iff] at key
207+
haveI : Infinite ιK := by
208+
rw [← aleph0_le_mk_iff, ← rank_eq_cardinal_basis' bK]; exact key.1
209+
rw [bK.repr.toEquiv.cardinal_eq, mk_finsupp_lift_of_infinite,
210+
lift_umax.{u,v}, lift_id'.{u,v}, ← rank_eq_cardinal_basis' bK, eq_comm, max_eq_left]
211+
exact key.2
212+
213+
/-- The **Erdős-Kaplansky Theorem**: the dual of an infinite-dimensional vector space
214+
over a division ring has dimension equal to its cardinality. -/
215+
theorem rank_dual_eq_card_dual_of_aleph0_le_rank' {V : Type*} [AddCommGroup V] [Module K V]
216+
(h : ℵ₀ ≤ Module.rank K V) : Module.rank Kᵐᵒᵖ (V →ₗ[K] K) = #(V →ₗ[K] K) := by
217+
obtain ⟨⟨ι, b⟩⟩ := Module.Free.exists_basis (R := K) (M := V)
218+
rw [rank_eq_cardinal_basis' b, aleph0_le_mk_iff] at h
219+
have e := (b.constr Kᵐᵒᵖ (M' := K)).symm.trans
220+
(LinearEquiv.piCongrRight fun _ ↦ MulOpposite.opLinearEquiv Kᵐᵒᵖ)
221+
rw [e.rank_eq, e.toEquiv.cardinal_eq]
222+
apply rank_fun_infinite
223+
224+
/-- The **Erdős-Kaplansky Theorem** over a field. -/
225+
theorem rank_dual_eq_card_dual_of_aleph0_le_rank {K V} [Field K] [AddCommGroup V] [Module K V]
226+
(h : ℵ₀ ≤ Module.rank K V) : Module.rank K (V →ₗ[K] K) = #(V →ₗ[K] K) := by
227+
obtain ⟨⟨ι, b⟩⟩ := Module.Free.exists_basis (R := K) (M := V)
228+
rw [rank_eq_cardinal_basis' b, aleph0_le_mk_iff] at h
229+
have e := (b.constr K (M' := K)).symm
230+
rw [e.rank_eq, e.toEquiv.cardinal_eq]
231+
apply rank_fun_infinite
232+
233+
theorem lift_rank_lt_rank_dual' {V : Type v} [AddCommGroup V] [Module K V]
234+
(h : ℵ₀ ≤ Module.rank K V) :
235+
Cardinal.lift.{u} (Module.rank K V) < Module.rank Kᵐᵒᵖ (V →ₗ[K] K) := by
236+
obtain ⟨⟨ι, b⟩⟩ := Module.Free.exists_basis (R := K) (M := V)
237+
rw [rank_eq_cardinal_basis' b, rank_dual_eq_card_dual_of_aleph0_le_rank' h,
238+
← (b.constr ℕ (M' := K)).toEquiv.cardinal_eq, mk_arrow]
239+
apply cantor'
240+
erw [nat_lt_lift_iff, one_lt_iff_nontrivial]
241+
infer_instance
242+
243+
theorem lift_rank_lt_rank_dual {K : Type u} {V : Type v} [Field K] [AddCommGroup V] [Module K V]
244+
(h : ℵ₀ ≤ Module.rank K V) :
245+
Cardinal.lift.{u} (Module.rank K V) < Module.rank K (V →ₗ[K] K) := by
246+
rw [rank_dual_eq_card_dual_of_aleph0_le_rank h, ← rank_dual_eq_card_dual_of_aleph0_le_rank' h]
247+
exact lift_rank_lt_rank_dual' h
248+
249+
theorem rank_lt_rank_dual' {V : Type u} [AddCommGroup V] [Module K V] (h : ℵ₀ ≤ Module.rank K V) :
250+
Module.rank K V < Module.rank Kᵐᵒᵖ (V →ₗ[K] K) := by
251+
convert lift_rank_lt_rank_dual' h; rw [lift_id]
252+
253+
theorem rank_lt_rank_dual {K V : Type u} [Field K] [AddCommGroup V] [Module K V]
254+
(h : ℵ₀ ≤ Module.rank K V) : Module.rank K V < Module.rank K (V →ₗ[K] K) := by
255+
convert lift_rank_lt_rank_dual h; rw [lift_id]
256+
257+
end DivisionRing

0 commit comments

Comments
 (0)