mathlib documentation

data.​nat.​pairing

data.​nat.​pairing

def nat.​mkpair  :
ℕ → ℕ → ℕ

Pairing function for the natural numbers.

Equations
def nat.​unpair  :

Unpairing function for the natural numbers.

Equations
@[simp]
theorem nat.​mkpair_unpair (n : ℕ) :

theorem nat.​mkpair_unpair' {n a b : ℕ} :
n.unpair = (a, b) → a.mkpair b = n

@[simp]
theorem nat.​unpair_mkpair (a b : ℕ) :
(a.mkpair b).unpair = (a, b)

theorem nat.​unpair_lt {n : ℕ} :
1 ≤ n → n.unpair.fst < n

theorem nat.​unpair_le_left (n : ℕ) :

theorem nat.​le_mkpair_left (a b : ℕ) :
a ≤ a.mkpair b

theorem nat.​le_mkpair_right (a b : ℕ) :
b ≤ a.mkpair b

theorem nat.​mkpair_lt_mkpair_left {a₁ a₂ : ℕ} (b : ℕ) :
a₁ < a₂ → a₁.mkpair b < a₂.mkpair b

theorem nat.​mkpair_lt_mkpair_right (a : ℕ) {b₁ b₂ : ℕ} :
b₁ < b₂ → a.mkpair b₁ < a.mkpair b₂