Theorem: padicValRat.sum_pos_of_pos
File: Mathlib/NumberTheory/Padics/PadicVal.lean

tactic: induction' n with d hd
state_before: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0 : ∑ i in Finset.range n, F i ≠ 0
⊢ 0 < padicValRat p (∑ i in Finset.range n, F i)

tactic: exact False.elim (hn0 rfl)
state_before: case zero
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
hF : ∀ (i : ℕ), i < zero → 0 < padicValRat p (F i)
hn0 : ∑ i in Finset.range zero, F i ≠ 0
⊢ 0 < padicValRat p (∑ i in Finset.range zero, F i)

tactic: rw [Finset.sum_range_succ] at hn0⊢
state_before: case succ
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ i in Finset.range (succ d), F i ≠ 0
⊢ 0 < padicValRat p (∑ i in Finset.range (succ d), F i)

tactic: by_cases h : (∑ x : ℕ in Finset.range d, F x) = 0
state_before: case succ
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ x in Finset.range d, F x + F d ≠ 0
⊢ 0 < padicValRat p (∑ x in Finset.range d, F x + F d)

tactic: rw [h, zero_add]
state_before: case pos
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ x in Finset.range d, F x + F d ≠ 0
h : ∑ x in Finset.range d, F x = 0
⊢ 0 < padicValRat p (∑ x in Finset.range d, F x + F d)

tactic: exact hF d (lt_add_one _)
state_before: case pos
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ x in Finset.range d, F x + F d ≠ 0
h : ∑ x in Finset.range d, F x = 0
⊢ 0 < padicValRat p (F d)

tactic: refine' lt_of_lt_of_le _ (min_le_padicValRat_add hn0)
state_before: case neg
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ x in Finset.range d, F x + F d ≠ 0
h : ¬∑ x in Finset.range d, F x = 0
⊢ 0 < padicValRat p (∑ x in Finset.range d, F x + F d)

tactic: refine' lt_min (hd (fun i hi => _) h) (hF d (lt_add_one _))
state_before: case neg
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ x in Finset.range d, F x + F d ≠ 0
h : ¬∑ x in Finset.range d, F x = 0
⊢ 0 < min (padicValRat p (∑ x in Finset.range d, F x)) (padicValRat p (F d))

tactic: exact hF _ (lt_trans hi (lt_add_one _))
state_before: case neg
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
F : ℕ → ℚ
hF✝ : ∀ (i : ℕ), i < n → 0 < padicValRat p (F i)
hn0✝ : ∑ i in Finset.range n, F i ≠ 0
d : ℕ
hd :
  (∀ (i : ℕ), i < d → 0 < padicValRat p (F i)) →
    ∑ i in Finset.range d, F i ≠ 0 → 0 < padicValRat p (∑ i in Finset.range d, F i)
hF : ∀ (i : ℕ), i < succ d → 0 < padicValRat p (F i)
hn0 : ∑ x in Finset.range d, F x + F d ≠ 0
h : ¬∑ x in Finset.range d, F x = 0
i : ℕ
hi : i < d
⊢ 0 < padicValRat p (F i)