roseking's picture
Add lean source and binary files (part 6)
2c7d975 verified
Raw History Blame Contribute Delete
2.81 kB
15
def differential (n : ℕ) : (P.complex.X n ⟶ Y) →ₗ[k] (P.complex.X (n + 1) ⟶ Y) where
body · 3 lines
  toFun f := P.complex.d (n + 1) n ≫ f
  map_add' f g := by simp only [Preadditive.comp_add]
  map_smul' a f := by simp only [Linear.comp_smul, RingHom.id_apply]
20
@[simp] theorem differential_apply (n : ℕ) (f : P.complex.X n ⟶ Y) :
    differential (k := k) P n f = P.complex.d (n + 1) n ≫ f := rfl
23
theorem differential_comp (n : ℕ) :
    (differential (k := k) (Y := Y) P (n + 1)).comp (differential P n) = 0 := by
proof · 3 lines
  ext f
  change P.complex.d (n + 2) (n + 1) ≫ (P.complex.d (n + 1) n ≫ f) = 0
  rw [← Category.assoc, P.complex.d_comp_d, Limits.zero_comp]
31
theorem extMk_smul (n : ℕ) (f : P.complex.X n ⟶ Y)
    (hf : P.complex.d (n + 1) n ≫ f = 0) (a : k) :
    P.extMk (a • f) (n + 1) rfl (by simp [hf]) = a • P.extMk f (n + 1) rfl hf := by
proof · 3 lines
  rw [Ext.smul_eq_comp_mk₀, P.extMk_comp_mk₀]
  congr 1
  simp
38
def cyclesToExt (n : ℕ) :
    LinearMap.ker (differential (k := k) (Y := Y) P (n + 1)) →ₗ[k] Ext X Y (n + 1) where
body · 3 lines
  toFun f := P.extMk f.val (n + 2) rfl f.property
  map_add' f g := (P.add_extMk f.val g.val _ rfl f.property g.property).symm
  map_smul' a f := extMk_smul P (n + 1) f.val f.property a
44
theorem cyclesToExt_surjective (n : ℕ) :
    Function.Surjective (cyclesToExt (k := k) (Y := Y) P n) := by
proof · 3 lines
  intro a
  obtain ⟨f, hf, hfa⟩ := P.extMk_surjective a (n + 2) rfl
  exact ⟨⟨f, hf⟩, hfa⟩
50
theorem cyclesToExt_kernel (n : ℕ) :
    LinearMap.ker (cyclesToExt (k := k) (Y := Y) P n) =
      LinearHomology.boundaries (differential P n) (differential P (n + 1)) (differential_comp P n) := by
proof · 8 lines
  ext x
  constructor
  · intro hx
    obtain ⟨f, hf⟩ := (P.extMk_eq_zero_iff x.val (n + 2) rfl x.property n rfl).mp hx
    exact ⟨f, Subtype.ext hf⟩
  · rintro ⟨f, hfx⟩
    apply (P.extMk_eq_zero_iff x.val (n + 2) rfl x.property n rfl).mpr
    exact ⟨f, congrArg Subtype.val hfx⟩
62
def extEquiv (n : ℕ) :
    LinearHomology.Homology (differential (k := k) (Y := Y) P n)
      (differential P (n + 1)) (differential_comp P n) ≃ₗ[k] Ext X Y (n + 1) :=
body · 2 lines
  (Submodule.quotEquivOfEq _ _ (cyclesToExt_kernel P n).symm).trans
    ((cyclesToExt P n).quotKerEquivOfSurjective (cyclesToExt_surjective P n))