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

Commit c459d2b

Browse files
committed
feat(algebra/algebra/basic,data/matrix/basic): resolve a TODO about alg_hom.map_smul_of_tower (#12684)
It turns out that this lemma doesn't actually help in the place I claimed it would, so I added the lemma that does help too.
1 parent 6a71007 commit c459d2b

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/algebra/algebra/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,10 @@ by { ext, refl }
670670
of_linear_map linear_map.id map_one map_mul = alg_hom.id R A :=
671671
ext $ λ _, rfl
672672

673+
lemma map_smul_of_tower {R'} [has_scalar R' A] [has_scalar R' B]
674+
[linear_map.compatible_smul A B R' R] (r : R') (x : A) : φ (r • x) = r • φ x :=
675+
φ.to_linear_map.map_smul_of_tower r x
676+
673677
lemma map_list_prod (s : list A) :
674678
φ s.prod = (s.map φ).prod :=
675679
φ.to_ring_hom.map_list_prod s

src/data/matrix/basic.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@ lemma map_smul [has_scalar R α] [has_scalar R β] (f : α → β) (r : R)
151151
(hf : ∀ a, f (r • a) = r • f a) (M : matrix m n α) : (r • M).map f = r • (M.map f) :=
152152
ext $ λ _ _, hf _
153153

154+
/-- The scalar action via `has_mul.to_has_scalar` is transformed by the same map as the elements
155+
of the matrix, when `f` preserves multiplication. -/
156+
lemma map_smul' [has_mul α] [has_mul β] (f : α → β) (r : α) (A : matrix n n α)
157+
(hf : ∀ a₁ a₂, f (a₁ * a₂) = f a₁ * f a₂) :
158+
(r • A).map f = f r • A.map f :=
159+
ext $ λ _ _, hf _ _
160+
161+
/-- The scalar action via `has_mul.to_has_opposite_scalar` is transformed by the same map as the
162+
elements of the matrix, when `f` preserves multiplication. -/
163+
lemma map_op_smul' [has_mul α] [has_mul β] (f : α → β) (r : α) (A : matrix n n α)
164+
(hf : ∀ a₁ a₂, f (a₁ * a₂) = f a₁ * f a₂) :
165+
(mul_opposite.op r • A).map f = mul_opposite.op (f r) • A.map f :=
166+
ext $ λ _ _, hf _ _
167+
154168
lemma _root_.is_smul_regular.matrix [has_scalar R S] {k : R} (hk : is_smul_regular S k) :
155169
is_smul_regular (matrix m n S) k :=
156170
is_smul_regular.pi $ λ _, is_smul_regular.pi $ λ _, hk

src/linear_algebra/matrix/adjugate.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,8 @@ begin
438438
let A' := mv_polynomial_X n n ℤ,
439439
suffices : adjugate (adjugate A') = det A' ^ (fintype.card n - 2) • A',
440440
{ rw [←mv_polynomial_X_map_matrix_aeval ℤ A, ←alg_hom.map_adjugate, ←alg_hom.map_adjugate, this,
441-
←alg_hom.map_det, ← alg_hom.map_pow],
442-
-- TODO: missing an `alg_hom.map_smul_of_tower` here.
443-
ext i j,
444-
dsimp [-mv_polynomial_X],
445-
rw [←alg_hom.map_mul] },
441+
←alg_hom.map_det, ← alg_hom.map_pow, alg_hom.map_matrix_apply, alg_hom.map_matrix_apply,
442+
matrix.map_smul' _ _ _ (_root_.map_mul _)] },
446443
have h_card' : fintype.card n - 2 + 1 = fintype.card n - 1,
447444
{ simp [h_card] },
448445

0 commit comments

Comments
 (0)