Conversation
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Dec 14, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 14, 2024
|
Mathlib CI status (docs):
|
kim-em
added a commit
to leanprover-community/batteries
that referenced
this pull request
Dec 14, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 14, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 14, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Dec 14, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 14, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 14, 2024
List.lt to List.Lex', and replace with Mathlib compatible definitionList.lt with List.Lex
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Dec 15, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 15, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Dec 15, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 15, 2024
luisacicolini
pushed a commit
to opencompl/lean4
that referenced
this pull request
Jan 21, 2025
This PR replaces `List.lt` with `List.Lex`, from Mathlib, and adds the new `Bool` valued lexicographic comparatory function `List.lex`. This subtly changes the definition of `<` on Lists in some situations. `List.lt` was a weaker relation: in particular if `l₁ < l₂`, then `a :: l₁ < b :: l₂` may hold according to `List.lt` even if `a` and `b` are merely incomparable (either neither `a < b` nor `b < a`), whereas according to `List.Lex` this would require `a = b`. When `<` is total, in the sense that `¬ · < ·` is antisymmetric, then the two relations coincide. Mathlib was already overriding the order instances for `List α`, so this change should not be noticed by anyone already using Mathlib. We simultaneously add the boolean valued `List.lex` function, parameterised by a `BEq` typeclass and an arbitrary `lt` function. This will support the flexibility previously provided for `List.lt`, via a `==` function which is weaker than strict equality.
JovanGerb
pushed a commit
to JovanGerb/lean4
that referenced
this pull request
Jan 21, 2025
This PR replaces `List.lt` with `List.Lex`, from Mathlib, and adds the new `Bool` valued lexicographic comparatory function `List.lex`. This subtly changes the definition of `<` on Lists in some situations. `List.lt` was a weaker relation: in particular if `l₁ < l₂`, then `a :: l₁ < b :: l₂` may hold according to `List.lt` even if `a` and `b` are merely incomparable (either neither `a < b` nor `b < a`), whereas according to `List.Lex` this would require `a = b`. When `<` is total, in the sense that `¬ · < ·` is antisymmetric, then the two relations coincide. Mathlib was already overriding the order instances for `List α`, so this change should not be noticed by anyone already using Mathlib. We simultaneously add the boolean valued `List.lex` function, parameterised by a `BEq` typeclass and an arbitrary `lt` function. This will support the flexibility previously provided for `List.lt`, via a `==` function which is weaker than strict equality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces
List.ltwithList.Lex, from Mathlib, and adds the newBoolvalued lexicographic comparatory functionList.lex. This subtly changes the definition of<on Lists in some situations.List.ltwas a weaker relation: in particular ifl₁ < l₂, thena :: l₁ < b :: l₂may hold according toList.lteven ifaandbare merely incomparable(either neither
a < bnorb < a), whereas according toList.Lexthis would requirea = b.When
<is total, in the sense that¬ · < ·is antisymmetric, then the two relations coincide.Mathlib was already overriding the order instances for
List α,so this change should not be noticed by anyone already using Mathlib.
We simultaneously add the boolean valued
List.lexfunction, parameterised by aBEqtypeclassand an arbitrary
ltfunction. This will support the flexibility previously provided forList.lt,via a
==function which is weaker than strict equality.