Theorem: not_summable_one_div_on_primes
File: Mathlib/NumberTheory/SumPrimeReciprocals.lean

tactic: intro h
state_before: ⊢ ¬Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
state_after: h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
⊢ False

tactic: obtain ⟨k, hk⟩ := h.nat_tsum_vanishing (Iio_mem_nhds one_half_pos : Iio (1 / 2 : ℝ) ∈ 𝓝 0)
state_before: h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
⊢ False
state_after: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∀ t ⊆ {n | k ≤ n}, ∑' (n : ↑t), {p | Nat.Prime p}.indicator (fun n => 1 / ↑n) ↑n ∈ Iio (1 / 2)
⊢ False

tactic: specialize hk ({p | Nat.Prime p} ∩ {p | k ≤ p}) inter_subset_right
state_before: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∀ t ⊆ {n | k ≤ n}, ∑' (n : ↑t), {p | Nat.Prime p}.indicator (fun n => 1 / ↑n) ↑n ∈ Iio (1 / 2)
⊢ False
state_after: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (n : ↑({p | Nat.Prime p} ∩ {p | k ≤ p})), {p | Nat.Prime p}.indicator (fun n => 1 / ↑n) ↑n ∈ Iio (1 / 2)
⊢ False

tactic: rw [tsum_subtype, indicator_indicator, inter_eq_left.mpr fun n hn ↦ hn.1, mem_Iio] at hk
state_before: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (n : ↑({p | Nat.Prime p} ∩ {p | k ≤ p})), {p | Nat.Prime p}.indicator (fun n => 1 / ↑n) ↑n ∈ Iio (1 / 2)
⊢ False
state_after: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
⊢ False

tactic: have h' : Summable (indicator ({p | Nat.Prime p} ∩ {p | k ≤ p}) fun n ↦ (1 : ℝ) / n) := by
  convert h.indicator {n : ℕ | k ≤ n} using 1
  simp only [indicator_indicator, inter_comm]
state_before: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
⊢ False
state_after: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
⊢ False

tactic: refine ((one_half_le_sum_primes_ge_one_div k).trans_lt <| LE.le.trans_lt ?_ hk).false
state_before: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
⊢ False
state_after: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
⊢ ∑ p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow, 1 / ↑p ≤
    ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x

tactic: convert sum_le_tsum (primesBelow ((4 ^ (k.primesBelow.card + 1)).succ) \ primesBelow k)
  (fun n _ ↦ indicator_nonneg (fun p _ ↦ by positivity) _) h' using 2 with p hp
state_before: case intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
⊢ ∑ p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow, 1 / ↑p ≤
    ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x
state_after: case h.e'_3.a
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
⊢ 1 / ↑p = ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) p

tactic: obtain ⟨hp₁, hp₂⟩ := mem_setOf_eq ▸ Finset.mem_sdiff.mp hp
state_before: case h.e'_3.a
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
⊢ 1 / ↑p = ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) p
state_after: case h.e'_3.a.intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
hp₁ : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow.val
hp₂ : p ∉ k.primesBelow
⊢ 1 / ↑p = ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) p

tactic: have hpp := prime_of_mem_primesBelow hp₁
state_before: case h.e'_3.a.intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
hp₁ : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow.val
hp₂ : p ∉ k.primesBelow
⊢ 1 / ↑p = ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) p
state_after: case h.e'_3.a.intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
hp₁ : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow.val
hp₂ : p ∉ k.primesBelow
hpp : Nat.Prime p
⊢ 1 / ↑p = ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) p

tactic: refine (indicator_of_mem (mem_def.mpr ⟨hpp, ?_⟩) fun n : ℕ ↦ (1 / n : ℝ)).symm
state_before: case h.e'_3.a.intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
hp₁ : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow.val
hp₂ : p ∉ k.primesBelow
hpp : Nat.Prime p
⊢ 1 / ↑p = ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) p
state_after: case h.e'_3.a.intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
hp₁ : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow.val
hp₂ : p ∉ k.primesBelow
hpp : Nat.Prime p
⊢ p ∈ {p | k ≤ p}

tactic: exact not_lt.mp <| (not_and_or.mp <| (not_congr mem_primesBelow).mp hp₂).neg_resolve_right hpp
state_before: case h.e'_3.a.intro
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
p : ℕ
hp : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
hp₁ : p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow.val
hp₂ : p ∉ k.primesBelow
hpp : Nat.Prime p
⊢ p ∈ {p | k ≤ p}
state_after: no goals

tactic: convert h.indicator {n : ℕ | k ≤ n} using 1
state_before: h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
⊢ Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
state_after: case h.e'_5
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
⊢ (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n) =
    {n | k ≤ n}.indicator ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)

tactic: simp only [indicator_indicator, inter_comm]
state_before: case h.e'_5
h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
⊢ (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n) =
    {n | k ≤ n}.indicator ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
state_after: no goals

tactic: positivity
state_before: h : Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)
k : ℕ
hk : ∑' (x : ℕ), ({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator (fun n => 1 / ↑n) x < 1 / 2
h' : Summable (({p | Nat.Prime p} ∩ {p | k ≤ p}).indicator fun n => 1 / ↑n)
n : ℕ
x✝¹ : n ∉ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow
p : ℕ
x✝ : p ∈ {p | Nat.Prime p} ∩ {p | k ≤ p}
⊢ 0 ≤ 1 / ↑p
state_after: no goals