Sign type #
This file defines the type of signs $\{-1, 0, 1\}$ and its basic arithmetic instances.
Equations
- instInhabitedSignType = { default := SignType.zero }
Equations
- instFintypeSignType = { elems := { val := ↑SignType.enumList, nodup := SignType.enumList_nodup }, complete := instFintypeSignType._proof_1 }
Equations
- SignType.instZero = { zero := SignType.zero }
Equations
- SignType.instNeg = { neg := fun (s : SignType) => match s with | SignType.neg => SignType.pos | SignType.zero => SignType.zero | SignType.pos => SignType.neg }
Equations
- SignType.instMul = { mul := fun (x y : SignType) => match x with | SignType.neg => -y | SignType.zero => SignType.zero | SignType.pos => y }
The less-than-or-equal relation on signs.
- of_neg (a : SignType) : neg.LE a
- zero : SignType.zero.LE SignType.zero
- of_pos (a : SignType) : a.LE pos
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- SignType.instBoundedOrder = { top := 1, le_top := SignType.LE.of_pos, bot := -1, bot_le := SignType.LE.of_neg }
Equations
- One or more equations did not get rendered due to their size.
Turn a SignType
into zero, one, or minus one. This is a coercion instance.
Equations
- ↑SignType.zero = 0
- ↑SignType.pos = 1
- ↑SignType.neg = -1
Instances For
This is a CoeTail
since the type on the right (trivially) determines the type on the left.
outParam
-wise it could be a Coe
, but we don't want to try applying this instance for a
coercion to any α
.
Equations
- SignType.instCoeTail = { coe := SignType.cast }
theorem
SignType.map_cast
{α : Type u_2}
{β : Type u_3}
{F : Type u_4}
[AddGroupWithOne α]
[One β]
[SubtractionMonoid β]
[FunLike F α β]
[AddMonoidHomClass F α β]
[OneHomClass F α β]
(f : F)
(s : SignType)
:
Casting out of SignType
respects composition with suitable bundled homomorphism types.
@[simp]
@[simp]
theorem
StrictMono.sign_comp
{α : Type u_1}
[Zero α]
[LinearOrder α]
{β : Type u_2}
{F : Type u_3}
[Zero β]
[Preorder β]
[DecidableLT β]
[FunLike F α β]
[ZeroHomClass F α β]
{f : F}
(hf : StrictMono ⇑f)
(a : α)
:
SignType.sign
respects strictly monotone zero-preserving maps.
@[simp]
@[simp]
@[simp]
theorem
sign_one
{α : Type u_1}
[Semiring α]
[PartialOrder α]
[IsOrderedRing α]
[DecidableLT α]
[Nontrivial α]
:
theorem
Left.sign_neg
{α : Type u_1}
[AddGroup α]
[Preorder α]
[DecidableLT α]
[AddLeftStrictMono α]
(a : α)
:
theorem
Right.sign_neg
{α : Type u_1}
[AddGroup α]
[Preorder α]
[DecidableLT α]
[AddRightStrictMono α]
(a : α)
: