Monotonicity of scalar multiplication by positive elements #
This file defines typeclasses to reason about monotonicity of the operations
b ↦ a • b
, "left scalar multiplication"a ↦ a • b
, "right scalar multiplication"
We use eight typeclasses to encode the various properties we care about for those two operations. These typeclasses are meant to be mostly internal to this file, to set up each lemma in the appropriate generality.
Less granular typeclasses like OrderedAddCommMonoid
, LinearOrderedField
, OrderedSMul
should be
enough for most purposes, and the system is set up so that they imply the correct granular
typeclasses here. If those are enough for you, you may stop reading here! Else, beware that what
follows is a bit technical.
Definitions #
In all that follows, α
and β
are orders which have a 0
and such that α
acts on β
by scalar
multiplication. Note however that we do not use lawfulness of this action in most of the file. Hence
•
should be considered here as a mostly arbitrary function α → β → β
.
We use the following four typeclasses to reason about left scalar multiplication (b ↦ a • b
):
PosSMulMono
: Ifa ≥ 0
, thenb₁ ≤ b₂
impliesa • b₁ ≤ a • b₂
.PosSMulStrictMono
: Ifa > 0
, thenb₁ < b₂
impliesa • b₁ < a • b₂
.PosSMulReflectLT
: Ifa ≥ 0
, thena • b₁ < a • b₂
impliesb₁ < b₂
.PosSMulReflectLE
: Ifa > 0
, thena • b₁ ≤ a • b₂
impliesb₁ ≤ b₂
.
We use the following four typeclasses to reason about right scalar multiplication (a ↦ a • b
):
SMulPosMono
: Ifb ≥ 0
, thena₁ ≤ a₂
impliesa₁ • b ≤ a₂ • b
.SMulPosStrictMono
: Ifb > 0
, thena₁ < a₂
impliesa₁ • b < a₂ • b
.SMulPosReflectLT
: Ifb ≥ 0
, thena₁ • b < a₂ • b
impliesa₁ < a₂
.SMulPosReflectLE
: Ifb > 0
, thena₁ • b ≤ a₂ • b
impliesa₁ ≤ a₂
.
Constructors #
The four typeclasses about nonnegativity can usually be checked only on positive inputs due to their
condition becoming trivial when a = 0
or b = 0
. We therefore make the following constructors
available: PosSMulMono.of_pos
, PosSMulReflectLT.of_pos
, SMulPosMono.of_pos
,
SMulPosReflectLT.of_pos
Implications #
As α
and β
get more and more structure, those typeclasses end up being equivalent. The commonly
used implications are:
- When
α
,β
are partial orders: - When
β
is a linear order:PosSMulStrictMono → PosSMulReflectLE
- When
α
is a linear order:SMulPosStrictMono → SMulPosReflectLE
- When
α
is an ordered ring,β
an ordered group and also anα
-module: - When
α
is an ordered semifield,β
is anα
-module:
Further, the bundled non-granular typeclasses imply the granular ones like so:
OrderedSMul → PosSMulStrictMono
OrderedSMul → PosSMulReflectLT
All these are registered as instances, which means that in practice you should not worry about these implications. However, if you encounter a case where you think a statement is true but not covered by the current implications, please bring it up on Zulip!
Implementation notes #
This file uses custom typeclasses instead of abbreviations of CovariantClass
/ContravariantClass
because:
- They get displayed as classes in the docs. In particular, one can see their list of instances,
instead of their instances being invariably dumped to the
CovariantClass
/ContravariantClass
list. - They don't pollute other typeclass searches. Having many abbreviations of the same typeclass for
different purposes always felt like a performance issue (more instances with the same key, for no
added benefit), and indeed making the classes here abbreviation previous creates timeouts due to
the higher number of
CovariantClass
/ContravariantClass
instances. SMulPosReflectLT
/SMulPosReflectLE
do not fit in the framework since they relate≤
on two different types. So we would have to generaliseCovariantClass
/ContravariantClass
to three types and two relations.- Very minor, but the constructors let you work with
a : α
,h : 0 ≤ a
instead ofa : {a : α // 0 ≤ a}
. This actually makes some instances surprisingly cleaner to prove. - The
CovariantClass
/ContravariantClass
framework is only useful to automate very simple logic anyway. It is easily copied over.
In the future, it would be good to make the corresponding typeclasses in
Mathlib.Algebra.Order.Ring.Lemmas
custom typeclasses too.
TODO #
This file acts as a substitute for Mathlib.Algebra.Order.SMul
. We now need to
- finish the transition by deleting the duplicate lemmas
- rearrange the non-duplicate lemmas into new files
- generalise (most of) the lemmas from
Mathlib.Algebra.Order.Module
to here - rethink
OrderedSMul
Typeclass for monotonicity of scalar multiplication by nonnegative elements on the left,
namely b₁ ≤ b₂ → a • b₁ ≤ a • b₂
if 0 ≤ a
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
smul_le_smul_of_nonneg_left
instead.
Instances
Typeclass for strict monotonicity of scalar multiplication by positive elements on the left,
namely b₁ < b₂ → a • b₁ < a • b₂
if 0 < a
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
smul_lt_smul_of_pos_left
instead.
Instances
Typeclass for strict reverse monotonicity of scalar multiplication by nonnegative elements on
the left, namely a • b₁ < a • b₂ → b₁ < b₂
if 0 ≤ a
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
lt_of_smul_lt_smul_left
instead.
Instances
Typeclass for reverse monotonicity of scalar multiplication by positive elements on the left,
namely a • b₁ ≤ a • b₂ → b₁ ≤ b₂
if 0 < a
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
le_of_smul_lt_smul_left
instead.
Instances
Typeclass for monotonicity of scalar multiplication by nonnegative elements on the left,
namely a₁ ≤ a₂ → a₁ • b ≤ a₂ • b
if 0 ≤ b
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
smul_le_smul_of_nonneg_right
instead.
Instances
Typeclass for strict monotonicity of scalar multiplication by positive elements on the left,
namely a₁ < a₂ → a₁ • b < a₂ • b
if 0 < b
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
smul_lt_smul_of_pos_right
instead.
Instances
Typeclass for strict reverse monotonicity of scalar multiplication by nonnegative elements on
the left, namely a₁ • b < a₂ • b → a₁ < a₂
if 0 ≤ b
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
lt_of_smul_lt_smul_right
instead.
Instances
Typeclass for reverse monotonicity of scalar multiplication by positive elements on the left,
namely a₁ • b ≤ a₂ • b → a₁ ≤ a₂
if 0 < b
.
You should usually not use this very granular typeclass directly, but rather a typeclass like
OrderedSMul
.
Do not use this. Use
le_of_smul_lt_smul_right
instead.
Instances
Equations
- (_ : PosSMulMono α α) = (_ : PosSMulMono α α)
Equations
- (_ : PosSMulStrictMono α α) = (_ : PosSMulStrictMono α α)
Equations
- (_ : PosSMulReflectLT α α) = (_ : PosSMulReflectLT α α)
Equations
- (_ : PosSMulReflectLE α α) = (_ : PosSMulReflectLE α α)
Equations
- (_ : SMulPosMono α α) = (_ : SMulPosMono α α)
Equations
- (_ : SMulPosStrictMono α α) = (_ : SMulPosStrictMono α α)
Equations
- (_ : SMulPosReflectLT α α) = (_ : SMulPosReflectLT α α)
Equations
- (_ : SMulPosReflectLE α α) = (_ : SMulPosReflectLE α α)
Alias of lt_of_smul_lt_smul_left
.
Alias of le_of_smul_le_smul_left
.
Alias of lt_of_smul_lt_smul_right
.
Alias of le_of_smul_le_smul_right
.
Equations
- (_ : PosSMulReflectLE α β) = (_ : PosSMulReflectLE α β)
Equations
- (_ : PosSMulReflectLT α β) = (_ : PosSMulReflectLT α β)
Equations
- (_ : SMulPosReflectLE α β) = (_ : SMulPosReflectLE α β)
A constructor for PosSMulMono
requiring you to prove b₁ ≤ b₂ → a • b₁ ≤ a • b₂
only when
0 < a
A constructor for PosSMulReflectLT
requiring you to prove a • b₁ < a • b₂ → b₁ < b₂
only
when 0 < a
A constructor for SMulPosMono
requiring you to prove a₁ ≤ a₂ → a₁ • b ≤ a₂ • b
only when
0 < b
A constructor for SMulPosReflectLT
requiring you to prove a₁ • b < a₂ • b → a₁ < a₂
only
when 0 < b
Equations
- (_ : PosSMulMono α β) = (_ : PosSMulMono α β)
Equations
- (_ : SMulPosMono α β) = (_ : SMulPosMono α β)
Equations
- (_ : PosSMulReflectLT α β) = (_ : PosSMulReflectLT α β)
Equations
- (_ : SMulPosReflectLT α β) = (_ : SMulPosReflectLT α β)
Equations
- (_ : PosSMulReflectLE α β) = (_ : PosSMulReflectLE α β)
Right scalar multiplication as an order isomorphism.
Equations
- OrderIso.smulRight ha = { toEquiv := Equiv.smulRight (_ : a ≠ 0), map_rel_iff' := (_ : ∀ {a_1 b : β}, a • a_1 ≤ a • b ↔ a_1 ≤ b) }
Instances For
Equations
- (_ : PosSMulMono α βᵒᵈ) = (_ : PosSMulMono α βᵒᵈ)
Equations
- (_ : PosSMulStrictMono α βᵒᵈ) = (_ : PosSMulStrictMono α βᵒᵈ)
Equations
- (_ : PosSMulReflectLT α βᵒᵈ) = (_ : PosSMulReflectLT α βᵒᵈ)
Equations
- (_ : PosSMulReflectLE α βᵒᵈ) = (_ : PosSMulReflectLE α βᵒᵈ)
Equations
- (_ : SMulPosMono α βᵒᵈ) = (_ : SMulPosMono α βᵒᵈ)
Equations
- (_ : SMulPosStrictMono α βᵒᵈ) = (_ : SMulPosStrictMono α βᵒᵈ)
Equations
- (_ : SMulPosReflectLT α βᵒᵈ) = (_ : SMulPosReflectLT α βᵒᵈ)
Equations
- (_ : SMulPosReflectLE α βᵒᵈ) = (_ : SMulPosReflectLE α βᵒᵈ)
Equations
- (_ : SMulPosMono α β) = (_ : SMulPosMono α β)
Equations
- (_ : SMulPosStrictMono α β) = (_ : SMulPosStrictMono α β)
Alias of the reverse direction of smul_pos_iff_of_neg_left
.
Binary rearrangement inequality.
Binary rearrangement inequality.
Binary strict rearrangement inequality.
Binary strict rearrangement inequality.
Equations
- (_ : PosSMulReflectLE α β) = (_ : PosSMulReflectLE α β)
Equations
- (_ : PosSMulReflectLT α β) = (_ : PosSMulReflectLT α β)
Left scalar multiplication as an order isomorphism.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- (_ : PosSMulMono α ((i : ι) → β i)) = (_ : PosSMulMono α ((i : ι) → β i))
Equations
- (_ : SMulPosMono α ((i : ι) → β i)) = (_ : SMulPosMono α ((i : ι) → β i))
Equations
- (_ : PosSMulReflectLE α ((i : ι) → β i)) = (_ : PosSMulReflectLE α ((i : ι) → β i))
Equations
- (_ : SMulPosReflectLE α ((i : ι) → β i)) = (_ : SMulPosReflectLE α ((i : ι) → β i))
Equations
- (_ : PosSMulStrictMono α ((i : ι) → β i)) = (_ : PosSMulStrictMono α ((i : ι) → β i))
Equations
- (_ : SMulPosStrictMono α ((i : ι) → β i)) = (_ : SMulPosStrictMono α ((i : ι) → β i))
Equations
- (_ : SMulPosReflectLT α ((i : ι) → β i)) = (_ : SMulPosReflectLT α ((i : ι) → β i))
Equations
- (_ : PosSMulMono ℕ α) = (_ : PosSMulMono ℕ α)
Equations
- (_ : SMulPosMono ℕ α) = (_ : SMulPosMono ℕ α)
Equations
- (_ : PosSMulStrictMono ℕ α) = (_ : PosSMulStrictMono ℕ α)
Equations
- (_ : SMulPosStrictMono ℕ α) = (_ : SMulPosStrictMono ℕ α)
Positivity extension for HSMul, i.e. (_ • _).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Deprecated lemmas #
Those lemmas have been deprecated on 2023-12-23.
Alias of monotone_smul_left_of_nonneg
.
Alias of strictMono_smul_left_of_pos
.
Alias of smul_le_smul_of_nonneg_left
.
Alias of smul_lt_smul_of_pos_left
.
Alias of lt_of_smul_lt_smul_left
.
Alias of lt_of_smul_lt_smul_left
.
Alias of smul_le_smul_iff_of_pos_left
.
Alias of smul_lt_smul_iff_of_pos_left
.
Alias of smul_pos_iff_of_pos_left
.
Alias of inv_smul_le_iff_of_pos
.
Alias of le_inv_smul_iff_of_pos
.
Alias of inv_smul_lt_iff_of_pos
.
Alias of lt_inv_smul_iff_of_pos
.
Alias of OrderIso.smulRight
.
Right scalar multiplication as an order isomorphism.
Equations
Instances For
Alias of OrderIso.smulRight_symm_apply
.
Alias of OrderIso.smulRight_apply
.
Alias of smul_neg_iff_of_pos_left
.
Those lemmas have been deprecated on 2023-12-27.
Alias of strictAnti_smul_left
.
Alias of smul_le_smul_of_nonpos_left
.
Alias of smul_lt_smul_of_neg_left
.
Alias of smul_pos_iff_of_neg_left
.
Alias of smul_neg_iff_of_neg_left
.
Alias of smul_le_smul_iff_of_neg_left
.
Alias of smul_lt_smul_iff_of_neg_left
.