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

Commit 105935c

Browse files
committed
feat(linear_algebra/finite_dimensional): characterizations of finrank = 1 and ≤ 1 (#7354)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent f952dd1 commit 105935c

File tree

5 files changed

+131
-5
lines changed

5 files changed

+131
-5
lines changed

src/linear_algebra/affine_space/independent.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ begin
398398
intro he,
399399
rw vsub_eq_zero_iff_eq at he,
400400
exact h he.symm },
401-
exact linear_independent_unique hz
401+
exact linear_independent_unique _ hz
402402
end
403403

404404
end field

src/linear_algebra/basic.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,12 @@ lemma le_span_singleton_iff {s : submodule R M} {v₀ : M} :
948948
s ≤ (R ∙ v₀) ↔ ∀ v ∈ s, ∃ r : R, r • v₀ = v :=
949949
by simp_rw [set_like.le_def, mem_span_singleton]
950950

951+
lemma span_singleton_eq_top_iff (x : M) : (R ∙ x) = ⊤ ↔ ∀ v, ∃ r : R, r • x = v :=
952+
begin
953+
rw [eq_top_iff, le_span_singleton_iff],
954+
finish,
955+
end
956+
951957
@[simp] lemma span_zero_singleton : (R ∙ (0:M)) = ⊥ :=
952958
by { ext, simp [mem_span_singleton, eq_comm] }
953959

src/linear_algebra/basis.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,22 @@ end
343343

344344
end is_basis
345345

346+
lemma is_basis_singleton_iff
347+
{R : Type*} [ring R] [nontrivial R] [module R M] [no_zero_smul_divisors R M]
348+
(ι : Type*) [unique ι] (x : M) :
349+
is_basis R (λ (_ : ι), x) ↔ x ≠ 0 ∧ ∀ y : M, ∃ r : R, r • x = y :=
350+
begin
351+
fsplit,
352+
rintro ⟨li, sp⟩,
353+
fsplit,
354+
apply linear_independent.ne_zero (default ι) li,
355+
simpa [span_singleton_eq_top_iff] using sp,
356+
rintro ⟨nz, w⟩,
357+
fsplit,
358+
simpa [linear_independent_unique_iff] using nz,
359+
simpa [span_singleton_eq_top_iff] using w,
360+
end
361+
346362
lemma is_basis_singleton_one (R : Type*) [unique ι] [ring R] :
347363
is_basis R (λ (_ : ι), (1 : R)) :=
348364
begin

src/linear_algebra/finite_dimensional.lean

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,17 @@ let ⟨B, hB, B_fin⟩ := exists_is_basis_finite K V, ⟨g, hg⟩ := finite_dime
283283

284284
variables {K V}
285285

286+
/-- A module with dimension 1 has a basis of the form `{v}` for some `v : V`. -/
287+
lemma exists_is_basis_singleton (h : finrank K V = 1) :
288+
∃ (v : V), is_basis K (coe : ({v} : set V) → V) :=
289+
begin
290+
haveI := finite_dimensional_of_finrank (_root_.zero_lt_one.trans_le h.symm.le),
291+
obtain ⟨s, b⟩ := exists_is_basis_finset K V,
292+
obtain ⟨v, rfl⟩ := finset.card_eq_one.mp ((finrank_eq_card_finset_basis b).symm.trans h),
293+
use v,
294+
convert b; simp,
295+
end
296+
286297
lemma cardinal_mk_le_finrank_of_linear_independent
287298
[finite_dimensional K V] {ι : Type w} {b : ι → V} (h : linear_independent K b) :
288299
cardinal.mk ι ≤ finrank K V :=
@@ -344,7 +355,7 @@ lemma finrank_zero_iff [finite_dimensional K V] :
344355
iff.trans (by { rw ← finrank_eq_dim, norm_cast }) (@dim_zero_iff K V _ _ _)
345356

346357
/-- A finite dimensional space that is a subsingleton has zero `finrank`. -/
347-
lemma finrank_zero_of_subsingleton [finite_dimensional K V] [h : subsingleton V] :
358+
lemma finrank_zero_of_subsingleton [h : subsingleton V] :
348359
finrank K V = 0 :=
349360
finrank_zero_iff.2 h
350361

@@ -1197,8 +1208,99 @@ lemma set_is_basis_of_linear_independent_of_card_eq_finrank
11971208
is_basis K (coe : s → V) :=
11981209
is_basis_of_linear_independent_of_card_eq_finrank lin_ind (trans s.to_finset_card.symm card_eq)
11991210

1211+
lemma singleton_is_basis (v : V) (nz : v ≠ 0) (h : finrank K V = 1) :
1212+
is_basis K (coe : ({v} : set V) → V) :=
1213+
set_is_basis_of_linear_independent_of_card_eq_finrank
1214+
(linear_independent_singleton nz) (by simp [h])
1215+
12001216
end is_basis
12011217

1218+
/-!
1219+
We now give characterisations of `finrank K V = 1` and `finrank K V ≤ 1`.
1220+
-/
1221+
section finrank_eq_one
1222+
1223+
/-- If there is a nonzero vector and every other vector is a multiple of it,
1224+
then the module has dimension one. -/
1225+
lemma finrank_eq_one (v : V) (n : v ≠ 0) (h : ∀ w : V, ∃ c : K, c • v = w) :
1226+
finrank K V = 1 :=
1227+
begin
1228+
convert finrank_eq_card_basis ((is_basis_singleton_iff punit v).mpr _),
1229+
apply_instance, apply_instance, -- Not sure why these aren't found automatically.
1230+
exact ⟨n, h⟩,
1231+
end
1232+
1233+
/--
1234+
If every vector is a multiple of some `v : V`, then `V` has dimension at most one.
1235+
-/
1236+
lemma finrank_le_one (v : V) (h : ∀ w : V, ∃ c : K, c • v = w) :
1237+
finrank K V ≤ 1 :=
1238+
begin
1239+
by_cases n : v = 0,
1240+
{ subst n,
1241+
convert zero_le_one,
1242+
haveI := subsingleton_of_forall_eq (0 : V) (λ w, by { obtain ⟨c, rfl⟩ := h w, simp, }),
1243+
exact finrank_zero_of_subsingleton, },
1244+
{ exact (finrank_eq_one v n h).le, }
1245+
end
1246+
1247+
/--
1248+
A module with a nonzero vector `v` has dimension 1 iff `v` spans.
1249+
-/
1250+
lemma finrank_eq_one_iff_of_nonzero (v : V) (nz : v ≠ 0) :
1251+
finrank K V = 1 ↔ span K ({v} : set V) = ⊤ :=
1252+
⟨λ h, by { convert (singleton_is_basis v nz h).2, simp },
1253+
λ s, finrank_eq_card_basis ⟨linear_independent_singleton nz, by { convert s, simp }⟩⟩
1254+
1255+
/--
1256+
A module has dimension 1 iff there is some `v : V` so `{v}` is a basis.
1257+
-/
1258+
lemma finrank_eq_one_iff :
1259+
finrank K V = 1 ↔ ∃ (v : V), is_basis K (λ x : ({v} : set V), (x : V)) :=
1260+
begin
1261+
fsplit,
1262+
{ intro h,
1263+
haveI := finite_dimensional_of_finrank (_root_.zero_lt_one.trans_le h.symm.le),
1264+
exact exists_is_basis_singleton h, },
1265+
{ rintro ⟨v, b⟩,
1266+
convert finrank_eq_card_basis b, }
1267+
end
1268+
1269+
/--
1270+
A module has dimension 1 iff there is some nonzero `v : V` so every vector is a multiple of `v`.
1271+
-/
1272+
lemma finrank_eq_one_iff' :
1273+
finrank K V = 1 ↔ ∃ (v : V) (n : v ≠ 0), ∀ w : V, ∃ c : K, c • v = w :=
1274+
begin
1275+
convert finrank_eq_one_iff,
1276+
funext v,
1277+
simp only [exists_prop, eq_iff_iff, ne.def],
1278+
convert (is_basis_singleton_iff ({v} : set V) v).symm,
1279+
ext ⟨x, ⟨⟩⟩,
1280+
refl,
1281+
apply_instance, apply_instance, -- Not sure why this aren't found automatically.
1282+
end
1283+
1284+
/--
1285+
A finite dimensional module has dimension at most 1 iff
1286+
there is some `v : V` so every vector is a multiple of `v`.
1287+
-/
1288+
lemma finrank_le_one_iff [finite_dimensional K V] :
1289+
finrank K V ≤ 1 ↔ ∃ (v : V), ∀ w : V, ∃ c : K, c • v = w :=
1290+
begin
1291+
fsplit,
1292+
{ intro h,
1293+
by_cases h' : finrank K V = 0,
1294+
{ use 0, intro w, use 0, haveI := finrank_zero_iff.mp h', apply subsingleton.elim, },
1295+
{ replace h' := zero_lt_iff.mpr h', have : finrank K V = 1, { linarith },
1296+
obtain ⟨v, -, p⟩ := finrank_eq_one_iff'.mp this,
1297+
use ⟨v, p⟩, }, },
1298+
{ rintro ⟨v, p⟩,
1299+
exact finrank_le_one v p, }
1300+
end
1301+
1302+
end finrank_eq_one
1303+
12021304
section subalgebra_dim
12031305
open module
12041306
variables {F E : Type*} [field F] [field E] [algebra F E]

src/linear_algebra/linear_independent.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,10 @@ begin
900900
exact false.elim (h _ ((smul_mem_iff _ ha').1 ha)) }
901901
end
902902

903-
lemma linear_independent_unique_iff [unique ι] :
904-
linear_independent K v ↔ v (default ι) ≠ 0 :=
903+
lemma linear_independent_unique_iff [ring R] [nontrivial R] [add_comm_monoid M] [module R M]
904+
[no_zero_smul_divisors R M]
905+
(v : ι → M) [unique ι] :
906+
linear_independent R v ↔ v (default ι) ≠ 0 :=
905907
begin
906908
simp only [linear_independent_iff, finsupp.total_unique, smul_eq_zero],
907909
refine ⟨λ h hv, _, λ hv l hl, finsupp.unique_ext $ hl.resolve_right hv⟩,
@@ -913,7 +915,7 @@ alias linear_independent_unique_iff ↔ _ linear_independent_unique
913915

914916
lemma linear_independent_singleton {x : V} (hx : x ≠ 0) :
915917
linear_independent K (λ x, x : ({x} : set V) → V) :=
916-
@linear_independent_unique _ _ _ _ _ _ _ (set.unique_singleton _) ‹_›
918+
linear_independent_unique coe hx
917919

918920
lemma linear_independent_option' :
919921
linear_independent K (λ o, option.cases_on' o x v : option ι → V) ↔

0 commit comments

Comments
 (0)