lean-ja / lean-ja/lean-by-example
`guard` を使ったときに、命題に名前を付けて再利用したい
Open
Nobody has claimed this yet.
要調査
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
以下の例では dependent ite を使っているが、guard 構文を利用できないか?
def bar (x : Nat) (_ : x % 2 == 0) := x
def foo (i : Nat) (arr : Array Nat) : Option Nat := do
let x ← arr.get? i
if h : x % 2 == 0 then
some (bar x h)
else
none
Zulip: >
dependent guard syntax?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the dependent guard syntax question in the issue and read the linked Zulip discussion. Determine whether Lean supports naming and reusing the proposition in this example; the work is complete only when the supported syntax or an explicit limitation is documented, with any needed example identified.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100