Skip to content

Commit 72de784

Browse files
committed
chore(Tuple/Sort): dualize unique_monotone to unique_antitone (#23046)
From "Formalizing the Bruhat-Tits tree".
1 parent 5875bc5 commit 72de784

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Mathlib/Data/Fin/Tuple/Sort.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ theorem unique_monotone [PartialOrder α] {f : Fin n → α} {σ τ : Equiv.Perm
142142
eq_of_perm_of_sorted ((σ.ofFn_comp_perm f).trans (τ.ofFn_comp_perm f).symm)
143143
hfσ.ofFn_sorted hfτ.ofFn_sorted
144144

145+
/-- If two permutations of a tuple `f` are both antitone, then they are equal. -/
146+
theorem unique_antitone [PartialOrder α] {f : Fin n → α} {σ τ : Equiv.Perm (Fin n)}
147+
(hfσ : Antitone (f ∘ σ)) (hfτ : Antitone (f ∘ τ)) : f ∘ σ = f ∘ τ :=
148+
ofFn_injective <|
149+
eq_of_perm_of_sorted ((σ.ofFn_comp_perm f).trans (τ.ofFn_comp_perm f).symm)
150+
hfσ.ofFn_sorted hfτ.ofFn_sorted
151+
145152
variable [LinearOrder α] {f : Fin n → α} {σ : Equiv.Perm (Fin n)}
146153

147154
/-- A permutation `σ` equals `sort f` if and only if the map `i ↦ (f (σ i), σ i)` is

Mathlib/Data/List/Sort.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,24 @@ variable [Preorder α]
182182
strictly monotone. -/
183183
@[simp] theorem sorted_lt_ofFn_iff : (ofFn f).Sorted (· < ·) ↔ StrictMono f := sorted_ofFn_iff
184184

185+
/-- The list `List.ofFn f` is strictly sorted with respect to `(· ≥ ·)` if and only if `f` is
186+
strictly antitone. -/
187+
@[simp] theorem sorted_gt_ofFn_iff : (ofFn f).Sorted (· > ·) ↔ StrictAnti f := sorted_ofFn_iff
188+
185189
/-- The list `List.ofFn f` is sorted with respect to `(· ≤ ·)` if and only if `f` is monotone. -/
186190
@[simp] theorem sorted_le_ofFn_iff : (ofFn f).Sorted (· ≤ ·) ↔ Monotone f :=
187191
sorted_ofFn_iff.trans monotone_iff_forall_lt.symm
188192

189193
/-- The list obtained from a monotone tuple is sorted. -/
190194
alias ⟨_, _root_.Monotone.ofFn_sorted⟩ := sorted_le_ofFn_iff
191195

196+
/-- The list `List.ofFn f` is sorted with respect to `(· ≥ ·)` if and only if `f` is antitone. -/
197+
@[simp] theorem sorted_ge_ofFn_iff : (ofFn f).Sorted (· ≥ ·) ↔ Antitone f :=
198+
sorted_ofFn_iff.trans antitone_iff_forall_lt.symm
199+
200+
/-- The list obtained from an antitone tuple is sorted. -/
201+
alias ⟨_, _root_.Antitone.ofFn_sorted⟩ := sorted_ge_ofFn_iff
202+
192203
end Monotone
193204

194205
end List

0 commit comments

Comments
 (0)