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

[Merged by Bors] - feat: quasi-isomorphisms of short complexes #7262

Closed
wants to merge 4 commits into from

Conversation

joelriou
Copy link
Collaborator


Open in Gitpod

Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean Outdated Show resolved Hide resolved
Comment on lines 47 to 55
lemma quasiIso_comp' (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃) (hφ : QuasiIso φ) (hφ' : QuasiIso φ') :
QuasiIso (φ ≫ φ') := by
rw [quasiIso_iff] at hφ hφ' ⊢
rw [homologyMap_comp]
infer_instance

instance quasiIso_comp (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃) [QuasiIso φ] [QuasiIso φ'] :
QuasiIso (φ ≫ φ') :=
quasiIso_comp' φ φ' inferInstance inferInstance
Copy link
Member

Choose a reason for hiding this comment

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

You are essentially duplicating every instance as a lemma. But since Lean 4 permits named variables, I wonder whether it is enough to just provide the instances and give nice names to the instance variables:

Suggested change
lemma quasiIso_comp' (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃) (hφ : QuasiIso φ) (hφ' : QuasiIso φ') :
QuasiIso (φ ≫ φ') := by
rw [quasiIso_iff] at hφ hφ' ⊢
rw [homologyMap_comp]
infer_instance
instance quasiIso_comp (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃) [QuasiIso φ] [QuasiIso φ'] :
QuasiIso (φ ≫ φ') :=
quasiIso_comp' φ φ' inferInstance inferInstance
instance quasiIso_comp (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃) [hφ : QuasiIso φ] [hφ' : QuasiIso φ'] :
QuasiIso (φ ≫ φ') := by
rw [quasiIso_iff] at hφ hφ' ⊢
rw [homologyMap_comp]
infer_instance

This can then be used as quasiIso_comp φ φ' (hφ := foo) (hφ' := bar) when needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I have struggled a little bit with the syntax to make this work downstream, but it works. (It seems the exact syntax would be quasiIso_comp (hφ := foo) (hφ' := bar) because from the type of , Lean would find the type of φ!)

@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Sep 21, 2023
@joelriou joelriou added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes labels Sep 22, 2023
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Sep 22, 2023
bors bot pushed a commit that referenced this pull request Sep 22, 2023
@bors
Copy link

bors bot commented Sep 22, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: quasi-isomorphisms of short complexes [Merged by Bors] - feat: quasi-isomorphisms of short complexes Sep 22, 2023
@bors bors bot closed this Sep 22, 2023
@bors bors bot deleted the shortcomplex_quasiiso branch September 22, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-category-theory Category theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants