lean-ja / lean-ja/lean-by-example
induction .. generalizing が必要な例
Open
Nobody has claimed this yet.
コード例
タクティク
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
theorem MyNat.eq_zero_of_add_eq_zero {m n : MyNat} : m + n = 0 → m = 0 ∧ n = 0 := by
intro h
induction m generalizing n with -- *TODO*: generalizing が必要な例
| zero =>
suffices n = 0 from by simp_all
simp_all
| succ m ih =>
replace ih := @ih (n + 1) -- *TODO*: これは暗黙引数を明示化する例では?
replace ih := ih (show m + (n + 1) = 0 from by rw[← h]; ac_rfl)
simp_all
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 locating the example containing MyNat.eq_zero_of_add_eq_zero and read the surrounding explanation. Review the two TODO comments, especially whether the second describes explicit application of an implicit argument, and update the example's documentation so both points are accurately explained.
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
- 48/100