roseking's picture
Add lean source and binary files (part 6)
2c7d975 verified
Raw History Blame Contribute Delete
4.1 kB
14
@[ext] structure TriangularModule (φ : BalancedTensor k R F M →ₗ[R] N) where
body · 2 lines
  top : M
  bottom : N
23
def coordinates : TriangularModule k R F M N φ ≃ M × N where
body · 4 lines
  toFun x := (x.top, x.bottom)
  invFun x := ⟨x.1, x.2⟩
  left_inv _ := rfl
  right_inv _ := rfl
29
instance : AddCommGroup (TriangularModule k R F M N φ) := (coordinates φ).addCommGroup
31
def coordinateAddEquiv : TriangularModule k R F M N φ ≃+ M × N where
body · 2 lines
  __ := coordinates φ
  map_add' _ _ := rfl
35
@[simp] theorem top_add (x y : TriangularModule k R F M N φ) : (x + y).top = x.top + y.top := rfl
36
@[simp] theorem bottom_add (x y : TriangularModule k R F M N φ) :
    (x + y).bottom = x.bottom + y.bottom := rfl
38
@[simp] theorem top_zero : (0 : TriangularModule k R F M N φ).top = 0 := rfl
39
@[simp] theorem bottom_zero : (0 : TriangularModule k R F M N φ).bottom = 0 := rfl
41
instance : SMul (Triangular R F) (TriangularModule k R F M N φ) :=
body · 1 line
  ⟨fun a x => ⟨a.top • x.top, φ (BalancedTensor.tmul a.off x.top) + a.bottom • x.bottom⟩⟩
44
@[simp] theorem top_smul (a : Triangular R F) (x : TriangularModule k R F M N φ) :
    (a • x).top = a.top • x.top := rfl
46
@[simp] theorem bottom_smul (a : Triangular R F) (x : TriangularModule k R F M N φ) :
    (a • x).bottom = φ (BalancedTensor.tmul a.off x.top) + a.bottom • x.bottom := rfl
49
instance : Module (Triangular R F) (TriangularModule k R F M N φ) where
body · 14 lines
  one_smul x := by ext <;> simp
  mul_smul a b x := by
    ext
    · exact mul_smul a.top b.top x.top
    · simp only [bottom_smul, top_smul, Triangular.off_mul, Triangular.bottom_mul,
        BalancedTensor.add_tmul, BalancedTensor.balance, map_add, mul_smul, smul_add]
      rw [← BalancedTensor.smul_tmul, φ.map_smul]
      abel
  smul_add a x y := by
    ext <;> simp [BalancedTensor.tmul_add, smul_add, add_add_add_comm]
  smul_zero a := by ext <;> simp
  add_smul a b x := by
    ext <;> simp [BalancedTensor.add_tmul, add_smul, add_add_add_comm]
  zero_smul x := by ext <;> simp
69
instance : Module k (TriangularModule k R F M N φ) := (coordinateAddEquiv φ).module k
71
@[simp] theorem top_scalar (c : k) (x : TriangularModule k R F M N φ) :
    (c • x).top = c • x.top := rfl
73
@[simp] theorem bottom_scalar (c : k) (x : TriangularModule k R F M N φ) :
    (c • x).bottom = c • x.bottom := rfl
80
instance : IsScalarTower k (Triangular R F) (TriangularModule k R F M N φ) where
body · 5 lines
  smul_assoc c a x := by
    ext
    · exact smul_assoc c a.top x.top
    · simp only [bottom_smul, Triangular.off_smul, Triangular.bottom_smul,
        bottom_scalar, BalancedTensor.scalar_tmul, LinearMap.map_smul_of_tower, smul_assoc, smul_add]
87
instance [SMulCommClass k R M] [SMulCommClass k R N] :
    SMulCommClass k (Triangular R F) (TriangularModule k R F M N φ) where
body · 5 lines
  smul_comm c a x := by
    ext
    · exact smul_comm c a.top x.top
    · simp only [bottom_scalar, bottom_smul, top_scalar, BalancedTensor.tmul_scalar,
        LinearMap.map_smul_of_tower, smul_add, smul_comm c a.bottom]
95
def coordinateLinearEquiv : TriangularModule k R F M N φ ≃ₗ[k] M × N :=
body · 1 line
  (coordinateAddEquiv φ).linearEquiv k
98
instance [Module.Finite k M] [Module.Finite k N] :
    Module.Finite k (TriangularModule k R F M N φ) :=
body · 1 line
  Module.Finite.equiv (coordinateLinearEquiv φ).symm