File: Mathlib/Data/Nat/Defs.lean

full_name: Nat.instLinearOrder
code: instance instLinearOrder : LinearOrder ℕ 
goal: LinearOrder ℕ

full_name: Nat.instNontrivial
code: instance instNontrivial : Nontrivial ℕ 
goal: Nontrivial ℕ

full_name: Nat.default_eq_zero
code: @[simp] theorem default_eq_zero : default = 0 
goal: default = 0

full_name: Nat.succ_pos'
code: lemma succ_pos' : 0 < succ n 
goal: 0 < n.succ

full_name: Nat.succ_injective
code: lemma succ_injective : Injective Nat.succ 
goal: Function.Injective Nat.succ

full_name: Nat.succ_ne_succ
code: lemma succ_ne_succ : succ m ≠ succ n ↔ m ≠ n 
goal: m.succ ≠ n.succ ↔ m ≠ n

full_name: Nat.succ_succ_ne_one
code: lemma succ_succ_ne_one (n : ℕ) : n.succ.succ ≠ 1 
goal: n.succ.succ ≠ 1

full_name: Nat.one_lt_succ_succ
code: lemma one_lt_succ_succ (n : ℕ) : 1 < n.succ.succ 
goal: 1 < n.succ.succ

full_name: Nat.not_succ_lt_self
code: lemma not_succ_lt_self : ¬ succ n < n 
goal: ¬n.succ < n

full_name: Nat.succ_le_iff
code: lemma succ_le_iff : succ m ≤ n ↔ m < n 
goal: m.succ ≤ n ↔ m < n

full_name: Nat.le_succ_iff
code: lemma le_succ_iff : m ≤ n.succ ↔ m ≤ n ∨ m = n.succ 
goal: m ≤ n.succ ↔ m ≤ n ∨ m = n.succ

full_name: Nat.lt_iff_le_pred
code: lemma lt_iff_le_pred : ∀ {n}, 0 < n → (m < n ↔ m ≤ n - 1) 
goal: 0 < n → (m < n ↔ m ≤ n - 1)

full_name: Nat.le_of_pred_lt
code: lemma le_of_pred_lt : ∀ {m}, pred m < n → m ≤ n
  
goal: m.pred < n → m ≤ n

full_name: Nat.lt_iff_add_one_le
code: lemma lt_iff_add_one_le : m < n ↔ m + 1 ≤ n 
goal: m < n ↔ m + 1 ≤ n

full_name: Nat.lt_one_add_iff
code: lemma lt_one_add_iff : m < 1 + n ↔ m ≤ n 
goal: m < 1 + n ↔ m ≤ n

full_name: Nat.one_add_le_iff
code: lemma one_add_le_iff : 1 + m ≤ n ↔ m < n 
goal: 1 + m ≤ n ↔ m < n

full_name: Nat.one_le_iff_ne_zero
code: lemma one_le_iff_ne_zero : 1 ≤ n ↔ n ≠ 0 
goal: 1 ≤ n ↔ n ≠ 0

full_name: Nat.one_lt_iff_ne_zero_and_ne_one
code: lemma one_lt_iff_ne_zero_and_ne_one : ∀ {n : ℕ}, 1 < n ↔ n ≠ 0 ∧ n ≠ 1
  
goal: 1 < n ↔ n ≠ 0 ∧ n ≠ 1

full_name: Nat.le_one_iff_eq_zero_or_eq_one
code: lemma le_one_iff_eq_zero_or_eq_one : ∀ {n : ℕ}, n ≤ 1 ↔ n = 0 ∨ n = 1 
goal: n ≤ 1 ↔ n = 0 ∨ n = 1

full_name: Nat.lt_one_iff
code: @[simp] lemma lt_one_iff : n < 1 ↔ n = 0 
goal: n < 1 ↔ n = 0

full_name: Nat.one_le_of_lt
code: lemma one_le_of_lt (h : a < b) : 1 ≤ b 
goal: 1 ≤ b

full_name: Nat.min_eq_zero_iff
code: @[simp] lemma min_eq_zero_iff : min m n = 0 ↔ m = 0 ∨ n = 0 
goal: min m n = 0 ↔ m = 0 ∨ n = 0

full_name: Nat.max_eq_zero_iff
code: @[simp] lemma max_eq_zero_iff : max m n = 0 ↔ m = 0 ∧ n = 0 
goal: max m n = 0 ↔ m = 0 ∧ n = 0

full_name: Nat.pred_one_add
code: lemma pred_one_add (n : ℕ) : pred (1 + n) = n 
goal: (1 + n).pred = n

full_name: Nat.pred_eq_self_iff
code: lemma pred_eq_self_iff : n.pred = n ↔ n = 0 
goal: n.pred = n ↔ n = 0

full_name: Nat.pred_eq_of_eq_succ
code: lemma pred_eq_of_eq_succ (H : m = n.succ) : m.pred = n 
goal: m.pred = n

full_name: Nat.pred_eq_succ_iff
code: @[simp] lemma pred_eq_succ_iff : n - 1 = m + 1 ↔ n = m + 2 
goal: n - 1 = m + 1 ↔ n = m + 2

full_name: Nat.and_forall_succ
code: lemma and_forall_succ : p 0 ∧ (∀ n, p (n + 1)) ↔ ∀ n, p n 
goal: (p 0 ∧ ∀ (n : ℕ), p (n + 1)) ↔ ∀ (n : ℕ), p n

full_name: Nat.or_exists_succ
code: lemma or_exists_succ : p 0 ∨ (∃ n, p (n + 1)) ↔ ∃ n, p n 
goal: (p 0 ∨ ∃ n, p (n + 1)) ↔ ∃ n, p n

full_name: Nat.forall_lt_succ
code: lemma forall_lt_succ : (∀ m < n + 1, p m) ↔ (∀ m < n, p m) ∧ p n 
goal: (∀ (m : ℕ), m < n + 1 → p m) ↔ (∀ (m : ℕ), m < n → p m) ∧ p n

full_name: Nat.exists_lt_succ
code: lemma exists_lt_succ : (∃ m < n + 1, p m) ↔ (∃ m < n, p m) ∨ p n 
goal: (∃ m, m < n + 1 ∧ p m) ↔ (∃ m, m < n ∧ p m) ∨ p n

full_name: Nat.two_lt_of_ne
code: lemma two_lt_of_ne : ∀ {n}, n ≠ 0 → n ≠ 1 → n ≠ 2 → 2 < n
  
goal: n ≠ 0 → n ≠ 1 → n ≠ 2 → 2 < n

full_name: Nat.add_succ_sub_one
code: @[simp] lemma add_succ_sub_one (m n : ℕ) : m + succ n - 1 = m + n 
goal: m + n.succ - 1 = m + n

full_name: Nat.succ_add_sub_one
code: @[simp]
lemma succ_add_sub_one (n m : ℕ) : succ m + n - 1 = m + n 
goal: m.succ + n - 1 = m + n

full_name: Nat.pred_sub
code: lemma pred_sub (n m : ℕ) : pred n - m = pred (n - m) 
goal: n.pred - m = (n - m).pred

full_name: Nat.self_add_sub_one
code: lemma self_add_sub_one : ∀ n, n + (n - 1) = 2 * n - 1
  
goal: n + (n - 1) = 2 * n - 1

full_name: Nat.sub_one_add_self
code: lemma sub_one_add_self (n : ℕ) : (n - 1) + n = 2 * n - 1 
goal: n - 1 + n = 2 * n - 1

full_name: Nat.self_add_pred
code: lemma self_add_pred (n : ℕ) : n + pred n = (2 * n).pred 
goal: n + n.pred = (2 * n).pred

full_name: Nat.pred_add_self
code: lemma pred_add_self (n : ℕ) : pred n + n = (2 * n).pred 
goal: n.pred + n = (2 * n).pred

full_name: Nat.pred_le_iff
code: lemma pred_le_iff : pred m ≤ n ↔ m ≤ succ n 
goal: m.pred ≤ n ↔ m ≤ n.succ

full_name: Nat.lt_of_lt_pred
code: lemma lt_of_lt_pred (h : m < n - 1) : m < n 
goal: m < n

full_name: Nat.le_add_pred_of_pos
code: lemma le_add_pred_of_pos (a : ℕ) (hb : b ≠ 0) : a ≤ b + (a - 1) 
goal: a ≤ b + (a - 1)

full_name: Nat.add_def
code: @[simp] lemma add_def : Nat.add m n = m + n 
goal: m.add n = m + n

full_name: Nat.add_eq_left
code: @[simp, nolint simpNF] protected lemma add_eq_left : a + b = a ↔ b = 0 
goal: a + b = a ↔ b = 0

full_name: Nat.add_eq_right
code: @[simp, nolint simpNF] protected lemma add_eq_right : a + b = b ↔ a = 0 
goal: a + b = b ↔ a = 0

full_name: Nat.two_le_iff
code: lemma two_le_iff : ∀ n, 2 ≤ n ↔ n ≠ 0 ∧ n ≠ 1
  
goal: 2 ≤ n ↔ n ≠ 0 ∧ n ≠ 1

full_name: Nat.add_eq_max_iff
code: lemma add_eq_max_iff : m + n = max m n ↔ m = 0 ∨ n = 0 
goal: m + n = max m n ↔ m = 0 ∨ n = 0

full_name: Nat.add_eq_min_iff
code: lemma add_eq_min_iff : m + n = min m n ↔ m = 0 ∧ n = 0 
goal: m + n = min m n ↔ m = 0 ∧ n = 0

full_name: Nat.add_eq_zero
code: @[simp, nolint simpNF] protected lemma add_eq_zero : m + n = 0 ↔ m = 0 ∧ n = 0 
goal: m + n = 0 ↔ m = 0 ∧ n = 0

full_name: Nat.add_pos_iff_pos_or_pos
code: lemma add_pos_iff_pos_or_pos : 0 < m + n ↔ 0 < m ∨ 0 < n 
goal: 0 < m + n ↔ 0 < m ∨ 0 < n

full_name: Nat.add_eq_one_iff
code: lemma add_eq_one_iff : m + n = 1 ↔ m = 0 ∧ n = 1 ∨ m = 1 ∧ n = 0 
goal: m + n = 1 ↔ m = 0 ∧ n = 1 ∨ m = 1 ∧ n = 0

full_name: Nat.add_eq_two_iff
code: lemma add_eq_two_iff : m + n = 2 ↔ m = 0 ∧ n = 2 ∨ m = 1 ∧ n = 1 ∨ m = 2 ∧ n = 0 
goal: m + n = 2 ↔ m = 0 ∧ n = 2 ∨ m = 1 ∧ n = 1 ∨ m = 2 ∧ n = 0

full_name: Nat.add_eq_three_iff
code: lemma add_eq_three_iff :
    m + n = 3 ↔ m = 0 ∧ n = 3 ∨ m = 1 ∧ n = 2 ∨ m = 2 ∧ n = 1 ∨ m = 3 ∧ n = 0 
goal: m + n = 3 ↔ m = 0 ∧ n = 3 ∨ m = 1 ∧ n = 2 ∨ m = 2 ∧ n = 1 ∨ m = 3 ∧ n = 0

full_name: Nat.le_add_one_iff
code: lemma le_add_one_iff : m ≤ n + 1 ↔ m ≤ n ∨ m = n + 1 
goal: m ≤ n + 1 ↔ m ≤ n ∨ m = n + 1

full_name: Nat.le_and_le_add_one_iff
code: lemma le_and_le_add_one_iff : n ≤ m ∧ m ≤ n + 1 ↔ m = n ∨ m = n + 1 
goal: n ≤ m ∧ m ≤ n + 1 ↔ m = n ∨ m = n + 1

full_name: Nat.add_succ_lt_add
code: lemma add_succ_lt_add (hab : a < b) (hcd : c < d) : a + c + 1 < b + d 
goal: a + c + 1 < b + d

full_name: Nat.le_or_le_of_add_eq_add_pred
code: theorem le_or_le_of_add_eq_add_pred (h : a + c = b + d - 1) : b ≤ a ∨ d ≤ c 
goal: b ≤ a ∨ d ≤ c

full_name: Nat.sub_succ'
code: /-- A version of `Nat.sub_succ` in the form `_ - 1` instead of `Nat.pred _`. -/
lemma sub_succ' (m n : ℕ) : m - n.succ = m - n - 1 
goal: m - n.succ = m - n - 1

full_name: Nat.sub_eq_of_eq_add'
code: protected lemma sub_eq_of_eq_add' (h : a = b + c) : a - b = c 
goal: a - b = c

full_name: Nat.eq_sub_of_add_eq
code: protected lemma eq_sub_of_add_eq (h : c + b = a) : c = a - b 
goal: c = a - b

full_name: Nat.eq_sub_of_add_eq'
code: protected lemma eq_sub_of_add_eq' (h : b + c = a) : c = a - b 
goal: c = a - b

full_name: Nat.lt_sub_iff_add_lt
code: protected lemma lt_sub_iff_add_lt : a < c - b ↔ a + b < c 
goal: a < c - b ↔ a + b < c

full_name: Nat.lt_sub_iff_add_lt'
code: protected lemma lt_sub_iff_add_lt' : a < c - b ↔ b + a < c 
goal: a < c - b ↔ b + a < c

full_name: Nat.sub_lt_iff_lt_add
code: protected lemma sub_lt_iff_lt_add (hba : b ≤ a) : a - b < c ↔ a < b + c 
goal: a - b < c ↔ a < b + c

full_name: Nat.sub_lt_iff_lt_add'
code: protected lemma sub_lt_iff_lt_add' (hba : b ≤ a) : a - b < c ↔ a < c + b 
goal: a - b < c ↔ a < c + b

full_name: Nat.sub_sub_sub_cancel_right
code: protected lemma sub_sub_sub_cancel_right (h : c ≤ b) : a - c - (b - c) = a - b 
goal: a - c - (b - c) = a - b

full_name: Nat.add_sub_sub_cancel
code: protected lemma add_sub_sub_cancel (h : c ≤ a) : a + b - (a - c) = b + c 
goal: a + b - (a - c) = b + c

full_name: Nat.sub_add_sub_cancel
code: protected lemma sub_add_sub_cancel (hab : b ≤ a) (hcb : c ≤ b) : a - b + (b - c) = a - c 
goal: a - b + (b - c) = a - c

full_name: Nat.lt_pred_iff
code: lemma lt_pred_iff : a < pred b ↔ succ a < b 
goal: a < b.pred ↔ a.succ < b

full_name: Nat.sub_lt_sub_iff_right
code: protected lemma sub_lt_sub_iff_right (h : c ≤ a) : a - c < b - c ↔ a < b 
goal: a - c < b - c ↔ a < b

full_name: Nat.mul_def
code: @[simp] lemma mul_def : Nat.mul m n = m * n 
goal: m.mul n = m * n

full_name: Nat.zero_eq_mul
code: protected lemma zero_eq_mul : 0 = m * n ↔ m = 0 ∨ n = 0 
goal: 0 = m * n ↔ m = 0 ∨ n = 0

full_name: Nat.two_mul_ne_two_mul_add_one
code: lemma two_mul_ne_two_mul_add_one : 2 * n ≠ 2 * m + 1 
goal: 2 * n ≠ 2 * m + 1

full_name: Nat.mul_left_inj
code: protected lemma mul_left_inj (ha : a ≠ 0) : b * a = c * a ↔ b = c 
goal: b * a = c * a ↔ b = c

full_name: Nat.mul_right_inj
code: protected lemma mul_right_inj (ha : a ≠ 0) : a * b = a * c ↔ b = c 
goal: a * b = a * c ↔ b = c

full_name: Nat.mul_ne_mul_left
code: protected lemma mul_ne_mul_left (ha : a ≠ 0) : b * a ≠ c * a ↔ b ≠ c 
goal: b * a ≠ c * a ↔ b ≠ c

full_name: Nat.mul_ne_mul_right
code: protected lemma mul_ne_mul_right (ha : a ≠ 0) : a * b ≠ a * c ↔ b ≠ c 
goal: a * b ≠ a * c ↔ b ≠ c

full_name: Nat.mul_eq_left
code: lemma mul_eq_left (ha : a ≠ 0) : a * b = a ↔ b = 1 
goal: a * b = a ↔ b = 1

full_name: Nat.mul_eq_right
code: lemma mul_eq_right (hb : b ≠ 0) : a * b = b ↔ a = 1 
goal: a * b = b ↔ a = 1

full_name: Nat.mul_right_eq_self_iff
code: lemma mul_right_eq_self_iff (ha : 0 < a) : a * b = a ↔ b = 1 
goal: a * b = a ↔ b = 1

full_name: Nat.mul_left_eq_self_iff
code: lemma mul_left_eq_self_iff (hb : 0 < b) : a * b = b ↔ a = 1 
goal: a * b = b ↔ a = 1

full_name: Nat.le_of_mul_le_mul_right
code: protected lemma le_of_mul_le_mul_right (h : a * c ≤ b * c) (hc : 0 < c) : a ≤ b 
goal: a ≤ b

full_name: Nat.one_lt_mul_iff
code: /-- The product of two natural numbers is greater than 1 if and only if
  at least one of them is greater than 1 and both are positive. -/
lemma one_lt_mul_iff : 1 < m * n ↔ 0 < m ∧ 0 < n ∧ (1 < m ∨ 1 < n) 
goal: 1 < m * n ↔ 0 < m ∧ 0 < n ∧ (1 < m ∨ 1 < n)

full_name: Nat.eq_one_of_mul_eq_one_right
code: lemma eq_one_of_mul_eq_one_right (H : m * n = 1) : m = 1 
goal: m = 1

full_name: Nat.eq_one_of_mul_eq_one_left
code: lemma eq_one_of_mul_eq_one_left (H : m * n = 1) : n = 1 
goal: n = 1

full_name: Nat.lt_mul_iff_one_lt_left
code: @[simp] protected lemma lt_mul_iff_one_lt_left (hb : 0 < b) : b < a * b ↔ 1 < a 
goal: b < a * b ↔ 1 < a

full_name: Nat.lt_mul_iff_one_lt_right
code: @[simp] protected lemma lt_mul_iff_one_lt_right (ha : 0 < a) : a < a * b ↔ 1 < b 
goal: a < a * b ↔ 1 < b

full_name: Nat.eq_zero_of_double_le
code: lemma eq_zero_of_double_le (h : 2 * n ≤ n) : n = 0 
goal: n = 0

full_name: Nat.eq_zero_of_mul_le
code: lemma eq_zero_of_mul_le (hb : 2 ≤ n) (h : n * m ≤ m) : m = 0 
goal: m = 0

full_name: Nat.succ_mul_pos
code: lemma succ_mul_pos (m : ℕ) (hn : 0 < n) : 0 < succ m * n 
goal: 0 < m.succ * n

full_name: Nat.mul_self_le_mul_self
code: lemma mul_self_le_mul_self (h : m ≤ n) : m * m ≤ n * n 
goal: m * m ≤ n * n

full_name: Nat.mul_lt_mul''
code: lemma mul_lt_mul'' (hac : a < c) (hbd : b < d) : a * b < c * d 
goal: a * b < c * d

full_name: Nat.mul_self_lt_mul_self
code: lemma mul_self_lt_mul_self (h : m < n) : m * m < n * n 
goal: m * m < n * n

full_name: Nat.mul_self_le_mul_self_iff
code: lemma mul_self_le_mul_self_iff : m * m ≤ n * n ↔ m ≤ n 
goal: m * m ≤ n * n ↔ m ≤ n

full_name: Nat.mul_self_lt_mul_self_iff
code: lemma mul_self_lt_mul_self_iff : m * m < n * n ↔ m < n 
goal: m * m < n * n ↔ m < n

full_name: Nat.le_mul_self
code: lemma le_mul_self : ∀ n : ℕ, n ≤ n * n
  
goal: n ≤ n * n

full_name: Nat.mul_self_inj
code: lemma mul_self_inj : m * m = n * n ↔ m = n 
goal: m * m = n * n ↔ m = n

full_name: Nat.lt_mul_self_iff
code: @[simp] lemma lt_mul_self_iff : ∀ {n : ℕ}, n < n * n ↔ 1 < n
  
goal: n < n * n ↔ 1 < n

full_name: Nat.add_sub_one_le_mul
code: lemma add_sub_one_le_mul (ha : a ≠ 0) (hb : b ≠ 0) : a + b - 1 ≤ a * b 
goal: a + b - 1 ≤ a * b

full_name: Nat.add_le_mul
code: protected lemma add_le_mul {a : ℕ} (ha : 2 ≤ a) : ∀ {b : ℕ} (_ : 2 ≤ b), a + b ≤ a * b
  
goal: 2 ≤ b → a + b ≤ a * b

full_name: Nat.div_le_iff_le_mul_add_pred
code: lemma div_le_iff_le_mul_add_pred (hb : 0 < b) : a / b ≤ c ↔ a ≤ b * c + (b - 1) 
goal: a / b ≤ c ↔ a ≤ b * c + (b - 1)

full_name: Nat.div_lt_self'
code: /-- A version of `Nat.div_lt_self` using successors, rather than additional hypotheses. -/
lemma div_lt_self' (a b : ℕ) : (a + 1) / (b + 2) < a + 1 
goal: (a + 1) / (b + 2) < a + 1

full_name: Nat.le_div_iff_mul_le'
code: lemma le_div_iff_mul_le' (hb : 0 < b) : a ≤ c / b ↔ a * b ≤ c 
goal: a ≤ c / b ↔ a * b ≤ c

full_name: Nat.div_lt_iff_lt_mul'
code: lemma div_lt_iff_lt_mul' (hb : 0 < b) : a / b < c ↔ a < c * b 
goal: a / b < c ↔ a < c * b

full_name: Nat.one_le_div_iff
code: lemma one_le_div_iff (hb : 0 < b) : 1 ≤ a / b ↔ b ≤ a 
goal: 1 ≤ a / b ↔ b ≤ a

full_name: Nat.div_lt_one_iff
code: lemma div_lt_one_iff (hb : 0 < b) : a / b < 1 ↔ a < b 
goal: a / b < 1 ↔ a < b

full_name: Nat.div_le_div_right
code: @[gcongr]
protected lemma div_le_div_right (h : a ≤ b) : a / c ≤ b / c 
goal: a / c ≤ b / c

full_name: Nat.lt_of_div_lt_div
code: lemma lt_of_div_lt_div (h : a / c < b / c) : a < b 
goal: a < b

full_name: Nat.div_pos
code: protected lemma div_pos (hba : b ≤ a) (hb : 0 < b) : 0 < a / b 
goal: 0 < a / b

full_name: Nat.lt_mul_of_div_lt
code: lemma lt_mul_of_div_lt (h : a / c < b) (hc : 0 < c) : a < b * c 
goal: a < b * c

full_name: Nat.mul_div_le_mul_div_assoc
code: lemma mul_div_le_mul_div_assoc (a b c : ℕ) : a * (b / c) ≤ a * b / c 
goal: a * (b / c) ≤ a * b / c

full_name: Nat.eq_mul_of_div_eq_left
code: protected lemma eq_mul_of_div_eq_left (H1 : b ∣ a) (H2 : a / b = c) : a = c * b 
goal: a = c * b

full_name: Nat.mul_div_cancel_left'
code: protected lemma mul_div_cancel_left' (Hd : a ∣ b) : a * (b / a) = b 
goal: a * (b / a) = b

full_name: Nat.lt_div_mul_add
code: lemma lt_div_mul_add (hb : 0 < b) : a < a / b * b + b 
goal: a < a / b * b + b

full_name: Nat.div_left_inj
code: @[simp]
protected lemma div_left_inj (hda : d ∣ a) (hdb : d ∣ b) : a / d = b / d ↔ a = b 
goal: a / d = b / d ↔ a = b

full_name: Nat.div_mul_div_comm
code: lemma div_mul_div_comm : b ∣ a → d ∣ c → (a / b) * (c / d) = (a * c) / (b * d) 
goal: b ∣ a → d ∣ c → a / b * (c / d) = a * c / (b * d)

full_name: Nat.mul_div_mul_comm
code: protected lemma mul_div_mul_comm (hba : b ∣ a) (hdc : d ∣ c) : a * c / (b * d) = a / b * (c / d) 
goal: a * c / (b * d) = a / b * (c / d)

full_name: Nat.eq_zero_of_le_div
code: lemma eq_zero_of_le_div (hn : 2 ≤ n) (h : m ≤ m / n) : m = 0 
goal: m = 0

full_name: Nat.div_mul_div_le_div
code: lemma div_mul_div_le_div (a b c : ℕ) : a / c * b / a ≤ b / c 
goal: a / c * b / a ≤ b / c

full_name: Nat.eq_zero_of_le_half
code: lemma eq_zero_of_le_half (h : n ≤ n / 2) : n = 0 
goal: n = 0

full_name: Nat.le_half_of_half_lt_sub
code: lemma le_half_of_half_lt_sub (h : a / 2 < a - b) : b ≤ a / 2 
goal: b ≤ a / 2

full_name: Nat.half_le_of_sub_le_half
code: lemma half_le_of_sub_le_half (h : a - b ≤ a / 2) : a / 2 ≤ b 
goal: a / 2 ≤ b

full_name: Nat.div_le_of_le_mul'
code: protected lemma div_le_of_le_mul' (h : m ≤ k * n) : m / k ≤ n 
goal: m / k ≤ n

full_name: Nat.div_le_self'
code: protected lemma div_le_self' (m n : ℕ) : m / n ≤ m 
goal: m / n ≤ m

full_name: Nat.two_mul_odd_div_two
code: lemma two_mul_odd_div_two (hn : n % 2 = 1) : 2 * (n / 2) = n - 1 
goal: 2 * (n / 2) = n - 1

full_name: Nat.div_le_div_left
code: @[gcongr]
lemma div_le_div_left (hcb : c ≤ b) (hc : 0 < c) : a / b ≤ a / c 
goal: a / b ≤ a / c

full_name: Nat.div_eq_self
code: lemma div_eq_self : m / n = m ↔ m = 0 ∨ n = 1 
goal: m / n = m ↔ m = 0 ∨ n = 1

full_name: Nat.div_eq_sub_mod_div
code: lemma div_eq_sub_mod_div : m / n = (m - m % n) / n 
goal: m / n = (m - m % n) / n

full_name: Nat.eq_div_of_mul_eq_left
code: protected lemma eq_div_of_mul_eq_left (hc : c ≠ 0) (h : a * c = b) : a = b / c 
goal: a = b / c

full_name: Nat.eq_div_of_mul_eq_right
code: protected lemma eq_div_of_mul_eq_right (hc : c ≠ 0) (h : c * a = b) : a = b / c 
goal: a = b / c

full_name: Nat.mul_le_of_le_div
code: protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y 
goal: x * k ≤ y

full_name: Nat.div_mul_div_le
code: protected lemma div_mul_div_le (a b c d : ℕ) :
    (a / b) * (c / d) ≤ (a * c) / (b * d) 
goal: a / b * (c / d) ≤ a * c / (b * d)

full_name: Nat.pow_lt_pow_left
code: protected lemma pow_lt_pow_left (h : a < b) : ∀ {n : ℕ}, n ≠ 0 → a ^ n < b ^ n
  
goal: n ≠ 0 → a ^ n < b ^ n

full_name: Nat.pow_lt_pow_right
code: protected lemma pow_lt_pow_right (ha : 1 < a) (h : m < n) : a ^ m < a ^ n 
goal: a ^ m < a ^ n

full_name: Nat.pow_le_pow_iff_left
code: protected lemma pow_le_pow_iff_left {n : ℕ} (hn : n ≠ 0) : a ^ n ≤ b ^ n ↔ a ≤ b 
goal: a ^ n ≤ b ^ n ↔ a ≤ b

full_name: Nat.pow_lt_pow_iff_left
code: protected lemma pow_lt_pow_iff_left (hn : n ≠ 0) : a ^ n < b ^ n ↔ a < b 
goal: a ^ n < b ^ n ↔ a < b

full_name: Nat.pow_left_injective
code: lemma pow_left_injective (hn : n ≠ 0) : Injective (fun a : ℕ ↦ a ^ n) 
goal: Function.Injective fun a => a ^ n

full_name: Nat.pow_right_injective
code: protected lemma pow_right_injective (ha : 2 ≤ a) : Injective (a ^ ·) 
goal: Function.Injective fun x => a ^ x

full_name: Nat.pow_eq_zero
code: @[simp, nolint simpNF] protected lemma pow_eq_zero {a : ℕ} : ∀ {n : ℕ}, a ^ n = 0 ↔ a = 0 ∧ n ≠ 0
  
goal: a ^ n = 0 ↔ a = 0 ∧ n ≠ 0

full_name: Nat.pow_eq_self_iff
code: /-- For `a > 1`, `a ^ b = a` iff `b = 1`. -/
lemma pow_eq_self_iff {a b : ℕ} (ha : 1 < a) : a ^ b = a ↔ b = 1 
goal: a ^ b = a ↔ b = 1

full_name: Nat.le_self_pow
code: lemma le_self_pow (hn : n ≠ 0) : ∀ a : ℕ, a ≤ a ^ n
  
goal: a ≤ a ^ n

full_name: Nat.lt_pow_self
code: lemma lt_pow_self (ha : 1 < a) : ∀ n : ℕ, n < a ^ n
  
goal: n < a ^ n

full_name: Nat.lt_two_pow
code: lemma lt_two_pow (n : ℕ) : n < 2 ^ n 
goal: n < 2 ^ n

full_name: Nat.one_le_pow
code: lemma one_le_pow (n m : ℕ) (h : 0 < m) : 1 ≤ m ^ n 
goal: 1 ≤ m ^ n

full_name: Nat.one_le_pow'
code: lemma one_le_pow' (n m : ℕ) : 1 ≤ (m + 1) ^ n 
goal: 1 ≤ (m + 1) ^ n

full_name: Nat.one_lt_pow
code: lemma one_lt_pow (hn : n ≠ 0) (ha : 1 < a) : 1 < a ^ n 
goal: 1 < a ^ n

full_name: Nat.two_pow_succ
code: lemma two_pow_succ (n : ℕ) : 2 ^ (n + 1) = 2 ^ n + 2 ^ n 
goal: 2 ^ (n + 1) = 2 ^ n + 2 ^ n

full_name: Nat.one_lt_pow'
code: lemma one_lt_pow' (n m : ℕ) : 1 < (m + 2) ^ (n + 1) 
goal: 1 < (m + 2) ^ (n + 1)

full_name: Nat.one_lt_pow_iff
code: @[simp] lemma one_lt_pow_iff {n : ℕ} (hn : n ≠ 0) : ∀ {a}, 1 < a ^ n ↔ 1 < a
 
goal: 1 < a ^ n ↔ 1 < a

full_name: Nat.one_lt_two_pow'
code: lemma one_lt_two_pow' (n : ℕ) : 1 < 2 ^ (n + 1) 
goal: 1 < 2 ^ (n + 1)

full_name: Nat.mul_lt_mul_pow_succ
code: lemma mul_lt_mul_pow_succ (ha : 0 < a) (hb : 1 < b) : n * b < a * b ^ (n + 1) 
goal: n * b < a * b ^ (n + 1)

full_name: Nat.sq_sub_sq
code: lemma sq_sub_sq (a b : ℕ) : a ^ 2 - b ^ 2 = (a + b) * (a - b) 
goal: a ^ 2 - b ^ 2 = (a + b) * (a - b)

full_name: Nat.div_pow
code: protected lemma div_pow (h : a ∣ b) : (b / a) ^ c = b ^ c / a ^ c 
goal: (b / a) ^ c = b ^ c / a ^ c

full_name: Nat.rec_zero
code: @[simp]
lemma rec_zero {C : ℕ → Sort*} (h0 : C 0) (h : ∀ n, C n → C (n + 1)) : Nat.rec h0 h 0 = h0 
goal: Nat.rec h0 h 0 = h0

full_name: Nat.rec_add_one
code: lemma rec_add_one {C : ℕ → Sort*} (h0 : C 0) (h : ∀ n, C n → C (n + 1)) (n : ℕ) :
    Nat.rec h0 h (n + 1) = h n (Nat.rec h0 h n) 
goal: Nat.rec h0 h (n + 1) = h n (Nat.rec h0 h n)

full_name: Nat.rec_one
code: @[simp] lemma rec_one {C : ℕ → Sort*} (h0 : C 0) (h : ∀ n, C n → C (n + 1)) :
    Nat.rec (motive := C) h0 h 1 = h 0 h0 
goal: Nat.rec h0 h 1 = h 0 h0

full_name: Nat.leRec
code: /-- Recursion starting at a non-zero number: given a map `C k → C (k+1)` for each `k ≥ n`,
there is a map from `C n` to each `C m`, `n ≤ m`.

This is a version of `Nat.le.rec` that works for `Sort u`.
Similarly to `Nat.le.rec`, it can be used as
```
induction hle using Nat.leRec with
| refl => sorry
| le_succ_of_le hle ih => sorry
```
-/
@[elab_as_elim]
def leRec {n} {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl : motive n le_rfl)
    (le_succ_of_le : ∀ ⦃k⦄ (h : n ≤ k), motive k h → motive (k + 1) (le_succ_of_le h)) :
    ∀ {m} (h : n ≤ m), motive m h
  
goal: motive m h

full_name: Nat.leRec_eq_leRec
code: theorem leRec_eq_leRec : @Nat.leRec.{0} = @Nat.le.rec 
goal: @Nat.leRec = @Nat.le.rec

full_name: Nat.leRec_self
code: @[simp]
lemma leRec_self {n} {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl : motive n le_rfl)
    (le_succ_of_le : ∀ ⦃k⦄ (h : n ≤ k), motive k h → motive (k + 1) (le_succ_of_le h)) :
    (leRec (motive := motive) refl le_succ_of_le le_rfl : motive n le_rfl) = refl 
goal: Nat.leRec refl le_succ_of_le ⋯ = refl

full_name: Nat.leRec_succ
code: @[simp]
lemma leRec_succ {n} {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl : motive n le_rfl)
    (le_succ_of_le : ∀ ⦃k⦄ (h : n ≤ k), motive k h → motive (k + 1) (le_succ_of_le h))
    (h1 : n ≤ m) {h2 : n ≤ m + 1} :
    (leRec (motive := motive) refl le_succ_of_le h2) =
      le_succ_of_le h1 (leRec (motive := motive) refl le_succ_of_le h1) 
goal: Nat.leRec refl le_succ_of_le h2 = le_succ_of_le h1 (Nat.leRec refl le_succ_of_le h1)

full_name: Nat.leRec_succ'
code: lemma leRec_succ' {n} {motive : (m : ℕ) → n ≤ m → Sort*} (refl le_succ_of_le) :
    (leRec (motive := motive) refl le_succ_of_le (le_succ _)) = le_succ_of_le _ refl 
goal: Nat.leRec refl le_succ_of_le ⋯ = le_succ_of_le ⋯ refl

full_name: Nat.leRec_trans
code: lemma leRec_trans {n m k} {motive : (m : ℕ) → n ≤ m → Sort*} (refl le_succ_of_le)
    (hnm : n ≤ m) (hmk : m ≤ k) :
    leRec (motive := motive) refl le_succ_of_le (Nat.le_trans hnm hmk) =
      leRec
        (leRec refl (fun _ h => le_succ_of_le h) hnm)
        (fun _ h => le_succ_of_le <| Nat.le_trans hnm h) hmk 
goal: Nat.leRec refl le_succ_of_le ⋯ =
  Nat.leRec (Nat.leRec refl (fun x h => le_succ_of_le h) hnm) (fun x h => le_succ_of_le ⋯) hmk

full_name: Nat.leRec_succ_left
code: lemma leRec_succ_left {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl le_succ_of_le) {m} (h1 : n ≤ m) (h2 : n + 1 ≤ m) :
    -- the `@` is needed for this to elaborate, even though we only provide explicit arguments!
    @leRec _ _ (le_succ_of_le le_rfl refl) (fun k h ih => le_succ_of_le (le_of_succ_le h) ih) _ h2 =
      leRec (motive := motive) refl le_succ_of_le h1 
goal: Nat.leRec (le_succ_of_le ⋯ refl) (fun k h ih => le_succ_of_le ⋯ ih) h2 = Nat.leRec refl le_succ_of_le h1

full_name: Nat.leRecOn'
code: /-- Recursion starting at a non-zero number: given a map `C k → C (k+1)` for each `k ≥ n`,
there is a map from `C n` to each `C m`, `n ≤ m`.

Prefer `Nat.leRec`, which can be used as `induction h using Nat.leRec`. -/
@[elab_as_elim, deprecated Nat.leRec (since := "2024-07-05")]
def leRecOn' {C : ℕ → Sort*} : ∀ {m}, n ≤ m → (∀ ⦃k⦄, n ≤ k → C k → C (k + 1)) → C n → C m 
goal: n ≤ m → (⦃k : ℕ⦄ → n ≤ k → C k → C (k + 1)) → C n → C m

full_name: Nat.leRecOn
code: /-- Recursion starting at a non-zero number: given a map `C k → C (k + 1)` for each `k`,
there is a map from `C n` to each `C m`, `n ≤ m`. For a version where the assumption is only made
when `k ≥ n`, see `Nat.leRec`. -/
@[elab_as_elim]
def leRecOn {C : ℕ → Sort*} {n : ℕ} : ∀ {m}, n ≤ m → (∀ {k}, C k → C (k + 1)) → C n → C m 
goal: n ≤ m → ({k : ℕ} → C k → C (k + 1)) → C n → C m

full_name: Nat.leRecOn_self
code: lemma leRecOn_self {C : ℕ → Sort*} {n} {next : ∀ {k}, C k → C (k + 1)} (x : C n) :
    (leRecOn n.le_refl next x : C n) = x 
goal: Nat.leRecOn ⋯ (fun {k} => next) x = x

full_name: Nat.leRecOn_succ
code: lemma leRecOn_succ {C : ℕ → Sort*} {n m} (h1 : n ≤ m) {h2 : n ≤ m + 1} {next} (x : C n) :
    (leRecOn h2 next x : C (m + 1)) = next (leRecOn h1 next x : C m) 
goal: Nat.leRecOn h2 next x = next (Nat.leRecOn h1 (fun {k} => next) x)

full_name: Nat.leRecOn_succ'
code: lemma leRecOn_succ' {C : ℕ → Sort*} {n} {h : n ≤ n + 1} {next : ∀ {k}, C k → C (k + 1)} (x : C n) :
    (leRecOn h next x : C (n + 1)) = next x 
goal: Nat.leRecOn h (fun {k} => next) x = next x

full_name: Nat.leRecOn_trans
code: lemma leRecOn_trans {C : ℕ → Sort*} {n m k} (hnm : n ≤ m) (hmk : m ≤ k) {next} (x : C n) :
    (leRecOn (Nat.le_trans hnm hmk) (@next) x : C k) =
      leRecOn hmk (@next) (leRecOn hnm (@next) x) 
goal: Nat.leRecOn ⋯ next x = Nat.leRecOn hmk next (Nat.leRecOn hnm next x)

full_name: Nat.leRecOn_succ_left
code: lemma leRecOn_succ_left {C : ℕ → Sort*} {n m}
    {next : ∀ {k}, C k → C (k + 1)} (x : C n) (h1 : n ≤ m) (h2 : n + 1 ≤ m) :
    (leRecOn h2 next (next x) : C m) = (leRecOn h1 next x : C m) 
goal: Nat.leRecOn h2 (fun {k} => next) (next x) = Nat.leRecOn h1 (fun {k} => next) x

full_name: Nat.leRecOn_injective
code: lemma leRecOn_injective {C : ℕ → Sort*} {n m} (hnm : n ≤ m) (next : ∀ {k}, C k → C (k + 1))
    (Hnext : ∀ n, Injective (@next n)) : Injective (@leRecOn C n m hnm next) 
goal: Function.Injective (Nat.leRecOn hnm fun {k} => next)

full_name: Nat.leRecOn_surjective
code: lemma leRecOn_surjective {C : ℕ → Sort*} {n m} (hnm : n ≤ m) (next : ∀ {k}, C k → C (k + 1))
    (Hnext : ∀ n, Surjective (@next n)) : Surjective (@leRecOn C n m hnm next) 
goal: Function.Surjective (Nat.leRecOn hnm fun {k} => next)

full_name: Nat.strongRec'
code: /-- Recursion principle based on `<`. -/
@[elab_as_elim]
protected def strongRec' {p : ℕ → Sort*} (H : ∀ n, (∀ m, m < n → p m) → p n) : ∀ n : ℕ, p n
  
goal: p n

full_name: Nat.strongRecOn'
code: /-- Recursion principle based on `<` applied to some natural number. -/
@[elab_as_elim]
def strongRecOn' {P : ℕ → Sort*} (n : ℕ) (h : ∀ n, (∀ m, m < n → P m) → P n) : P n 
goal: P n

full_name: Nat.strongRecOn'_beta
code: lemma strongRecOn'_beta {P : ℕ → Sort*} {h} :
    (strongRecOn' n h : P n) = h n fun m _ ↦ (strongRecOn' m h : P m) 
goal: n.strongRecOn' h = h n fun m x => m.strongRecOn' h

full_name: Nat.le_induction
code: /-- Induction principle starting at a non-zero number.
To use in an induction proof, the syntax is `induction n, hn using Nat.le_induction` (or the same
for `induction'`).

This is an alias of `Nat.leRec`, specialized to `Prop`. -/
@[elab_as_elim]
lemma le_induction {m : ℕ} {P : ∀ n, m ≤ n → Prop} (base : P m m.le_refl)
    (succ : ∀ n hmn, P n hmn → P (n + 1) (le_succ_of_le hmn)) : ∀ n hmn, P n hmn 
goal: P n hmn

full_name: Nat.decreasingInduction
code: /-- Decreasing induction: if `P (k+1)` implies `P k` for all `k < n`, then `P n` implies `P m` for
all `m ≤ n`.
Also works for functions to `Sort*`.

For a version also assuming `m ≤ k`, see `Nat.decreasingInduction'`. -/
@[elab_as_elim]
def decreasingInduction {n} {motive : (m : ℕ) → m ≤ n → Sort*}
    (of_succ : ∀ k (h : k < n), motive (k + 1) h → motive k (le_of_succ_le h))
    (self : motive n le_rfl) {m} (mn : m ≤ n) : motive m mn 
goal: motive m mn

full_name: Nat.decreasingInduction_self
code: @[simp]
lemma decreasingInduction_self {n} {motive : (m : ℕ) → m ≤ n → Sort*} (of_succ self) :
    (decreasingInduction (motive := motive) of_succ self le_rfl) = self 
goal: Nat.decreasingInduction of_succ self ⋯ = self

full_name: Nat.decreasingInduction_succ
code: lemma decreasingInduction_succ {n} {motive : (m : ℕ) → m ≤ n + 1 → Sort*} (of_succ self)
    (mn : m ≤ n) (msn : m ≤ n + 1) :
    (decreasingInduction (motive := motive) of_succ self msn : motive m msn) =
      decreasingInduction (motive := fun m h => motive m (le_succ_of_le h))
        (fun i hi => of_succ _ _) (of_succ _ _ self) mn 
goal: Nat.decreasingInduction of_succ self msn = Nat.decreasingInduction (fun i hi => of_succ i ⋯) (of_succ n ⋯ self) mn

full_name: Nat.decreasingInduction_succ'
code: @[simp]
lemma decreasingInduction_succ' {n} {motive : (m : ℕ) → m ≤ n + 1 → Sort*} (of_succ self) :
    decreasingInduction (motive := motive) of_succ self n.le_succ = of_succ _ _ self 
goal: Nat.decreasingInduction of_succ self ⋯ = of_succ n ⋯ self

full_name: Nat.decreasingInduction_trans
code: lemma decreasingInduction_trans {motive : (m : ℕ) → m ≤ k → Sort*} (hmn : m ≤ n) (hnk : n ≤ k)
    (of_succ self) :
    (decreasingInduction (motive := motive) of_succ self (Nat.le_trans hmn hnk) : motive m _) =
    decreasingInduction (fun n ih => of_succ _ _) (decreasingInduction of_succ self hnk) hmn 
goal: Nat.decreasingInduction of_succ self ⋯ =
  Nat.decreasingInduction (fun n_1 ih => of_succ n_1 ⋯) (Nat.decreasingInduction of_succ self hnk) hmn

full_name: Nat.decreasingInduction_succ_left
code: lemma decreasingInduction_succ_left  {motive : (m : ℕ) → m ≤ n → Sort*} (of_succ self)
    (smn : m + 1 ≤ n) (mn : m ≤ n) :
    decreasingInduction (motive := motive) of_succ self mn =
      of_succ m smn (decreasingInduction of_succ self smn) 
goal: Nat.decreasingInduction of_succ self mn = of_succ m smn (Nat.decreasingInduction of_succ self smn)

full_name: Nat.strongSubRecursion
code: /-- Given `P : ℕ → ℕ → Sort*`, if for all `m n : ℕ` we can extend `P` from the rectangle
strictly below `(m, n)` to `P m n`, then we have `P n m` for all `n m : ℕ`.
Note that for non-`Prop` output it is preferable to use the equation compiler directly if possible,
since this produces equation lemmas. -/
@[elab_as_elim]
def strongSubRecursion {P : ℕ → ℕ → Sort*} (H : ∀ m n, (∀ x y, x < m → y < n → P x y) → P m n) :
    ∀ n m : ℕ, P n m
  
goal: P n m

full_name: Nat.pincerRecursion
code: /-- Given `P : ℕ → ℕ → Sort*`, if we have `P m 0` and `P 0 n` for all `m n : ℕ`, and for any
`m n : ℕ` we can extend `P` from `(m, n + 1)` and `(m + 1, n)` to `(m + 1, n + 1)` then we have
`P m n` for all `m n : ℕ`.

Note that for non-`Prop` output it is preferable to use the equation compiler directly if possible,
since this produces equation lemmas. -/
@[elab_as_elim]
def pincerRecursion {P : ℕ → ℕ → Sort*} (Ha0 : ∀ m : ℕ, P m 0) (H0b : ∀ n : ℕ, P 0 n)
    (H : ∀ x y : ℕ, P x y.succ → P x.succ y → P x.succ y.succ) : ∀ n m : ℕ, P n m
  
goal: P n m

full_name: Nat.decreasingInduction'
code: /-- Decreasing induction: if `P (k+1)` implies `P k` for all `m ≤ k < n`, then `P n` implies `P m`.
Also works for functions to `Sort*`.

Weakens the assumptions of `Nat.decreasingInduction`. -/
@[elab_as_elim]
def decreasingInduction' {P : ℕ → Sort*} (h : ∀ k < n, m ≤ k → P (k + 1) → P k)
    (mn : m ≤ n) (hP : P n) : P m 
goal: P m

full_name: Nat.diag_induction
code: /-- Given a predicate on two naturals `P : ℕ → ℕ → Prop`, `P a b` is true for all `a < b` if
`P (a + 1) (a + 1)` is true for all `a`, `P 0 (b + 1)` is true for all `b` and for all
`a < b`, `P (a + 1) b` is true and `P a (b + 1)` is true implies `P (a + 1) (b + 1)` is true. -/
@[elab_as_elim]
theorem diag_induction (P : ℕ → ℕ → Prop) (ha : ∀ a, P (a + 1) (a + 1)) (hb : ∀ b, P 0 (b + 1))
    (hd : ∀ a b, a < b → P (a + 1) b → P a (b + 1) → P (a + 1) (b + 1)) : ∀ a b, a < b → P a b
  
goal: a < b → P a b

full_name: Nat.set_induction_bounded
code: /-- A subset of `ℕ` containing `k : ℕ` and closed under `Nat.succ` contains every `n ≥ k`. -/
lemma set_induction_bounded {S : Set ℕ} (hk : k ∈ S) (h_ind : ∀ k : ℕ, k ∈ S → k + 1 ∈ S)
    (hnk : k ≤ n) : n ∈ S 
goal: n ∈ S

full_name: Nat.set_induction
code: /-- A subset of `ℕ` containing zero and closed under `Nat.succ` contains all of `ℕ`. -/
lemma set_induction {S : Set ℕ} (hb : 0 ∈ S) (h_ind : ∀ k : ℕ, k ∈ S → k + 1 ∈ S) (n : ℕ) :
    n ∈ S 
goal: n ∈ S

full_name: Nat.mod_two_ne_one
code: @[simp] lemma mod_two_ne_one : ¬n % 2 = 1 ↔ n % 2 = 0 
goal: ¬n % 2 = 1 ↔ n % 2 = 0

full_name: Nat.mod_two_ne_zero
code: @[simp] lemma mod_two_ne_zero : ¬n % 2 = 0 ↔ n % 2 = 1 
goal: ¬n % 2 = 0 ↔ n % 2 = 1

full_name: Nat.div_mod_eq_mod_mul_div
code: @[deprecated mod_mul_right_div_self (since := "2024-05-29")]
lemma div_mod_eq_mod_mul_div (a b c : ℕ) : a / b % c = a % (b * c) / b 
goal: a / b % c = a % (b * c) / b

full_name: Nat.lt_div_iff_mul_lt
code: protected lemma lt_div_iff_mul_lt (hdn : d ∣ n) (a : ℕ) : a < n / d ↔ d * a < n 
goal: a < n / d ↔ d * a < n

full_name: Nat.mul_div_eq_iff_dvd
code: lemma mul_div_eq_iff_dvd {n d : ℕ} : d * (n / d) = n ↔ d ∣ n 
goal: d * (n / d) = n ↔ d ∣ n

full_name: Nat.mul_div_lt_iff_not_dvd
code: lemma mul_div_lt_iff_not_dvd : d * (n / d) < n ↔ ¬ d ∣ n 
goal: d * (n / d) < n ↔ ¬d ∣ n

full_name: Nat.div_eq_iff_eq_of_dvd_dvd
code: lemma div_eq_iff_eq_of_dvd_dvd (hn : n ≠ 0) (ha : a ∣ n) (hb : b ∣ n) : n / a = n / b ↔ a = b 
goal: n / a = n / b ↔ a = b

full_name: Nat.div_eq_zero_iff
code: protected lemma div_eq_zero_iff (hb : 0 < b) : a / b = 0 ↔ a < b 
goal: a / b = 0 ↔ a < b

full_name: Nat.div_ne_zero_iff
code: protected lemma div_ne_zero_iff (hb : b ≠ 0) : a / b ≠ 0 ↔ b ≤ a 
goal: a / b ≠ 0 ↔ b ≤ a

full_name: Nat.div_pos_iff
code: protected lemma div_pos_iff (hb : b ≠ 0) : 0 < a / b ↔ b ≤ a 
goal: 0 < a / b ↔ b ≤ a

full_name: Nat.le_iff_ne_zero_of_dvd
code: lemma le_iff_ne_zero_of_dvd (ha : a ≠ 0) (hab : a ∣ b) : a ≤ b ↔ b ≠ 0 
goal: a ≤ b ↔ b ≠ 0

full_name: Nat.div_ne_zero_iff_of_dvd
code: lemma div_ne_zero_iff_of_dvd (hba : b ∣ a) : a / b ≠ 0 ↔ a ≠ 0 ∧ b ≠ 0 
goal: a / b ≠ 0 ↔ a ≠ 0 ∧ b ≠ 0

full_name: Nat.mul_mod_mod
code: @[simp] lemma mul_mod_mod (a b c : ℕ) : (a * (b % c)) % c = a * b % c 
goal: a * (b % c) % c = a * b % c

full_name: Nat.mod_mul_mod
code: @[simp] lemma mod_mul_mod (a b c : ℕ) : (a % c * b) % c = a * b % c 
goal: a % c * b % c = a * b % c

full_name: Nat.pow_mod
code: lemma pow_mod (a b n : ℕ) : a ^ b % n = (a % n) ^ b % n 
goal: a ^ b % n = (a % n) ^ b % n

full_name: Nat.not_pos_pow_dvd
code: lemma not_pos_pow_dvd : ∀ {a n : ℕ} (_ : 1 < a) (_ : 1 < n), ¬ a ^ n ∣ a
  
goal: 1 < a → 1 < n → ¬a ^ n ∣ a

full_name: Nat.lt_of_pow_dvd_right
code: lemma lt_of_pow_dvd_right (hb : b ≠ 0) (ha : 2 ≤ a) (h : a ^ n ∣ b) : n < b 
goal: n < b

full_name: Nat.div_dvd_of_dvd
code: lemma div_dvd_of_dvd (h : n ∣ m) : m / n ∣ m 
goal: m / n ∣ m

full_name: Nat.div_div_self
code: protected lemma div_div_self (h : n ∣ m) (hm : m ≠ 0) : m / (m / n) = n 
goal: m / (m / n) = n

full_name: Nat.not_dvd_of_pos_of_lt
code: lemma not_dvd_of_pos_of_lt (h1 : 0 < n) (h2 : n < m) : ¬m ∣ n 
goal: ¬m ∣ n

full_name: Nat.eq_of_dvd_of_lt_two_mul
code: lemma eq_of_dvd_of_lt_two_mul (ha : a ≠ 0) (hdvd : b ∣ a) (hlt : a < 2 * b) : a = b 
goal: a = b

full_name: Nat.mod_eq_iff_lt
code: lemma mod_eq_iff_lt (hn : n ≠ 0) : m % n = m ↔ m < n 
goal: m % n = m ↔ m < n

full_name: Nat.mod_succ_eq_iff_lt
code: @[simp]
lemma mod_succ_eq_iff_lt : m % n.succ = m ↔ m < n.succ 
goal: m % n.succ = m ↔ m < n.succ

full_name: Nat.mod_succ
code: @[simp] lemma mod_succ (n : ℕ) : n % n.succ = n 
goal: n % n.succ = n

full_name: Nat.mod_add_div'
code: lemma mod_add_div' (a b : ℕ) : a % b + a / b * b = a 
goal: a % b + a / b * b = a

full_name: Nat.div_add_mod'
code: lemma div_add_mod' (a b : ℕ) : a / b * b + a % b = a 
goal: a / b * b + a % b = a

full_name: Nat.div_mod_unique
code: /-- See also `Nat.divModEquiv` for a similar statement as an `Equiv`. -/
protected lemma div_mod_unique (h : 0 < b) :
    a / b = d ∧ a % b = c ↔ c + b * d = a ∧ c < b 
goal: a / b = d ∧ a % b = c ↔ c + b * d = a ∧ c < b

full_name: Nat.sub_mod_eq_zero_of_mod_eq
code: /-- If `m` and `n` are equal mod `k`, `m - n` is zero mod `k`. -/
lemma sub_mod_eq_zero_of_mod_eq (h : m % k = n % k) : (m - n) % k = 0 
goal: (m - n) % k = 0

full_name: Nat.one_mod
code: @[simp] lemma one_mod (n : ℕ) : 1 % (n + 2) = 1 
goal: 1 % (n + 2) = 1

full_name: Nat.one_mod_of_ne_one
code: lemma one_mod_of_ne_one : ∀ {n : ℕ}, n ≠ 1 → 1 % n = 1
  
goal: n ≠ 1 → 1 % n = 1

full_name: Nat.dvd_sub_mod
code: lemma dvd_sub_mod (k : ℕ) : n ∣ k - k % n 
goal: n ∣ k - k % n

full_name: Nat.add_mod_eq_ite
code: lemma add_mod_eq_ite :
    (m + n) % k = if k ≤ m % k + n % k then m % k + n % k - k else m % k + n % k 
goal: (m + n) % k = if k ≤ m % k + n % k then m % k + n % k - k else m % k + n % k

full_name: Nat.not_dvd_of_between_consec_multiples
code: /-- `m` is not divisible by `n` if it is between `n * k` and `n * (k + 1)` for some `k`. -/
theorem not_dvd_of_between_consec_multiples (h1 : n * k < m) (h2 : m < n * (k + 1)) : ¬n ∣ m 
goal: ¬n ∣ m

full_name: Nat.dvd_add_left
code: protected lemma dvd_add_left (h : a ∣ c) : a ∣ b + c ↔ a ∣ b 
goal: a ∣ b + c ↔ a ∣ b

full_name: Nat.dvd_add_right
code: protected lemma dvd_add_right (h : a ∣ b) : a ∣ b + c ↔ a ∣ c 
goal: a ∣ b + c ↔ a ∣ c

full_name: Nat.mul_dvd_mul_iff_left
code: /-- special case of `mul_dvd_mul_iff_left` for `ℕ`.
Duplicated here to keep simple imports for this file. -/
protected lemma mul_dvd_mul_iff_left (ha : 0 < a) : a * b ∣ a * c ↔ b ∣ c 
goal: a * b ∣ a * c ↔ b ∣ c

full_name: Nat.mul_dvd_mul_iff_right
code: /-- special case of `mul_dvd_mul_iff_right` for `ℕ`.
Duplicated here to keep simple imports for this file. -/
protected lemma mul_dvd_mul_iff_right (hc : 0 < c) : a * c ∣ b * c ↔ a ∣ b 
goal: a * c ∣ b * c ↔ a ∣ b

full_name: Nat.add_mod_eq_add_mod_right
code: lemma add_mod_eq_add_mod_right (c : ℕ) (H : a % d = b % d) : (a + c) % d = (b + c) % d 
goal: (a + c) % d = (b + c) % d

full_name: Nat.add_mod_eq_add_mod_left
code: lemma add_mod_eq_add_mod_left (c : ℕ) (H : a % d = b % d) : (c + a) % d = (c + b) % d 
goal: (c + a) % d = (c + b) % d

full_name: Nat.mul_dvd_of_dvd_div
code: lemma mul_dvd_of_dvd_div (hcb : c ∣ b) (h : a ∣ b / c) : c * a ∣ b 
goal: c * a ∣ b

full_name: Nat.eq_of_dvd_of_div_eq_one
code: lemma eq_of_dvd_of_div_eq_one (hab : a ∣ b) (h : b / a = 1) : a = b 
goal: a = b

full_name: Nat.eq_zero_of_dvd_of_div_eq_zero
code: lemma eq_zero_of_dvd_of_div_eq_zero (hab : a ∣ b) (h : b / a = 0) : b = 0 
goal: b = 0

full_name: Nat.div_le_div
code: @[gcongr]
protected theorem div_le_div {a b c d : ℕ} (h1 : a ≤ b) (h2 : d ≤ c) (h3 : d ≠ 0) : a / c ≤ b / d 
goal: a / c ≤ b / d

full_name: Nat.lt_mul_div_succ
code: lemma lt_mul_div_succ (a : ℕ) (hb : 0 < b) : a < b * (a / b + 1) 
goal: a < b * (a / b + 1)

full_name: Nat.mul_add_mod'
code: lemma mul_add_mod' (a b c : ℕ) : (a * b + c) % b = c % b 
goal: (a * b + c) % b = c % b

full_name: Nat.mul_add_mod_of_lt
code: lemma mul_add_mod_of_lt (h : c < b) : (a * b + c) % b = c 
goal: (a * b + c) % b = c

full_name: Nat.not_two_dvd_bit1
code: @[simp]
protected theorem not_two_dvd_bit1 (n : ℕ) : ¬2 ∣ 2 * n + 1 
goal: ¬2 ∣ 2 * n + 1

full_name: Nat.dvd_add_self_left
code: /-- A natural number `m` divides the sum `m + n` if and only if `m` divides `n`.-/
@[simp] protected lemma dvd_add_self_left : m ∣ m + n ↔ m ∣ n 
goal: m ∣ m + n ↔ m ∣ n

full_name: Nat.dvd_add_self_right
code: /-- A natural number `m` divides the sum `n + m` if and only if `m` divides `n`.-/
@[simp] protected lemma dvd_add_self_right : m ∣ n + m ↔ m ∣ n 
goal: m ∣ n + m ↔ m ∣ n

full_name: Nat.dvd_sub'
code: lemma dvd_sub' (h₁ : k ∣ m) (h₂ : k ∣ n) : k ∣ m - n 
goal: k ∣ m - n

full_name: Nat.succ_div
code: lemma succ_div : ∀ a b : ℕ, (a + 1) / b = a / b + if b ∣ a + 1 then 1 else 0
  
goal: (a + 1) / b = a / b + if b ∣ a + 1 then 1 else 0

full_name: Nat.succ_div_of_dvd
code: lemma succ_div_of_dvd (hba : b ∣ a + 1) : (a + 1) / b = a / b + 1 
goal: (a + 1) / b = a / b + 1

full_name: Nat.succ_div_of_not_dvd
code: lemma succ_div_of_not_dvd (hba : ¬b ∣ a + 1) : (a + 1) / b = a / b 
goal: (a + 1) / b = a / b

full_name: Nat.dvd_iff_div_mul_eq
code: lemma dvd_iff_div_mul_eq (n d : ℕ) : d ∣ n ↔ n / d * d = n 
goal: d ∣ n ↔ n / d * d = n

full_name: Nat.dvd_iff_le_div_mul
code: lemma dvd_iff_le_div_mul (n d : ℕ) : d ∣ n ↔ n ≤ n / d * d 
goal: d ∣ n ↔ n ≤ n / d * d

full_name: Nat.dvd_iff_dvd_dvd
code: lemma dvd_iff_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ k : ℕ, k ∣ d → k ∣ n 
goal: d ∣ n ↔ ∀ (k : ℕ), k ∣ d → k ∣ n

full_name: Nat.dvd_div_of_mul_dvd
code: lemma dvd_div_of_mul_dvd (h : a * b ∣ c) : b ∣ c / a 
goal: b ∣ c / a

full_name: Nat.dvd_div_iff_mul_dvd
code: @[simp] lemma dvd_div_iff_mul_dvd (hbc : c ∣ b) : a ∣ b / c ↔ c * a ∣ b 
goal: a ∣ b / c ↔ c * a ∣ b

full_name: Nat.dvd_mul_of_div_dvd
code: lemma dvd_mul_of_div_dvd (h : b ∣ a) (hdiv : a / b ∣ c) : a ∣ b * c 
goal: a ∣ b * c

full_name: Nat.div_dvd_iff_dvd_mul
code: @[simp] lemma div_dvd_iff_dvd_mul (h : b ∣ a) (hb : b ≠ 0) : a / b ∣ c ↔ a ∣ b * c 
goal: a / b ∣ c ↔ a ∣ b * c

full_name: Nat.div_div_div_eq_div
code: @[simp] lemma div_div_div_eq_div (dvd : b ∣ a) (dvd2 : a ∣ c) : c / (a / b) / b = c / a 
goal: c / (a / b) / b = c / a

full_name: Nat.eq_zero_of_dvd_of_lt
code: /-- If a small natural number is divisible by a larger natural number,
the small number is zero. -/
lemma eq_zero_of_dvd_of_lt (w : a ∣ b) (h : b < a) : b = 0 
goal: b = 0

full_name: Nat.le_of_lt_add_of_dvd
code: lemma le_of_lt_add_of_dvd (h : a < b + n) : n ∣ a → n ∣ b → a ≤ b 
goal: n ∣ a → n ∣ b → a ≤ b

full_name: Nat.not_dvd_iff_between_consec_multiples
code: /-- `n` is not divisible by `a` iff it is between `a * k` and `a * (k + 1)` for some `k`. -/
lemma not_dvd_iff_between_consec_multiples (n : ℕ) {a : ℕ} (ha : 0 < a) :
    (∃ k : ℕ, a * k < n ∧ n < a * (k + 1)) ↔ ¬a ∣ n 
goal: (∃ k, a * k < n ∧ n < a * (k + 1)) ↔ ¬a ∣ n

full_name: Nat.dvd_right_iff_eq
code: /-- Two natural numbers are equal if and only if they have the same multiples. -/
lemma dvd_right_iff_eq : (∀ a : ℕ, m ∣ a ↔ n ∣ a) ↔ m = n 
goal: (∀ (a : ℕ), m ∣ a ↔ n ∣ a) ↔ m = n

full_name: Nat.dvd_left_iff_eq
code: /-- Two natural numbers are equal if and only if they have the same divisors. -/
lemma dvd_left_iff_eq : (∀ a : ℕ, a ∣ m ↔ a ∣ n) ↔ m = n 
goal: (∀ (a : ℕ), a ∣ m ↔ a ∣ n) ↔ m = n

full_name: Nat.dvd_left_injective
code: /-- `dvd` is injective in the left argument -/
lemma dvd_left_injective : Function.Injective ((· ∣ ·) : ℕ → ℕ → Prop) 
goal: Function.Injective fun x x_1 => x ∣ x_1

full_name: Nat.div_lt_div_of_lt_of_dvd
code: lemma div_lt_div_of_lt_of_dvd {a b d : ℕ} (hdb : d ∣ b) (h : a < b) : a / d < b / d 
goal: a / d < b / d

full_name: _private.Mathlib.Data.Nat.Defs.0.Nat.iter_fp_bound
code: private lemma iter_fp_bound (n k : ℕ) :
    let iter_next (n guess : ℕ) := (guess + n / guess) / 2;
    sqrt.iter n k ≤ iter_next n (sqrt.iter n k) 
goal: let iter_next := fun n guess => (guess + n / guess) / 2;
Nat.sqrt.iter n k ≤ iter_next n (Nat.sqrt.iter n k)

full_name: _private.Mathlib.Data.Nat.Defs.0.Nat.AM_GM
code: private lemma AM_GM : {a b : ℕ} → (4 * a * b ≤ (a + b) * (a + b))
  
goal: 4 * a * b ≤ (a + b) * (a + b)

full_name: Nat.sqrt.iter_sq_le
code: lemma sqrt.iter_sq_le (n guess : ℕ) : sqrt.iter n guess * sqrt.iter n guess ≤ n 
goal: Nat.sqrt.iter n guess * Nat.sqrt.iter n guess ≤ n

full_name: Nat.sqrt.lt_iter_succ_sq
code: lemma sqrt.lt_iter_succ_sq (n guess : ℕ) (hn : n < (guess + 1) * (guess + 1)) :
    n < (sqrt.iter n guess + 1) * (sqrt.iter n guess + 1) 
goal: n < (Nat.sqrt.iter n guess + 1) * (Nat.sqrt.iter n guess + 1)

full_name: _private.Mathlib.Data.Nat.Defs.0.Nat.IsSqrt
code: private def IsSqrt (n q : ℕ) : Prop 
goal: Prop

full_name: _private.Mathlib.Data.Nat.Defs.0.Nat.sqrt_isSqrt
code: private lemma sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) 
goal: Nat.IsSqrt n n.sqrt

full_name: Nat.sqrt_le
code: lemma sqrt_le (n : ℕ) : sqrt n * sqrt n ≤ n 
goal: n.sqrt * n.sqrt ≤ n

full_name: Nat.sqrt_le'
code: lemma sqrt_le' (n : ℕ) : sqrt n ^ 2 ≤ n 
goal: n.sqrt ^ 2 ≤ n

full_name: Nat.lt_succ_sqrt
code: lemma lt_succ_sqrt (n : ℕ) : n < succ (sqrt n) * succ (sqrt n) 
goal: n < n.sqrt.succ * n.sqrt.succ

full_name: Nat.lt_succ_sqrt'
code: lemma lt_succ_sqrt' (n : ℕ) : n < succ (sqrt n) ^ 2 
goal: n < n.sqrt.succ ^ 2

full_name: Nat.sqrt_le_add
code: lemma sqrt_le_add (n : ℕ) : n ≤ sqrt n * sqrt n + sqrt n + sqrt n 
goal: n ≤ n.sqrt * n.sqrt + n.sqrt + n.sqrt

full_name: Nat.le_sqrt
code: lemma le_sqrt : m ≤ sqrt n ↔ m * m ≤ n 
goal: m ≤ n.sqrt ↔ m * m ≤ n

full_name: Nat.le_sqrt'
code: lemma le_sqrt' : m ≤ sqrt n ↔ m ^ 2 ≤ n 
goal: m ≤ n.sqrt ↔ m ^ 2 ≤ n

full_name: Nat.sqrt_lt
code: lemma sqrt_lt : sqrt m < n ↔ m < n * n 
goal: m.sqrt < n ↔ m < n * n

full_name: Nat.sqrt_lt'
code: lemma sqrt_lt' : sqrt m < n ↔ m < n ^ 2 
goal: m.sqrt < n ↔ m < n ^ 2

full_name: Nat.sqrt_le_self
code: lemma sqrt_le_self (n : ℕ) : sqrt n ≤ n 
goal: n.sqrt ≤ n

full_name: Nat.sqrt_le_sqrt
code: lemma sqrt_le_sqrt (h : m ≤ n) : sqrt m ≤ sqrt n 
goal: m.sqrt ≤ n.sqrt

full_name: Nat.sqrt_zero
code: @[simp] lemma sqrt_zero : sqrt 0 = 0 
goal: Nat.sqrt 0 = 0

full_name: Nat.sqrt_one
code: @[simp] lemma sqrt_one : sqrt 1 = 1 
goal: Nat.sqrt 1 = 1

full_name: Nat.sqrt_eq_zero
code: lemma sqrt_eq_zero : sqrt n = 0 ↔ n = 0 
goal: n.sqrt = 0 ↔ n = 0

full_name: Nat.eq_sqrt
code: lemma eq_sqrt : a = sqrt n ↔ a * a ≤ n ∧ n < (a + 1) * (a + 1) 
goal: a = n.sqrt ↔ a * a ≤ n ∧ n < (a + 1) * (a + 1)

full_name: Nat.eq_sqrt'
code: lemma eq_sqrt' : a = sqrt n ↔ a ^ 2 ≤ n ∧ n < (a + 1) ^ 2 
goal: a = n.sqrt ↔ a ^ 2 ≤ n ∧ n < (a + 1) ^ 2

full_name: Nat.le_three_of_sqrt_eq_one
code: lemma le_three_of_sqrt_eq_one (h : sqrt n = 1) : n ≤ 3 
goal: n ≤ 3

full_name: Nat.sqrt_lt_self
code: lemma sqrt_lt_self (h : 1 < n) : sqrt n < n 
goal: n.sqrt < n

full_name: Nat.sqrt_pos
code: lemma sqrt_pos : 0 < sqrt n ↔ 0 < n 
goal: 0 < n.sqrt ↔ 0 < n

full_name: Nat.sqrt_add_eq
code: lemma sqrt_add_eq (n : ℕ) (h : a ≤ n + n) : sqrt (n * n + a) = n 
goal: (n * n + a).sqrt = n

full_name: Nat.sqrt_add_eq'
code: lemma sqrt_add_eq' (n : ℕ) (h : a ≤ n + n) : sqrt (n ^ 2 + a) = n 
goal: (n ^ 2 + a).sqrt = n

full_name: Nat.sqrt_eq
code: lemma sqrt_eq (n : ℕ) : sqrt (n * n) = n 
goal: (n * n).sqrt = n

full_name: Nat.sqrt_eq'
code: lemma sqrt_eq' (n : ℕ) : sqrt (n ^ 2) = n 
goal: (n ^ 2).sqrt = n

full_name: Nat.sqrt_succ_le_succ_sqrt
code: lemma sqrt_succ_le_succ_sqrt (n : ℕ) : sqrt n.succ ≤ n.sqrt.succ 
goal: n.succ.sqrt ≤ n.sqrt.succ

full_name: Nat.exists_mul_self
code: lemma exists_mul_self (x : ℕ) : (∃ n, n * n = x) ↔ sqrt x * sqrt x = x 
goal: (∃ n, n * n = x) ↔ x.sqrt * x.sqrt = x

full_name: Nat.exists_mul_self'
code: lemma exists_mul_self' (x : ℕ) : (∃ n, n ^ 2 = x) ↔ sqrt x ^ 2 = x 
goal: (∃ n, n ^ 2 = x) ↔ x.sqrt ^ 2 = x

full_name: Nat.sqrt_mul_sqrt_lt_succ
code: lemma sqrt_mul_sqrt_lt_succ (n : ℕ) : sqrt n * sqrt n < n + 1 
goal: n.sqrt * n.sqrt < n + 1

full_name: Nat.sqrt_mul_sqrt_lt_succ'
code: lemma sqrt_mul_sqrt_lt_succ' (n : ℕ) : sqrt n ^ 2 < n + 1 
goal: n.sqrt ^ 2 < n + 1

full_name: Nat.succ_le_succ_sqrt
code: lemma succ_le_succ_sqrt (n : ℕ) : n + 1 ≤ (sqrt n + 1) * (sqrt n + 1) 
goal: n + 1 ≤ (n.sqrt + 1) * (n.sqrt + 1)

full_name: Nat.succ_le_succ_sqrt'
code: lemma succ_le_succ_sqrt' (n : ℕ) : n + 1 ≤ (sqrt n + 1) ^ 2 
goal: n + 1 ≤ (n.sqrt + 1) ^ 2

full_name: Nat.not_exists_sq
code: /-- There are no perfect squares strictly between m² and (m+1)² -/
lemma not_exists_sq (hl : m * m < n) (hr : n < (m + 1) * (m + 1)) : ¬∃ t, t * t = n 
goal: ¬∃ t, t * t = n

full_name: Nat.not_exists_sq'
code: lemma not_exists_sq' : m ^ 2 < n → n < (m + 1) ^ 2 → ¬∃ t, t ^ 2 = n 
goal: m ^ 2 < n → n < (m + 1) ^ 2 → ¬∃ t, t ^ 2 = n

full_name: Nat.decidableLoHi
code: instance decidableLoHi (lo hi : ℕ) (P : ℕ → Prop) [H : DecidablePred P] :
    Decidable (∀ x, lo ≤ x → x < hi → P x) 
goal: Decidable (∀ (x : ℕ), lo ≤ x → x < hi → P x)

full_name: Nat.decidableLoHiLe
code: instance decidableLoHiLe (lo hi : ℕ) (P : ℕ → Prop) [DecidablePred P] :
    Decidable (∀ x, lo ≤ x → x ≤ hi → P x) 
goal: Decidable (∀ (x : ℕ), lo ≤ x → x ≤ hi → P x)