Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: shortlex order on lists #20310

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0a62a10
add shortlex
hannahfechtner Dec 29, 2024
6888e32
extra file
hannahfechtner Dec 29, 2024
28b57ad
mk_all
hannahfechtner Dec 29, 2024
cb7c517
nonsense with capitalization
hannahfechtner Dec 29, 2024
1b5d4d9
end namespace
hannahfechtner Dec 29, 2024
81d94f4
rcases triple
hannahfechtner Dec 29, 2024
d97da73
renaming and simp
hannahfechtner Dec 30, 2024
a5b352c
iff version
hannahfechtner Dec 30, 2024
adfbefd
remove double naming
hannahfechtner Dec 31, 2024
8489a89
naming iff
hannahfechtner Dec 31, 2024
df4f8c0
variables in wf
hannahfechtner Dec 31, 2024
047141a
identation
hannahfechtner Dec 31, 2024
a68a46f
slashes
hannahfechtner Dec 31, 2024
8946f04
space
hannahfechtner Jan 20, 2025
a78373f
two lines to one
hannahfechtner Jan 20, 2025
e3f2fe7
nicer
hannahfechtner Jan 20, 2025
cd80f58
accessible naming
hannahfechtner Jan 20, 2025
9154739
rename throughout
hannahfechtner Jan 20, 2025
33b2136
minor fixes
hannahfechtner Jan 22, 2025
3a4b73d
new shortlex definition
hannahfechtner Jan 22, 2025
59e8726
suffices
hannahfechtner Jan 22, 2025
2537b98
Merge branch 'master' into hannahfechtner_shortlex
hannahfechtner Jan 23, 2025
95b88aa
invimage and prod lemmas
hannahfechtner Feb 7, 2025
018b842
reorder variables
hannahfechtner Feb 7, 2025
a45871b
shorter lemma using Prod
hannahfechtner Feb 20, 2025
30608c5
another simpler proof
hannahfechtner Feb 20, 2025
b972fed
move InvImage
hannahfechtner Feb 20, 2025
b102a7d
hopefully better names
hannahfechtner Feb 20, 2025
5e65885
IsTrichotmous version for InvImage
hannahfechtner Feb 20, 2025
d984733
correct trichotomous
hannahfechtner Feb 20, 2025
e340454
remove deprecated
hannahfechtner Feb 20, 2025
e64bec8
Merge branch 'master' into hannahfechtner_shortlex
hannahfechtner Feb 20, 2025
be50e5e
linespace
hannahfechtner Feb 20, 2025
ec90975
add newline
hannahfechtner Feb 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Mathlib/Data/List/Shortlex.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Authors: Hannah Fechtner

import Mathlib.Data.List.Lex
import Mathlib.Tactic.Linarith
import Mathlib.Order.RelClasses

/-!
# Shortlex ordering of lists.
Expand All @@ -28,17 +29,6 @@ Related files are:

/-! ### shortlex ordering -/

--to add to another file
theorem InvImage.trichotomous {α β : Type*} {r : α → α → Prop} [IsTrichotomous α r] {f : β → α}
(h : Function.Injective f) : ∀ a b, (InvImage r f) a b ∨ a = b ∨ (InvImage r f) b a := by
intro a b
rw [← Function.Injective.eq_iff h]
exact IsTrichotomous.trichotomous (f a) (f b)

instance InvImage.isAsymm {α β : Type*} {r : α → α → Prop} [IsAsymm α r] (f : β → α) :
IsAsymm β (InvImage r f) where
asymm := fun a b h h2 => IsAsymm.asymm (f a) (f b) h h2

namespace List

/-- Given a relation `r` on `α`, the shortlex order on `List α`, for which
Expand Down
11 changes: 11 additions & 0 deletions Mathlib/Order/RelClasses.lean
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ instance (priority := 100) isStrictTotalOrder_of_isStrictTotalOrder [IsStrictTot
IsStrictWeakOrder α r :=
{ isStrictWeakOrder_of_isOrderConnected with }

/-! ### Inverse Image -/
theorem InvImage.trichotomous {α β : Type*} {r : α → α → Prop} [IsTrichotomous α r] {f : β → α}
(h : Function.Injective f) : ∀ a b, (InvImage r f) a b ∨ a = b ∨ (InvImage r f) b a := by
intro a b
rw [← Function.Injective.eq_iff h]
exact IsTrichotomous.trichotomous (f a) (f b)

instance InvImage.isAsymm {α β : Type*} {r : α → α → Prop} [IsAsymm α r] (f : β → α) :
IsAsymm β (InvImage r f) where
asymm := fun a b h h2 => IsAsymm.asymm (f a) (f b) h h2

/-! ### Well-order -/


Expand Down
Loading