-- Mathlib/Algebra/Order/Ring/Pow.lean
/-- **Bernoulli's inequality**. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
lemma one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + n * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by simp
  | n + 2 =>
    have : 0 ≤ n * (a * a * (2 + a)) + a * a :=
      add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq
    calc
      _ ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) := le_add_of_nonneg_right this
      _ = (1 + a) * (1 + a) * (1 + n * a)

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ 1 + (↑n * a + (a + (a + (↑n * (a * a) + (↑n * (a * a) + (↑n * (a * a * a) + a * a)))))) =
    1 + (a + (a + (a * a + (↑n * a + (a * (↑n * a) + (a * (↑n * a) + a * a * (↑n * a)))))))

Tactic:
simp only [← add_assoc, add_comm _ (↑n * a)]

Result:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ ↑n * a + 1 + a + a + ↑n * (a * a) + ↑n * (a * a) + ↑n * (a * a * a) + a * a =
    ↑n * a + 1 + a + a + a * a + a * (↑n * a) + a * (↑n * a) + a * a * (↑n * a)

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
⊢ 1 + ↑1 * a ≤ (1 + a) ^ 1

Tactic:
simp

Result:
no goals

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ (1 + a) * (1 + a) * (1 + a) ^ n = (1 + a) ^ (n + 2)

Tactic:
simp only [pow_succ', mul_assoc]

Result:
no goals

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ ↑n * a + 1 + a + a + ↑n * (a * a) + ↑n * (a * a) + ↑n * (a * a * a) + a * a =
    ↑n * a + 1 + a + a + a * a + a * (↑n * a) + a * (↑n * a) + a * a * (↑n * a)

Tactic:
simp only [add_assoc, (n.cast_commute (_ : R)).left_comm]

Result:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ ↑n * a + (1 + (a + (a + (a * (↑n * a) + (a * (↑n * a) + (a * a * (↑n * a) + a * a)))))) =
    ↑n * a + (1 + (a + (a + (a * a + (a * (↑n * a) + (a * (↑n * a) + a * a * (↑n * a)))))))

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ ↑n * a + (1 + (a + (a + (a * (↑n * a) + (a * (↑n * a) + (a * a * (↑n * a) + a * a)))))) =
    ↑n * a + (1 + (a + (a + (a * a + (a * (↑n * a) + (a * (↑n * a) + a * a * (↑n * a)))))))

Tactic:
simp only [add_comm, add_left_comm]

Result:
no goals

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
⊢ 1 + ↑0 * a ≤ (1 + a) ^ 0

Tactic:
simp

Result:
no goals

Proof state:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ 1 + ↑(n + 2) * a + (↑n * (a * a * (2 + a)) + a * a) = (1 + a) * (1 + a) * (1 + ↑n * a)

Tactic:
simp only [Nat.cast_add, add_mul, mul_add, one_mul, mul_one, ← one_add_one_eq_two,
  Nat.cast_one, add_assoc, add_right_inj]

Result:
R : Type u_1
inst✝ : OrderedSemiring R
a : R
Hsq : 0 ≤ a * a
Hsq' : 0 ≤ (1 + a) * (1 + a)
H : 0 ≤ 2 + a
n : ℕ
this : 0 ≤ ↑n * (a * a * (2 + a)) + a * a
⊢ 1 + (↑n * a + (a + (a + (↑n * (a * a) + (↑n * (a * a) + (↑n * (a * a * a) + a * a)))))) =
    1 + (a + (a + (a * a + (↑n * a + (a * (↑n * a) + (a * (↑n * a) + a * a * (↑n * a)))))))