Theorem: padicNorm.sum_lt
File: Mathlib/NumberTheory/Padics/PadicNorm.lean

tactic: refine s.induction_on (by rintro ⟨-, ⟨⟩⟩) ?_
state_before: p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ s, F i) < t
state_after: p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ ∀ ⦃a : α⦄ {s : Finset α},
    a ∉ s →
      (s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ s, F i) < t) →
        (insert a s).Nonempty → (∀ i ∈ insert a s, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ insert a s, F i) < t

tactic: rintro a S haS IH - ht
state_before: p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ ∀ ⦃a : α⦄ {s : Finset α},
    a ∉ s →
      (s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ s, F i) < t) →
        (insert a s).Nonempty → (∀ i ∈ insert a s, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ insert a s, F i) < t
state_after: p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
⊢ padicNorm p (∑ i ∈ insert a S, F i) < t

tactic: by_cases hs : S.Nonempty
state_before: p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
⊢ padicNorm p (∑ i ∈ insert a S, F i) < t
state_after: case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : S.Nonempty
⊢ padicNorm p (∑ i ∈ insert a S, F i) < t

case neg
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : ¬S.Nonempty
⊢ padicNorm p (∑ i ∈ insert a S, F i) < t

tactic: rintro ⟨-, ⟨⟩⟩
state_before: p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ ∅.Nonempty → (∀ i ∈ ∅, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ ∅, F i) < t
state_after: no goals

tactic: rw [Finset.sum_insert haS]
state_before: case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : S.Nonempty
⊢ padicNorm p (∑ i ∈ insert a S, F i) < t
state_after: case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : S.Nonempty
⊢ padicNorm p (F a + ∑ x ∈ S, F x) < t

tactic: exact
  lt_of_le_of_lt padicNorm.nonarchimedean
    (max_lt (ht a (Finset.mem_insert_self a S))
      (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
state_before: case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : S.Nonempty
⊢ padicNorm p (F a + ∑ x ∈ S, F x) < t
state_after: no goals

tactic: simp_all
state_before: case neg
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : S.Nonempty → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i ∈ S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : ¬S.Nonempty
⊢ padicNorm p (∑ i ∈ insert a S, F i) < t
state_after: no goals