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 / V02. Numbers

Mathlib.Data.Num.ZNum

110 declarations. Mathlib docs · Source

Properties of the ZNum representation of integers

This file was split from Mathlib/Data/Num/Lemmas.lean to keep the former under 1500 lines.

theorem Num.gcdAux.match_1.congr_eq_3 E1 #

∀ (motive : ℕ → Num → Num → Sort u_1) (x : ℕ) (x_1 x_2 : Num) (h_1 : (x b : Num) → motive 0 x b)
  (h_2 : (n : ℕ) → (b : Num) → motive n.succ Num.zero b) (h_3 : (n : ℕ) → (a b : Num) → motive n.succ a b) (n : ℕ)
  (a b : Num),
  x = n.succ →
    x_1 = a →
      x_2 = b →
        (a = Num.zero → False) →
          (match x, x_1, x_2 with
            | 0, x, b => h_1 x b
            | n.succ, Num.zero, b => h_2 n b
            | n.succ, a, b => h_3 n a b) ≍
            h_3 n a b

theorem ZNum.ofInt'.match_1.congr_eq_1 E1 #

∀ (motive : ℤ → Sort u_1) (x : ℤ) (h_1 : (n : ℕ) → motive (Int.ofNat n)) (h_2 : (n : ℕ) → motive (Int.negSucc n))
  (n : ℕ),
  x = Int.ofNat n →
    (match x with
      | Int.ofNat n => h_1 n
      | Int.negSucc n => h_2 n) ≍
      h_1 n

theorem PosNum.sub'.match_1.congr_eq_1 E1 #

∀ (motive : PosNum → PosNum → Sort u_1) (x x_1 : PosNum) (h_1 : (a : PosNum) → motive a PosNum.one)
  (h_2 : (b : PosNum) → motive PosNum.one b) (h_3 : (a b : PosNum) → motive a.bit0 b.bit0)
  (h_4 : (a b : PosNum) → motive a.bit0 b.bit1) (h_5 : (a b : PosNum) → motive a.bit1 b.bit0)
  (h_6 : (a b : PosNum) → motive a.bit1 b.bit1) (a : PosNum),
  x = a →
    x_1 = PosNum.one →
      (match x, x_1 with
        | a, PosNum.one => h_1 a
        | PosNum.one, b => h_2 b
        | a.bit0, b.bit0 => h_3 a b
        | a.bit0, b.bit1 => h_4 a b
        | a.bit1, b.bit0 => h_5 a b
        | a.bit1, b.bit1 => h_6 a b) ≍
        h_1 a

theorem Num.gcdAux.match_1.congr_eq_2 E1 #

∀ (motive : ℕ → Num → Num → Sort u_1) (x : ℕ) (x_1 x_2 : Num) (h_1 : (x b : Num) → motive 0 x b)
  (h_2 : (n : ℕ) → (b : Num) → motive n.succ Num.zero b) (h_3 : (n : ℕ) → (a b : Num) → motive n.succ a b) (n : ℕ)
  (b : Num),
  x = n.succ →
    x_1 = Num.zero →
      x_2 = b →
        (match x, x_1, x_2 with
          | 0, x, b => h_1 x b
          | n.succ, Num.zero, b => h_2 n b
          | n.succ, a, b => h_3 n a b) ≍
          h_2 n b

theorem ZNum.zNeg.match_1.congr_eq_1 E1 #

∀ (motive : ZNum → Sort u_1) (x : ZNum) (h_1 : Unit → motive ZNum.zero) (h_2 : (a : PosNum) → motive (ZNum.pos a))
  (h_3 : (a : PosNum) → motive (ZNum.neg a)),
  x = ZNum.zero →
    (match x with
      | ZNum.zero => h_1 ()
      | ZNum.pos a => h_2 a
      | ZNum.neg a => h_3 a) ≍
      h_1 ()

theorem PosNum.sub'.match_1.congr_eq_6 E1 #

∀ (motive : PosNum → PosNum → Sort u_1) (x x_1 : PosNum) (h_1 : (a : PosNum) → motive a PosNum.one)
  (h_2 : (b : PosNum) → motive PosNum.one b) (h_3 : (a b : PosNum) → motive a.bit0 b.bit0)
  (h_4 : (a b : PosNum) → motive a.bit0 b.bit1) (h_5 : (a b : PosNum) → motive a.bit1 b.bit0)
  (h_6 : (a b : PosNum) → motive a.bit1 b.bit1) (a b : PosNum),
  x = a.bit1 →
    x_1 = b.bit1 →
      (match x, x_1 with
        | a, PosNum.one => h_1 a
        | PosNum.one, b => h_2 b
        | a.bit0, b.bit0 => h_3 a b
        | a.bit0, b.bit1 => h_4 a b
        | a.bit1, b.bit0 => h_5 a b
        | a.bit1, b.bit1 => h_6 a b) ≍
        h_6 a b

theorem PosNum.sub'.match_1.congr_eq_5 E1 #

∀ (motive : PosNum → PosNum → Sort u_1) (x x_1 : PosNum) (h_1 : (a : PosNum) → motive a PosNum.one)
  (h_2 : (b : PosNum) → motive PosNum.one b) (h_3 : (a b : PosNum) → motive a.bit0 b.bit0)
  (h_4 : (a b : PosNum) → motive a.bit0 b.bit1) (h_5 : (a b : PosNum) → motive a.bit1 b.bit0)
  (h_6 : (a b : PosNum) → motive a.bit1 b.bit1) (a b : PosNum),
  x = a.bit1 →
    x_1 = b.bit0 →
      (match x, x_1 with
        | a, PosNum.one => h_1 a
        | PosNum.one, b => h_2 b
        | a.bit0, b.bit0 => h_3 a b
        | a.bit0, b.bit1 => h_4 a b
        | a.bit1, b.bit0 => h_5 a b
        | a.bit1, b.bit1 => h_6 a b) ≍
        h_5 a b

theorem ZNum.zNeg.match_1.congr_eq_2 E1 #

∀ (motive : ZNum → Sort u_1) (x : ZNum) (h_1 : Unit → motive ZNum.zero) (h_2 : (a : PosNum) → motive (ZNum.pos a))
  (h_3 : (a : PosNum) → motive (ZNum.neg a)) (a : PosNum),
  x = ZNum.pos a →
    (match x with
      | ZNum.zero => h_1 ()
      | ZNum.pos a => h_2 a
      | ZNum.neg a => h_3 a) ≍
      h_2 a

theorem ZNum.ofInt'.match_1.congr_eq_2 E1 #

∀ (motive : ℤ → Sort u_1) (x : ℤ) (h_1 : (n : ℕ) → motive (Int.ofNat n)) (h_2 : (n : ℕ) → motive (Int.negSucc n))
  (n : ℕ),
  x = Int.negSucc n →
    (match x with
      | Int.ofNat n => h_1 n
      | Int.negSucc n => h_2 n) ≍
      h_2 n

theorem Num.add.match_1.congr_eq_2 E1 #

∀ (motive : Num → Num → Sort u_1) (x x_1 : Num) (h_1 : (a : Num) → motive Num.zero a)
  (h_2 : (b : Num) → motive b Num.zero) (h_3 : (a b : PosNum) → motive (Num.pos a) (Num.pos b)) (b : Num),
  x = b →
    x_1 = Num.zero →
      (b = Num.zero → False) →
        (match x, x_1 with
          | Num.zero, a => h_1 a
          | b, Num.zero => h_2 b
          | Num.pos a, Num.pos b => h_3 a b) ≍
          h_2 b

theorem ZNum.zNeg.match_1.congr_eq_3 E1 #

∀ (motive : ZNum → Sort u_1) (x : ZNum) (h_1 : Unit → motive ZNum.zero) (h_2 : (a : PosNum) → motive (ZNum.pos a))
  (h_3 : (a : PosNum) → motive (ZNum.neg a)) (a : PosNum),
  x = ZNum.neg a →
    (match x with
      | ZNum.zero => h_1 ()
      | ZNum.pos a => h_2 a
      | ZNum.neg a => h_3 a) ≍
      h_3 a

theorem PosNum.sub'.match_1.congr_eq_3 E1 #

∀ (motive : PosNum → PosNum → Sort u_1) (x x_1 : PosNum) (h_1 : (a : PosNum) → motive a PosNum.one)
  (h_2 : (b : PosNum) → motive PosNum.one b) (h_3 : (a b : PosNum) → motive a.bit0 b.bit0)
  (h_4 : (a b : PosNum) → motive a.bit0 b.bit1) (h_5 : (a b : PosNum) → motive a.bit1 b.bit0)
  (h_6 : (a b : PosNum) → motive a.bit1 b.bit1) (a b : PosNum),
  x = a.bit0 →
    x_1 = b.bit0 →
      (match x, x_1 with
        | a, PosNum.one => h_1 a
        | PosNum.one, b => h_2 b
        | a.bit0, b.bit0 => h_3 a b
        | a.bit0, b.bit1 => h_4 a b
        | a.bit1, b.bit0 => h_5 a b
        | a.bit1, b.bit1 => h_6 a b) ≍
        h_3 a b

theorem Num.add.match_1.congr_eq_3 E1 #

∀ (motive : Num → Num → Sort u_1) (x x_1 : Num) (h_1 : (a : Num) → motive Num.zero a)
  (h_2 : (b : Num) → motive b Num.zero) (h_3 : (a b : PosNum) → motive (Num.pos a) (Num.pos b)) (a b : PosNum),
  x = Num.pos a →
    x_1 = Num.pos b →
      (match x, x_1 with
        | Num.zero, a => h_1 a
        | b, Num.zero => h_2 b
        | Num.pos a, Num.pos b => h_3 a b) ≍
        h_3 a b

theorem PosNum.sub'.match_1.congr_eq_2 E1 #

∀ (motive : PosNum → PosNum → Sort u_1) (x x_1 : PosNum) (h_1 : (a : PosNum) → motive a PosNum.one)
  (h_2 : (b : PosNum) → motive PosNum.one b) (h_3 : (a b : PosNum) → motive a.bit0 b.bit0)
  (h_4 : (a b : PosNum) → motive a.bit0 b.bit1) (h_5 : (a b : PosNum) → motive a.bit1 b.bit0)
  (h_6 : (a b : PosNum) → motive a.bit1 b.bit1) (b : PosNum),
  x = PosNum.one →
    x_1 = b →
      (b = PosNum.one → False) →
        (match x, x_1 with
          | a, PosNum.one => h_1 a
          | PosNum.one, b => h_2 b
          | a.bit0, b.bit0 => h_3 a b
          | a.bit0, b.bit1 => h_4 a b
          | a.bit1, b.bit0 => h_5 a b
          | a.bit1, b.bit1 => h_6 a b) ≍
          h_2 b

theorem Num.gcdAux.match_1.congr_eq_1 E1 #

∀ (motive : ℕ → Num → Num → Sort u_1) (x : ℕ) (x_1 x_2 : Num) (h_1 : (x b : Num) → motive 0 x b)
  (h_2 : (n : ℕ) → (b : Num) → motive n.succ Num.zero b) (h_3 : (n : ℕ) → (a b : Num) → motive n.succ a b)
  (x_3 b : Num),
  x = 0 →
    x_1 = x_3 →
      x_2 = b →
        (match x, x_1, x_2 with
          | 0, x, b => h_1 x b
          | n.succ, Num.zero, b => h_2 n b
          | n.succ, a, b => h_3 n a b) ≍
          h_1 x_3 b

theorem PosNum.sub'.match_1.congr_eq_4 E1 #

∀ (motive : PosNum → PosNum → Sort u_1) (x x_1 : PosNum) (h_1 : (a : PosNum) → motive a PosNum.one)
  (h_2 : (b : PosNum) → motive PosNum.one b) (h_3 : (a b : PosNum) → motive a.bit0 b.bit0)
  (h_4 : (a b : PosNum) → motive a.bit0 b.bit1) (h_5 : (a b : PosNum) → motive a.bit1 b.bit0)
  (h_6 : (a b : PosNum) → motive a.bit1 b.bit1) (a b : PosNum),
  x = a.bit0 →
    x_1 = b.bit1 →
      (match x, x_1 with
        | a, PosNum.one => h_1 a
        | PosNum.one, b => h_2 b
        | a.bit0, b.bit0 => h_3 a b
        | a.bit0, b.bit1 => h_4 a b
        | a.bit1, b.bit0 => h_5 a b
        | a.bit1, b.bit1 => h_6 a b) ≍
        h_4 a b

theorem Num.add.match_1.congr_eq_1 E1 #

∀ (motive : Num → Num → Sort u_1) (x x_1 : Num) (h_1 : (a : Num) → motive Num.zero a)
  (h_2 : (b : Num) → motive b Num.zero) (h_3 : (a b : PosNum) → motive (Num.pos a) (Num.pos b)) (a : Num),
  x = Num.zero →
    x_1 = a →
      (match x, x_1 with
        | Num.zero, a => h_1 a
        | b, Num.zero => h_2 b
        | Num.pos a, Num.pos b => h_3 a b) ≍
        h_1 a

theorem ZNum.cast_zero E0 #

∀ {α : Type u_1} [inst : Zero α] [inst_1 : One α] [inst_2 : Add α] [inst_3 : Neg α], ↑0 = 0

theorem ZNum.cast_zero' E0 #

∀ {α : Type u_1} [inst : Zero α] [inst_1 : One α] [inst_2 : Add α] [inst_3 : Neg α], ↑ZNum.zero = 0

theorem ZNum.cast_one E0 #

∀ {α : Type u_1} [inst : Zero α] [inst_1 : One α] [inst_2 : Add α] [inst_3 : Neg α], ↑1 = 1

theorem ZNum.cast_pos E0 #

∀ {α : Type u_1} [inst : Zero α] [inst_1 : One α] [inst_2 : Add α] [inst_3 : Neg α] (n : PosNum), ↑(ZNum.pos n) = ↑n

theorem ZNum.cast_neg E0 #

∀ {α : Type u_1} [inst : Zero α] [inst_1 : One α] [inst_2 : Add α] [inst_3 : Neg α] (n : PosNum), ↑(ZNum.neg n) = -↑n

theorem ZNum.cast_zneg E0 #

∀ {α : Type u_1} [inst : SubtractionMonoid α] [inst_1 : One α] (n : ZNum), ↑(-n) = -↑n

theorem ZNum.neg_zero E1 #

-0 = 0

theorem ZNum.zneg_pos E1 #

∀ (n : PosNum), -ZNum.pos n = ZNum.neg n

theorem ZNum.zneg_neg E1 #

∀ (n : PosNum), -ZNum.neg n = ZNum.pos n

theorem ZNum.zneg_zneg E1 #

∀ (n : ZNum), - -n = n

theorem ZNum.zneg_bit1 E1 #

∀ (n : ZNum), -n.bit1 = (-n).bitm1

theorem ZNum.zneg_bitm1 E1 #

∀ (n : ZNum), -n.bitm1 = (-n).bit1

theorem ZNum.zneg_succ E1 #

∀ (n : ZNum), -n.succ = (-n).pred

theorem ZNum.zneg_pred E1 #

∀ (n : ZNum), -n.pred = (-n).succ

theorem ZNum.abs_to_nat E0 #

∀ (n : ZNum), ↑n.abs = (↑n).natAbs

theorem ZNum.abs_toZNum E0 #

∀ (n : Num), n.toZNum.abs = n

theorem ZNum.cast_to_int E0 #

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

theorem ZNum.bit0_of_bit0 E1 #

∀ (n : ZNum), n + n = n.bit0

theorem ZNum.bit1_of_bit1 E1 #

∀ (n : ZNum), n + n + 1 = n.bit1

theorem ZNum.cast_bit0 E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (n : ZNum), ↑n.bit0 = ↑n + ↑n

theorem ZNum.cast_bit1 E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (n : ZNum), ↑n.bit1 = ↑n + ↑n + 1

theorem ZNum.cast_bitm1 E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (n : ZNum), ↑n.bitm1 = ↑n + ↑n - 1

theorem ZNum.add_zero E1 #

∀ (n : ZNum), n + 0 = n

theorem ZNum.zero_add E1 #

∀ (n : ZNum), 0 + n = n

theorem ZNum.add_one E1 #

∀ (n : ZNum), n + 1 = n.succ

theorem PosNum.cast_to_znum E1 #

∀ (n : PosNum), ↑n = ZNum.pos n

theorem PosNum.cast_sub' E1 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (m n : PosNum), ↑(m.sub' n) = ↑m - ↑n

theorem PosNum.to_nat_eq_succ_pred E1 #

∀ (n : PosNum), ↑n = ↑n.pred' + 1

theorem PosNum.to_int_eq_succ_pred E1 #

∀ (n : PosNum), ↑n = ↑↑n.pred' + 1

theorem Num.cast_sub' E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (m n : Num), ↑(m.sub' n) = ↑m - ↑n

theorem Num.toZNum_succ E1 #

∀ (n : Num), n.succ.toZNum = n.toZNum.succ

theorem Num.toZNumNeg_succ E1 #

∀ (n : Num), n.succ.toZNumNeg = n.toZNumNeg.pred

theorem Num.pred_succ E0 #

∀ (n : ZNum), n.pred.succ = n

theorem Num.succ_ofInt' E1 #

∀ (n : ℤ), ZNum.ofInt' (n + 1) = ZNum.ofInt' n + 1

theorem Num.ofInt'_toZNum E1 #

∀ (n : ℕ), (↑n).toZNum = ZNum.ofInt' ↑n

theorem Num.mem_ofZNum' E0 #

∀ {m : Num} {n : ZNum}, m ∈ Num.ofZNum' n ↔ n = m.toZNum

theorem Num.ofZNum'_toNat E1 #

∀ (n : ZNum), castNum <$> Num.ofZNum' n = (↑n).toNat?

theorem Num.ofZNum_toNat E1 #

∀ (n : ZNum), ↑(Num.ofZNum n) = (↑n).toNat

theorem Num.cast_ofZNum E0 #

∀ {α : Type u_1} [inst : AddMonoidWithOne α] (n : ZNum), ↑(Num.ofZNum n) = ↑(↑n).toNat

theorem Num.sub_to_nat E0 #

∀ (m n : Num), ↑(m - n) = ↑m - ↑n

theorem ZNum.cast_add E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (m n : ZNum), ↑(m + n) = ↑m + ↑n

theorem ZNum.cast_succ E0 #

∀ {α : Type u_1} [inst : AddGroupWithOne α] (n : ZNum), ↑n.succ = ↑n + 1

theorem ZNum.mul_to_int E0 #

∀ (m n : ZNum), ↑(m * n) = ↑m * ↑n

theorem ZNum.cast_mul E1 #

∀ {α : Type u_1} [inst : NonAssocRing α] (m n : ZNum), ↑(m * n) = ↑m * ↑n

theorem ZNum.ofInt'_neg E1 #

∀ (n : ℤ), ZNum.ofInt' (-n) = -ZNum.ofInt' n

theorem ZNum.of_to_int' E1 #

∀ (n : ZNum), ZNum.ofInt' ↑n = n

theorem ZNum.to_int_inj E1 #

∀ {m n : ZNum}, ↑m = ↑n ↔ m = n

theorem ZNum.cmp_to_int E1 #

∀ (m n : ZNum), Ordering.casesOn (m.cmp n) (↑m < ↑n) (m = n) (↑n < ↑m)

theorem ZNum.lt_to_int E1 #

∀ {m n : ZNum}, ↑m < ↑n ↔ m < n

theorem ZNum.le_to_int E1 #

∀ {m n : ZNum}, ↑m ≤ ↑n ↔ m ≤ n

theorem ZNum.cast_lt E0 #

∀ {α : Type u_1} [inst : Ring α] [inst_1 : PartialOrder α] [IsStrictOrderedRing α] {m n : ZNum}, ↑m < ↑n ↔ m < n

theorem ZNum.cast_le E0 #

∀ {α : Type u_1} [inst : Ring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] {m n : ZNum}, ↑m ≤ ↑n ↔ m ≤ n

theorem ZNum.cast_inj E0 #

∀ {α : Type u_1} [inst : Ring α] [inst_1 : PartialOrder α] [IsStrictOrderedRing α] {m n : ZNum}, ↑m = ↑n ↔ m = n

def ZNum.transfer_rw E1 #

Lean.ParserDescr

This tactic tries to turn an (in)equality about ZNums to one about Ints by rewriting.

example (n : ZNum) (m : ZNum) : n ≤ n + m * m := by
  transfer_rw
  exact le_add_of_nonneg_right (mul_self_nonneg _)

def ZNum.transfer E1 #

Lean.ParserDescr

This tactic tries to prove (in)equalities about ZNums by transferring them to the Int world and then trying to call simp.

example (n : ZNum) (m : ZNum) : n ≤ n + m * m := by
  transfer
  exact mul_self_nonneg _

instance ZNum.linearOrder E0 #

LinearOrder ZNum

instance ZNum.addMonoid E0 #

AddMonoid ZNum

instance ZNum.addCommGroup E0 #

AddCommGroup ZNum

instance ZNum.addMonoidWithOne E0 #

AddMonoidWithOne ZNum

instance ZNum.commRing E0 #

CommRing ZNum

instance ZNum.nontrivial E0 #

Nontrivial ZNum

instance ZNum.zeroLEOneClass E0 #

ZeroLEOneClass ZNum

instance ZNum.isOrderedAddMonoid E0 #

IsOrderedAddMonoid ZNum

instance ZNum.isStrictOrderedRing E0 #

IsStrictOrderedRing ZNum

theorem ZNum.cast_sub E0 #

∀ {α : Type u_1} [inst : AddCommGroupWithOne α] (m n : ZNum), ↑(m - n) = ↑m - ↑n

theorem ZNum.neg_of_int E1 #

∀ (n : ℤ), ↑(-n) = -↑n

theorem ZNum.ofInt'_eq E0 #

∀ (n : ℤ), ZNum.ofInt' n = ↑n

theorem ZNum.of_nat_toZNum E0 #

∀ (n : ℕ), (↑n).toZNum = ↑n

theorem ZNum.of_to_int E0 #

∀ (n : ZNum), ↑↑n = n

theorem ZNum.to_of_int E1 #

∀ (n : ℤ), ↑↑n = n

theorem ZNum.of_nat_toZNumNeg E0 #

∀ (n : ℕ), (↑n).toZNumNeg = -↑n

theorem ZNum.of_intCast E0 #

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

theorem ZNum.of_natCast E0 #

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

theorem ZNum.dvd_to_int E0 #

∀ (m n : ZNum), ↑m ∣ ↑n ↔ m ∣ n

theorem PosNum.divMod_to_nat_aux E0 #

∀ {n d : PosNum} {q r : Num},
  ↑r + ↑d * (↑q + ↑q) = ↑n →
    ↑r < 2 * ↑d → ↑(d.divModAux q r).2 + ↑d * ↑(d.divModAux q r).1 = ↑n ∧ ↑(d.divModAux q r).2 < ↑d

theorem PosNum.divMod_to_nat E1 #

∀ (d n : PosNum), ↑n / ↑d = ↑(d.divMod n).1 ∧ ↑n % ↑d = ↑(d.divMod n).2

theorem PosNum.div'_to_nat E0 #

∀ (n d : PosNum), ↑(n.div' d) = ↑n / ↑d

theorem PosNum.mod'_to_nat E0 #

∀ (n d : PosNum), ↑(n.mod' d) = ↑n % ↑d

theorem Num.div_zero E0 #

∀ (n : Num), n / 0 = 0

theorem Num.div_to_nat E0 #

∀ (n d : Num), ↑(n / d) = ↑n / ↑d

theorem Num.mod_zero E0 #

∀ (n : Num), n % 0 = n

theorem Num.mod_to_nat E0 #

∀ (n d : Num), ↑(n % d) = ↑n % ↑d

theorem Num.gcd_to_nat_aux E0 #

∀ {n : ℕ} {a b : Num}, a ≤ b → (a * b).natSize ≤ n → ↑(Num.gcdAux n a b) = (↑a).gcd ↑b

theorem Num.gcd_to_nat E0 #

∀ (a b : Num), ↑(a.gcd b) = (↑a).gcd ↑b

theorem Num.dvd_iff_mod_eq_zero E1 #

∀ {m n : Num}, m ∣ n ↔ n % m = 0

instance Num.decidableDvd E0 #

DecidableRel fun x1 x2 ↦ x1 ∣ x2

instance PosNum.decidableDvd E0 #

DecidableRel fun x1 x2 ↦ x1 ∣ x2

theorem ZNum.div_zero E0 #

∀ (n : ZNum), n / 0 = 0

theorem ZNum.div_to_int E0 #

∀ (n d : ZNum), ↑(n / d) = ↑n / ↑d

theorem ZNum.mod_to_int E0 #

∀ (n d : ZNum), ↑(n % d) = ↑n % ↑d

theorem ZNum.gcd_to_nat E0 #

∀ (a b : ZNum), ↑(a.gcd b) = (↑a).gcd ↑b

theorem ZNum.dvd_iff_mod_eq_zero E1 #

∀ {m n : ZNum}, m ∣ n ↔ n % m = 0

instance ZNum.decidableDvd E0 #

DecidableRel fun x1 x2 ↦ x1 ∣ x2