l3lab/ntp-mathlib huggingface dataset:
/-- Note that `AddCommGroup.int_smulCommClass` requires stronger assumptions on `R`. -/
instance NonUnitalNonAssocRing.int_smulCommClass [NonUnitalNonAssocRing R] :
    SMulCommClass ℤ R R :=
  ⟨fun n x y =>
    match n with
    | (n : ℕ) => by simp_rw [coe_nat_zsmul, smul_comm]
    | -[n+1] => by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : NonUnitalNonAssocRing R
n✝ : ℤ
x y : R
n : ℕ
⊢ -[n+1] • x • y = x • -[n+1] • y

Next tactic:
simp_rw [negSucc_zsmul, smul_eq_mul, mul_neg, mul_smul_comm]
/-- Note that `AddCommGroup.int_isScalarTower` requires stronger assumptions on `R`. -/
instance NonUnitalNonAssocRing.int_isScalarTower [NonUnitalNonAssocRing R] :
    IsScalarTower ℤ R R :=
  ⟨fun n x y =>
    match n with
    | (n : ℕ) => by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : NonUnitalNonAssocRing R
n✝ : ℤ
x y : R
n : ℕ
⊢ (↑n • x) • y = ↑n • x • y

Next tactic:
simp_rw [coe_nat_zsmul, smul_assoc]
/-- Note that `AddCommGroup.int_isScalarTower` requires stronger assumptions on `R`. -/
instance NonUnitalNonAssocRing.int_isScalarTower [NonUnitalNonAssocRing R] :
    IsScalarTower ℤ R R :=
  ⟨fun n x y =>
    match n with
    | (n : ℕ) => by simp_rw [coe_nat_zsmul, smul_assoc]
    | -[n+1] => by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : NonUnitalNonAssocRing R
n✝ : ℤ
x y : R
n : ℕ
⊢ (-[n+1] • x) • y = -[n+1] • x • y

Next tactic:
simp_rw [negSucc_zsmul, smul_eq_mul, neg_mul, smul_mul_assoc]
theorem zsmul_int_int (a b : ℤ) : a • b = a * b := by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
a b : ℤ
⊢ a • b = a * b

Next tactic:
simp
theorem zsmul_int_one (n : ℤ) : n • (1 : ℤ) = n := by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
n : ℤ
⊢ n • 1 = n

Next tactic:
simp
@[simp, norm_cast]
theorem Int.cast_pow [Ring R] (n : ℤ) (m : ℕ) : (↑(n ^ m) : R) = (↑n : R) ^ m := by
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : Ring R
n : ℤ
m : ℕ
⊢ ↑(n ^ m) = ↑n ^ m

Next tactic:
induction' m with m ih
@[simp, norm_cast]
theorem Int.cast_pow [Ring R] (n : ℤ) (m : ℕ) : (↑(n ^ m) : R) = (↑n : R) ^ m := by
  induction' m with m ih
  · 

Proof state:
case zero
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : Ring R
n : ℤ
⊢ ↑(n ^ Nat.zero) = ↑n ^ Nat.zero

Next tactic:
rw [pow_zero, pow_zero, Int.cast_one]
@[simp, norm_cast]
theorem Int.cast_pow [Ring R] (n : ℤ) (m : ℕ) : (↑(n ^ m) : R) = (↑n : R) ^ m := by
  induction' m with m ih
  · rw [pow_zero, pow_zero, Int.cast_one]
  · 

Proof state:
case succ
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : Ring R
n : ℤ
m : ℕ
ih : ↑(n ^ m) = ↑n ^ m
⊢ ↑(n ^ Nat.succ m) = ↑n ^ Nat.succ m

Next tactic:
rw [pow_succ, pow_succ, Int.cast_mul, ih]
theorem neg_one_pow_eq_pow_mod_two [Ring R] {n : ℕ} : (-1 : R) ^ n = (-1) ^ (n % 2) := by
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : Ring R
n : ℕ
⊢ (-1) ^ n = (-1) ^ (n % 2)

Next tactic:
rw [← Nat.mod_add_div n 2, pow_add, pow_mul]
theorem neg_one_pow_eq_pow_mod_two [Ring R] {n : ℕ} : (-1 : R) ^ n = (-1) ^ (n % 2) := by
  rw [← Nat.mod_add_div n 2, pow_add, pow_mul]; 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : Ring R
n : ℕ
⊢ (-1) ^ (n % 2) * ((-1) ^ 2) ^ (n / 2) = (-1) ^ ((n % 2 + 2 * (n / 2)) % 2)

Next tactic:
simp [sq]
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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

Next tactic:
simp
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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

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

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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)

Next 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]
          simp only [← add_assoc, add_comm _ (↑n * a)]
          simp only [add_assoc, (n.cast_commute (_ : R)).left_comm]
          simp only [add_comm, add_left_comm] }
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by simp
  | n + 2 =>
    have : 0 ≤ (n : R) * (a * a * (2 + a)) + a * a :=
      add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq
    calc
      1 + (↑(n + 2) : R) * a ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) :=
        le_add_of_nonneg_right this
      _ = (1 + a) * (1 + a) * (1 + n * a) := by {
          

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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)

Next 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]
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by simp
  | n + 2 =>
    have : 0 ≤ (n : R) * (a * a * (2 + a)) + a * a :=
      add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq
    calc
      1 + (↑(n + 2) : R) * a ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) :=
        le_add_of_nonneg_right this
      _ = (1 + a) * (1 + a) * (1 + n * a) := by {
          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]
          

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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)))))))

Next tactic:
simp only [← add_assoc, add_comm _ (↑n * a)]
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by simp
  | n + 2 =>
    have : 0 ≤ (n : R) * (a * a * (2 + a)) + a * a :=
      add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq
    calc
      1 + (↑(n + 2) : R) * a ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) :=
        le_add_of_nonneg_right this
      _ = (1 + a) * (1 + a) * (1 + n * a) := by {
          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]
          simp only [← add_assoc, add_comm _ (↑n * a)]
          

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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)

Next tactic:
simp only [add_assoc, (n.cast_commute (_ : R)).left_comm]
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by simp
  | n + 2 =>
    have : 0 ≤ (n : R) * (a * a * (2 + a)) + a * a :=
      add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq
    calc
      1 + (↑(n + 2) : R) * a ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) :=
        le_add_of_nonneg_right this
      _ = (1 + a) * (1 + a) * (1 + n * a) := by {
          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]
          simp only [← add_assoc, add_comm _ (↑n * a)]
          simp only [add_assoc, (n.cast_commute (_ : R)).left_comm]
          

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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)))))))

Next tactic:
simp only [add_comm, add_left_comm]
/-- Bernoulli's inequality. This version works for semirings but requires
additional hypotheses `0 ≤ a * a` and `0 ≤ (1 + a) * (1 + a)`. -/
theorem one_add_mul_le_pow' (Hsq : 0 ≤ a * a) (Hsq' : 0 ≤ (1 + a) * (1 + a)) (H : 0 ≤ 2 + a) :
    ∀ n : ℕ, 1 + (n : R) * a ≤ (1 + a) ^ n
  | 0 => by simp
  | 1 => by simp
  | n + 2 =>
    have : 0 ≤ (n : R) * (a * a * (2 + a)) + a * a :=
      add_nonneg (mul_nonneg n.cast_nonneg (mul_nonneg Hsq H)) Hsq
    calc
      1 + (↑(n + 2) : R) * a ≤ 1 + ↑(n + 2) * a + (n * (a * a * (2 + a)) + a * a) :=
        le_add_of_nonneg_right this
      _ = (1 + a) * (1 + a) * (1 + n * a) := by {
          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]
          simp only [← add_assoc, add_comm _ (↑n * a)]
          simp only [add_assoc, (n.cast_commute (_ : R)).left_comm]
          simp only [add_comm, add_left_comm] }
      _ ≤ (1 + a) * (1 + a) * (1 + a) ^ n :=
        mul_le_mul_of_nonneg_left (one_add_mul_le_pow' Hsq Hsq' H _) Hsq'
      _ = (1 + a) ^ (n + 2) := by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H✝ : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
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)

Next tactic:
simp only [pow_succ, mul_assoc]
theorem pow_le_pow_of_le_one_aux (h : 0 ≤ a) (ha : a ≤ 1) (i : ℕ) :
    ∀ k : ℕ, a ^ (i + k) ≤ a ^ i
  | 0 => by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : OrderedSemiring R
a : R
h : 0 ≤ a
ha : a ≤ 1
i : ℕ
⊢ a ^ (i + 0) ≤ a ^ i

Next tactic:
simp
theorem pow_le_pow_of_le_one_aux (h : 0 ≤ a) (ha : a ≤ 1) (i : ℕ) :
    ∀ k : ℕ, a ^ (i + k) ≤ a ^ i
  | 0 => by simp
  | k + 1 => by
    

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : OrderedSemiring R
a : R
h : 0 ≤ a
ha : a ≤ 1
i k : ℕ
⊢ a ^ (i + (k + 1)) ≤ a ^ i

Next tactic:
rw [← add_assoc, ← one_mul (a ^ i), pow_succ]
theorem pow_le_pow_of_le_one_aux (h : 0 ≤ a) (ha : a ≤ 1) (i : ℕ) :
    ∀ k : ℕ, a ^ (i + k) ≤ a ^ i
  | 0 => by simp
  | k + 1 => by
    rw [← add_assoc, ← one_mul (a ^ i), pow_succ]
    

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : OrderedSemiring R
a : R
h : 0 ≤ a
ha : a ≤ 1
i k : ℕ
⊢ a * a ^ (i + k) ≤ 1 * a ^ i

Next tactic:
exact mul_le_mul ha (pow_le_pow_of_le_one_aux h ha _ _) (pow_nonneg h _) zero_le_one
theorem pow_le_pow_of_le_one (h : 0 ≤ a) (ha : a ≤ 1) {i j : ℕ} (hij : i ≤ j) : a ^ j ≤ a ^ i := by
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : OrderedSemiring R
a : R
h : 0 ≤ a
ha : a ≤ 1
i j : ℕ
hij : i ≤ j
⊢ a ^ j ≤ a ^ i

Next tactic:
let ⟨k, hk⟩ := Nat.exists_eq_add_of_le hij
theorem pow_le_pow_of_le_one (h : 0 ≤ a) (ha : a ≤ 1) {i j : ℕ} (hij : i ≤ j) : a ^ j ≤ a ^ i := by
  let ⟨k, hk⟩ := Nat.exists_eq_add_of_le hij
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : OrderedSemiring R
a : R
h : 0 ≤ a
ha : a ≤ 1
i j : ℕ
hij : i ≤ j
k : ℕ
hk : j = i + k
⊢ a ^ j ≤ a ^ i

Next tactic:
rw [hk]
theorem pow_le_pow_of_le_one (h : 0 ≤ a) (ha : a ≤ 1) {i j : ℕ} (hij : i ≤ j) : a ^ j ≤ a ^ i := by
  let ⟨k, hk⟩ := Nat.exists_eq_add_of_le hij
  rw [hk]; 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : OrderedSemiring R
a : R
h : 0 ≤ a
ha : a ≤ 1
i j : ℕ
hij : i ≤ j
k : ℕ
hk : j = i + k
⊢ a ^ (i + k) ≤ a ^ i

Next tactic:
exact pow_le_pow_of_le_one_aux h ha _ _
theorem sign_cases_of_C_mul_pow_nonneg {C r : R} (h : ∀ n : ℕ, 0 ≤ C * r ^ n) :
    C = 0 ∨ 0 < C ∧ 0 ≤ r := by
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedSemiring R
C r : R
h : ∀ (n : ℕ), 0 ≤ C * r ^ n
⊢ C = 0 ∨ 0 < C ∧ 0 ≤ r

Next tactic:
have : 0 ≤ C := by simpa only [pow_zero, mul_one] using h 0
theorem sign_cases_of_C_mul_pow_nonneg {C r : R} (h : ∀ n : ℕ, 0 ≤ C * r ^ n) :
    C = 0 ∨ 0 < C ∧ 0 ≤ r := by
  have : 0 ≤ C := by 

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedSemiring R
C r : R
h : ∀ (n : ℕ), 0 ≤ C * r ^ n
⊢ 0 ≤ C

Next tactic:
simpa only [pow_zero, mul_one] using h 0
theorem sign_cases_of_C_mul_pow_nonneg {C r : R} (h : ∀ n : ℕ, 0 ≤ C * r ^ n) :
    C = 0 ∨ 0 < C ∧ 0 ≤ r := by
  have : 0 ≤ C := by simpa only [pow_zero, mul_one] using h 0
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedSemiring R
C r : R
h : ∀ (n : ℕ), 0 ≤ C * r ^ n
this : 0 ≤ C
⊢ C = 0 ∨ 0 < C ∧ 0 ≤ r

Next tactic:
refine' this.eq_or_lt.elim (fun h => Or.inl h.symm) fun hC => Or.inr ⟨hC, _⟩
theorem sign_cases_of_C_mul_pow_nonneg {C r : R} (h : ∀ n : ℕ, 0 ≤ C * r ^ n) :
    C = 0 ∨ 0 < C ∧ 0 ≤ r := by
  have : 0 ≤ C := by simpa only [pow_zero, mul_one] using h 0
  refine' this.eq_or_lt.elim (fun h => Or.inl h.symm) fun hC => Or.inr ⟨hC, _⟩
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedSemiring R
C r : R
h : ∀ (n : ℕ), 0 ≤ C * r ^ n
this : 0 ≤ C
hC : 0 < C
⊢ 0 ≤ r

Next tactic:
refine' nonneg_of_mul_nonneg_right _ hC
theorem sign_cases_of_C_mul_pow_nonneg {C r : R} (h : ∀ n : ℕ, 0 ≤ C * r ^ n) :
    C = 0 ∨ 0 < C ∧ 0 ≤ r := by
  have : 0 ≤ C := by simpa only [pow_zero, mul_one] using h 0
  refine' this.eq_or_lt.elim (fun h => Or.inl h.symm) fun hC => Or.inr ⟨hC, _⟩
  refine' nonneg_of_mul_nonneg_right _ hC
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedSemiring R
C r : R
h : ∀ (n : ℕ), 0 ≤ C * r ^ n
this : 0 ≤ C
hC : 0 < C
⊢ 0 ≤ C * r

Next tactic:
simpa only [pow_one] using h 1
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
⊢ a ^ bit1 n ≤ 0 ↔ a ≤ 0

Next tactic:
simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
⊢ a < 0 ∨ a ^ bit1 n = 0 ↔ a < 0 ∨ a = 0

Next tactic:
refine' ⟨_, _⟩
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
⊢ a < 0 ∨ a ^ bit1 n = 0 → a < 0 ∨ a = 0

Next tactic:
rintro (hpos | hz)
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · 

Proof state:
case refine'_1.inl
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hpos : a < 0
⊢ a < 0 ∨ a = 0

Next tactic:
left
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      

Proof state:
case refine'_1.inl.h
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hpos : a < 0
⊢ a < 0

Next tactic:
exact hpos
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · 

Proof state:
case refine'_1.inr
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hz : a ^ bit1 n = 0
⊢ a < 0 ∨ a = 0

Next tactic:
right
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · right
      

Proof state:
case refine'_1.inr.h
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hz : a ^ bit1 n = 0
⊢ a = 0

Next tactic:
exact (pow_eq_zero_iff'.1 hz).1
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · right
      exact (pow_eq_zero_iff'.1 hz).1
  · 

Proof state:
case refine'_2
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
⊢ a < 0 ∨ a = 0 → a < 0 ∨ a ^ bit1 n = 0

Next tactic:
rintro (hneg | hz)
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · right
      exact (pow_eq_zero_iff'.1 hz).1
  · rintro (hneg | hz)
    · 

Proof state:
case refine'_2.inl
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hneg : a < 0
⊢ a < 0 ∨ a ^ bit1 n = 0

Next tactic:
left
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · right
      exact (pow_eq_zero_iff'.1 hz).1
  · rintro (hneg | hz)
    · left
      

Proof state:
case refine'_2.inl.h
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hneg : a < 0
⊢ a < 0

Next tactic:
exact hneg
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · right
      exact (pow_eq_zero_iff'.1 hz).1
  · rintro (hneg | hz)
    · left
      exact hneg
    · 

Proof state:
case refine'_2.inr
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hz : a = 0
⊢ a < 0 ∨ a ^ bit1 n = 0

Next tactic:
right
@[simp]
theorem pow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 := by
  simp only [le_iff_lt_or_eq, pow_bit1_neg_iff]
  refine' ⟨_, _⟩
  · rintro (hpos | hz)
    · left
      exact hpos
    · right
      exact (pow_eq_zero_iff'.1 hz).1
  · rintro (hneg | hz)
    · left
      exact hneg
    · right
      

Proof state:
case refine'_2.inr.h
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n : ℕ
hz : a = 0
⊢ a ^ bit1 n = 0

Next tactic:
simp [hz, bit1]
theorem strictMono_pow_bit1 (n : ℕ) : StrictMono fun a : R => a ^ bit1 n := by
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a : R
n✝ n : ℕ
⊢ StrictMono fun a => a ^ bit1 n

Next tactic:
intro a b hab
theorem strictMono_pow_bit1 (n : ℕ) : StrictMono fun a : R => a ^ bit1 n := by
  intro a b hab
  

Proof state:
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a✝ : R
n✝ n : ℕ
a b : R
hab : a < b
⊢ (fun a => a ^ bit1 n) a < (fun a => a ^ bit1 n) b

Next tactic:
rcases le_total a 0 with ha | ha
theorem strictMono_pow_bit1 (n : ℕ) : StrictMono fun a : R => a ^ bit1 n := by
  intro a b hab
  rcases le_total a 0 with ha | ha
  · 

Proof state:
case inl
α : Type u_1
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝ : LinearOrderedRing R
a✝ : R
n✝ n : ℕ
a b : R
hab : a < b
ha : a ≤ 0
⊢ (fun a => a ^ bit1 n) a < (fun a => a ^ bit1 n) b

Next tactic:
rcases le_or_lt b 0 with hb | hb