Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a51d1e0

Browse files
committed
feat(algebra/homology/homological_complex): Dualizes some constructions (#7643)
This PR adds `cochain_complex.of` and `cochain_complex.of_hom`. Still not done: `cochain_complex.mk`.
1 parent e275604 commit a51d1e0

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed

src/algebra/homology/homological_complex.lean

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ end homological_complex
486486

487487
namespace chain_complex
488488

489-
/- TODO: dualize to `cochain_complex` -/
490-
491489
section of
492490
variables {V} {α : Type*} [add_right_cancel_semigroup α] [has_one α] [decidable_eq α]
493491

@@ -546,6 +544,8 @@ end of_hom
546544

547545
section mk
548546

547+
/- TODO: dualize to `cochain_complex` -/
548+
549549
/--
550550
Auxiliary structure for setting up the recursion in `mk`.
551551
This is purely an implementation detail: for some reason just using the dependent 6-tuple directly
@@ -681,3 +681,62 @@ end
681681
end mk_hom
682682

683683
end chain_complex
684+
685+
namespace cochain_complex
686+
687+
section of
688+
variables {V} {α : Type*} [add_right_cancel_semigroup α] [has_one α] [decidable_eq α]
689+
690+
/--
691+
Construct an `α`-indexed cochain complex from a dependently-typed differential.
692+
-/
693+
def of (X : α → V) (d : Π n, X n ⟶ X (n+1)) (sq : ∀ n, d n ≫ d (n+1) = 0) : cochain_complex V α :=
694+
{ X := X,
695+
d := λ i j, if h : i + 1 = j then
696+
d _ ≫ eq_to_hom (by subst h)
697+
else
698+
0,
699+
shape' := λ i j w, by {rw dif_neg, exact w},
700+
d_comp_d' := λ i j k,
701+
begin
702+
split_ifs with h h' h',
703+
{ substs h h',
704+
simp [sq] },
705+
all_goals { simp },
706+
end }
707+
708+
variables (X : α → V) (d : Π n, X n ⟶ X (n+1)) (sq : ∀ n, d n ≫ d (n+1) = 0)
709+
710+
@[simp] lemma of_X (n : α) : (of X d sq).X n = X n := rfl
711+
@[simp] lemma of_d (j : α) : (of X d sq).d j (j+1) = d j :=
712+
by { dsimp [of], rw [if_pos rfl, category.comp_id] }
713+
lemma of_d_ne {i j : α} (h : i + 1 ≠ j) : (of X d sq).d i j = 0 :=
714+
by { dsimp [of], rw [dif_neg h] }
715+
716+
end of
717+
718+
section of_hom
719+
720+
variables {V} {α : Type*} [add_right_cancel_semigroup α] [has_one α] [decidable_eq α]
721+
722+
variables (X : α → V) (d_X : Π n, X n ⟶ X (n+1)) (sq_X : ∀ n, d_X n ≫ d_X (n+1) = 0)
723+
(Y : α → V) (d_Y : Π n, Y n ⟶ Y (n+1)) (sq_Y : ∀ n, d_Y n ≫ d_Y (n+1) = 0)
724+
725+
/--
726+
A constructor for chain maps between `α`-indexed cochain complexes built using `cochain_complex.of`,
727+
from a dependently typed collection of morphisms.
728+
-/
729+
@[simps] def of_hom (f : Π i : α, X i ⟶ Y i) (comm : ∀ i : α, f i ≫ d_Y i = d_X i ≫ f (i+1)) :
730+
of X d_X sq_X ⟶ of Y d_Y sq_Y :=
731+
{ f := f,
732+
comm' := λ n m,
733+
begin
734+
by_cases h : n + 1 = m,
735+
{ subst h,
736+
simpa using comm n },
737+
{ rw [of_d_ne X _ _ h, of_d_ne Y _ _ h], simp }
738+
end }
739+
740+
end of_hom
741+
742+
end cochain_complex

0 commit comments

Comments
 (0)