Document `strong_coinduct`

Open Beginner friendly
#937 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Domain
documentation

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.

Description

doc-request

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.

Dominant language
Lean
Stars
129
Forks
67
Avg merge
1d 15h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leanprover/reference-manual

All issues in leanprover/reference-manual

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.