Lexicographic order on finitely supported functions #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the lexicographic order on finsupp
.
finsupp.lex r s
is the lexicographic relation on α →₀ N
, where α
is ordered by r
,
and N
is ordered by s
.
The type synonym lex (α →₀ N)
has an order given by finsupp.lex (<) (<)
.
Equations
- finsupp.lex r s x y = pi.lex r (λ (_x : α), s) ⇑x ⇑y
The partial order on finsupp
s obtained by the lexicographic ordering.
See finsupp.lex.linear_order
for a proof that this partial order is in fact linear.
Equations
- finsupp.lex.partial_order = partial_order.lift (λ (x : lex (α →₀ N)), ⇑to_lex ⇑(⇑of_lex x)) finsupp.coe_fn_injective
The linear order on finsupp
s obtained by the lexicographic ordering.
Equations
- finsupp.lex.linear_order = {le := partial_order.le finsupp.lex.partial_order, lt := partial_order.lt finsupp.lex.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_total := _, decidable_le := linear_order.decidable_le (linear_order.lift' (⇑to_lex ∘ finsupp.to_dfinsupp ∘ ⇑of_lex) finsupp.lex.linear_order._proof_6), decidable_eq := linear_order.decidable_eq (linear_order.lift' (⇑to_lex ∘ finsupp.to_dfinsupp ∘ ⇑of_lex) finsupp.lex.linear_order._proof_6), decidable_lt := linear_order.decidable_lt (linear_order.lift' (⇑to_lex ∘ finsupp.to_dfinsupp ∘ ⇑of_lex) finsupp.lex.linear_order._proof_6), max := linear_order.max (linear_order.lift' (⇑to_lex ∘ finsupp.to_dfinsupp ∘ ⇑of_lex) finsupp.lex.linear_order._proof_6), max_def := _, min := linear_order.min (linear_order.lift' (⇑to_lex ∘ finsupp.to_dfinsupp ∘ ⇑of_lex) finsupp.lex.linear_order._proof_6), min_def := _}
We are about to sneak in a hypothesis that might appear to be too strong.
We assume covariant_class
with strict inequality <
also when proving the one with the
weak inequality ≤
. This is actually necessary: addition on lex (α →₀ N)
may fail to be
monotone, when it is "just" monotone on N
.
See counterexamples.zero_divisors_in_add_monoid_algebras
for a counterexample.