openAI-math-dataset / lean /OAI /Algebra /AuslanderReiten /Tensor /BalancedTensorLeftExact.lean
roseking's picture
Add lean source and binary files (part 6)
2c7d975 verified
Raw History Blame Contribute Delete
6.65 kB
15
def mapLeft (a : F →ₗ[Rᵐᵒᵖ] G) : BalancedTensor k R F M →ₗ[k] BalancedTensor k R G M :=
body · 1 line
  map (a.restrictScalars k) LinearMap.id (fun r f => a.map_smul r f) (fun _ _ => rfl)
19
@[simp] theorem mapLeft_tmul (a : F →ₗ[Rᵐᵒᵖ] G) (f : F) (m : M) :
    mapLeft (k := k) a (tmul f m) = tmul (a f) m := rfl
23
@[simp] theorem mapLeft_comp (a : F →ₗ[Rᵐᵒᵖ] G) (b : G →ₗ[Rᵐᵒᵖ] H) :
    mapLeft (k := k) (M := M) (b.comp a) = (mapLeft b).comp (mapLeft a) := by
proof · 3 lines
  apply hom_ext
  intro f m
  rfl
30
@[simp] theorem mapLeft_zero : mapLeft (k := k) (M := M) (0 : F →ₗ[Rᵐᵒᵖ] G) = 0 := by
proof · 3 lines
  apply hom_ext
  intro f m
  exact zero_tmul m
37
def leftCoefficients (s : M →ₗ[R] (Fin n → R)) :
    BalancedTensor k R F M →ₗ[k] (Fin n → F) :=
body · 19 lines
  lift
    { toFun f :=
        { toFun m i := MulOpposite.op (s m i) • f
          map_add' m m' := by
            ext i
            simp only [map_add, Pi.add_apply, MulOpposite.op_add, add_smul]
          map_smul' c m := by
            ext i
            simp only [LinearMap.map_smul_of_tower, Pi.smul_apply, MulOpposite.op_smul,
              smul_assoc, RingHom.id_apply] }
      map_add' f f' := by ext m i; exact smul_add _ _ _
      map_smul' c f := by
        ext m i
        exact (smul_comm c (MulOpposite.op (s m i)) f).symm }
    (by
      intro f r m
      ext i
      change MulOpposite.op (s m i) • (MulOpposite.op r • f) = MulOpposite.op (s (r • m) i) • f
      simp only [map_smul, Pi.smul_apply, smul_eq_mul, MulOpposite.op_mul, mul_smul])
59
@[simp] theorem leftCoefficients_tmul (s : M →ₗ[R] (Fin n → R)) (f : F) (m : M) (i : Fin n) :
    leftCoefficients (k := k) s (tmul f m) i = MulOpposite.op (s m i) • f := rfl
62
def leftRecombine (p : (Fin n → R) →ₗ[R] M) :
    (Fin n → F) →ₗ[k] BalancedTensor k R F M :=
body · 1 line
  ∑ i, (((mk (k := k) (R := R)).flip (p (Pi.single i 1))).comp (LinearMap.proj i))
67
@[simp] theorem leftRecombine_apply (p : (Fin n → R) →ₗ[R] M) (f : Fin n → F) :
    leftRecombine (k := k) p f = ∑ i, tmul (f i) (p (Pi.single i 1)) := by
proof · 1 line
  simp [leftRecombine, mk]
71
theorem leftRecombine_leftCoefficients (s : M →ₗ[R] (Fin n → R))
    (p : (Fin n → R) →ₗ[R] M) (h : p.comp s = LinearMap.id) (z : BalancedTensor k R F M) :
    leftRecombine p (leftCoefficients s z) = z := by
proof · 22 lines
  induction z using induction_on with
  | zero => simp
  | add x y hx hy => simp only [map_add, hx, hy]
  | tmul f m =>
    rw [leftRecombine_apply]
    calc
      (∑ i, tmul (leftCoefficients s (tmul f m) i) (p (Pi.single i 1))) =
          ∑ i, tmul f (p (Pi.single i (s m i))) := by
        apply Finset.sum_congr rfl
        intro i hi
        rw [leftCoefficients_tmul, balance, ← p.map_smul]
        congr 2
        ext j
        by_cases hij : j = i
        · subst j; simp
        · simp [hij]
      _ = tmul f (p (∑ i, Pi.single i (s m i))) := by
        simp only [map_sum]
        exact (map_sum (mk (k := k) (R := R) f) _ _).symm
      _ = tmul f m := by
        rw [Finset.univ_sum_single]
        exact congrArg (fun m => tmul (k := k) (R := R) f m) (DFunLike.congr_fun h m)
97
theorem leftCoefficients_natural (s : M →ₗ[R] (Fin n → R)) (a : F →ₗ[Rᵐᵒᵖ] G)
    (z : BalancedTensor k R F M) :
    leftCoefficients s (mapLeft a z) = fun i => a (leftCoefficients s z i) := by
proof · 4 lines
  induction z using induction_on with
  | zero => ext i; simp
  | tmul f m => ext i; simp
  | add x y hx hy => ext i; simp only [map_add, Pi.add_apply, hx, hy]
106
theorem leftRecombine_natural (p : (Fin n → R) →ₗ[R] M) (a : F →ₗ[Rᵐᵒᵖ] G) (z : Fin n → F) :
    mapLeft a (leftRecombine p z) = leftRecombine (k := k) p (fun i => a (z i)) := by
proof · 1 line
  simp only [leftRecombine_apply, map_sum, mapLeft_tmul]
110
theorem mapLeft_exact [Module.Finite R M] [Module.Projective R M]
    (a : F →ₗ[Rᵐᵒᵖ] G) (b : G →ₗ[Rᵐᵒᵖ] H) (hex : Function.Exact a b) :
    Function.Exact (mapLeft (k := k) (M := M) a) (mapLeft b) := by
proof · 19 lines
  obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M
  obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp
  intro z
  constructor
  · intro hz
    have hcoords : ∀ i, b (leftCoefficients s z i) = 0 := by
      have hnat := leftCoefficients_natural s b z
      rw [hz, map_zero] at hnat
      intro i
      exact (congrFun hnat i).symm
    choose w hw using fun i => (hex (leftCoefficients s z i)).mp (hcoords i)
    refine ⟨leftRecombine p w, ?_⟩
    rw [leftRecombine_natural]
    convert leftRecombine_leftCoefficients s p hs z using 1
    exact congrArg (leftRecombine (k := k) p) (funext hw)
  · rintro ⟨w, rfl⟩
    have hba : b.comp a = 0 := by ext f; exact (hex (a f)).mpr ⟨f, rfl⟩
    change ((mapLeft b).comp (mapLeft a)) w = 0
    rw [← mapLeft_comp, hba, mapLeft_zero, LinearMap.zero_apply]
134
theorem mapLeft_surjective (a : F →ₗ[Rᵐᵒᵖ] G) (ha : Function.Surjective a) :
    Function.Surjective (mapLeft (k := k) (M := M) a) :=
proof · 2 lines
  map_surjective (a.restrictScalars k) LinearMap.id
    (fun r f => a.map_smul r f) (fun _ _ => rfl) ha Function.surjective_id
139
theorem mapLeft_injective [Module.Finite R M] [Module.Projective R M]
    (a : F →ₗ[Rᵐᵒᵖ] G) (ha : Function.Injective a) :
    Function.Injective (mapLeft (k := k) (M := M) a) := by
proof · 9 lines
  obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M
  obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp
  intro x y hxy
  have hc : leftCoefficients s x = leftCoefficients s y := by
    ext i
    apply ha
    have hh := congrArg (fun z => leftCoefficients s z i) hxy
    simpa only [leftCoefficients_natural] using hh
  rw [← leftRecombine_leftCoefficients s p hs x, ← leftRecombine_leftCoefficients s p hs y, hc]