-
Notifications
You must be signed in to change notification settings - Fork 354
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
Conversation
joelriou
commented
Sep 19, 2023
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 |
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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 hφ
, Lean would find the type of φ
!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
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. If you want to switch to GitHub's built-in merge queue, visit their help page. |