leanprover / leanprover/fp-lean
3.5.3: question about `1 + x` in `(fun (x : Nat) => 1 + x) = (Nat.succ ·)`
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 192
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
I'm not sure if this is incorrect, but just feel it questionable.
The statement
(fun (x : Nat) => 1 + x) = (Nat.succ ·)is a perfectly reasonable statement. From the perspective of mathematics, two functions are equal if they map equal inputs to equal outputs, so this statement is even true, though it requires a one-line proof to convince Lean of this fact.
I think the one-line proof here is funext; apply Nat.add_comm. Is this what is intended?
The proof of the following statement seems easier:
(fun (x : Nat) => x + 1) = (Nat.succ ·)
example : (fun (x : Nat) => 1 + x) = (Nat.succ ·) := by
funext
apply Nat.add_comm
example : (fun (x : Nat) => x + 1) = (Nat.succ ·) := by
rfl
Anyway, thanks for the great book!
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/TypeClasses/StandardClasses.lean around lines 144–145 and compare the two function-equality examples in the issue. Check whether the text should explain the one-line proof or use the definitionally equal form; done means the book’s statement and accompanying explanation accurately reflect the intended Lean proof.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100