Skip to content

[Merged by Bors] - feat(Data/List): add theorem length_eq_two'#35775

Closed
IvanRenison wants to merge 2 commits intoleanprover-community:masterfrom
IvanRenison:length_eq_two'
Closed

[Merged by Bors] - feat(Data/List): add theorem length_eq_two'#35775
IvanRenison wants to merge 2 commits intoleanprover-community:masterfrom
IvanRenison:length_eq_two'

Conversation

@IvanRenison
Copy link
Collaborator


Open in Gitpod

@IvanRenison IvanRenison changed the title feat(Data/List): add lemma length_eq_two' feat(Data/List): add theorem length_eq_two' Feb 25, 2026
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

PR summary 9b809f3970

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ length_eq_two'

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 scripts/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).

@github-actions github-actions bot added the t-data Data (lists, quotients, numbers, etc) label Feb 25, 2026
Copy link
Collaborator

@vihdzp vihdzp left a comment

Choose a reason for hiding this comment

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

Can grind solve this? Perhaps rw [length_eq_two]; grind?

Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Copy link
Collaborator

@vihdzp vihdzp left a comment

Choose a reason for hiding this comment

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

I wonder if the statement

theorem length_eq_two' {l : List α} : l.length = 2 ↔ ∃ h, l = [l.head h, l.getLast h] := ...

might be more useful? That's up to you, otherwise LGTM.

@IvanRenison
Copy link
Collaborator Author

In my use case in #35777 it does not work

Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

I would even mildly prefer this phrasing over the original length_eq_two (since replacing with explicit witnesses is nicer!). So looks good to me!

bors r+

@mathlib-triage mathlib-triage bot added the ready-to-merge This PR has been sent to bors. label Mar 5, 2026
mathlib-bors bot pushed a commit that referenced this pull request Mar 5, 2026
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Mar 5, 2026

This PR was included in a batch that was canceled, it will be automatically retried

mathlib-bors bot pushed a commit that referenced this pull request Mar 5, 2026
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Mar 5, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Data/List): add theorem length_eq_two' [Merged by Bors] - feat(Data/List): add theorem length_eq_two' Mar 5, 2026
@mathlib-bors mathlib-bors bot closed this Mar 5, 2026
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.

3 participants