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

Commit be2ac64

Browse files
committed
chore(linear_algebra/dimension): rename rank to linear_map.rank (#18734)
It's a bit weird having `rank` in the root namespace, defined in terms of `module.rank` which isn't. This moves all the lemmas into a single block at the end of the file, as they were previously spread through the file.
1 parent 4cf7ca0 commit be2ac64

File tree

3 files changed

+63
-55
lines changed

3 files changed

+63
-55
lines changed

docs/undergrad.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Linear algebra:
2828
Finite-dimensional vector spaces:
2929
finite-dimensionality : 'finite_dimensional'
3030
isomorphism with $K^n$: 'basis.equiv_fun'
31-
rank of a linear map: 'rank'
31+
rank of a linear map: 'linear_map.rank'
3232
rank of a set of vectors: 'set.finrank'
3333
rank of a system of linear equations: 'https://www.math.tamu.edu/~fnarc/psfiles/rank2005.pdf'
3434
isomorphism with bidual: 'module.eval_equiv'

src/analysis/normed_space/finite_dimension.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ lemma is_open_set_of_linear_independent {ι : Type*} [finite ι] :
244244
is_open {f : ι → E | linear_independent 𝕜 f} :=
245245
is_open_iff_mem_nhds.2 $ λ f, linear_independent.eventually
246246

247-
lemma is_open_set_of_nat_le_rank (n : ℕ) : is_open {f : E →L[𝕜] F | ↑n ≤ rank (f : E →ₗ[𝕜] F)} :=
247+
lemma is_open_set_of_nat_le_rank (n : ℕ) : is_open {f : E →L[𝕜] F | ↑n ≤ (f : E →ₗ[𝕜] F).rank } :=
248248
begin
249-
simp only [le_rank_iff_exists_linear_independent_finset, set_of_exists, ← exists_prop],
249+
simp only [linear_map.le_rank_iff_exists_linear_independent_finset, set_of_exists, ← exists_prop],
250250
refine is_open_bUnion (λ t ht, _),
251251
have : continuous (λ f : E →L[𝕜] F, (λ x : (t : set E), f x)),
252252
from continuous_pi (λ x, (continuous_linear_map.apply 𝕜 F (x : E)).continuous),

src/linear_algebra/dimension.lean

Lines changed: 60 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,61 +1169,10 @@ end
11691169

11701170
end division_ring
11711171

1172-
section rank
1173-
1174-
section
1175-
variables [ring K] [add_comm_group V] [module K V] [add_comm_group V₁] [module K V₁]
1176-
variables [add_comm_group V'] [module K V']
1177-
1178-
/-- `rank f` is the rank of a `linear_map f`, defined as the dimension of `f.range`. -/
1179-
def rank (f : V →ₗ[K] V') : cardinal := module.rank K f.range
1180-
1181-
lemma rank_le_range (f : V →ₗ[K] V₁) : rank f ≤ module.rank K V₁ :=
1182-
dim_submodule_le _
1183-
1184-
@[simp] lemma rank_zero [nontrivial K] : rank (0 : V →ₗ[K] V') = 0 :=
1185-
by rw [rank, linear_map.range_zero, dim_bot]
1186-
1187-
variables [add_comm_group V''] [module K V'']
1188-
1189-
lemma rank_comp_le1 (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f :=
1190-
begin
1191-
refine dim_le_of_submodule _ _ _,
1192-
rw [linear_map.range_comp],
1193-
exact linear_map.map_le_range,
1194-
end
1195-
1196-
variables [add_comm_group V'₁] [module K V'₁]
1197-
1198-
lemma rank_comp_le2 (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g :=
1199-
by rw [rank, rank, linear_map.range_comp]; exact dim_map_le _ _
1200-
1201-
end
1202-
1203-
end rank
1204-
12051172
section division_ring
12061173
variables [division_ring K] [add_comm_group V] [module K V] [add_comm_group V₁] [module K V₁]
12071174
variables [add_comm_group V'] [module K V']
12081175

1209-
lemma rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ module.rank K V :=
1210-
by { rw [← dim_range_add_dim_ker f], exact self_le_add_right _ _ }
1211-
1212-
lemma rank_add_le (f g : V →ₗ[K] V') : rank (f + g) ≤ rank f + rank g :=
1213-
calc rank (f + g) ≤ module.rank K (f.range ⊔ g.range : submodule K V') :
1214-
begin
1215-
refine dim_le_of_submodule _ _ _,
1216-
exact (linear_map.range_le_iff_comap.2 $ eq_top_iff'.2 $
1217-
assume x, show f x + g x ∈ (f.range ⊔ g.range : submodule K V'), from
1218-
mem_sup.2 ⟨_, ⟨x, rfl⟩, _, ⟨x, rfl⟩, rfl⟩)
1219-
end
1220-
... ≤ rank f + rank g : dim_add_le_dim_add_dim _ _
1221-
1222-
lemma rank_finset_sum_le {η} (s : finset η) (f : η → V →ₗ[K] V') :
1223-
rank (∑ d in s, f d) ≤ ∑ d in s, rank (f d) :=
1224-
@finset.sum_hom_rel _ _ _ _ _ (λa b, rank a ≤ b) f (λ d, rank (f d)) s (le_of_eq rank_zero)
1225-
(λ i g c h, le_trans (rank_add_le _ _) (add_le_add_left h _))
1226-
12271176
/-- The `ι` indexed basis on `V`, where `ι` is an empty type and `V` is zero-dimensional.
12281177
12291178
See also `finite_dimensional.fin_basis`.
@@ -1355,6 +1304,65 @@ lemma module.rank_le_one_iff_top_is_principal :
13551304
module.rank K V ≤ 1 ↔ (⊤ : submodule K V).is_principal :=
13561305
by rw [← submodule.rank_le_one_iff_is_principal, dim_top]
13571306

1307+
end division_ring
1308+
1309+
end module
1310+
1311+
/-! ### The rank of a linear map -/
1312+
1313+
namespace linear_map
1314+
1315+
section ring
1316+
variables [ring K] [add_comm_group V] [module K V] [add_comm_group V₁] [module K V₁]
1317+
variables [add_comm_group V'] [module K V']
1318+
1319+
/-- `rank f` is the rank of a `linear_map` `f`, defined as the dimension of `f.range`. -/
1320+
def rank (f : V →ₗ[K] V') : cardinal := module.rank K f.range
1321+
1322+
lemma rank_le_range (f : V →ₗ[K] V₁) : rank f ≤ module.rank K V₁ :=
1323+
dim_submodule_le _
1324+
1325+
@[simp] lemma rank_zero [nontrivial K] : rank (0 : V →ₗ[K] V') = 0 :=
1326+
by rw [rank, linear_map.range_zero, dim_bot]
1327+
1328+
variables [add_comm_group V''] [module K V'']
1329+
1330+
lemma rank_comp_le1 (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f :=
1331+
begin
1332+
refine dim_le_of_submodule _ _ _,
1333+
rw [linear_map.range_comp],
1334+
exact linear_map.map_le_range,
1335+
end
1336+
1337+
variables [add_comm_group V'₁] [module K V'₁]
1338+
1339+
lemma rank_comp_le2 (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g :=
1340+
by rw [rank, rank, linear_map.range_comp]; exact dim_map_le _ _
1341+
1342+
end ring
1343+
1344+
section division_ring
1345+
variables [division_ring K] [add_comm_group V] [module K V] [add_comm_group V₁] [module K V₁]
1346+
variables [add_comm_group V'] [module K V']
1347+
1348+
lemma rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ module.rank K V :=
1349+
by { rw [← dim_range_add_dim_ker f], exact self_le_add_right _ _ }
1350+
1351+
lemma rank_add_le (f g : V →ₗ[K] V') : rank (f + g) ≤ rank f + rank g :=
1352+
calc rank (f + g) ≤ module.rank K (f.range ⊔ g.range : submodule K V') :
1353+
begin
1354+
refine dim_le_of_submodule _ _ _,
1355+
exact (linear_map.range_le_iff_comap.2 $ eq_top_iff'.2 $
1356+
assume x, show f x + g x ∈ (f.range ⊔ g.range : submodule K V'), from
1357+
mem_sup.2 ⟨_, ⟨x, rfl⟩, _, ⟨x, rfl⟩, rfl⟩)
1358+
end
1359+
... ≤ rank f + rank g : dim_add_le_dim_add_dim _ _
1360+
1361+
lemma rank_finset_sum_le {η} (s : finset η) (f : η → V →ₗ[K] V') :
1362+
rank (∑ d in s, f d) ≤ ∑ d in s, rank (f d) :=
1363+
@finset.sum_hom_rel _ _ _ _ _ (λa b, rank a ≤ b) f (λ d, rank (f d)) s (le_of_eq rank_zero)
1364+
(λ i g c h, le_trans (rank_add_le _ _) (add_le_add_left h _))
1365+
13581366
lemma le_rank_iff_exists_linear_independent {c : cardinal} {f : V →ₗ[K] V'} :
13591367
c ≤ rank f ↔
13601368
∃ s : set V, cardinal.lift.{v'} (#s) = cardinal.lift.{v} c ∧
@@ -1391,4 +1399,4 @@ end
13911399

13921400
end division_ring
13931401

1394-
end module
1402+
end linear_map

0 commit comments

Comments
 (0)