The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V01. The language of Mathlib

Mathlib.Basic.Sign.Basic

25 declarations. Mathlib docs · Source

theorem SignType.intCast_cast E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (s : SignType), ↑↑s = ↑s

Casting SignType → ℤ → α is the same as casting directly SignType → α.

theorem SignType.pow_odd E1 #

∀ (s : SignType) {n : ℕ}, Odd n → s ^ n = s

theorem SignType.zpow_odd E1 #

∀ (s : SignType) {z : ℤ}, Odd z → s ^ z = s

theorem SignType.pow_even E1 #

∀ (s : SignType) {n : ℕ}, Even n → s ≠ 0 → s ^ n = 1

theorem SignType.zpow_even E1 #

∀ (s : SignType) {z : ℤ}, Even z → s ≠ 0 → s ^ z = 1

theorem SignType.mul_self_eq_one_iff E0 #

∀ {s : SignType}, s * s = 1 ↔ s ≠ 0

def SignType.castHom E1 #

{α : Type u_1} → [inst : MulZeroOneClass α] → [HasDistribNeg α] → SignType →*₀ α

SignType.cast as a MulWithZeroHom.

theorem SignType.castHom_apply E0 #

∀ {α : Type u_1} [inst : MulZeroOneClass α] [inst_1 : HasDistribNeg α] (a : SignType), SignType.castHom a = ↑a

theorem SignType.univ_eq E0 #

Finset.univ = {0, -1, 1}

theorem SignType.range_eq E0 #

∀ {α : Type u_1} (f : SignType → α), Set.range f = {f SignType.zero, f SignType.neg, f SignType.pos}

theorem SignType.coe_mul E0 #

∀ {α : Type u_1} [inst : MulZeroOneClass α] [inst_1 : HasDistribNeg α] (a b : SignType), ↑(a * b) = ↑a * ↑b

theorem SignType.coe_pow E0 #

∀ {α : Type u_1} [inst : MonoidWithZero α] [inst_1 : HasDistribNeg α] (a : SignType) (k : ℕ), ↑(a ^ k) = ↑a ^ k

theorem SignType.coe_zpow E0 #

∀ {α : Type u_1} [inst : GroupWithZero α] [inst_1 : HasDistribNeg α] (a : SignType) (k : ℤ), ↑(a ^ k) = ↑a ^ k

theorem sign_intCast E0 #

∀ {α : Type u_1} [inst : Ring α] [inst_1 : PartialOrder α] [IsOrderedRing α] [Nontrivial α] [inst_4 : DecidableLT α]
  (n : ℤ), SignType.sign ↑n = SignType.sign n

theorem sign_mul E1 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (x y : α),
  SignType.sign (x * y) = SignType.sign x * SignType.sign y

theorem sign_mul_abs E0 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (x : α), ↑(SignType.sign x) * |x| = x

theorem abs_mul_sign E0 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (x : α), |x| * ↑(SignType.sign x) = x

theorem sign_mul_self E0 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (x : α), ↑(SignType.sign x) * x = |x|

theorem self_mul_sign E0 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (x : α), x * ↑(SignType.sign x) = |x|

def signHom E1 #

{α : Type u} → [inst : Ring α] → [inst_1 : LinearOrder α] → [IsStrictOrderedRing α] → α →*₀ SignType

SignType.sign as a MonoidWithZeroHom for a nontrivial ordered semiring. Note that linearity is required; consider ℂ with the order z ≤ w iff they have the same imaginary part and z - w ≤ 0 in the reals; then 1 + I and 1 - I are incomparable to zero, and thus we have: 0 * 0 = SignType.sign (1 + I) * SignType.sign (1 - I) ≠ SignType.sign 2 = 1. (Complex.orderedCommRing)

theorem signHom_apply E0 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [inst_2 : IsStrictOrderedRing α], ⇑signHom = ⇑SignType.sign

theorem sign_pow E1 #

∀ {α : Type u} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (x : α) (n : ℕ),
  SignType.sign (x ^ n) = SignType.sign x ^ n

theorem sign_sum E1 #

∀ {α : Type u} [inst : AddCommGroup α] [inst_1 : LinearOrder α] [IsOrderedAddMonoid α] {ι : Type u_1} {s : Finset ι}
  {f : ι → α}, s.Nonempty → ∀ (t : SignType), (∀ i ∈ s, SignType.sign (f i) = t) → SignType.sign (∑ i ∈ s, f i) = t

theorem exists_signed_sum E1 #

∀ {α : Type u} [inst : DecidableEq α] (s : Finset α) (f : α → ℤ),
  ∃ β x sgn g,
    (∀ (b : β), g b ∈ s) ∧
      Fintype.card β = ∑ a ∈ s, (f a).natAbs ∧ ∀ a ∈ s, (∑ b, if g b = a then ↑(sgn b) else 0) = f a

We can decompose a sum of absolute value n into a sum of n signs.

theorem exists_signed_sum' E1 #

∀ {α : Type u} [Nonempty α] [inst : DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ),
  ∑ i ∈ s, (f i).natAbs ≤ n →
    ∃ β x sgn g,
      (∀ (b : β), g b ∉ s → sgn b = 0) ∧ Fintype.card β = n ∧ ∀ a ∈ s, (∑ i, if g i = a then ↑(sgn i) else 0) = f a

We can decompose a sum of absolute value less than n into a sum of at most n signs.