Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a33315d

Browse files
abentkampmergify[bot]
authored andcommitted
feat(linear_algebra/dim): findim equivalence (#1217)
* feat(linear_algebra/dim): findim equivalence * feat(linear_algebra/dim): two versions of dim_fun * feat(linear_algebra/dim): clean up
1 parent 3e77fec commit a33315d

File tree

3 files changed

+63
-14
lines changed

3 files changed

+63
-14
lines changed

src/linear_algebra/dimension.lean

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import linear_algebra.basis
99
import set_theory.ordinal
1010
noncomputable theory
1111

12-
universes u v v' w w'
12+
universes u u' u'' v v' w w'
1313

1414
variables {α : Type u} {β γ δ ε : Type v}
15-
variables {ι : Type w} {ι' : Type w'} {η : Type u} {φ : η → Type u}
15+
variables {ι : Type w} {ι' : Type w'} {η : Type u''} {φ : η → Type u'}
1616
-- TODO: relax these universe constraints
1717

1818
section vector_space
@@ -313,12 +313,20 @@ begin
313313
simp [λ i, (hb i).mk_range_eq_dim.symm, cardinal.sum_mk]
314314
end
315315

316-
lemma dim_fun {β : Type u} [add_comm_group β] [vector_space α β] :
316+
lemma dim_funη : Type u} [fintype η] [add_comm_group β] [vector_space α β] :
317317
vector_space.dim α (η → β) = fintype.card η * vector_space.dim α β :=
318318
by rw [dim_pi, cardinal.sum_const, cardinal.fintype_card]
319319

320+
lemma dim_fun_eq_lift_mul :
321+
vector_space.dim α (η → β) = (fintype.card η : cardinal.{max u'' v}) *
322+
cardinal.lift.{v u''} (vector_space.dim α β) :=
323+
by rw [dim_pi, cardinal.sum_const_eq_lift_mul, cardinal.fintype_card, cardinal.lift_nat_cast]
324+
320325
lemma dim_fun' : vector_space.dim α (η → α) = fintype.card η :=
321-
by rw [dim_fun, dim_of_field α, mul_one]
326+
by rw [dim_fun_eq_lift_mul, dim_of_field α, cardinal.lift_one, mul_one, cardinal.nat_cast_inj]
327+
328+
lemma dim_fin_fun (n : ℕ) : dim α (fin n → α) = n :=
329+
by simp [dim_fun']
322330

323331
end fintype
324332

src/linear_algebra/finsupp_vector_space.lean

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,36 +80,63 @@ end dim
8080
end finsupp
8181

8282
section vector_space
83-
universes u v
84-
variables {α : Type u} {β γ : Type v}
83+
/- We use `universe variables` instead of `universes` here because universes introduced by the
84+
`universes` keyword do not get replaced by metavariables once a lemma has been proven. So if you
85+
prove a lemma using universe `u`, you can only apply it to universe `u` in other lemmas of the
86+
same section. -/
87+
universe variables u v w
88+
variables {α : Type u} {β γ : Type v} {β' : Type v} {γ' : Type w}
8589
variables [discrete_field α]
8690
variables [add_comm_group β] [vector_space α β]
8791
variables [add_comm_group γ] [vector_space α γ]
92+
variables [add_comm_group β'] [vector_space α β']
93+
variables [add_comm_group γ'] [vector_space α γ']
8894

8995
open vector_space
9096

9197
set_option class.instance_max_depth 70
9298

93-
lemma equiv_of_dim_eq_dim [decidable_eq β] [decidable_eq γ] (h : dim α β = dim α γ) :
94-
nonempty (β ≃ₗ[α] γ) :=
99+
lemma equiv_of_dim_eq_lift_dim
100+
(h : cardinal.lift.{v w} (dim α β') = cardinal.lift.{w v} (dim α γ')) :
101+
nonempty (β' ≃ₗ[α] γ') :=
95102
begin
96-
rcases exists_is_basis α β with ⟨b, hb⟩,
97-
rcases exists_is_basis α γ with ⟨c, hc⟩,
98-
rw [← cardinal.lift_inj, ← hb.mk_eq_dim, ← hc.mk_eq_dim, cardinal.lift_inj] at h,
103+
haveI := classical.dec_eq β',
104+
haveI := classical.dec_eq γ',
105+
rcases exists_is_basis α β' with ⟨b, hb⟩,
106+
rcases exists_is_basis α γ' with ⟨c, hc⟩,
107+
rw [←cardinal.lift_inj.1 hb.mk_eq_dim, ←cardinal.lift_inj.1 hc.mk_eq_dim] at h,
99108
rcases quotient.exact h with ⟨e⟩,
109+
let e := (equiv.ulift.symm.trans e).trans equiv.ulift,
100110
exact ⟨((module_equiv_finsupp hb).trans
101111
(finsupp.dom_lcongr e)).trans
102112
(module_equiv_finsupp hc).symm⟩,
103113
end
104114

105-
lemma eq_bot_iff_dim_eq_zero [decidable_eq β] (p : submodule α β) (h : dim α p = 0) : p = ⊥ :=
115+
def equiv_of_dim_eq_dim (h : dim α β = dim α γ) : β ≃ₗ[α] γ :=
116+
begin
117+
classical,
118+
exact classical.choice (equiv_of_dim_eq_lift_dim (cardinal.lift_inj.2 h))
119+
end
120+
121+
lemma fin_dim_vectorspace_equiv (n : ℕ)
122+
(hn : (dim α β) = n) : β ≃ₗ[α] (fin n → α) :=
123+
begin
124+
have : cardinal.lift.{v u} (n : cardinal.{v}) = cardinal.lift.{u v} (n : cardinal.{u}),
125+
by simp,
126+
have hn := cardinal.lift_inj.{v u}.2 hn,
127+
rw this at hn,
128+
rw ←@dim_fin_fun α _ n at hn,
129+
exact classical.choice (equiv_of_dim_eq_lift_dim hn),
130+
end
131+
132+
lemma eq_bot_iff_dim_eq_zero (p : submodule α β) (h : dim α p = 0) : p = ⊥ :=
106133
begin
107134
have : dim α p = dim α (⊥ : submodule α β) := by rwa [dim_bot],
108-
rcases equiv_of_dim_eq_dim this with ⟨e⟩,
135+
let e := equiv_of_dim_eq_dim this,
109136
exact e.eq_bot_of_equiv _
110137
end
111138

112-
lemma injective_of_surjective [decidable_eq β] [decidable_eq γ] (f : β →ₗ[α] γ)
139+
lemma injective_of_surjective (f : β →ₗ[α] γ)
113140
(hβ : dim α β < cardinal.omega) (heq : dim α γ = dim α β) (hf : f.range = ⊤) : f.ker = ⊥ :=
114141
have hk : dim α f.ker < cardinal.omega := lt_of_le_of_lt (dim_submodule_le _) hβ,
115142
begin

src/set_theory/cardinal.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,20 @@ calc lift.{u (max v w)} a = lift.{v (max u w)} b
505505
= lift.{(max u v) w} (lift.{v u} b) : by simp
506506
... ↔ lift.{u v} a = lift.{v u} b : lift_inj
507507

508+
theorem mk_prod {α : Type u} {β : Type v} :
509+
mk (α × β) = lift.{u v} (mk α) * lift.{v u} (mk β) :=
510+
quotient.sound ⟨equiv.prod_congr (equiv.ulift).symm (equiv.ulift).symm⟩
511+
512+
theorem sum_const_eq_lift_mul (ι : Type u) (a : cardinal.{v}) :
513+
sum (λ _:ι, a) = lift.{u v} (mk ι) * lift.{v u} a :=
514+
begin
515+
apply quotient.induction_on a,
516+
intro α,
517+
simp only [cardinal.mk_def, cardinal.sum_mk, cardinal.lift_id],
518+
convert mk_prod using 1,
519+
exact quotient.sound ⟨equiv.sigma_equiv_prod ι α⟩,
520+
end
521+
508522
/-- `ω` is the smallest infinite cardinal, also known as ℵ₀. -/
509523
def omega : cardinal.{u} := lift (mk ℕ)
510524

0 commit comments

Comments
 (0)