Skip to content

[Merged by Bors] - feat(Data/Seq): coinductive predicates for sequences#28874

Closed
vasnesterov wants to merge 49 commits intoleanprover-community:masterfrom
vasnesterov:vasnesterov/Seq_predicates
Closed

[Merged by Bors] - feat(Data/Seq): coinductive predicates for sequences#28874
vasnesterov wants to merge 49 commits intoleanprover-community:masterfrom
vasnesterov:vasnesterov/Seq_predicates

Conversation

@vasnesterov
Copy link
Copy Markdown
Collaborator

@vasnesterov vasnesterov commented Aug 24, 2025

  • Prove eq_of_bisim' and eq_of_bisim_strong coinductive principles for equality.
  • Develop API for a predicate ∀ x ∈ s, p x where s : Seq α, including coinductive principle all_coind.
  • Introduce the Pairwise predicate along with API and coinductive principles Pairwise.coind and Pairwise.coind_trans.
  • Introduce ENat-valued length of a sequence, length', along with minimal API.
  • Move theorems about length from Defs.lean to Basic.lean.
  • Prove a coinductive principle for a predicate a.length' ≤ b.length'.

All of these "coinductive principles" are stated in the form as similar as possible to inductive principles.


This PR is necessary for a new tactic (#28291), which computes the asymptotics of real functions.

Open in Gitpod

This PR continues the work from #20241.

Original PR: #20241

@bryangingechen bryangingechen added the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 9, 2025
@vasnesterov vasnesterov removed the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 9, 2025
@bryangingechen bryangingechen added the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 10, 2025
@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Sep 12, 2025
@vasnesterov vasnesterov removed the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 12, 2025
Copy link
Copy Markdown
Contributor

@bryangingechen bryangingechen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty reasonable to me. Granted, I haven't checked the code in #28291 where this is used yet though.

@plp127 @eric-wieser any final comments?

@bryangingechen bryangingechen added the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 14, 2025
@vasnesterov vasnesterov removed the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 14, 2025
@bryangingechen
Copy link
Copy Markdown
Contributor

Thanks!
bors r+

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Sep 17, 2025
mathlib-bors bot pushed a commit that referenced this pull request Sep 17, 2025
* Prove `eq_of_bisim'` and `eq_of_bisim_strong` coinductive principles for equality.
* Develop API for a predicate `∀ x ∈ s, p x` where `s : Seq α`, including coinductive principle `all_coind`.
* Introduce the `Pairwise` predicate along with API and coinductive principles `Pairwise.coind` and `Pairwise.coind_trans`.
* Introduce `ENat`-valued length of a sequence, `length'`, along with minimal API. 
* Move theorems about `length` from `Defs.lean` to `Basic.lean`.
* Prove a coinductive principle for a predicate `a.length' ≤ b.length'`. 
 
All of these "coinductive principles" are stated in the form as similar as possible to inductive principles.

Co-authored-by: Vasily Nesterov <vas.nesterov63@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Sep 17, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Data/Seq): coinductive predicates for sequences [Merged by Bors] - feat(Data/Seq): coinductive predicates for sequences Sep 17, 2025
@mathlib-bors mathlib-bors bot closed this Sep 17, 2025
joelriou pushed a commit to joelriou/mathlib4 that referenced this pull request Oct 2, 2025
…unity#28874)

* Prove `eq_of_bisim'` and `eq_of_bisim_strong` coinductive principles for equality.
* Develop API for a predicate `∀ x ∈ s, p x` where `s : Seq α`, including coinductive principle `all_coind`.
* Introduce the `Pairwise` predicate along with API and coinductive principles `Pairwise.coind` and `Pairwise.coind_trans`.
* Introduce `ENat`-valued length of a sequence, `length'`, along with minimal API. 
* Move theorems about `length` from `Defs.lean` to `Basic.lean`.
* Prove a coinductive principle for a predicate `a.length' ≤ b.length'`. 
 
All of these "coinductive principles" are stated in the form as similar as possible to inductive principles.

Co-authored-by: Vasily Nesterov <vas.nesterov63@gmail.com>
zhuyizheng pushed a commit to zhuyizheng/mathlib4 that referenced this pull request Oct 2, 2025
…unity#28874)

* Prove `eq_of_bisim'` and `eq_of_bisim_strong` coinductive principles for equality.
* Develop API for a predicate `∀ x ∈ s, p x` where `s : Seq α`, including coinductive principle `all_coind`.
* Introduce the `Pairwise` predicate along with API and coinductive principles `Pairwise.coind` and `Pairwise.coind_trans`.
* Introduce `ENat`-valued length of a sequence, `length'`, along with minimal API. 
* Move theorems about `length` from `Defs.lean` to `Basic.lean`.
* Prove a coinductive principle for a predicate `a.length' ≤ b.length'`. 
 
All of these "coinductive principles" are stated in the form as similar as possible to inductive principles.

Co-authored-by: Vasily Nesterov <vas.nesterov63@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports ready-to-merge This PR has been sent to bors. t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants