lean-ja / lean-ja/lean-by-example
grind funCC の使い方
Open
Nobody has claimed this yet.
優先度たかし
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
Here's a situation where grind fails to solve a goal involving function equalities.
def Φ : (Nat → Nat) → (Nat → Nat) := id
example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
grind -- fails
example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
grind [Φ] -- fails
example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
rw [h] -- succeeds
-- apply congrFun ‹_› -- also succeeds
example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
grind only [funext_iff (f := Φ f) (g := Φ g)] -- succeeds
example (f g : Nat → Nat) (h : f = g) (a : Nat) : Φ f a = Φ g a := by
grind only -- succeeds
こういうのを証明できるようになる
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 by reproducing the two failing grind examples in the issue, then compare them with the succeeding rw, congrFun, and funext_iff examples. Trace how grind handles equalities between functions and determine what is needed so the first two examples are provable; done means those examples succeed without the explicit workaround.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100