Definitions of basic functions #
theorem
Int.subNatNat_of_sub_eq_zero
{m : Nat}
{n : Nat}
(h : n - m = 0)
:
Int.subNatNat m n = ↑(m - n)
theorem
Int.subNatNat_of_sub_eq_succ
{m : Nat}
{n : Nat}
{k : Nat}
(h : n - m = Nat.succ k)
:
Int.subNatNat m n = Int.negSucc k
These are only for internal use #
theorem
Int.ofNat_add_negSucc
(m : Nat)
(n : Nat)
:
↑m + Int.negSucc n = Int.subNatNat m (Nat.succ n)
theorem
Int.negSucc_add_ofNat
(m : Nat)
(n : Nat)
:
Int.negSucc m + ↑n = Int.subNatNat n (Nat.succ m)
theorem
Int.negSucc_add_negSucc
(m : Nat)
(n : Nat)
:
Int.negSucc m + Int.negSucc n = Int.negSucc (Nat.succ (m + n))
theorem
Int.ofNat_mul_negSucc'
(m : Nat)
(n : Nat)
:
↑m * Int.negSucc n = Int.negOfNat (m * Nat.succ n)
theorem
Int.negSucc_mul_ofNat'
(m : Nat)
(n : Nat)
:
Int.negSucc m * ↑n = Int.negOfNat (Nat.succ m * n)
theorem
Int.negSucc_mul_negSucc'
(m : Nat)
(n : Nat)
:
Int.negSucc m * Int.negSucc n = Int.ofNat (Nat.succ m * Nat.succ n)
theorem
Int.subNatNat_elim
(m : Nat)
(n : Nat)
(motive : Nat → Nat → Int → Prop)
(hp : ∀ (i n : Nat), motive (n + i) n ↑i)
(hn : ∀ (i m : Nat), motive m (m + i + 1) (Int.negSucc i))
:
motive m n (Int.subNatNat m n)
theorem
Int.subNatNat_add_add
(m : Nat)
(n : Nat)
(k : Nat)
:
Int.subNatNat (m + k) (n + k) = Int.subNatNat m n
theorem
Int.subNatNat_of_lt
{m : Nat}
{n : Nat}
(h : m < n)
:
Int.subNatNat m n = Int.negSucc (Nat.pred (n - m))
theorem
Int.ofNat_add_negSucc_of_lt
{m : Nat}
{n : Nat}
(h : m < Nat.succ n)
:
Int.ofNat m + Int.negSucc n = Int.negSucc (n - m)
theorem
Int.subNatNat_sub
{n : Nat}
{m : Nat}
(h : n ≤ m)
(k : Nat)
:
Int.subNatNat (m - n) k = Int.subNatNat m (k + n)
theorem
Int.subNatNat_add
(m : Nat)
(n : Nat)
(k : Nat)
:
Int.subNatNat (m + n) k = ↑m + Int.subNatNat n k
theorem
Int.subNatNat_add_negSucc
(m : Nat)
(n : Nat)
(k : Nat)
:
Int.subNatNat m n + Int.negSucc k = Int.subNatNat m (n + Nat.succ k)
theorem
Int.add_assoc.aux2
(m : Nat)
(n : Nat)
(k : Nat)
:
Int.negSucc m + Int.negSucc n + ↑k = Int.negSucc m + (Int.negSucc n + ↑k)
@[simp]
@[simp]
@[simp]
theorem
Int.negSucc_mul_negSucc
(m : Nat)
(n : Nat)
:
Int.negSucc m * Int.negSucc n = ↑(Nat.succ m) * ↑(Nat.succ n)
theorem
Int.negSucc_mul_negOfNat
(m : Nat)
(n : Nat)
:
Int.negSucc m * Int.negOfNat n = Int.ofNat (Nat.succ m * n)
theorem
Int.negOfNat_mul_negSucc
(m : Nat)
(n : Nat)
:
Int.negOfNat n * Int.negSucc m = Int.ofNat (n * Nat.succ m)
theorem
Int.ofNat_mul_subNatNat
(m : Nat)
(n : Nat)
(k : Nat)
:
↑m * Int.subNatNat n k = Int.subNatNat (m * n) (m * k)
theorem
Int.negOfNat_add
(m : Nat)
(n : Nat)
:
Int.negOfNat m + Int.negOfNat n = Int.negOfNat (m + n)
theorem
Int.negSucc_mul_subNatNat
(m : Nat)
(n : Nat)
(k : Nat)
:
Int.negSucc m * Int.subNatNat n k = Int.subNatNat (Nat.succ m * k) (Nat.succ m * n)
pow #
NatCast lemmas
The following lemmas are later subsumed by e.g. Nat.cast_add
and Nat.cast_mul
in Mathlib
but it is convenient to have these earlier, for users who only need Nat
and Int
.