[Typo] Section 8.5 recursion on wrong var in Nat.plusR rhs
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 55/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- documentation
Research direction
Open Section 8.5 and inspect the Nat.plusR example shown in the issue. Correct the recursive right-hand side as indicated, then verify that the example no longer reports the displayed termination error.
Written by the indexing model from the issue text.
Description
def Nat.plusR : Nat → Nat → Nat
| n, 0 => n
| n, k + 1 => plusR n k + 1
The recursion doesn't reduce the size of either Nat and generates a "Failed to show termination" error. I believe the last line should be
| n, k + 1 => plusRinbook (n + 1) k
Full error text:
▶ 8:5-8:14: error:
fail to show termination for
Nat.plusR
with errors
failed to infer structural recursion:
Cannot use parameter #1:
failed to eliminate recursive application
n.plusR (k + 1)
Cannot use parameter #2:
failed to eliminate recursive application
n.plusR (k + 1)
Could not find a decreasing measure.
The arguments relate at each recursive call as follows:
(<, ≤, =: relation proved, ? all proofs failed, _: no proof attempted)
x1 x2
1) 10:16-31 = =
Please use `termination_by` to specify a decreasing measure.
- Dominant language
- Lean
- Stars
- 211
- Forks
- 83
- Avg merge
- 8m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from leanprover/fp-lean
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
leanprover/fp-lean#316 ·
-
Typo
Difficulty 1/5 Under an hour Newbie friendliness 90/100
leanprover/fp-lean#311 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
leanprover/fp-lean#304 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leanprover/fp-lean#303 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
leanprover/fp-lean#301 · 1 comment ·
All issues in leanprover/fp-lean
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
優先度たかし
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lean-ja/lean-by-example#2681 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
laststance/design-world#79 ·
Maintainers usually reply within 1 day
-
v2
Difficulty 1/5 Under an hour Newbie friendliness 86/100
modelcontextprotocol/python-sdk#3978 · 2 comments ·
Maintainers usually reply within 1 day