Sign type #
This file defines the type of signs $\{-1, 0, 1\}$ and its basic arithmetic instances.
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
@[instance_reducible]
We can define a Field instance on SignType, but it's not mathematically sensible,
so we only define the CommGroupWithZero.
@[instance_reducible]
This can't be a CoeTail or Coe instance because we don't want it to fire when SignType isn't
involved in the coercion (or CoeHead or CoeOut because of outParams). The only other
user-exposed option is CoeDep then, which allows us to match on both given and expected type.
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]
The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise.
Instances For
@[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_eq_sign_or_eq_neg {α : Type u_1} [Zero α] [LinearOrder α] {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) :
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 : α) :