leanprover / leanprover/reference-manual
Document `strong_coinduct`
Open
Beginner friendly
Nobody has claimed this yet.
doc-request
- Dominant language
- Lean
- Stars
- 129
- Forks
- 67
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 16
Description
In lean4#14855 a support for strong coinduction was added. For example:
coinductive infSeq {r : α → α → Prop} : α → Prop where
| mk : r a b → infSeq b → infSeq a
/--
info: infSeq.coinduct.{u_1} {α : Sort u_1} {r : α → α → Prop} (pred : α → Prop)
(hyp : ∀ (a : α), pred a → ∃ b, r a b ∧ pred b) (a✝ : α) : pred a✝ → infSeq a✝
-/
#guard_msgs in
#check infSeq.coinduct
/--
info: infSeq.strong_coinduct.{u_1} {α : Sort u_1} {r : α → α → Prop} (pred : α → Prop)
(hyp : ∀ (a : α), pred a → ∃ b, r a b ∧ (pred b ∨ infSeq b)) (a✝ : α) : pred a✝ → infSeq a✝
-/
#guard_msgs in
#check infSeq.strong_coinduct
Note, that this also works for mutually-recursive (including mixed inductive-coinductive) definitions.
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 with the reference manual section covering coinductive definitions and use the issue's infSeq example and #check output as the documentation requirements. Document strong_coinduct, including its hypothesis and applicability to mutually recursive and mixed inductive-coinductive definitions; done when these cases are clearly explained with the relevant example.
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
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100