Skip to content

chore(Order/RelSeries): tag definitions providing RelSeries with implicit_reducible - #46111

Open
Hagb wants to merge 4 commits into
leanprover-community:masterfrom
WuProver:RelSeries-backward
Open

Hagb wants to merge 4 commits into
leanprover-community:masterfrom
WuProver:RelSeries-backward

Conversation

@Hagb

@Hagb Hagb commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

These definitions are sometimes applied with Fin _ whose the type-correctness needs unfolding the definition.

For example,

def ofLE (x : RelSeries r) {s : SetRel α α} (h : r ≤ s) : RelSeries s where
  length := x.length
  toFun := x
  step := ...

is used with ofLE s h n (i.e. (ofLE s h).toFun n) where (ofLE s h).toFun is a Fin ((ofLE s h).length + 1) → α and n is in Fin (s.length + 1) instead of Fin ((ofLE s h).length + 1), unless w.r.t. higher transparency.

It would be possible to cast these Fin _ or use Fin (EXPR.length + 1) (where EXPR is the expression of a RelSeries r such as ofLE s h), which are painful. This PR tags these definitions with @[implicit_reducible] so that they can be unfolded in implicit transparency. As a result, set_option backward.* in Mathlib.Order.RelSeries can be removed.


@Hagb

Hagb commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

!bench

@leanprover-radar

leanprover-radar commented Nov 17, 2026 •

Copy link
Copy Markdown

Benchmark results for 8311bd4 against 9fdc182 are in. No significant results found. @Hagb

  • ✅ build//instructions: -570.4M (-0.00%)

Small changes (2🟥)

  • 2 hidden

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

PR summary 6827cead7b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

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

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 6827cea).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


Decrease in strong tech debt: (relative, absolute) = (8.17, 0.01)
Current number Change Type (strong)
1757 -7 backward.defeqAttrib.useBackward
3542 -18 backward.isDefEq.respectTransparency
1971 -4 backward.isDefEq.respectTransparency.types
No changes to weak technical debt.

Current commit 6827cead7b
Reference commit 426b896108

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 Nov 17, 2026
@Hagb Hagb changed the title chore(Order/RelSeries): tag definitions producing RelSeries with implicit_reducible chore(Order/RelSeries): tag definitions providing RelSeries's with implicit_reducible Nov 17, 2026
@Hagb Hagb changed the title chore(Order/RelSeries): tag definitions providing RelSeries's with implicit_reducible chore(Order/RelSeries): tag definitions providing RelSeries with implicit_reducible Nov 17, 2026
@Hagb
Hagb marked this pull request as ready for review November 17, 2026 10:51
@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 Nov 18, 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 Nov 20, 2026

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