Note about Mathlib/Init/
#
The files in Mathlib/Init
are leftovers from the port from Mathlib3.
(They contain content moved from lean3 itself that Mathlib needed but was not moved to lean4.)
We intend to move all the content of these files out into the main Mathlib
directory structure.
Contributions assisting with this are appreciated.
multiplication
properties of inequality
Equations
- Nat.ltGeByCases h₁ h₂ = Decidable.byCases h₁ fun (h : ¬a < b) => h₂ ⋯
Instances For
def
Nat.ltByCases
{a : ℕ}
{b : ℕ}
{C : Sort u}
(h₁ : a < b → C)
(h₂ : a = b → C)
(h₃ : b < a → C)
:
C
Equations
- Nat.ltByCases h₁ h₂ h₃ = Nat.ltGeByCases h₁ fun (h₁ : b ≤ a) => Nat.ltGeByCases h₃ fun (h : a ≤ b) => h₂ ⋯
Instances For
bit0/bit1 properties
successor and predecessor
subtraction
Many lemmas are proven more generally in mathlib algebra/order/sub
min
induction principles
def
Nat.twoStepInduction
{P : ℕ → Sort u}
(H1 : P 0)
(H2 : P 1)
(H3 : (n : ℕ) → P n → P n.succ → P n.succ.succ)
(a : ℕ)
:
P a
Equations
- Nat.twoStepInduction H1 H2 H3 0 = H1
- Nat.twoStepInduction H1 H2 H3 1 = H2
- Nat.twoStepInduction H1 H2 H3 _n.succ.succ = H3 _n (Nat.twoStepInduction H1 H2 H3 _n) (Nat.twoStepInduction H1 H2 H3 _n.succ)
Instances For
def
Nat.subInduction
{P : ℕ → ℕ → Sort u}
(H1 : (m : ℕ) → P 0 m)
(H2 : (n : ℕ) → P n.succ 0)
(H3 : (n m : ℕ) → P n m → P n.succ m.succ)
(n : ℕ)
(m : ℕ)
:
P n m
Equations
- Nat.subInduction H1 H2 H3 0 x = H1 x
- Nat.subInduction H1 H2 H3 _n.succ 0 = H2 _n
- Nat.subInduction H1 H2 H3 n.succ m.succ = H3 n m (Nat.subInduction H1 H2 H3 n m)
Instances For
mod
div
dvd