forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parity between structure instance notation and
where
notation (…
…leanprover#6165) This PR modifies structure instance notation and `where` notation to use the same notation for fields. Structure instance notation now admits binders, type ascriptions, and equations, and `where` notation admits full structure lvals. Examples of these for structure instance notation: ```lean structure PosFun where f : Nat → Nat pos : ∀ n, 0 < f n def p : PosFun := { f n := n + 1 pos := by simp } def p' : PosFun := { f | 0 => 1 | n + 1 => n + 1 pos := by rintro (_|_) <;> simp } ``` Just like for the structure `where` notation, a field `f x y z : ty := val` expands to `f := fun x y z => (val : ty)`. The type ascription is optional. The PR also is setting things up for future expansion. Pending some discussion, in the future structure/`where` notation could have have embedded `where` clauses; rather than `{ a := { x := 1, y := z } }` one could write `{ a where x := 1; y := z }`.
- Loading branch information
Showing
13 changed files
with
328 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.