|
1 | 1 | /-
|
2 | 2 | Copyright (c) 2021 Johan Commelin. All rights reserved.
|
3 | 3 | Released under Apache 2.0 license as described in the file LICENSE.
|
4 |
| -Authors: Johan Commelin, Eric Wieer |
| 4 | +Authors: Johan Commelin, Eric Wieser |
5 | 5 | -/
|
6 | 6 | import Mathlib.LinearAlgebra.FreeModule.Finite.Rank
|
7 | 7 | import Mathlib.LinearAlgebra.Matrix.ToLin
|
8 | 8 | import Mathlib.LinearAlgebra.FiniteDimensional
|
9 | 9 | import Mathlib.LinearAlgebra.Matrix.DotProduct
|
| 10 | +import Mathlib.LinearAlgebra.Determinant |
10 | 11 | import Mathlib.Data.Complex.Module
|
11 | 12 |
|
12 | 13 | #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7"
|
@@ -101,6 +102,26 @@ theorem rank_of_isUnit [StrongRankCondition R] [DecidableEq n] (A : Matrix n n R
|
101 | 102 | exact rank_unit A
|
102 | 103 | #align matrix.rank_of_is_unit Matrix.rank_of_isUnit
|
103 | 104 |
|
| 105 | +/-- Right multiplying by an invertible matrix does not change the rank -/ |
| 106 | +lemma rank_mul_eq_left_of_isUnit_det [DecidableEq n] |
| 107 | + (A : Matrix n n R) (B : Matrix m n R) (hA : IsUnit A.det) : |
| 108 | + (B ⬝ A).rank = B.rank := by |
| 109 | + suffices : Function.Surjective A.mulVecLin |
| 110 | + · rw [rank, mulVecLin_mul, LinearMap.range_comp_of_range_eq_top _ |
| 111 | + (LinearMap.range_eq_top.mpr this), ← rank] |
| 112 | + intro v |
| 113 | + exact ⟨(A⁻¹).mulVecLin v, by simp [mul_nonsing_inv _ hA]⟩ |
| 114 | + |
| 115 | +/-- Left multiplying by an invertible matrix does not change the rank -/ |
| 116 | +lemma rank_mul_eq_right_of_isUnit_det [DecidableEq m] |
| 117 | + (A : Matrix m m R) (B : Matrix m n R) (hA : IsUnit A.det) : |
| 118 | + (A ⬝ B).rank = B.rank := by |
| 119 | + let b : Basis m R (m → R) := Pi.basisFun R m |
| 120 | + replace hA : IsUnit (LinearMap.toMatrix b b A.mulVecLin).det := by |
| 121 | + convert hA; rw [← LinearEquiv.eq_symm_apply]; rfl |
| 122 | + have hAB : mulVecLin (A ⬝ B) = (LinearEquiv.ofIsUnitDet hA).comp (mulVecLin B) := by ext; simp |
| 123 | + rw [rank, rank, hAB, LinearMap.range_comp, LinearEquiv.finrank_map_eq] |
| 124 | + |
104 | 125 | /-- Taking a subset of the rows and permuting the columns reduces the rank. -/
|
105 | 126 | theorem rank_submatrix_le [StrongRankCondition R] [Fintype m] (f : n → m) (e : n ≃ m)
|
106 | 127 | (A : Matrix m m R) : rank (A.submatrix f e) ≤ rank A := by
|
|
0 commit comments