Skip to content

feat(Order/UpperLower/Basic): an injective function constrained by the identity function using a well-order is the identity#36626

Open
SnirBroshi wants to merge 1 commit intoleanprover-community:masterfrom
SnirBroshi:feature/order/is-well-order-not-lt-injective
Open

feat(Order/UpperLower/Basic): an injective function constrained by the identity function using a well-order is the identity#36626
SnirBroshi wants to merge 1 commit intoleanprover-community:masterfrom
SnirBroshi:feature/order/is-well-order-not-lt-injective

Conversation

@SnirBroshi
Copy link
Copy Markdown
Collaborator


(yes I know IsLowerSet is bundled but I need the theorems for unbundled relations 🙈)

Open in Gitpod

…e identity function using a well-order is the identity
@SnirBroshi SnirBroshi requested a review from vihdzp March 14, 2026 01:01
@github-actions
Copy link
Copy Markdown

PR summary 7c885dc01c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ IsLowerSet.eqOn_id_of_injOn_of_forall_le
+ IsLowerSet.eqOn_id_of_injOn_of_forall_not_lt
+ IsWellOrder.eq_id_of_injective_of_forall_not_lt
+ IsWellOrder.eq_id_of_injective_of_le_id

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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-order Order theory label Mar 14, 2026
@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Mar 14, 2026

a) Do you really, really, really need unbundled relations for what you're doing? Forcibly turning a bundled predicate into an unbundled one is certainly the opposite of what we should be doing. If the issue is that you need both a normal ordering and a well-ordering on the same type, might I suggest a type alias?

b) This seems a bit similar to StrictMono.id_le. Can you reprove one using the other?

@SnirBroshi
Copy link
Copy Markdown
Collaborator Author

a) I'm accepting an arbitrary type α and an arbitrary well-order on it. Using instances such as LE/LT means that users will have to use type-aliases to use different orders. I even have a theorem with ∃ (r : α → α → Prop) (hr : IsWellOrder α r), ... and I don't see how it makes sense with bundled relations. The only thing I can think of is to add something like WithLT α r to Mathlib as a type-alias with instance LT (WithLT α r) := ⟨r⟩ and instance LT (WithLE α r) := ⟨¬r · ·⟩.

b) Yeah but it doesn't work for an arbitrary lower-set, and also I need monotonicity to use StrictMono.id_le in either direction, which I don't have.

@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Mar 14, 2026

The only thing I can think of is to add something like WithLT α r to Mathlib as a type-alias with instance LT (WithLT α r) := ⟨r⟩ and instance LT (WithLE α r) := ⟨¬r · ·⟩.

My idea was to create a WellOrdered α type alias, which is in bijection with α but has a well-ordered < relation. Surely that's enough for what you're doing?

@SnirBroshi
Copy link
Copy Markdown
Collaborator Author

By "has a well-ordered < relation" do you mean to use WellOrderingRel?

How would you spell IsFoo α ↔ ∃ (r : α → α → Prop) (hr : IsWellOrder α r), IsBar α using WellOrdered α?

@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Mar 14, 2026

I wouldn't spell it out directly, it'd be implied by the equivalence to WellOrder \a.

Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

I agree with Violeta that these lemmas look odd. Can you share the code where you use this?

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

Labels

t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants