Skip to content

Commit 421fab3

Browse files
hakii6hakii6eric-wieser
committed
feat(LinearAlgebra/Matrix/Block, Analysis/Normed/Algebra/MatrixExponential): add BlockTriangular.pow and BlockTriangular.exp (#37006)
These will help with proving `det (exp A) = exp (trace A)` Zulip thread: [#new members > (Matrix and NormedSpace.exp) | det (exp A) = exp (trace A)](https://leanprover.zulipchat.com/#narrow/channel/113489-new-members/topic/.28Matrix.20and.20NormedSpace.2Eexp.29.20.7C.20det.20.28exp.20A.29.20.3D.20exp.20.28trace.20A.29/with/580964688) Co-authored-by: hakii6 <hakii6@hakii6.localdomain> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Eric Wieser <efw@google.com>
1 parent 5e4acf8 commit 421fab3

3 files changed

Lines changed: 54 additions & 2 deletions

File tree

Mathlib/Analysis/Normed/Algebra/MatrixExponential.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ public import Mathlib.Analysis.Matrix.Normed
1010
public import Mathlib.LinearAlgebra.Matrix.ZPow
1111
public import Mathlib.LinearAlgebra.Matrix.Hermitian
1212
public import Mathlib.LinearAlgebra.Matrix.Symmetric
13+
public import Mathlib.LinearAlgebra.Matrix.Block
1314
public import Mathlib.Topology.UniformSpace.Matrix
15+
public import Mathlib.Topology.Instances.Matrix
1416

1517
/-!
1618
# Lemmas about the matrix exponential
@@ -67,7 +69,7 @@ open scoped Matrix
6769

6870
open NormedSpace -- For `exp`.
6971

70-
variable {m n : Type*} {n' : m → Type*} {𝔸 : Type*}
72+
variable {m n : Type*} {n' : m → Type*} {α 𝔸 : Type*}
7173

7274
namespace Matrix
7375

@@ -98,6 +100,11 @@ theorem IsHermitian.exp [StarRing 𝔸] [ContinuousStar 𝔸] {A : Matrix m m
98100
(exp A).IsHermitian :=
99101
(exp_conjTranspose _).symm.trans <| congr_arg _ h
100102

103+
theorem BlockTriangular.exp [LinearOrder α] [Algebra ℚ 𝔸] {M : Matrix m m 𝔸} {b : m → α}
104+
(hM : BlockTriangular M b) :
105+
(exp M).BlockTriangular b :=
106+
exp_mem (s := blockTriangularSubalgebra ℚ _ b) isClosed_setOf_blockTriangular hM
107+
101108
end Ring
102109

103110
section CommRing

Mathlib/LinearAlgebra/Matrix/Block.lean

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ open Matrix
4444
universe v
4545

4646
variable {α β m n o : Type*} {m' n' : α → Type*}
47-
variable {R : Type v} {M N : Matrix m m R} {b : m → α}
47+
variable {R : Type v} {A : Type*} {M N : Matrix m m R} {b : m → α}
4848

4949
namespace Matrix
5050

@@ -186,6 +186,44 @@ theorem BlockTriangular.mul [Fintype m] [NonUnitalNonAssocSemiring R]
186186
· simp_rw [hM hki, zero_mul]
187187
· simp_rw [hN (lt_of_lt_of_le hij hki), mul_zero]
188188

189+
variable (R b) in
190+
/-- `BlockTriangular` matrices form a subsemiring. -/
191+
@[simps]
192+
def blockTriangularSubsemiring [DecidableEq m] [Fintype m] [Semiring R] :
193+
Subsemiring (Matrix m m R) where
194+
carrier := {M | BlockTriangular M b}
195+
zero_mem' := blockTriangular_zero
196+
one_mem' := blockTriangular_one
197+
mul_mem' := .mul
198+
add_mem' := .add
199+
200+
@[simp]
201+
theorem mem_blockTriangularSubsemiring [DecidableEq m] [Fintype m] [Semiring R]
202+
{M : Matrix m m R} :
203+
M ∈ blockTriangularSubsemiring R b ↔ BlockTriangular M b :=
204+
Iff.rfl
205+
206+
theorem BlockTriangular.pow [DecidableEq m] [Fintype m] [Semiring R] (hM : BlockTriangular M b)
207+
(n : ℕ) : BlockTriangular (M ^ n) b :=
208+
pow_mem (S := blockTriangularSubsemiring R b) hM n
209+
210+
theorem blockTriangular_algebraMap [CommSemiring R] [Semiring A] [Algebra R A]
211+
[DecidableEq m] [Fintype m] (r : R) : (algebraMap R (Matrix m m A) r).BlockTriangular b :=
212+
blockTriangular_diagonal _
213+
214+
variable (R A b) in
215+
/-- `BlockTriangular` matrices form a subalgebra. -/
216+
def blockTriangularSubalgebra [CommSemiring R] [Semiring A] [Algebra R A]
217+
[DecidableEq m] [Fintype m] : Subalgebra R (Matrix m m A) where
218+
__ := blockTriangularSubsemiring A b
219+
algebraMap_mem' r := blockTriangular_algebraMap r
220+
221+
@[simp]
222+
theorem mem_blockTriangularSubalgebra [CommSemiring R] [Semiring A] [Algebra R A]
223+
[DecidableEq m] [Fintype m] {M : Matrix m m A} :
224+
M ∈ blockTriangularSubalgebra R A b ↔ BlockTriangular M b :=
225+
Iff.rfl
226+
189227
end LinearOrder
190228

191229
theorem upper_two_blockTriangular [Zero R] [Preorder α] (A : Matrix m m R) (B : Matrix m n R)

Mathlib/Topology/Instances/Matrix.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Oliver Nash, Eric Wieser
66
module
77

88
public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
9+
public import Mathlib.LinearAlgebra.Matrix.Block
910
public import Mathlib.Topology.Algebra.InfiniteSum.Basic
1011
public import Mathlib.Topology.Algebra.Ring.Basic
1112
public import Mathlib.Topology.Algebra.Star
@@ -307,6 +308,12 @@ theorem Continuous.matrix_blockDiag'
307308
Continuous fun x => blockDiag' (A x) :=
308309
continuous_pi fun _i => continuous_matrix fun _j _k => hA.matrix_elem _ _
309310

311+
theorem isClosed_setOf_blockTriangular {α : Type*} {b : m → α} [LinearOrder α] [Zero R]
312+
[T2Space R] : IsClosed {M : Matrix m m R | M.BlockTriangular b} := by
313+
simp only [BlockTriangular, Set.setOf_forall]
314+
refine isClosed_iInter fun i => isClosed_iInter fun j => isClosed_iInter fun _ => ?_
315+
exact isClosed_eq (continuous_id.matrix_elem i j) continuous_const
316+
310317
end BlockMatrices
311318

312319
end Continuity

0 commit comments

Comments
 (0)