Theorem: geom_sum_alternating_of_lt_neg_one
File: Mathlib/Algebra/GeomSum.lean

tactic: have hx0 : x < 0 := ((le_add_iff_nonneg_right _).2 zero_le_one).trans_lt hx
state_before: α : Type u
β : Type ?u.236749
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
⊢ if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i

tactic: refine' Nat.le_induction _ _ n (show 2 ≤ n from hn)
state_before: α : Type u
β : Type ?u.236749
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i

tactic: clear hn
state_before: case refine'_2
α : Type u
β : Type ?u.236749
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ ∀ (n : ℕ),
    2 ≤ n →
      (if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i) →
        if Even (n + 1) then ∑ i in range (n + 1), x ^ i < 0 else 1 < ∑ i in range (n + 1), x ^ i

tactic: intro n _ ihn
state_before: case refine'_2
α : Type u
β : Type ?u.236749
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
⊢ ∀ (n : ℕ),
    2 ≤ n →
      (if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i) →
        if Even (n + 1) then ∑ i in range (n + 1), x ^ i < 0 else 1 < ∑ i in range (n + 1), x ^ i

tactic: simp only [Nat.even_add_one, geom_sum_succ]
state_before: case refine'_2
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i
⊢ if Even (n + 1) then ∑ i in range (n + 1), x ^ i < 0 else 1 < ∑ i in range (n + 1), x ^ i

tactic: by_cases hn' : Even n
state_before: case refine'_2
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i
⊢ if ¬Even n then x * ∑ i in range n, x ^ i + 1 < 0 else 1 < x * ∑ i in range n, x ^ i + 1

tactic: simp only [geom_sum_two, lt_add_iff_pos_left, ite_true, gt_iff_lt, hx]
state_before: case refine'_1
α : Type u
β : Type ?u.236749
n : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hn : 1 < n
hx0 : x < 0
⊢ if Even 2 then ∑ i in range 2, x ^ i < 0 else 1 < ∑ i in range 2, x ^ i

tactic: rw [if_pos hn'] at ihn
state_before: case pos
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i
hn' : Even n
⊢ if ¬Even n then x * ∑ i in range n, x ^ i + 1 < 0 else 1 < x * ∑ i in range n, x ^ i + 1

tactic: rw [if_neg, lt_add_iff_pos_left]
state_before: case pos
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : ∑ i in range n, x ^ i < 0
hn' : Even n
⊢ if ¬Even n then x * ∑ i in range n, x ^ i + 1 < 0 else 1 < x * ∑ i in range n, x ^ i + 1

tactic: exact mul_pos_of_neg_of_neg hx0 ihn
state_before: case pos
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : ∑ i in range n, x ^ i < 0
hn' : Even n
⊢ 0 < x * ∑ i in range n, x ^ i

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

tactic: exact not_not_intro hn'
state_before: case pos.hnc
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : ∑ i in range n, x ^ i < 0
hn' : Even n
⊢ ¬¬Even n

tactic: rw [if_neg hn'] at ihn
state_before: case neg
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : if Even n then ∑ i in range n, x ^ i < 0 else 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
⊢ if ¬Even n then x * ∑ i in range n, x ^ i + 1 < 0 else 1 < x * ∑ i in range n, x ^ i + 1

tactic: rw [if_pos]
state_before: case neg
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
⊢ if ¬Even n then x * ∑ i in range n, x ^ i + 1 < 0 else 1 < x * ∑ i in range n, x ^ i + 1

tactic: swap
state_before: case neg
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
⊢ x * ∑ i in range n, x ^ i + 1 < 0

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

tactic: have := add_lt_add_right (mul_lt_mul_of_neg_left ihn hx0) 1
state_before: case neg
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
⊢ x * ∑ i in range n, x ^ i + 1 < 0

tactic: rw [mul_one] at this
state_before: case neg
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
this : x * ∑ i in range n, x ^ i + 1 < x * 1 + 1
⊢ x * ∑ i in range n, x ^ i + 1 < 0

tactic: exact this.trans hx
state_before: case neg
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
this : x * ∑ i in range n, x ^ i + 1 < x + 1
⊢ x * ∑ i in range n, x ^ i + 1 < 0

tactic: exact hn'
state_before: case neg.hc
α : Type u
β : Type ?u.236749
n✝ : ℕ
x : α
inst✝ : StrictOrderedRing α
hx : x + 1 < 0
hx0 : x < 0
n : ℕ
hn✝ : 2 ≤ n
ihn : 1 < ∑ i in range n, x ^ i
hn' : ¬Even n
⊢ ¬Even n