Theorem: Odd.geom_sum_pos
File: Mathlib/Algebra/GeomSum.lean

tactic: rcases n with (_ | _ | k)
state_before: α : Type u
β : Type u_1
n : ℕ
x : α
inst✝ : LinearOrderedRing α
h : Odd n
⊢ 0 < ∑ i ∈ range n, x ^ i
state_after: case zero
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
h : Odd 0
⊢ 0 < ∑ i ∈ range 0, x ^ i

case succ.zero
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
h : Odd (0 + 1)
⊢ 0 < ∑ i ∈ range (0 + 1), x ^ i

case succ.succ
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : Odd (k + 1 + 1)
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

tactic: rw [Nat.odd_iff_not_even] at h
state_before: case succ.succ
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : Odd (k + 1 + 1)
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: case succ.succ
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

tactic: rcases lt_trichotomy (x + 1) 0 with (hx | hx | hx)
state_before: case succ.succ
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: case succ.succ.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 < 0
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

case succ.succ.inr.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 = 0
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

case succ.succ.inr.inr
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : 0 < x + 1
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

tactic: exact ((show ¬Odd 0 by decide) h).elim
state_before: case zero
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
h : Odd 0
⊢ 0 < ∑ i ∈ range 0, x ^ i
state_after: no goals

tactic: decide
state_before: α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
h : Odd 0
⊢ ¬Odd 0
state_after: no goals

tactic: simp only [zero_add, range_one, sum_singleton, pow_zero, zero_lt_one]
state_before: case succ.zero
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
h : Odd (0 + 1)
⊢ 0 < ∑ i ∈ range (0 + 1), x ^ i
state_after: no goals

tactic: have := geom_sum_alternating_of_lt_neg_one hx k.one_lt_succ_succ
state_before: case succ.succ.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 < 0
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: case succ.succ.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 < 0
this : if Even k.succ.succ then ∑ i ∈ range k.succ.succ, x ^ i < 0 else 1 < ∑ i ∈ range k.succ.succ, x ^ i
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

tactic: simp only [h, if_false] at this
state_before: case succ.succ.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 < 0
this : if Even k.succ.succ then ∑ i ∈ range k.succ.succ, x ^ i < 0 else 1 < ∑ i ∈ range k.succ.succ, x ^ i
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: case succ.succ.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 < 0
this : 1 < ∑ i ∈ range k.succ.succ, x ^ i
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i

tactic: exact zero_lt_one.trans this
state_before: case succ.succ.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 < 0
this : 1 < ∑ i ∈ range k.succ.succ, x ^ i
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: no goals

tactic: simp only [eq_neg_of_add_eq_zero_left hx, h, neg_one_geom_sum, if_false, zero_lt_one]
state_before: case succ.succ.inr.inl
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : x + 1 = 0
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: no goals

tactic: exact geom_sum_pos' hx k.succ.succ_ne_zero
state_before: case succ.succ.inr.inr
α : Type u
β : Type u_1
x : α
inst✝ : LinearOrderedRing α
k : ℕ
h : ¬Even (k + 1 + 1)
hx : 0 < x + 1
⊢ 0 < ∑ i ∈ range (k + 1 + 1), x ^ i
state_after: no goals