Skip to content

feat(Order/RelSeries): order series by refinement - #42561

Open
SnirBroshi wants to merge 11 commits into
leanprover-community:masterfrom
SnirBroshi:feature/order/rel-series-partial-order
Open

SnirBroshi wants to merge 11 commits into
leanprover-community:masterfrom
SnirBroshi:feature/order/rel-series-partial-order

Conversation

@SnirBroshi

@SnirBroshi SnirBroshi commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator

Define a partial order on RelSeries, add basic lemmas for the operations (e.g. p < p.append q), and relate to IsChain on sets.

This lets us spell "maximal chain" using series.


Open in Gitpod

@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

PR summary bb28048935

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ drop_le
+ eraseLast_eq_self_iff
+ eraseLast_le
+ eraseLast_lt
+ instance : PartialOrder (RelSeries r)
+ instance [r.FiniteDimensional] : Std.Asymm (· ~[r] ·)
+ isChain_setRange
+ isMax_of_isMaxChain_setRange
+ le_def
+ left_lt_append
+ length_strictMono
+ lt_cons
+ lt_snoc
+ map_monotone
+ mem_of_le_of_mem
+ reverse_mono
+ right_lt_append
+ setRange_mono
+ setRange_monotone
+ tail_lt
+ take_le
+ toList_drop
+ toList_map
+ toList_range
+ toList_reverse
+ toList_take
++ setRange_injective
++ setRange_strictMono

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit bb28048).

  • +32 new declarations
  • −0 removed declarations
+LTSeries.setRange_injective
+LTSeries.setRange_strictMono
+LTSeries.toList_range
+List.get.hcongr_3
+RelSeries.drop_le
+RelSeries.eraseLast_eq_self_iff
+RelSeries.eraseLast_le
+RelSeries.eraseLast_lt
+RelSeries.instAsymmMemProdSetRelMkOfFiniteDimensional
+RelSeries.instPartialOrder
+RelSeries.isChain_setRange
+RelSeries.isMax_of_isMaxChain_setRange
+RelSeries.le_def
+RelSeries.left_lt_append
+RelSeries.length_strictMono
+RelSeries.longestOf.congr_simp
+RelSeries.lt_cons
+RelSeries.lt_snoc
+RelSeries.map_monotone
+RelSeries.mem_of_le_of_mem
+RelSeries.reverse_mono
+RelSeries.right_lt_append
+RelSeries.setRange_injective
+RelSeries.setRange_mono
+RelSeries.setRange_monotone
+RelSeries.setRange_strictMono
+RelSeries.tail_lt
+RelSeries.take_le
+RelSeries.toList_drop
+RelSeries.toList_map
+RelSeries.toList_reverse
+RelSeries.toList_take

Decrease in strong tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (strong)
4171 -1 backward.isDefEq.respectTransparency
No changes to weak technical debt.

Current commit bb28048935
Reference commit 2b2e96747c

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py 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-order Order theory label Aug 8, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 26, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@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 Oct 26, 2026

theorem reverse_mono : p.reverse ≤ q.reverse ↔ p ≤ q := by
simp [le_def]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this be @[simp]'ed?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-order Order theory tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants