lean-ja / lean-ja/lean-by-example
List.attach 使用例
Open
Nobody has claimed this yet.
コード例
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
Zulip: How to make this recursion (?) work?
mutual
inductive Value: Type where
| function: ℕ → Expression → Value
inductive Expression where
| fun_apply: Expression → List Expression → Expression
end
def List.Exists {A} (L: List A) (P: A → Prop): Prop :=
match L with
| List.nil => False
| x :: t => P x ∨ t.Exists P
def freeVariable (n: ℕ) (exp: Expression): Prop :=
match exp with
| Expression.fun_apply f L => freeVariable n f ∨ List.Exists L.attach (fun ⟨e, _⟩ => freeVariable n e)
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 linked Zulip discussion and the Lean snippet in the issue, focusing on List.attach and the recursive freeVariable definition. Determine how this example can be expressed correctly, then document a working List.attach usage example in the repository; done means the recursion and attached-list traversal are accepted by Lean.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100