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.Nat.Sqrt

32 declarations. Mathlib docs · Source

Properties of the natural number square root function.

sqrt

See [Wikipedia, Methods of computing square roots] (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Binary_numeral_system_(base_2)).

theorem Nat.sqrt_le' E1 #

∀ (n : ℕ), n.sqrt ^ 2 ≤ n

theorem Nat.lt_succ_sqrt' E1 #

∀ (n : ℕ), n < n.sqrt.succ ^ 2

theorem Nat.sqrt_le_add E1 #

∀ (n : ℕ), n ≤ n.sqrt * n.sqrt + n.sqrt + n.sqrt

theorem Nat.le_sqrt E1 #

∀ {m n : ℕ}, m ≤ n.sqrt ↔ m * m ≤ n

theorem Nat.le_sqrt' E1 #

∀ {m n : ℕ}, m ≤ n.sqrt ↔ m ^ 2 ≤ n

theorem Nat.sqrt_lt E1 #

∀ {m n : ℕ}, m.sqrt < n ↔ m < n * n

theorem Nat.sqrt_lt' E1 #

∀ {m n : ℕ}, m.sqrt < n ↔ m < n ^ 2

theorem Nat.sqrt_le_self E1 #

∀ (n : ℕ), n.sqrt ≤ n

theorem Nat.sqrt_le_sqrt E1 #

∀ {m n : ℕ}, m ≤ n → m.sqrt ≤ n.sqrt

theorem Nat.le_three_of_sqrt_eq_one E1 #

∀ {n : ℕ}, n.sqrt = 1 → n ≤ 3

theorem Nat.sqrt_lt_self E1 #

∀ {n : ℕ}, 1 < n → n.sqrt < n

theorem Nat.sqrt_pos E1 #

∀ {n : ℕ}, 0 < n.sqrt ↔ 0 < n

theorem Nat.sqrt_add_eq E0 #

∀ {a : ℕ} (n : ℕ), a ≤ n + n → (n * n + a).sqrt = n

theorem Nat.sqrt_add_eq' E1 #

∀ {a : ℕ} (n : ℕ), a ≤ n + n → (n ^ 2 + a).sqrt = n

theorem Nat.sqrt_eq E0 #

∀ (n : ℕ), (n * n).sqrt = n

theorem Nat.sqrt_eq' E0 #

∀ (n : ℕ), (n ^ 2).sqrt = n

theorem Nat.sqrt_succ_le_succ_sqrt E1 #

∀ (n : ℕ), n.succ.sqrt ≤ n.sqrt.succ

theorem Nat.log2_two E0 #

Nat.log2 2 = 1

theorem Nat.sqrt_zero E0 #

Nat.sqrt 0 = 0

theorem Nat.sqrt_one E0 #

Nat.sqrt 1 = 1

theorem Nat.sqrt_eq_zero E1 #

∀ {n : ℕ}, n.sqrt = 0 ↔ n = 0

theorem Nat.sqrt_two E0 #

Nat.sqrt 2 = 1

theorem Nat.add_one_sqrt_le_of_ne_zero E1 #

∀ {n : ℕ}, n ≠ 0 → (n + 1).sqrt ≤ n

theorem Nat.exists_mul_self E1 #

∀ (x : ℕ), (∃ n, n * n = x) ↔ x.sqrt * x.sqrt = x

theorem Nat.exists_mul_self' E1 #

∀ (x : ℕ), (∃ n, n ^ 2 = x) ↔ x.sqrt ^ 2 = x

theorem Nat.sqrt_mul_sqrt_lt_succ E1 #

∀ (n : ℕ), n.sqrt * n.sqrt < n + 1

theorem Nat.sqrt_mul_sqrt_lt_succ' E1 #

∀ (n : ℕ), n.sqrt ^ 2 < n + 1

theorem Nat.succ_le_succ_sqrt E1 #

∀ (n : ℕ), n + 1 ≤ (n.sqrt + 1) * (n.sqrt + 1)

theorem Nat.succ_le_succ_sqrt' E1 #

∀ (n : ℕ), n + 1 ≤ (n.sqrt + 1) ^ 2

theorem Nat.not_exists_sq E1 #

∀ {m n : ℕ}, m * m < n → n < (m + 1) * (m + 1) → ¬∃ t, t * t = n

There are no perfect squares strictly between m² and (m+1)²

theorem Nat.not_exists_sq' E1 #

∀ {m n : ℕ}, m ^ 2 < n → n < (m + 1) ^ 2 → ¬∃ t, t ^ 2 = n

theorem Nat.le_sqrt_of_eq_mul E1 #

∀ {a b c : ℕ}, a = b * c → b ≤ a.sqrt ∨ c ≤ a.sqrt