Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mathlib commit leanprover-community/mathlib@eb0cb45
- Loading branch information
1 parent
5a03351
commit e1a04c8
Showing
23 changed files
with
1,330 additions
and
1,198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/- | ||
Copyright (c) 2023 Eric Wieser. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Eric Wieser | ||
! This file was ported from Lean 3 source module data.matrix.dual_number | ||
! leanprover-community/mathlib commit eb0cb4511aaef0da2462207b67358a0e1fe1e2ee | ||
! Please do not edit these lines, except to modify the commit id | ||
! if you have ported upstream changes. | ||
-/ | ||
import Mathbin.Algebra.DualNumber | ||
import Mathbin.Data.Matrix.Basic | ||
|
||
/-! | ||
# Matrices of dual numbers are isomorphic to dual numbers over matrices | ||
Showing this for the more general case of `triv_sq_zero_ext R M` would require an action between | ||
`matrix n n R` and `matrix n n M`, which would risk causing diamonds. | ||
-/ | ||
|
||
|
||
variable {R n : Type} [CommSemiring R] [Fintype n] [DecidableEq n] | ||
|
||
open Matrix TrivSqZeroExt | ||
|
||
/-- Matrices over dual numbers and dual numbers over matrices are isomorphic. -/ | ||
@[simps] | ||
def Matrix.dualNumberEquiv : Matrix n n (DualNumber R) ≃ₐ[R] DualNumber (Matrix n n R) | ||
where | ||
toFun A := ⟨of fun i j => (A i j).fst, of fun i j => (A i j).snd⟩ | ||
invFun d := of fun i j => (d.fst i j, d.snd i j) | ||
left_inv A := Matrix.ext fun i j => TrivSqZeroExt.ext rfl rfl | ||
right_inv d := TrivSqZeroExt.ext (Matrix.ext fun i j => rfl) (Matrix.ext fun i j => rfl) | ||
map_mul' A B := by | ||
ext <;> dsimp [mul_apply] | ||
· simp_rw [fst_sum, fst_mul] | ||
· simp_rw [snd_sum, snd_mul, smul_eq_mul, op_smul_eq_mul, Finset.sum_add_distrib] | ||
map_add' A B := TrivSqZeroExt.ext rfl rfl | ||
commutes' r := | ||
by | ||
simp_rw [algebra_map_eq_inl', algebra_map_eq_diagonal, Pi.algebraMap_def, | ||
Algebra.id.map_eq_self, algebra_map_eq_inl, ← diagonal_map (inl_zero R), map_apply, fst_inl, | ||
snd_inl] | ||
rfl | ||
#align matrix.dual_number_equiv Matrix.dualNumberEquiv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.