leanprover / leanprover/fp-lean
minus function in GettingToKnow/DatatypesPatterns.lean doesn't work
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 192
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
In the Getting to Know Lean chapter, section 1.5 Datatypes, there's a mistake on line 372 in the definition of the minus function.
The current version reads:
def minus (n : Nat) (k : Nat) : Nat :=
match k with
| Nat.zero => n
| Nat.succ k' => pred (minus n k')
It should read:
def minus (n : Nat) (k : Nat) : Nat :=
match k with
| Nat.zero => n
| Nat.succ k' => Nat.pred (minus n k')
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
Open book/FPLean/GettingToKnow/DatatypesPatterns.lean around line 368 and compare the minus definition with the issue's corrected version. Verify that the definition uses Nat.pred, then check the surrounding chapter content or Lean validation to confirm the example works.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100