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

Commit 45ce392

Browse files
committed
chore(linear_algebra/dimension): tidy lemma names for linear_map.rank (#18769)
`le1` and `le2` don't really fit the usual naming convention. Also generalizes `rank_le_domain` to rings and `rank_le_range` across universes.
1 parent 284fdd2 commit 45ce392

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/data/matrix/rank.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ lemma rank_mul_le [strong_rank_condition R] (A : matrix m n R) (B : matrix n o R
5656
(A ⬝ B).rank ≤ A.rank :=
5757
begin
5858
rw [rank, rank, to_lin'_mul],
59-
refine cardinal.to_nat_le_of_le_of_lt_aleph_0 _ (linear_map.rank_comp_le1 _ _),
59+
refine cardinal.to_nat_le_of_le_of_lt_aleph_0 _ (linear_map.rank_comp_le_left _ _),
6060
rw [←cardinal.lift_lt_aleph_0],
6161
have := lift_rank_range_le A.to_lin',
6262
rw [rank_fun', cardinal.lift_nat_cast] at this,

src/linear_algebra/dimension.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,15 +1317,18 @@ variables [add_comm_group V'] [module K V']
13171317
/-- `rank f` is the rank of a `linear_map` `f`, defined as the dimension of `f.range`. -/
13181318
def rank (f : V →ₗ[K] V') : cardinal := module.rank K f.range
13191319

1320-
lemma rank_le_range (f : V →ₗ[K] V) : rank f ≤ module.rank K V :=
1320+
lemma rank_le_range (f : V →ₗ[K] V') : rank f ≤ module.rank K V' :=
13211321
rank_submodule_le _
13221322

1323+
lemma rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ module.rank K V :=
1324+
rank_range_le _
1325+
13231326
@[simp] lemma rank_zero [nontrivial K] : rank (0 : V →ₗ[K] V') = 0 :=
13241327
by rw [rank, linear_map.range_zero, rank_bot]
13251328

13261329
variables [add_comm_group V''] [module K V'']
13271330

1328-
lemma rank_comp_le1 (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f :=
1331+
lemma rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f :=
13291332
begin
13301333
refine rank_le_of_submodule _ _ _,
13311334
rw [linear_map.range_comp],
@@ -1334,7 +1337,7 @@ end
13341337

13351338
variables [add_comm_group V'₁] [module K V'₁]
13361339

1337-
lemma rank_comp_le2 (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g :=
1340+
lemma rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g :=
13381341
by rw [rank, rank, linear_map.range_comp]; exact rank_map_le _ _
13391342

13401343
end ring
@@ -1343,9 +1346,6 @@ section division_ring
13431346
variables [division_ring K] [add_comm_group V] [module K V] [add_comm_group V₁] [module K V₁]
13441347
variables [add_comm_group V'] [module K V']
13451348

1346-
lemma rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ module.rank K V :=
1347-
by { rw [← rank_range_add_rank_ker f], exact self_le_add_right _ _ }
1348-
13491349
lemma rank_add_le (f g : V →ₗ[K] V') : rank (f + g) ≤ rank f + rank g :=
13501350
calc rank (f + g) ≤ module.rank K (f.range ⊔ g.range : submodule K V') :
13511351
begin

src/linear_algebra/matrix/to_lin.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,13 @@ lemma linear_map.to_matrix_alg_equiv'_mul
342342
(f * g).to_matrix_alg_equiv' = f.to_matrix_alg_equiv' ⬝ g.to_matrix_alg_equiv' :=
343343
linear_map.to_matrix_alg_equiv'_comp f g
344344

345-
lemma matrix.rank_vec_mul_vec {K m n : Type u} [field K] [fintype n] [decidable_eq n]
345+
lemma matrix.rank_vec_mul_vec {K m n : Type u}
346+
[comm_ring K] [strong_rank_condition K] [fintype n] [decidable_eq n]
346347
(w : m → K) (v : n → K) :
347348
rank (vec_mul_vec w v).to_lin' ≤ 1 :=
348349
begin
349350
rw [vec_mul_vec_eq, matrix.to_lin'_mul],
350-
refine le_trans (rank_comp_le1 _ _) _,
351+
refine le_trans (rank_comp_le_left _ _) _,
351352
refine (rank_le_domain _).trans_eq _,
352353
rw [rank_fun', fintype.card_unit, nat.cast_one]
353354
end

0 commit comments

Comments
 (0)