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

Revise have syntax, once more #479

Merged
merged 3 commits into from
May 20, 2021
Merged

Revise have syntax, once more #479

merged 3 commits into from
May 20, 2021

Conversation

Kha
Copy link
Member

@Kha Kha commented May 20, 2021

This PR changes have's syntax to support all that of let:

have name param* [: type]? := term
have name param* [: type]? [| case]+
have pattern := term

The only additional syntax is anonymous have, which now always has a : before the type (if any) for disambiguation (just like instance), and introduces a hypothesis this as before:

have : type := term
have : type [| case]+

@leodemoura leodemoura merged commit a02c6fd into leanprover:master May 20, 2021
ChrisHughes24 pushed a commit to ChrisHughes24/lean4 that referenced this pull request Dec 2, 2022
My first attempt to port a file to mathlib4. Please review my code style carefully -- I'm still not 100% sure about the rules yet.

Notes: 

1) The file uses `Function.surjective.forall` once, and this declaration is in Mathlib.Logic.Function.Basic. Conversely, importing that file gives us everything we need. As a result the imports in this file look totally unrelated to the corresponding imports in the mathlib3 file.

2) The proof of `mk.inj_iff` in mathlib3 was `by simp` but this failed in mathlib4 so I knocked up a longer proof (lines 56-57). Should I worry about this? In Lean 3 `simp?` suggested `simp only [implies_true_iff, and.congr_left_iff]`, which didn't work in Lean 3, and `squeeze_simp` suggested `simp only` which (to my mild surprise) does ;-)

3) I also edited the module docstring because I found the Lean 3 docstring claim that a dependent product was "like `α × β`" and then immediately "a generalization of `α ⊕ β`" confusing (these are not the same alpha and beta; the idea is that the first alpha is bool in the second example; hopefully my explanation is now better).

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants