-- Mathlib/Algebra/GeomSum.lean
theorem geom_sum_alternating_of_lt_neg_one [StrictOrderedRing α] (hx : x + 1 < 0) (hn : 1 < n) :
    if Even n then (∑ i ∈ range n, x ^ i) < 0 else 1 < ∑ i ∈ range n, x ^ i

Proof state:
case refine_2
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ ∀ (n : ℕ),
    2 ≤ n →
      (if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i) →
        if Even (n + 1) then ∑ i ∈ range (n + 1), x ^ i < 0 else 1 < ∑ i ∈ range (n + 1), x ^ i

Tactic:
clear hn

Result:
case refine_2
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
⊢ ∀ (n : ℕ),
    2 ≤ n →
      (if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i) →
        if Even (n + 1) then ∑ i ∈ range (n + 1), x ^ i < 0 else 1 < ∑ i ∈ range (n + 1), x ^ i

Proof state:
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
⊢ if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i

Tactic:
have hx0 : x < 0 := (le_add_of_nonneg_right zero_le_one).trans_lt hx

Result:
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i

Proof state:
case neg
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Tactic:
rw [if_pos]

Result:
case neg
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ x * ∑ i ∈ range n, x ^ i + 1 < 0

case neg.hc
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ ¬Even n

Proof state:
case refine_1
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ if Even 2 then ∑ i ∈ range 2, x ^ i < 0 else 1 < ∑ i ∈ range 2, x ^ i

Tactic:
simp only [geom_sum_two, lt_add_iff_pos_left, ite_true, gt_iff_lt, hx, even_two]

Result:
no goals

Proof state:
case refine_2
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
⊢ if Even (n + 1) then ∑ i ∈ range (n + 1), x ^ i < 0 else 1 < ∑ i ∈ range (n + 1), x ^ i

Tactic:
simp only [Nat.even_add_one, geom_sum_succ]

Result:
case refine_2
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Proof state:
case refine_2
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Tactic:
by_cases hn' : Even n

Result:
case pos
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
hn' : Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

case neg
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Proof state:
case pos
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
hn' : Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Tactic:
rw [if_pos hn'] at ihn

Result:
case pos
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : ∑ i ∈ range n, x ^ i < 0
hn' : Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Proof state:
case pos
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : ∑ i ∈ range n, x ^ i < 0
hn' : Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Tactic:
rw [if_neg, lt_add_iff_pos_left]

Result:
case pos
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : ∑ i ∈ range n, x ^ i < 0
hn' : Even n
⊢ 0 < x * ∑ i ∈ range n, x ^ i

case pos.hnc
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : ∑ i ∈ range n, x ^ i < 0
hn' : Even n
⊢ ¬¬Even n

Proof state:
case neg.hc
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ ¬Even n

Tactic:
exact hn'

Result:
no goals

Proof state:
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i

Tactic:
refine Nat.le_induction ?_ ?_ n (show 2 ≤ n from hn)

Result:
case refine_1
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ if Even 2 then ∑ i ∈ range 2, x ^ i < 0 else 1 < ∑ i ∈ range 2, x ^ i

case refine_2
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ ∀ (n : ℕ),
    2 ≤ n →
      (if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i) →
        if Even (n + 1) then ∑ i ∈ range (n + 1), x ^ i < 0 else 1 < ∑ i ∈ range (n + 1), x ^ i

Proof state:
case refine_2
α : Type u
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
⊢ ∀ (n : ℕ),
    2 ≤ n →
      (if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i) →
        if Even (n + 1) then ∑ i ∈ range (n + 1), x ^ i < 0 else 1 < ∑ i ∈ range (n + 1), x ^ i

Tactic:
intro n _ ihn

Result:
case refine_2
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
⊢ if Even (n + 1) then ∑ i ∈ range (n + 1), x ^ i < 0 else 1 < ∑ i ∈ range (n + 1), x ^ i

Proof state:
case neg
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
this : x * ∑ i ∈ range n, x ^ i + 1 < x + 1
⊢ x * ∑ i ∈ range n, x ^ i + 1 < 0

Tactic:
exact this.trans hx

Result:
no goals

Proof state:
case neg
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : if Even n then ∑ i ∈ range n, x ^ i < 0 else 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Tactic:
rw [if_neg hn'] at ihn

Result:
case neg
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : 1 < ∑ i ∈ range n, x ^ i
hn' : ¬Even n
⊢ if ¬Even n then x * ∑ i ∈ range n, x ^ i + 1 < 0 else 1 < x * ∑ i ∈ range n, x ^ i + 1

Proof state:
case pos
α : Type u
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hmn✝ : 2 ≤ n
ihn : ∑ i ∈ range n, x ^ i < 0
hn' : Even n
⊢ 0 < x * ∑ i ∈ range n, x ^ i

Tactic:
exact mul_pos_of_neg_of_neg hx0 ihn

Result:
no goals