-
Notifications
You must be signed in to change notification settings - Fork 344
Generalize commute-subst-rename
#1130
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
base: dev
Are you sure you want to change the base?
Conversation
|
Thank you for the quick reply! I read the build error message, but it seems like that the error is irrelevant to change made in this PR. (#1129 also fails check with same error) |
|
Thank you @damhiya for this PR. I like your generalization. |
8092813 to
acf3a29
Compare
|
@jsiek Thank you, I recovered the original theorem as your suggestion! |
jsiek
left a comment
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.
Please change the uses of the lemma back to the old one. Thank you!
acf3a29 to
a79928b
Compare
jsiek
left a comment
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.
Looks great, thanks again!
added definition: `Commute` added lemma: `Commute-S`, `Commute-ext`, `Commute-subst-rename`
a79928b to
07741de
Compare
Hello! I generalized the statement of
commute-subst-renameand added some definitions and lemmas in the Substitution appendix.Here is the previous statement of
commute-subst-rename:And suggested revision:
Old statement is an instance of the new one, where
σ₁ = exts σandσ₂ = σ.The motivation for this change is two folded. First, it is simply more general, so it has more applications in theory. Second and more importantly, the new proof can be naturally adapted to typed setting, while the older one is not. Consider the previous proof of
commute-subst-renamefor theƛ_case.commute-subst-rename {Γ}{Δ}{ƛ N}{σ}{ρ₁}{ρ₂} H = cong ƛ_ (commute-subst-rename{Γ , ★}{Δ , ★}{N} {exts σ}{ext ρ₁}{ext ρ₂} (λ {x} → H′ {x})) where H′ : {x : Γ , ★ ∋ ★} → exts (exts σ) (ext ρ₁ x) ≡ rename (ext ρ₂) (exts σ x) H′ = ...In the type of
H′,exts σon the LHS andexts σon the RHS may seem equal, but each occurrence ofextsoperations are responsible for different variables. If we annotateext/extsoperations with relatedness, the type would be something like the following:However the use of
H′incommute-subst-rename{Γ , ★}{Δ , ★}{N}{exts σ}{ext ρ₁}{ext ρ₂} (λ {x} → H′ {x})requiresexts₁ σandexts₂ σto be judgementally equal. This is the case in our untyped setting, but it could be false in general, for instance in intrinsically typed setting. The generalized version does not have this problem.I also fixed text according to changed proof structure.