Skip to content

[Merged by Bors] - refactor(Data/Seq): reorganize Seq.lean#20071

Closed
vasnesterov wants to merge 30 commits intomasterfrom
vasnesterov/Seq_refactor
Closed

[Merged by Bors] - refactor(Data/Seq): reorganize Seq.lean#20071
vasnesterov wants to merge 30 commits intomasterfrom
vasnesterov/Seq_refactor

Conversation

@vasnesterov
Copy link
Copy Markdown
Collaborator

@vasnesterov vasnesterov commented Dec 19, 2024

The Seq API in the Seq.lean file was somewhat disorganized. This PR reorganizes the file to make it more structured.

It arranges the API in the following way:

  1. Definitions and the get? function.
  2. Constructors: nil and cons.
  3. Destructors: head, tail, and destruct.
  4. Recursion and corecursion principles.
  5. Bisimulation.
  6. Terminates API.
  7. Membership for sequences.
  8. Conversion to and from other types (List, Stream, MLList) and take operation as it is required for conversion to List.
  9. Definitions of other operations on sequences (append, map, join, etc.).
  10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.

I tried not to change any proofs here, but had to rewrite some of them due to dependencies and to avoid importing apply_fun. The proofs of the following lemmas were changed:

  • head_eq_some
  • head_eq_none
  • cons_ne_nil
  • cons_eq_cons
  • ofList

I found it useful to run git diff --color-moved to verify that the actual difference is just these proofs and adding sections.

Open in Gitpod

@vasnesterov vasnesterov added the t-data Data (lists, quotients, numbers, etc) label Dec 19, 2024
@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Dec 19, 2024
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 19, 2024
@github-actions github-actions bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Jan 18, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 18, 2025

PR summary f2334cb2b1

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.Seq.Seq 331 258 -73 (-22.05%)
Mathlib.Data.WSeq.Basic 332 263 -69 (-20.78%)
Mathlib.Data.WSeq.Relation 333 265 -68 (-20.42%)
Import changes for all files
Files Import difference
Mathlib.Data.Seq.Seq -73
Mathlib.Algebra.ContinuedFractions.Basic -72
5 files Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence Mathlib.Algebra.ContinuedFractions.TerminatedStable Mathlib.Algebra.ContinuedFractions.Translations Mathlib.Data.WSeq.Basic Mathlib.Data.WSeq.Defs
-69
4 files Mathlib.Data.Seq.Parallel Mathlib.Data.Seq.WSeq Mathlib.Data.WSeq.Productive Mathlib.Data.WSeq.Relation
-68
Mathlib.Algebra.ContinuedFractions.Determinant -8
Mathlib.Algebra.ContinuedFractions.Computation.Basic Mathlib.Algebra.ContinuedFractions.ConvergentsEquiv -7
Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating Mathlib.Algebra.ContinuedFractions.Computation.Translations -6
Mathlib.Algebra.ContinuedFractions.Computation.Approximations Mathlib.Algebra.ContinuedFractions.Computation.TerminatesIffRat -1

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 22, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Mar 10, 2025
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

This PR/issue depends on:

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 18, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 18, 2025
@j-loreaux
Copy link
Copy Markdown
Contributor

Thanks for this tip: git diff --color-moved, it was helpful in reviewing!

@j-loreaux
Copy link
Copy Markdown
Contributor

maintainer merge

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 9, 2025

🚀 Pull request has been placed on the maintainer queue by j-loreaux.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label May 9, 2025
@jcommelin
Copy link
Copy Markdown
Member

Thanks 🎉

bors merge

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels May 12, 2025
mathlib-bors bot pushed a commit that referenced this pull request May 12, 2025
The `Seq` API in the `Seq.lean` file was somewhat disorganized. This PR reorganizes the file to make it more structured.  

It arranges the API in the following way:
1. Definitions and the `get?` function.  
2. Constructors: `nil` and `cons`.  
3. Destructors: `head`, `tail`, and `destruct`.  
4. Recursion and corecursion principles.  
5. Bisimulation.  
6. `Terminates` API.  
7. `Membership` for sequences.  
8. Conversion to and from other types (`List`, `Stream`, `MLList`) and `take` operation as it is required for conversion to `List`.  
9. Definitions of other operations on sequences (`append`, `map`, `join`, etc.).  
10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 12, 2025

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request May 12, 2025
The `Seq` API in the `Seq.lean` file was somewhat disorganized. This PR reorganizes the file to make it more structured.  

It arranges the API in the following way:
1. Definitions and the `get?` function.  
2. Constructors: `nil` and `cons`.  
3. Destructors: `head`, `tail`, and `destruct`.  
4. Recursion and corecursion principles.  
5. Bisimulation.  
6. `Terminates` API.  
7. `Membership` for sequences.  
8. Conversion to and from other types (`List`, `Stream`, `MLList`) and `take` operation as it is required for conversion to `List`.  
9. Definitions of other operations on sequences (`append`, `map`, `join`, etc.).  
10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 12, 2025

Build failed:

@vasnesterov
Copy link
Copy Markdown
Collaborator Author

@jcommelin Should it be merged again?

@j-loreaux
Copy link
Copy Markdown
Contributor

bors merge

mathlib-bors bot pushed a commit that referenced this pull request May 12, 2025
The `Seq` API in the `Seq.lean` file was somewhat disorganized. This PR reorganizes the file to make it more structured.  

It arranges the API in the following way:
1. Definitions and the `get?` function.  
2. Constructors: `nil` and `cons`.  
3. Destructors: `head`, `tail`, and `destruct`.  
4. Recursion and corecursion principles.  
5. Bisimulation.  
6. `Terminates` API.  
7. `Membership` for sequences.  
8. Conversion to and from other types (`List`, `Stream`, `MLList`) and `take` operation as it is required for conversion to `List`.  
9. Definitions of other operations on sequences (`append`, `map`, `join`, etc.).  
10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 12, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(Data/Seq): reorganize Seq.lean [Merged by Bors] - refactor(Data/Seq): reorganize Seq.lean May 12, 2025
@mathlib-bors mathlib-bors bot closed this May 12, 2025
@mathlib-bors mathlib-bors bot deleted the vasnesterov/Seq_refactor branch May 12, 2025 18:50
tannerduve pushed a commit that referenced this pull request May 13, 2025
The `Seq` API in the `Seq.lean` file was somewhat disorganized. This PR reorganizes the file to make it more structured.  

It arranges the API in the following way:
1. Definitions and the `get?` function.  
2. Constructors: `nil` and `cons`.  
3. Destructors: `head`, `tail`, and `destruct`.  
4. Recursion and corecursion principles.  
5. Bisimulation.  
6. `Terminates` API.  
7. `Membership` for sequences.  
8. Conversion to and from other types (`List`, `Stream`, `MLList`) and `take` operation as it is required for conversion to `List`.  
9. Definitions of other operations on sequences (`append`, `map`, `join`, etc.).  
10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.
jano-wol pushed a commit that referenced this pull request May 16, 2025
The `Seq` API in the `Seq.lean` file was somewhat disorganized. This PR reorganizes the file to make it more structured.  

It arranges the API in the following way:
1. Definitions and the `get?` function.  
2. Constructors: `nil` and `cons`.  
3. Destructors: `head`, `tail`, and `destruct`.  
4. Recursion and corecursion principles.  
5. Bisimulation.  
6. `Terminates` API.  
7. `Membership` for sequences.  
8. Conversion to and from other types (`List`, `Stream`, `MLList`) and `take` operation as it is required for conversion to `List`.  
9. Definitions of other operations on sequences (`append`, `map`, `join`, etc.).  
10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.
bwehlin pushed a commit to bwehlin/mathlib4 that referenced this pull request May 31, 2025
The `Seq` API in the `Seq.lean` file was somewhat disorganized. This PR reorganizes the file to make it more structured.  

It arranges the API in the following way:
1. Definitions and the `get?` function.  
2. Constructors: `nil` and `cons`.  
3. Destructors: `head`, `tail`, and `destruct`.  
4. Recursion and corecursion principles.  
5. Bisimulation.  
6. `Terminates` API.  
7. `Membership` for sequences.  
8. Conversion to and from other types (`List`, `Stream`, `MLList`) and `take` operation as it is required for conversion to `List`.  
9. Definitions of other operations on sequences (`append`, `map`, `join`, etc.).  
10. Lemmas about conversions and operations, organized into sections by the primary operation of each lemma.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants