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:
partial
inhabitation uses local Inhabited
instances created…
… from parameters (leanprover#5821) Rather than having a special pass where `mkInhabitantFor` uses the `assumption` tactic, it creates `Inhabited` instances for each parameter and just searches for an `Inhabited`/`Nonempty` instance for the return type. This makes examples like the following work: ```lean partial def f (x : X) : Bool × X := ... ``` Removes the strategy where it looks for `Inhabited`/`Nonempty` instances for every suffix of the signature. This is a follow-up to leanprover#5780. Motivated [by Zulip](https://leanprover.zulipchat.com/#narrow/channel/113489-new-members/topic/Why.20return.20type.20of.20partial.20function.20MUST.20.60inhabited.60.3F/near/477905312).
- Loading branch information
1 parent
35efb1a
commit 69716bb
Showing
3 changed files
with
50 additions
and
41 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