Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(algebra/homology): chain complexes #2174

Merged
merged 48 commits into from Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
64c23b4
thoughts on chain complexes
semorrison Mar 12, 2020
5034cc2
Merge remote-tracking branch 'origin/master' into chain_complex
semorrison Mar 12, 2020
a322404
minor
semorrison Mar 14, 2020
fe8e3a4
feat(category_theory): split epis and monos, and a result about (co)p…
semorrison Mar 14, 2020
c983761
Merge branch 'split_mono' into chain_complex
semorrison Mar 14, 2020
17cfe8a
total functor faithful
semorrison Mar 14, 2020
84e6f1a
homology!
semorrison Mar 14, 2020
44153fc
remove lint
semorrison Mar 14, 2020
7da3a8a
something something homology
semorrison Mar 14, 2020
cbee3ea
comment out broken stuff
semorrison Mar 14, 2020
c36be73
adding comments
semorrison Mar 17, 2020
d78e102
various
semorrison Mar 17, 2020
b1621f1
rewrite
semorrison Mar 18, 2020
3921c6c
merge
semorrison Mar 18, 2020
25f56b2
fixes
semorrison Mar 18, 2020
eb8a389
Update src/category_theory/epi_mono.lean
semorrison Mar 18, 2020
c4cf955
Update src/category_theory/epi_mono.lean
semorrison Mar 18, 2020
babe6c6
Update src/category_theory/epi_mono.lean
semorrison Mar 18, 2020
e3442fa
better use of ext
semorrison Mar 18, 2020
b21cd0c
Merge remote-tracking branch 'origin/master' into chain_complex
semorrison Mar 18, 2020
e547914
feat(category_theory): subsingleton (has_zero_morphisms)
semorrison Mar 18, 2020
d3dcf67
revert some independent changes moved to #2180
semorrison Mar 18, 2020
0b257ca
revert some independent changes moved to #2181
semorrison Mar 18, 2020
f1d142c
revert independent changes moved to #2182
semorrison Mar 18, 2020
da69994
fix
semorrison Mar 18, 2020
7e4ae76
Merge branch 'subsingleton_has_zero_morphisms' into chain_complex
semorrison Mar 18, 2020
ea7d385
Apply suggestions from code review
semorrison Mar 19, 2020
d3e92fe
changes from review
semorrison Mar 19, 2020
4613e0d
module docs
semorrison Mar 19, 2020
f3c802c
merge
semorrison Mar 20, 2020
c4260dd
Merge remote-tracking branch 'origin/master' into chain_complex
semorrison Mar 21, 2020
7ed3b3c
various
semorrison Mar 22, 2020
c6b085a
Update src/category_theory/shift.lean
semorrison Mar 22, 2020
0352bc1
various
semorrison Mar 22, 2020
195fcc9
Merge branch 'chain_complex' of github.com:leanprover-community/mathl…
semorrison Mar 22, 2020
17e4f6d
various fixes
semorrison Mar 22, 2020
92a0bf4
fix
semorrison Mar 22, 2020
dca405f
all the minor suggestions
semorrison Mar 22, 2020
8be3226
Merge remote-tracking branch 'origin/master' into chain_complex
semorrison Mar 23, 2020
e3f4c27
ugh... fix reverting stuff from #2180
semorrison Mar 23, 2020
39d0cb1
off by one
semorrison Mar 23, 2020
5db4cb7
various
semorrison Mar 23, 2020
10d9433
use abbreviation
semorrison Mar 24, 2020
34958ba
chain as well as cochain
semorrison Mar 24, 2020
1a024ed
satisfy the linter
semorrison Mar 24, 2020
74c235b
some simp lemmas
semorrison Mar 24, 2020
c611d76
simp lemmas
semorrison Mar 25, 2020
452c0bb
Merge branch 'master' into chain_complex
mergify[bot] Mar 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/algebra/homology/chain_complex.lean
Expand Up @@ -50,9 +50,11 @@ variables {V}
A convenience lemma for morphisms of differential graded objects,
picking out one component of the commutation relation.
-/
-- Could this be a simp lemma? Which way?
lemma category_theory.differential_object.hom.comm_at {X Y : differential_object.{v} (graded_object ℤ V)}
(f : X ⟶ Y) (i : ℤ) : f.f i ≫ Y.d i = X.d i ≫ f.f (i+1) := congr_fun f.comm i
@[simp]
lemma category_theory.differential_object.hom.comm_at
{X Y : differential_object.{v} (graded_object ℤ V)} (f : X ⟶ Y) (i : ℤ) :
X.d i ≫ f.f (i+1) = f.f i ≫ Y.d i :=
congr_fun f.comm i
end

namespace chain_complex
Expand All @@ -73,8 +75,8 @@ by { dsimp [chain_complex], apply_instance }.

-- The components of a chain map `f : C ⟶ D` are accessed as `f.f i`.
example {C D : chain_complex V} (f : C ⟶ D) : C.X 5 ⟶ D.X 5 := f.f 5
example {C D : chain_complex V} (f : C ⟶ D) : f.fD.d = C.df.f[[1]] := f.comm
example {C D : chain_complex V} (f : C ⟶ D) : f.f 5 ≫ D.d 5 = C.d 5 ≫ f.f 6 := congr_fun f.comm 5
example {C D : chain_complex V} (f : C ⟶ D) : C.df.f⟦1⟧' = f.fD.d := by simp
example {C D : chain_complex V} (f : C ⟶ D) : C.d 5 ≫ f.f 6 = f.f 5 ≫ D.d 5 := congr_fun f.comm 5

/-- The forgetful functor from chain complexes to graded objects, forgetting the differential. -/
def forget : (chain_complex V) ⥤ (graded_object ℤ V) :=
Expand Down
2 changes: 1 addition & 1 deletion src/algebra/homology/homology.lean
Expand Up @@ -37,7 +37,7 @@ def induced_map_on_cycles {C C' : chain_complex.{v} V} (f : C ⟶ C') (i : ℤ)
kernel (C.d i) ⟶ kernel (C'.d i) :=
kernel.lift _ (kernel.ι _ ≫ f.f i)
begin
rw [category.assoc, f.comm_at, ←category.assoc, kernel.condition, has_zero_morphisms.zero_comp],
rw [category.assoc, f.comm_at, ←category.assoc, kernel.condition, has_zero_morphisms.zero_comp],
end
end

Expand Down
14 changes: 7 additions & 7 deletions src/category_theory/differential_object.lean
Expand Up @@ -11,7 +11,7 @@ import category_theory.shift

A differential object in a category with zero morphisms and a shift is
an object `X` equipped with
a morphism `d : X ⟶ X[1]`, such that `d^2 = 0`.
a morphism `d : X ⟶ X⟦1⟧`, such that `d^2 = 0`.

We build the category of differential objects, and some basic constructions
such as the forgetful functor, and zero morphisms and zero objects.
Expand All @@ -31,13 +31,13 @@ variables [has_zero_morphisms.{v} C] [has_shift.{v} C]
/--
A differential object in a category with zero morphisms and a shift is
an object `X` equipped with
a morphism `d : X ⟶ X[1]`, such that `d^2 = 0`.
a morphism `d : X ⟶ X⟦1⟧`, such that `d^2 = 0`.
-/
@[nolint has_inhabited_instance]
semorrison marked this conversation as resolved.
Show resolved Hide resolved
structure differential_object :=
(X : C)
(d : X ⟶ X[1])
(d_squared' : d ≫ d[[1]] = 0 . obviously)
(d : X ⟶ X⟦1⟧)
(d_squared' : d ≫ d⟦1⟧' = 0 . obviously)

restate_axiom differential_object.d_squared'
attribute [simp] differential_object.d_squared
Expand All @@ -52,9 +52,10 @@ A morphism of differential objects is a morphism commuting with the differential
@[ext, nolint has_inhabited_instance]
structure hom (X Y : differential_object.{v} C) :=
(f : X.X ⟶ Y.X)
(comm' : fY.d = X.df[[1]] . obviously)
(comm' : X.df⟦1⟧' = fY.d . obviously)

restate_axiom hom.comm'
attribute [simp, reassoc] hom.comm

namespace hom

Expand All @@ -66,8 +67,7 @@ def id (X : differential_object.{v} C) : hom X X :=
/-- The composition of morphisms of differential objects. -/
@[simps]
def comp {X Y Z : differential_object.{v} C} (f : hom X Y) (g : hom Y Z) : hom X Z :=
{ f := f.f ≫ g.f,
comm' := by rw [category.assoc, g.comm, ←category.assoc, f.comm, category.assoc, functor.map_comp], }
{ f := f.f ≫ g.f, }

end hom

Expand Down
18 changes: 6 additions & 12 deletions src/category_theory/equivalence.lean
Expand Up @@ -196,20 +196,14 @@ omit 𝒟 ℰ
-- The power structure is nevertheless useful

/-- Powers of an auto-equivalence. -/
def nat_pow (e : C ≌ C) : ℕ → (C ≌ C)
| 0 := equivalence.refl
| 1 := e
| (n+2) := e.trans (nat_pow (n+1))

instance has_pow_nat : has_pow (C ≌ C) ℕ := ⟨nat_pow⟩

/-- Integer powers of an auto-equivalence. -/
def int_pow (e : C ≌ C) : ℤ → (C ≌ C)
| (int.of_nat n) := e^n
def pow (e : C ≌ C) : ℤ → (C ≌ C)
jcommelin marked this conversation as resolved.
Show resolved Hide resolved
| (int.of_nat 0) := equivalence.refl
| (int.of_nat 1) := e
| (int.of_nat (n+2)) := e.trans (pow (int.of_nat (n+1)))
| (int.neg_succ_of_nat 0) := e.symm
| (int.neg_succ_of_nat (n+1)) := e.symm.trans (int_pow (int.neg_succ_of_nat n))
| (int.neg_succ_of_nat (n+1)) := e.symm.trans (pow (int.neg_succ_of_nat n))

instance has_pow_int : has_pow (C ≌ C) ℤ := ⟨int_pow
instance : has_pow (C ≌ C) ℤ := ⟨pow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this come with simp-lemmas or canonical-isom-defs for the cases n in {-1, 0, 1}, and similarly for (n+1) etc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the simp lemmas for -1, 0, 1. I don't think we're ready yet to express the power laws like (e^a).trans (e^b) \iso e^(a+b), as we haven't even specified the category structure on equivalences, let alone the monoidal category structure on autoequivalences!


end

Expand Down
17 changes: 9 additions & 8 deletions src/category_theory/shift.lean
Expand Up @@ -5,10 +5,10 @@ Authors: Scott Morrison
-/
import category_theory.limits.shapes.zero

semorrison marked this conversation as resolved.
Show resolved Hide resolved
/-! #Shift
/-! #Shift

A `shift` on a category is nothing more than an automorphism of the category. An example to
keep in mind might be the category of complexes ⋯ → C_{n-1} → C_n → C_{n+1} → ⋯with the shift
keep in mind might be the category of complexes ⋯ → C_{n-1} → C_n → C_{n+1} → ⋯ with the shift
operator re-indexing the terms, so the degree `n` term of `shift C` would be the degree `n+1`
term of `C`.

Expand All @@ -26,20 +26,21 @@ class has_shift :=

variables [has_shift.{v} C]

/-- The shift functor, moving objects and morphisms 'up'. -/
def shift : C C := (has_shift.shift.{v} C).functor
/-- The shift autoequivalence, moving objects and morphisms 'up'. -/
def shift : C C := has_shift.shift.{v} C

-- Any better notational suggestions?
notation X`[1]`:20 := (shift _).obj X
notation f`[[1]]`:80 := (shift _).map f
notation X`⟦`n`⟧`:20 := ((shift _)^(n : ℤ)).functor.obj X
notation f`⟦`n`⟧'`:80 := ((shift _)^(n : ℤ)).functor.map f

semorrison marked this conversation as resolved.
Show resolved Hide resolved
example {X Y : C} (f : X ⟶ Y) : X[1] ⟶ Y[1] := f[[1]]
example {X Y : C} (f : X ⟶ Y) : X⟦1⟧ ⟶ Y⟦1⟧ := f⟦1⟧'
example {X Y : C} (f : X ⟶ Y) : X⟦-2⟧ ⟶ Y⟦-2⟧ := f⟦-2⟧'

open category_theory.limits
variables [has_zero_morphisms.{v} C]

@[simp]
lemma shift_zero (X Y : C) : (0 : X ⟶ Y)[[1]] = (0 : X[1] ⟶ Y[1]) :=
lemma shift_zero (X Y : C) (n : ℤ) : (0 : X ⟶ Y)⟦n⟧' = (0 : X⟦n⟧ ⟶ Y⟦n⟧) :=
semorrison marked this conversation as resolved.
Show resolved Hide resolved
by apply equivalence_preserves_zero_morphisms

end category_theory