Documentation

HexBasic.ExactDiv

class Hex.ExactDivLaws (R : Type u) [Zero R] [Mul R] [Div R] :

A quotient operation is exact when multiplication by every nonzero right factor can be undone by division by that factor.

  • mul_div_cancel_right (a b : R) : b 0a * b / b = a

    Right multiplication followed by division by a nonzero factor cancels.

Instances
    theorem Hex.ExactDivLaws.mul_right_cancel {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] {a b c : R} (hc : c 0) (h : a * c = b * c) :
    a = b

    Exact division implies right cancellation by a nonzero factor.

    theorem Hex.ExactDivLaws.mul_ne_zero {R : Type u} [Lean.Grind.CommRing R] [Div R] [ExactDivLaws R] {a b : R} (ha : a 0) (hb : b 0) :
    a * b 0

    Exact division and commutative-ring laws rule out nonzero products vanishing.

    theorem Hex.one_ne_zero_of_nonzero {S : Type u} [Lean.Grind.CommRing S] {a : S} (ha : a 0) :
    1 0

    A nonzero element witnesses that a lightweight ring is nontrivial.

    theorem Hex.negOne_ne_zero_of_one {S : Type u} [Lean.Grind.CommRing S] (h1 : 1 0) :
    0 - 1 0

    The additive inverse of one is nonzero in a nontrivial lightweight ring.

    def Hex.exactDiv {R : Type u} [Zero R] [DecidableEq R] [Div R] (a b : R) :
    R

    Total exact quotient wrapper. The zero denominator is a documented junk input and returns zero.

    Equations
    Instances For
      @[simp]
      theorem Hex.exactDiv_zero_right {R : Type u} [Zero R] [DecidableEq R] [Div R] (a : R) :
      exactDiv a 0 = 0

      Exact division by zero takes the stable junk branch.

      theorem Hex.exactDiv_eq_div_of_ne {R : Type u} [Zero R] [DecidableEq R] [Div R] (a : R) {b : R} (hb : b 0) :
      exactDiv a b = a / b

      A nonzero exact quotient is the underlying quotient operation.

      @[simp]
      theorem Hex.exactDiv_mul_right {R : Type u} [Lean.Grind.CommRing R] [DecidableEq R] [Div R] [ExactDivLaws R] (a : R) {b : R} (hb : b 0) :
      exactDiv (a * b) b = a

      The wrapper cancels a nonzero exact right factor under ExactDivLaws.

      Integer Euclidean division is exact on nonzero right multiples.

      Every Lean.Grind.Field supplies the exact-division law.