Open Proof Network

Problems / erdos-257 / variant-90827f46

union of finitely many lacunary sequences

variant-90827f46

proved

Restated as hole h_lacunary_union of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).

$\displaystyle \forall\, r \ge 1,\ \forall\, c_0, \dots, c_{r-1} : \mathbb{N} \to \mathbb{N},\quad \Big(c_i(0) > 0,\ \ (2r+1)^{r+1}\, c_i(j) \le c_i(j+1)\ \text{for all } i, j\Big) \;\Longrightarrow\; \sum_{n \in \bigcup_i \{c_i(j) : j \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$

The sum is over the union of the $r$ sequences' values, each value counted once. Each sequence grows by a factor of at least $(2r+1)^{r+1}$ per step (9 for one sequence, 125 for two, 2401 for three); nothing is assumed about divisibility or about how the sequences sit relative to each other. Every element is at least $1$, so no term meets Lean's junk value at $n = 0$.

unverified · history

Lean
theorem Opn.erdos_257_lacunary_union :
    ∀ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r → (∀ i, 0 < c i 0) →
    (∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) →
    Irrational (∑' n : (⋃ i, Set.range (c i) : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := by
  sorry
Why does it end in sorry?

A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →

How it was proved

Proved by Proof.lean, checked by the kernel. Its attestation, 000942, records the gate’s run.

The proof step by step (outline)

Checked by the kernel — an outline of the attested proof below: attestations/000942.json, merge commit 3baa017dcbd1.

Outline of Proof.lean, extracted by the gate at 1bd7ca70c9ee from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.

  1. hR2 have (2 : ℕ) ≤ R

    Leaves Irrational (∑' (n : (↑(⋃ (i : Fin r), Set.range (c i)) : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))), with hR2 : (2 : ℕ) ≤ R.

    Lean, lines 273–276
      have hR2 : 2 ≤ R := by
        calc 2 ≤ 2 * r + 1 := by omega
          _ = (2 * r + 1) ^ 1 := (pow_one _).symm
          _ ≤ (2 * r + 1) ^ (r + 1) := Nat.pow_le_pow_right (by omega) (by omega)

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 273–276 at 3baa017dcbd1 ↗

    1. hR2.s1 calc (2 : ℕ) ≤ (2 : ℕ) * r + (1 : ℕ) routine: omega

      Closes the goal.

      Lean, line 274
          calc 2 ≤ 2 * r + 1 := by omega

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 274 at 3baa017dcbd1 ↗

    2. hR2.s2 calc (2 : ℕ) * r + (1 : ℕ) = ((2 : ℕ) * r + (1 : ℕ)) ^ (1 : ℕ)

      Closes the goal.

      Uses library pow_one.

      Lean, line 275
            _ = (2 * r + 1) ^ 1 := (pow_one _).symm

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 275 at 3baa017dcbd1 ↗

    3. hR2.s3 calc ((2 : ℕ) * r + (1 : ℕ)) ^ (1 : ℕ) ≤ ((2 : ℕ) * r + (1 : ℕ)) ^ (r + (1 : ℕ))

      Closes the goal.

      Uses library Nat.pow_le_pow_right.

      Lean, line 276
            _ ≤ (2 * r + 1) ^ (r + 1) := Nat.pow_le_pow_right (by omega) (by omega)

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 276 at 3baa017dcbd1 ↗

  2. hmemA have ∀ (a : ℕ), a ∈ A ↔ ∃ (i : Fin r), a ∈ Set.range (c i)

    Leaves Irrational (∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))), with hmemA : ∀ (a : ℕ), a ∈ A ↔ ∃ (i : Fin r), a ∈ Set.range (c i).

    Uses library Set.range Range of a function. , Set.mem_iUnion.

    Lean, lines 278–279
      have hmemA : ∀ a, a ∈ A ↔ ∃ i, a ∈ Set.range (c i) := fun a => by
        rw [hA, Set.mem_iUnion]

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 278–279 at 3baa017dcbd1 ↗

  3. hinf have A.Infinite

    Leaves Irrational (∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))), with hinf : A.Infinite.

    Uses library Set.Infinite.mono, Set.subset_iUnion, Set.range Range of a function. , Fin.mk Creates a Fin n from i : Nat and a proof that i < n. , Set.infinite_range_of_injective.

    Lean, lines 280–282
      have hinf : A.Infinite :=
        Set.Infinite.mono (Set.subset_iUnion (fun i => Set.range (c i)) ⟨0, hr⟩)
          (Set.infinite_range_of_injective (lu_mono (c ⟨0, hr⟩) R hR2 (h0 _) (hR _)).injective)

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 280–282 at 3baa017dcbd1 ↗

  4. h0A have (0 : ℕ) ∉ A

    Leaves Irrational (∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))), with h0A : (0 : ℕ) ∉ A.

    Lean, lines 283–287
      have h0A : 0 ∉ A := by
        intro h
        obtain ⟨i, j, hj⟩ := (hmemA 0).1 h
        have := lu_gt (c i) R hR2 (h0 i) (hR i) j
        omega

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 283–287 at 3baa017dcbd1 ↗

    1. h0A.s1 obtain ∃ (i : Fin r), (0 : ℕ) ∈ Set.range (c i)

      Leaves False, with i : Fin r, j : ℕ, hj : c i j = (0 : ℕ).

      Lean, line 285
          obtain ⟨i, j, hj⟩ := (hmemA 0).1 h

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 285 at 3baa017dcbd1 ↗

    2. h0A.this have j < c i j

      Leaves False, with this : j < c i j.

      Lean, line 286
          have := lu_gt (c i) R hR2 (h0 i) (hR i) j

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 286 at 3baa017dcbd1 ↗

  5. s5 obtain ∃ k ≤ r, ∀ (i : Fin r) (j : ℕ), c i j ≤ ((2 : ℕ) * r + (1 : ℕ)) ^ k * C ∨ ((2 : ℕ) * r + (1 : ℕ)) ^ (k + (1 : ℕ)) * C < c i j

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with k : ℕ, left✝ : k ≤ r, hk : ∀ (i : Fin r) (j : ℕ), c i j ≤ ((2 : ℕ) * r + (1 : ℕ)) ^ k * C ∨ ((2 : ℕ) * r + (1 : ℕ)) ^ (k + (1 : ℕ)) * C < c i j.

    Uses library le_rfl A version of le_refl where the argument is implicit .

    Lean, line 290
      obtain ⟨k, _, hk⟩ := lu_window r c R hR2 le_rfl h0 hR C

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 290 at 3baa017dcbd1 ↗

  6. hCT have C ≤ T

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hCT : C ≤ T.

    Lean, lines 292–294
      have hCT : C ≤ T := by
        have := Nat.mul_le_mul_right C (Nat.one_le_pow k (2 * r + 1) (by omega))
        simpa [hT] using this

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 292–294 at 3baa017dcbd1 ↗

    1. hCT.this have (1 : ℕ) * C ≤ ((2 : ℕ) * r + (1 : ℕ)) ^ k * C

      Leaves C ≤ T, with this : (1 : ℕ) * C ≤ ((2 : ℕ) * r + (1 : ℕ)) ^ k * C.

      Uses library Nat.mul_le_mul_right, Nat.one_le_pow.

      Lean, line 293
          have := Nat.mul_le_mul_right C (Nat.one_le_pow k (2 * r + 1) (by omega))

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 293 at 3baa017dcbd1 ↗

  7. s7 obtain ∃ b ∈ A, T < b

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with a0 : ℕ, ha0A : a0 ∈ A, ha0 : T < a0.

    Lean, line 295
      obtain ⟨a0, ha0A, ha0⟩ := hinf.exists_gt T

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 295 at 3baa017dcbd1 ↗

  8. hex have ∃ m ∈ A, T < m

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hex : ∃ m ∈ A, T < m.

    Uses library Exists.intro Existential introduction. .

    Lean, line 296
      have hex : ∃ m, m ∈ A ∧ T < m := ⟨a0, ha0A, ha0⟩

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 296 at 3baa017dcbd1 ↗

  9. s9 obtain Nat.find hex ∈ A ∧ T < Nat.find hex

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hmA : Nat.find hex ∈ A, hTm : T < Nat.find hex.

    Uses library Nat.find_spec.

    Lean, line 298
      obtain ⟨hmA, hTm⟩ := Nat.find_spec hex

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 298 at 3baa017dcbd1 ↗

  10. hbelow have ∀ a ∈ A, a < m → a ≤ T

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hbelow : ∀ a ∈ A, a < m → a ≤ T.

    Uses library Nat.find_min, And.intro And.intro : a → b → a ∧ b is the constructor for the And operation. .

    Lean, lines 299–302
      have hbelow : ∀ a ∈ A, a < m → a ≤ T := fun a ha ham => by
        by_contra h
        push_neg at h
        exact Nat.find_min hex ham ⟨ha, h⟩

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 299–302 at 3baa017dcbd1 ↗

  11. hmbig have ((2 : ℕ) * r + (1 : ℕ)) * T < m

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hmbig : ((2 : ℕ) * r + (1 : ℕ)) * T < m.

    Lean, lines 303–308
      have hmbig : (2 * r + 1) * T < m := by
        obtain ⟨i, j, hij⟩ := (hmemA m).1 hmA
        have e : (2 * r + 1) ^ (k + 1) * C = (2 * r + 1) * T := by rw [hT]; ring
        rcases hk i j with h | h
        · rw [hij] at h; omega
        · rw [hij] at h; omega

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 303–308 at 3baa017dcbd1 ↗

    1. hmbig.s1 obtain ∃ (i : Fin r), m ∈ Set.range (c i)

      Leaves ((2 : ℕ) * r + (1 : ℕ)) * T < m, with i : Fin r, j : ℕ, hij : c i j = m.

      Lean, line 304
          obtain ⟨i, j, hij⟩ := (hmemA m).1 hmA

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 304 at 3baa017dcbd1 ↗

    2. hmbig.e have ((2 : ℕ) * r + (1 : ℕ)) ^ (k + (1 : ℕ)) * C = ((2 : ℕ) * r + (1 : ℕ)) * T

      Leaves ((2 : ℕ) * r + (1 : ℕ)) * T < m, with e : ((2 : ℕ) * r + (1 : ℕ)) ^ (k + (1 : ℕ)) * C = ((2 : ℕ) * r + (1 : ℕ)) * T.

      Lean, line 305
          have e : (2 * r + 1) ^ (k + 1) * C = (2 * r + 1) * T := by rw [hT]; ring

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 305 at 3baa017dcbd1 ↗

    3. hmbig.s3 case

      Leaves ((2 : ℕ) * r + (1 : ℕ)) * T < m, with h : c i j ≤ T.

      Lean, line 307
          · rw [hij] at h; omega

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 307 at 3baa017dcbd1 ↗

    4. hmbig.s4 case

      Leaves ((2 : ℕ) * r + (1 : ℕ)) * T < m, with h : ((2 : ℕ) * r + (1 : ℕ)) ^ (k + (1 : ℕ)) * C < c i j.

      Lean, line 308
          · rw [hij] at h; omega

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 308 at 3baa017dcbd1 ↗

  12. hFmem have ∀ (a : ℕ), a ∈ F ↔ a < m ∧ a ∈ A

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hFmem : ∀ (a : ℕ), a ∈ F ↔ a < m ∧ a ∈ A.

    Uses library Finset.mem_filter, Finset.mem_range.

    Lean, lines 310–311
      have hFmem : ∀ a, a ∈ F ↔ a < m ∧ a ∈ A := fun a => by
        rw [hF, Finset.mem_filter, Finset.mem_range]

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 310–311 at 3baa017dcbd1 ↗

  13. hg have ∀ a ∈ A, a ∈ Set.range (c (g a))

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hg : ∀ a ∈ A, a ∈ Set.range (c (g a)).

    Uses library Set.range Range of a function. , dif_pos.

    Lean, lines 315–318
      have hg : ∀ a ∈ A, a ∈ Set.range (c (g a)) := fun a ha => by
        have h := (hmemA a).1 ha
        simp only [g, dif_pos h]
        exact h.choose_spec

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 315–318 at 3baa017dcbd1 ↗

    1. hg.h have ∃ (i : Fin r), a ∈ Set.range (c i)

      Leaves a ∈ Set.range (c (g a)), with h : ∃ (i : Fin r), a ∈ Set.range (c i).

      Lean, line 316
          have h := (hmemA a).1 ha

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 316 at 3baa017dcbd1 ↗

  14. hfib have ∀ (i : Fin r), ∑ a ∈ F with g a = i, a ≤ (2 : ℕ) * T

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hfib : ∀ (i : Fin r), ∑ a ∈ F with g a = i, a ≤ (2 : ℕ) * T.

    Uses library Fin Natural numbers less than some upper bound. .

    Lean, lines 319–337
      have hfib : ∀ i : Fin r, ∑ a ∈ F with g a = i, a ≤ 2 * T := fun i => by
        apply lu_geo_sum
        · intro a ha
          rw [Finset.mem_filter] at ha
          have := (hFmem a).1 ha.1
          exact hbelow a this.2 this.1
        · intro a ha b hb hab
          rw [Finset.mem_filter] at ha hb
          have haA := ((hFmem a).1 ha.1).2
          have hbA := ((hFmem b).1 hb.1).2
          obtain ⟨ja, hja⟩ := ha.2 ▸ hg a haA
          obtain ⟨jb, hjb⟩ := hb.2 ▸ hg b hbA
          have hmono := lu_mono (c i) R hR2 (h0 i) (hR i)
          have hj : ja < jb := by
            rw [← hja, ← hjb] at hab
            exact hmono.lt_iff_lt.1 hab
          have := lu_ratio (c i) R hR2 (h0 i) (hR i) _ _ hj
          have h2 : 2 * c i ja ≤ R * c i ja := Nat.mul_le_mul_right _ hR2
          omega

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 319–337 at 3baa017dcbd1 ↗

    1. hfib.s1 case

      Leaves ∀ a ∈ {a ∈ F | g a = i}, a ≤ T.

      Uses library Finset.mem_filter.

      Lean, lines 321–324
          · intro a ha
            rw [Finset.mem_filter] at ha
            have := (hFmem a).1 ha.1
            exact hbelow a this.2 this.1

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 321–324 at 3baa017dcbd1 ↗

      1. hfib.s1.this have a < m ∧ a ∈ A

        Leaves a ≤ T, with this : a < m ∧ a ∈ A.

        Lean, line 323
              have := (hFmem a).1 ha.1

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 323 at 3baa017dcbd1 ↗

    2. hfib.s2 case

      Leaves ∀ a ∈ {a ∈ F | g a = i}, ∀ b ∈ {a ∈ F | g a = i}, a < b → (2 : ℕ) * a ≤ b.

      Uses library Finset.mem_filter.

      Lean, lines 325–337
          · intro a ha b hb hab
            rw [Finset.mem_filter] at ha hb
            have haA := ((hFmem a).1 ha.1).2
            have hbA := ((hFmem b).1 hb.1).2
            obtain ⟨ja, hja⟩ := ha.2 ▸ hg a haA
            obtain ⟨jb, hjb⟩ := hb.2 ▸ hg b hbA
            have hmono := lu_mono (c i) R hR2 (h0 i) (hR i)
            have hj : ja < jb := by
              rw [← hja, ← hjb] at hab
              exact hmono.lt_iff_lt.1 hab
            have := lu_ratio (c i) R hR2 (h0 i) (hR i) _ _ hj
            have h2 : 2 * c i ja ≤ R * c i ja := Nat.mul_le_mul_right _ hR2
            omega

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 325–337 at 3baa017dcbd1 ↗

      1. hfib.s2.haA have a ∈ A

        Leaves (2 : ℕ) * a ≤ b, with haA : a ∈ A.

        Lean, line 327
              have haA := ((hFmem a).1 ha.1).2

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 327 at 3baa017dcbd1 ↗

      2. hfib.s2.hbA have b ∈ A

        Leaves (2 : ℕ) * a ≤ b, with hbA : b ∈ A.

        Lean, line 328
              have hbA := ((hFmem b).1 hb.1).2

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 328 at 3baa017dcbd1 ↗

      3. hfib.s2.s3 obtain a ∈ Set.range (c i)

        Leaves (2 : ℕ) * a ≤ b, with ja : ℕ, hja : c i ja = a.

        Lean, line 329
              obtain ⟨ja, hja⟩ := ha.2 ▸ hg a haA

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 329 at 3baa017dcbd1 ↗

      4. hfib.s2.s4 obtain b ∈ Set.range (c i)

        Leaves (2 : ℕ) * a ≤ b, with jb : ℕ, hjb : c i jb = b.

        Lean, line 330
              obtain ⟨jb, hjb⟩ := hb.2 ▸ hg b hbA

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 330 at 3baa017dcbd1 ↗

      5. hfib.s2.hmono have StrictMono (c i)

        Leaves (2 : ℕ) * a ≤ b, with hmono : StrictMono (c i).

        Lean, line 331
              have hmono := lu_mono (c i) R hR2 (h0 i) (hR i)

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 331 at 3baa017dcbd1 ↗

      6. hfib.s2.hj have ja < jb

        Leaves (2 : ℕ) * a ≤ b, with hj : ja < jb.

        Lean, lines 332–334
              have hj : ja < jb := by
                rw [← hja, ← hjb] at hab
                exact hmono.lt_iff_lt.1 hab

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 332–334 at 3baa017dcbd1 ↗

      7. hfib.s2.this have R * c i ja ≤ c i jb

        Leaves (2 : ℕ) * a ≤ b, with this : R * c i ja ≤ c i jb.

        Lean, line 335
              have := lu_ratio (c i) R hR2 (h0 i) (hR i) _ _ hj

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 335 at 3baa017dcbd1 ↗

      8. hfib.s2.h2 have (2 : ℕ) * c i ja ≤ R * c i ja

        Leaves (2 : ℕ) * a ≤ b, with h2 : (2 : ℕ) * c i ja ≤ R * c i ja.

        Uses library Nat.mul_le_mul_right.

        Lean, line 336
              have h2 : 2 * c i ja ≤ R * c i ja := Nat.mul_le_mul_right _ hR2

        targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 336 at 3baa017dcbd1 ↗

  15. hsum have ∑ a ∈ F, a ≤ r * ((2 : ℕ) * T)

    Leaves ∃ m ∈ A, ∃ (L : ℕ), (0 : ℕ) < L ∧ (∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m, with hsum : ∑ a ∈ F, a ≤ r * ((2 : ℕ) * T).

    Uses library Finset.sum_fiberwise.

    Lean, lines 338–342
      have hsum : ∑ a ∈ F, a ≤ r * (2 * T) := by
        rw [← Finset.sum_fiberwise F g (fun a => a)]
        calc ∑ i : Fin r, ∑ a ∈ F with g a = i, a ≤ ∑ _i : Fin r, 2 * T :=
              Finset.sum_le_sum (fun i _ => hfib i)
          _ = r * (2 * T) := by simp

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 338–342 at 3baa017dcbd1 ↗

    1. hsum.s1 calc ∑ i : Fin r, ∑ a ∈ F with g a = i, a ≤ ∑ _i : Fin r, (2 : ℕ) * T

      Closes the goal.

      Uses library Fin Natural numbers less than some upper bound. , Finset.sum_le_sum In an ordered additive commutative monoid, if each summand f i of one finite sum is less than or equal to the corresponding summand g i of another finite sum, then ∑ i ∈ s, f i ≤ ∑ i ∈ s, g i. .

      Lean, lines 340–341
          calc ∑ i : Fin r, ∑ a ∈ F with g a = i, a ≤ ∑ _i : Fin r, 2 * T :=
                Finset.sum_le_sum (fun i _ => hfib i)

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 340–341 at 3baa017dcbd1 ↗

    2. hsum.s2 calc routine: simp

      Closes the goal.

      Lean, line 342
            _ = r * (2 * T) := by simp

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 342 at 3baa017dcbd1 ↗

  16. s16 case

    Leaves (0 : ℕ) < ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)).

    Uses library Finset.prod_pos.

    Lean, lines 344–349
      · apply Finset.prod_pos
        intro a ha
        have haA := ((hFmem a).1 ha).2
        have hne : a ≠ 0 := fun h => h0A (h ▸ haA)
        have := Nat.one_lt_two_pow hne
        omega

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 344–349 at 3baa017dcbd1 ↗

    1. s16.haA have a ∈ A

      Leaves (0 : ℕ) < (2 : ℕ) ^ a - (1 : ℕ), with haA : a ∈ A.

      Lean, line 346
          have haA := ((hFmem a).1 ha).2

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 346 at 3baa017dcbd1 ↗

    2. s16.hne have a ≠ (0 : ℕ)

      Leaves (0 : ℕ) < (2 : ℕ) ^ a - (1 : ℕ), with hne : a ≠ (0 : ℕ).

      Lean, line 347
          have hne : a ≠ 0 := fun h => h0A (h ▸ haA)

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 347 at 3baa017dcbd1 ↗

    3. s16.this have (1 : ℕ) < (2 : ℕ) ^ a

      Leaves (0 : ℕ) < (2 : ℕ) ^ a - (1 : ℕ), with this : (1 : ℕ) < (2 : ℕ) ^ a.

      Uses library Nat.one_lt_two_pow.

      Lean, line 348
          have := Nat.one_lt_two_pow hne

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 348 at 3baa017dcbd1 ↗

  17. s17 case

    Leaves ∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)).

    Uses library Finset.dvd_prod_of_mem, And.intro And.intro : a → b → a ∧ b is the constructor for the And operation. .

    Lean, lines 350–351
      · intro a ha ham
        exact Finset.dvd_prod_of_mem _ ((hFmem a).2 ⟨ham, ha⟩)

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 350–351 at 3baa017dcbd1 ↗

  18. s18 case

    Leaves (2 : ℕ) ^ C * ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)) ≤ (2 : ℕ) ^ m.

    Lean, lines 352–358
      · have hL : ∏ a ∈ F, (2 ^ a - 1) ≤ 2 ^ (∑ a ∈ F, a) := by
          rw [← Finset.prod_pow_eq_pow_sum]
          exact Finset.prod_le_prod (fun _ _ => Nat.zero_le _) (fun a _ => Nat.sub_le _ _)
        have e2 : (2 * r + 1) * T = r * (2 * T) + T := by ring
        calc 2 ^ C * ∏ a ∈ F, (2 ^ a - 1) ≤ 2 ^ C * 2 ^ (∑ a ∈ F, a) := Nat.mul_le_mul_left _ hL
          _ = 2 ^ (C + ∑ a ∈ F, a) := (pow_add _ _ _).symm
          _ ≤ 2 ^ m := Nat.pow_le_pow_right (by norm_num) (by omega)

    targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 352–358 at 3baa017dcbd1 ↗

    1. s18.hL have ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)) ≤ (2 : ℕ) ^ ∑ a ∈ F, a

      Leaves (2 : ℕ) ^ C * ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)) ≤ (2 : ℕ) ^ m, with hL : ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)) ≤ (2 : ℕ) ^ ∑ a ∈ F, a.

      Uses library Finset.prod_pow_eq_pow_sum, Finset.prod_le_prod If all f i, i ∈ s, are nonnegative and each f i is less than or equal to g i, then the product of f i is less than or equal to the product of g i. , Nat.zero_le, Nat.sub_le.

      Lean, lines 352–354
        · have hL : ∏ a ∈ F, (2 ^ a - 1) ≤ 2 ^ (∑ a ∈ F, a) := by
            rw [← Finset.prod_pow_eq_pow_sum]
            exact Finset.prod_le_prod (fun _ _ => Nat.zero_le _) (fun a _ => Nat.sub_le _ _)

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, lines 352–354 at 3baa017dcbd1 ↗

    2. s18.e2 have ((2 : ℕ) * r + (1 : ℕ)) * T = r * ((2 : ℕ) * T) + T routine: ring

      Leaves (2 : ℕ) ^ C * ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)) ≤ (2 : ℕ) ^ m, with e2 : ((2 : ℕ) * r + (1 : ℕ)) * T = r * ((2 : ℕ) * T) + T.

      Lean, line 355
          have e2 : (2 * r + 1) * T = r * (2 * T) + T := by ring

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 355 at 3baa017dcbd1 ↗

    3. s18.s3 calc (2 : ℕ) ^ C * ∏ a ∈ F, ((2 : ℕ) ^ a - (1 : ℕ)) ≤ (2 : ℕ) ^ C * (2 : ℕ) ^ ∑ a ∈ F, a

      Closes the goal.

      Uses library Nat.mul_le_mul_left.

      Lean, line 356
          calc 2 ^ C * ∏ a ∈ F, (2 ^ a - 1) ≤ 2 ^ C * 2 ^ (∑ a ∈ F, a) := Nat.mul_le_mul_left _ hL

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 356 at 3baa017dcbd1 ↗

    4. s18.s4 calc (2 : ℕ) ^ C * (2 : ℕ) ^ ∑ a ∈ F, a = (2 : ℕ) ^ (C + ∑ a ∈ F, a)

      Closes the goal.

      Uses library pow_add.

      Lean, line 357
            _ = 2 ^ (C + ∑ a ∈ F, a) := (pow_add _ _ _).symm

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 357 at 3baa017dcbd1 ↗

    5. s18.s5 calc (2 : ℕ) ^ (C + ∑ a ∈ F, a) ≤ (2 : ℕ) ^ m

      Closes the goal.

      Uses library Nat.pow_le_pow_right.

      Lean, line 358
            _ ≤ 2 ^ m := Nat.pow_le_pow_right (by norm_num) (by omega)

      targets/erdos-257/nodes/variant-90827f46/Proof.lean, line 358 at 3baa017dcbd1 ↗

The proof in Lean (Proof.lean)

Checked by the kernel — these bytes are the ones its attestation names: attestations/000942.json, merge commit 3baa017dcbd1.

Proof.lean — its sha256 is the artifact_hash of the attestation below, so these are the bytes the gate checked. Rendered from targets/erdos-257/nodes/variant-90827f46/Proof.lean, sha256 b20a30c4d149.
import Mathlib
import Nodes.«variant-90827f46».Context

private lemma lac_f_nonneg (n : ℕ) : 0 ≤ (1 : ℝ) / (2 ^ n - 1) := by
  apply div_nonneg zero_le_one
  have : (1 : ℝ) ≤ 2 ^ n := one_le_pow₀ (by norm_num)
  linarith

private lemma lac_f_le (n : ℕ) : (1 : ℝ) / (2 ^ n - 1) ≤ 2 * (1 / 2) ^ n := by
  rcases Nat.eq_zero_or_pos n with rfl | hn
  · norm_num
  · have h2 : (2 : ℝ) ≤ 2 ^ n := by
      calc (2 : ℝ) = 2 ^ 1 := by norm_num
        _ ≤ 2 ^ n := pow_le_pow_right₀ (by norm_num) hn
    have hpos : (0 : ℝ) < 2 ^ n - 1 := by linarith
    have hp : (0 : ℝ) < 2 ^ n := by positivity
    rw [one_div_pow, div_le_iff₀ hpos]
    have e : (2 : ℝ) * (1 / 2 ^ n) * (2 ^ n - 1) = 2 - 2 / 2 ^ n := by
      field_simp
    have h3 : 2 / (2 : ℝ) ^ n ≤ 1 := (div_le_one hp).mpr h2
    linarith

private lemma lac_summable : Summable (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) :=
  Summable.of_nonneg_of_le lac_f_nonneg lac_f_le
    ((summable_geometric_of_lt_one (by norm_num) (by norm_num)).mul_left 2)

private lemma lac_tail_le (A : Set ℕ) (m : ℕ) :
    ∑' k : ℕ, A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) (k + m) ≤ 4 * (1 / 2) ^ m := by
  classical
  have hrw : ∀ k : ℕ, 2 * (1 / 2 : ℝ) ^ (k + m) = (2 * (1 / 2) ^ m) * (1 / 2) ^ k := by
    intro k; rw [pow_add]; ring
  have hg : Summable (fun k : ℕ => 2 * (1 / 2 : ℝ) ^ (k + m)) := by
    simp_rw [hrw]
    exact (summable_geometric_of_lt_one (by norm_num) (by norm_num)).mul_left _
  have hle : ∀ k, A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) (k + m)
      ≤ 2 * (1 / 2 : ℝ) ^ (k + m) := by
    intro k
    rw [Set.indicator_apply]
    split_ifs
    · exact lac_f_le _
    · positivity
  have hs : Summable (fun k : ℕ => A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) (k + m)) :=
    Summable.of_nonneg_of_le (fun k => Set.indicator_nonneg (fun n _ => lac_f_nonneg n) _) hle hg
  calc _ ≤ ∑' k : ℕ, 2 * (1 / 2 : ℝ) ^ (k + m) := Summable.tsum_le_tsum hle hs hg
    _ = 4 * (1 / 2) ^ m := by
      simp_rw [hrw]
      rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num) (by norm_num)]
      norm_num
      ring

private lemma liou_int (L : ℕ) (F : Finset ℕ) (hF : ∀ a ∈ F, 2 ^ a - 1 ∣ L)
    (hF0 : ∀ a ∈ F, a ≠ 0) :
    ∃ N : ℤ, (L : ℝ) * ∑ a ∈ F, (1 : ℝ) / (2 ^ a - 1) = N := by
  rw [Finset.mul_sum]
  have : ∀ a ∈ F, ∃ c : ℤ, (L : ℝ) * (1 / ((2 : ℝ) ^ a - 1)) = c := by
    intro a ha
    obtain ⟨c, hc⟩ := hF a ha
    refine ⟨c, ?_⟩
    have h1 : (1 : ℝ) < 2 ^ a := one_lt_pow₀ (by norm_num) (hF0 a ha)
    have h0 : (2 : ℝ) ^ a - 1 ≠ 0 := by linarith
    have hc' : (L : ℝ) = ((2 : ℝ) ^ a - 1) * c := by
      have h2 : 1 ≤ 2 ^ a := Nat.one_le_two_pow
      rw [hc]; push_cast [Nat.cast_sub h2]; ring
    rw [hc']; field_simp
    norm_cast
  choose c hc using this
  refine ⟨∑ a ∈ F.attach, c a.1 a.2, ?_⟩
  push_cast
  rw [← Finset.sum_attach F]
  exact Finset.sum_congr rfl (fun a _ => hc a.1 a.2)

private lemma r2_liou :
    ∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
    (∀ C : ℕ, ∃ m ∈ A, ∃ L : ℕ, 0 < L ∧ (∀ a ∈ A, a < m → 2 ^ a - 1 ∣ L) ∧ 2 ^ C * L ≤ 2 ^ m) →
    Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
  classical
  intro A _ h0 hA
  rintro ⟨r, hr⟩
  have hsum : Summable (A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1))) :=
    lac_summable.indicator A
  have hrA : (r : ℝ) = ∑' n, A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) n :=
    hr.trans (tsum_subtype A (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)))
  set q : ℕ := r.den with hq
  obtain ⟨m, hmA, L, hL0, hLdvd, hLm⟩ := hA (4 * q)
  have hm1 : 1 ≤ m := by
    rcases Nat.eq_zero_or_pos m with h | h
    · exact absurd (h ▸ hmA) h0
    · exact h
  set F := (Finset.range m).filter (· ∈ A) with hF
  have hsplit := hsum.sum_add_tsum_nat_add m
  have hfin : ∑ i ∈ Finset.range m, A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) i
      = ∑ a ∈ F, (1 : ℝ) / (2 ^ a - 1) := by
    rw [hF, Finset.sum_filter]
    simp [Set.indicator_apply]
  set T := ∑' i, A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) (i + m) with hT
  have hTs : Summable (fun i => A.indicator (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) (i + m)) :=
    (summable_nat_add_iff m).mpr hsum
  have hTpos : 0 < T := by
    apply Summable.tsum_pos hTs (fun i => Set.indicator_nonneg (fun n _ => lac_f_nonneg n) _) 0
    rw [zero_add, Set.indicator_of_mem hmA]
    have : (1 : ℝ) < 2 ^ m := one_lt_pow₀ (by norm_num) (by omega)
    apply div_pos one_pos; linarith
  have hTle : T ≤ 4 * (1 / 2) ^ m := lac_tail_le A m
  have hrT : (r : ℝ) = (∑ a ∈ F, (1 : ℝ) / (2 ^ a - 1)) + T := by
    rw [hrA, ← hsplit, hfin]
  obtain ⟨N, hN⟩ := liou_int L F
    (fun a ha => hLdvd a (Finset.mem_filter.1 ha).2 (Finset.mem_range.1 (Finset.mem_filter.1 ha).1))
    (fun a ha h => h0 (h ▸ (Finset.mem_filter.1 ha).2))
  have hPpos : (0 : ℝ) < L := by exact_mod_cast hL0
  have hqr : (r : ℝ) * q = r.num := by
    rw [hq]; exact_mod_cast Rat.mul_den_eq_num r
  have hZ : (q : ℝ) * L * T = ((L : ℤ) * r.num - q * N : ℤ) := by
    push_cast
    rw [← hN, ← hqr]
    have : T = r - ∑ a ∈ F, (1 : ℝ) / (2 ^ a - 1) := by linarith
    rw [this]; ring
  have hqpos : (0 : ℝ) < q := by
    rw [hq]; exact_mod_cast r.den_pos
  have hpos : (0 : ℝ) < (q : ℝ) * L * T := by positivity
  have hge : (1 : ℝ) ≤ (q : ℝ) * L * T := by
    rw [hZ] at hpos ⊢
    have : (0 : ℤ) < (L : ℤ) * r.num - q * N := by exact_mod_cast hpos
    exact_mod_cast this
  have hLm' : (2 : ℝ) ^ (4 * q) * L ≤ 2 ^ m := by exact_mod_cast hLm
  have hbig : (4 * q : ℝ) < 2 ^ (4 * q) := by
    have h1 : 4 * q < 2 ^ (4 * q) := Nat.lt_two_pow_self
    exact_mod_cast h1
  have h2m : (2 : ℝ) ^ m * (1 / 2) ^ m = 1 := by rw [← mul_pow]; norm_num
  have hupper : (q : ℝ) * L * T < 1 := by
    have hA1 : (q : ℝ) * L * T ≤ q * L * (4 * (1 / 2) ^ m) :=
      mul_le_mul_of_nonneg_left hTle (by positivity)
    have hA2 : (2 : ℝ) ^ (4 * q) * ((q : ℝ) * L * (4 * (1 / 2) ^ m))
        ≤ 4 * q * (2 ^ m * (1 / 2) ^ m) := by
      have := mul_le_mul_of_nonneg_right hLm' (by positivity : (0 : ℝ) ≤ 4 * q * (1 / 2) ^ m)
      nlinarith [this]
    rw [h2m, mul_one] at hA2
    have hpow : (0 : ℝ) < 2 ^ (4 * q) := by positivity
    have : (q : ℝ) * L * (4 * (1 / 2) ^ m) < 1 := by
      by_contra hc
      have hc2 := not_lt.mp hc
      nlinarith
    linarith
  linarith



private lemma lu_geo_sum : ∀ T (S : Finset ℕ), (∀ a ∈ S, a ≤ T) →
    (∀ a ∈ S, ∀ b ∈ S, a < b → 2 * a ≤ b) → ∑ a ∈ S, a ≤ 2 * T := by
  intro T
  induction T using Nat.strong_induction_on with
  | _ T ih =>
  intro S hT hR
  rcases S.eq_empty_or_nonempty with rfl | hne
  · simp
  · set M := S.max' hne with hM
    have hMS : M ∈ S := S.max'_mem hne
    have hMT : M ≤ T := hT M hMS
    have hsplit : ∑ a ∈ S, a = M + ∑ a ∈ S.erase M, a := (Finset.add_sum_erase S _ hMS).symm
    rcases Nat.eq_zero_or_pos M with h0 | hpos
    · have hz : ∀ a ∈ S, a = 0 := fun a ha => by
        have hle : a ≤ M := S.le_max' a ha
        omega
      rw [Finset.sum_eq_zero hz]
      omega
    · have hsub : ∀ a ∈ S.erase M, a ≤ M / 2 := by
        intro a ha
        have haS := Finset.mem_of_mem_erase ha
        have hne' := Finset.ne_of_mem_erase ha
        have hle : a ≤ M := S.le_max' a haS
        have hlt : a < M := lt_of_le_of_ne hle hne'
        have := hR a haS M hMS hlt
        omega
      have hrest := ih (M / 2) (by omega) (S.erase M) hsub
        (fun a ha b hb hab => hR a (Finset.mem_of_mem_erase ha) b (Finset.mem_of_mem_erase hb) hab)
      omega

private lemma lu_gt (c : ℕ → ℕ) (R : ℕ) (hR2 : 2 ≤ R) (h0 : 0 < c 0)
    (hR : ∀ j, R * c j ≤ c (j + 1)) : ∀ j, j < c j := by
  intro j
  induction j with
  | zero => exact h0
  | succ j ih =>
    have h1 := hR j
    have h2 : 2 * c j ≤ R * c j := Nat.mul_le_mul_right _ hR2
    omega

private lemma lu_mono (c : ℕ → ℕ) (R : ℕ) (hR2 : 2 ≤ R) (h0 : 0 < c 0)
    (hR : ∀ j, R * c j ≤ c (j + 1)) : StrictMono c := by
  apply strictMono_nat_of_lt_succ
  intro j
  have h1 := hR j
  have h2 : 2 * c j ≤ R * c j := Nat.mul_le_mul_right _ hR2
  have := lu_gt c R hR2 h0 hR j
  omega

private lemma lu_ratio (c : ℕ → ℕ) (R : ℕ) (hR2 : 2 ≤ R) (h0 : 0 < c 0)
    (hR : ∀ j, R * c j ≤ c (j + 1)) : ∀ i j, i < j → R * c i ≤ c j := by
  intro i j hij
  induction j, hij using Nat.le_induction with
  | base => exact hR i
  | succ j _ ih =>
    have : c j < c (j + 1) := (lu_mono c R hR2 h0 hR).lt_iff_lt.2 (by omega)
    omega

private lemma lu_window (r : ℕ) (c : Fin r → ℕ → ℕ) (R : ℕ) (hR2 : 2 ≤ R)
    (hRq : (2 * r + 1) ^ (r + 1) ≤ R) (h0 : ∀ i, 0 < c i 0)
    (hR : ∀ i j, R * c i j ≤ c i (j + 1)) (T : ℕ) :
    ∃ k ≤ r, ∀ i j, c i j ≤ (2 * r + 1) ^ k * T ∨ (2 * r + 1) ^ (k + 1) * T < c i j := by
  classical
  by_contra hcon
  push_neg at hcon
  have hk : ∀ k : Fin (r + 1), ∃ i : Fin r, ∃ j,
      (2 * r + 1) ^ (k : ℕ) * T < c i j ∧ c i j ≤ (2 * r + 1) ^ ((k : ℕ) + 1) * T :=
    fun k => hcon k (Nat.lt_succ_iff.mp k.2)
  choose f g hfg using hk
  obtain ⟨k1, k2, hne, heq⟩ := Fintype.exists_ne_map_eq_of_card_lt f (by simp)
  have h1 := hfg k1
  have h2 := hfg k2
  rw [heq] at h1
  set i := f k2
  have hk1 : (k1 : ℕ) ≤ r := Nat.lt_succ_iff.mp k1.2
  have hk2 : (k2 : ℕ) ≤ r := Nat.lt_succ_iff.mp k2.2
  have hq : 1 ≤ 2 * r + 1 := by omega
  have hTlow : ∀ k : ℕ, T ≤ (2 * r + 1) ^ k * T := fun k => by
    have := Nat.mul_le_mul_right T (Nat.one_le_pow k (2 * r + 1) (by omega))
    simpa using this
  have hThigh : ∀ k : ℕ, k ≤ r → (2 * r + 1) ^ (k + 1) * T ≤ R * T := fun k hk =>
    Nat.mul_le_mul_right T ((Nat.pow_le_pow_right hq (by omega)).trans hRq)
  rcases lt_trichotomy (g k1) (g k2) with hlt | heqj | hgt
  · have hr := lu_ratio (c i) R hR2 (h0 i) (hR i) _ _ hlt
    have a1 := hTlow k1
    have a2 := hThigh k2 hk2
    have a3 : R * (T + 1) ≤ R * c i (g k1) := Nat.mul_le_mul_left R (by omega)
    rw [Nat.mul_add, Nat.mul_one] at a3
    omega
  · rw [heqj] at h1
    have hne' : (k1 : ℕ) ≠ k2 := fun h => hne (Fin.ext h)
    rcases lt_or_gt_of_ne hne' with h | h
    · have := Nat.mul_le_mul_right T (Nat.pow_le_pow_right hq (show (k1 : ℕ) + 1 ≤ k2 by omega))
      omega
    · have := Nat.mul_le_mul_right T (Nat.pow_le_pow_right hq (show (k2 : ℕ) + 1 ≤ k1 by omega))
      omega
  · have hr := lu_ratio (c i) R hR2 (h0 i) (hR i) _ _ hgt
    have a1 := hTlow k2
    have a2 := hThigh k1 hk1
    have a3 : R * (T + 1) ≤ R * c i (g k2) := Nat.mul_le_mul_left R (by omega)
    rw [Nat.mul_add, Nat.mul_one] at a3
    omega

/-- Erdős 257 for a union of finitely many lacunary sequences. Let `c 0, …, c (r-1)` be `r ≥ 1`
sequences of positive integers, each growing by a factor of at least `(2r+1)^(r+1)` from one
term to the next (no divisibility and no relation between the sequences is assumed). Then
`∑_{n ∈ A} 1/(2^n - 1)` is irrational for `A` the union of their ranges. For `r = 1` the
factor is 9 (a case `Opn.erdos_257_eventually_ratio_two` already covers); for three sequences
it is `7^4 = 2401`, met for instance by `n ↦ 2401^n`, `n ↦ 3·2401^n` and
`n ↦ (n + 1)·2401^n`, the last not a divisibility chain. The union need not be lacunary of ratio two,
so `Opn.erdos_257_eventually_ratio_two` does not apply, and the sequences need not be
divisibility chains, as `Opn.erdos_257_two_chains` requires. Proof: by pigeonhole over the
`r + 1` windows `(q^k T, q^(k+1) T]`, `q = 2r+1`, `k = 0, …, r`, one window contains no
element of `A`, because two elements of one sequence in `(T, q^(r+1) T]` would contradict its
growth. The least element `m` of `A` above `q^k T` then exceeds `(2r+1) q^k T`, while the
elements of each sequence below `m` are at most `q^k T` and sum to at most twice that. So `m`
exceeds the sum of all smaller elements of `A` by at least `T`, and Liouville's criterion
(`Opn.erdos_257_liouville_criterion`, common denominator `∏_{a ∈ A, a < m} (2^a - 1)`)
applies, as in `Opn.erdos_257_long_gaps`. The proof is elementary and complete. -/
theorem Opn.erdos_257_lacunary_union :
    ∀ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r → (∀ i, 0 < c i 0) →
    (∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) →
    Irrational (∑' n : (⋃ i, Set.range (c i) : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := by
  intro r c hr h0 hR
  classical
  set R := (2 * r + 1) ^ (r + 1) with hRdef
  have hR2 : 2 ≤ R := by
    calc 2 ≤ 2 * r + 1 := by omega
      _ = (2 * r + 1) ^ 1 := (pow_one _).symm
      _ ≤ (2 * r + 1) ^ (r + 1) := Nat.pow_le_pow_right (by omega) (by omega)
  set A : Set ℕ := ⋃ i, Set.range (c i) with hA
  have hmemA : ∀ a, a ∈ A ↔ ∃ i, a ∈ Set.range (c i) := fun a => by
    rw [hA, Set.mem_iUnion]
  have hinf : A.Infinite :=
    Set.Infinite.mono (Set.subset_iUnion (fun i => Set.range (c i)) ⟨0, hr⟩)
      (Set.infinite_range_of_injective (lu_mono (c ⟨0, hr⟩) R hR2 (h0 _) (hR _)).injective)
  have h0A : 0 ∉ A := by
    intro h
    obtain ⟨i, j, hj⟩ := (hmemA 0).1 h
    have := lu_gt (c i) R hR2 (h0 i) (hR i) j
    omega
  apply r2_liou A hinf h0A
  intro C
  obtain ⟨k, _, hk⟩ := lu_window r c R hR2 le_rfl h0 hR C
  set T := (2 * r + 1) ^ k * C with hT
  have hCT : C ≤ T := by
    have := Nat.mul_le_mul_right C (Nat.one_le_pow k (2 * r + 1) (by omega))
    simpa [hT] using this
  obtain ⟨a0, ha0A, ha0⟩ := hinf.exists_gt T
  have hex : ∃ m, m ∈ A ∧ T < m := ⟨a0, ha0A, ha0⟩
  set m := Nat.find hex with hm
  obtain ⟨hmA, hTm⟩ := Nat.find_spec hex
  have hbelow : ∀ a ∈ A, a < m → a ≤ T := fun a ha ham => by
    by_contra h
    push_neg at h
    exact Nat.find_min hex ham ⟨ha, h⟩
  have hmbig : (2 * r + 1) * T < m := by
    obtain ⟨i, j, hij⟩ := (hmemA m).1 hmA
    have e : (2 * r + 1) ^ (k + 1) * C = (2 * r + 1) * T := by rw [hT]; ring
    rcases hk i j with h | h
    · rw [hij] at h; omega
    · rw [hij] at h; omega
  set F := (Finset.range m).filter (· ∈ A) with hF
  have hFmem : ∀ a, a ∈ F ↔ a < m ∧ a ∈ A := fun a => by
    rw [hF, Finset.mem_filter, Finset.mem_range]
  -- a chain index for each element
  let g : ℕ → Fin r := fun a =>
    if h : ∃ i, a ∈ Set.range (c i) then h.choose else ⟨0, hr⟩
  have hg : ∀ a ∈ A, a ∈ Set.range (c (g a)) := fun a ha => by
    have h := (hmemA a).1 ha
    simp only [g, dif_pos h]
    exact h.choose_spec
  have hfib : ∀ i : Fin r, ∑ a ∈ F with g a = i, a ≤ 2 * T := fun i => by
    apply lu_geo_sum
    · intro a ha
      rw [Finset.mem_filter] at ha
      have := (hFmem a).1 ha.1
      exact hbelow a this.2 this.1
    · intro a ha b hb hab
      rw [Finset.mem_filter] at ha hb
      have haA := ((hFmem a).1 ha.1).2
      have hbA := ((hFmem b).1 hb.1).2
      obtain ⟨ja, hja⟩ := ha.2 ▸ hg a haA
      obtain ⟨jb, hjb⟩ := hb.2 ▸ hg b hbA
      have hmono := lu_mono (c i) R hR2 (h0 i) (hR i)
      have hj : ja < jb := by
        rw [← hja, ← hjb] at hab
        exact hmono.lt_iff_lt.1 hab
      have := lu_ratio (c i) R hR2 (h0 i) (hR i) _ _ hj
      have h2 : 2 * c i ja ≤ R * c i ja := Nat.mul_le_mul_right _ hR2
      omega
  have hsum : ∑ a ∈ F, a ≤ r * (2 * T) := by
    rw [← Finset.sum_fiberwise F g (fun a => a)]
    calc ∑ i : Fin r, ∑ a ∈ F with g a = i, a ≤ ∑ _i : Fin r, 2 * T :=
          Finset.sum_le_sum (fun i _ => hfib i)
      _ = r * (2 * T) := by simp
  refine ⟨m, hmA, ∏ a ∈ F, (2 ^ a - 1), ?_, ?_, ?_⟩
  · apply Finset.prod_pos
    intro a ha
    have haA := ((hFmem a).1 ha).2
    have hne : a ≠ 0 := fun h => h0A (h ▸ haA)
    have := Nat.one_lt_two_pow hne
    omega
  · intro a ha ham
    exact Finset.dvd_prod_of_mem _ ((hFmem a).2 ⟨ham, ha⟩)
  · have hL : ∏ a ∈ F, (2 ^ a - 1) ≤ 2 ^ (∑ a ∈ F, a) := by
      rw [← Finset.prod_pow_eq_pow_sum]
      exact Finset.prod_le_prod (fun _ _ => Nat.zero_le _) (fun a _ => Nat.sub_le _ _)
    have e2 : (2 * r + 1) * T = r * (2 * T) + T := by ring
    calc 2 ^ C * ∏ a ∈ F, (2 ^ a - 1) ≤ 2 ^ C * 2 ^ (∑ a ∈ F, a) := Nat.mul_le_mul_left _ hL
      _ = 2 ^ (C + ∑ a ∈ F, a) := (pow_add _ _ _).symm
      _ ≤ 2 ^ m := Nat.pow_le_pow_right (by norm_num) (by omega)

What is known

Work on it

No explainer yet. This proof written as a journal would print it, labelled unverified, is the next thing a writer could add, by pull request (D-3, D-36; the guide shows how).

Write the explainer →

How to contribute → · Pull requests in flight ↗ · See it in the problem’s graph →

Record

Statement: the Lean file and its words (1 version)

Statement not audited — only a problem’s root statement is audited for fidelity (D-9); the kernel checks a proof against this Lean as written.

import Mathlib
import Nodes.«variant-90827f46».Context

/-- Erdős 257 for a union of finitely many lacunary sequences. Let `c 0, …, c (r-1)` be `r ≥ 1`
sequences of positive integers, each growing by a factor of at least `(2r+1)^(r+1)` from one
term to the next (no divisibility and no relation between the sequences is assumed). Then
`∑_{n ∈ A} 1/(2^n - 1)` is irrational for `A` the union of their ranges. For `r = 1` the
factor is 9 (a case `Opn.erdos_257_eventually_ratio_two` already covers); for three sequences
it is `7^4 = 2401`, met for instance by `n ↦ 2401^n`, `n ↦ 3·2401^n` and
`n ↦ (n + 1)·2401^n`, the last not a divisibility chain. The union need not be lacunary of ratio two,
so `Opn.erdos_257_eventually_ratio_two` does not apply, and the sequences need not be
divisibility chains, as `Opn.erdos_257_two_chains` requires. Proof: by pigeonhole over the
`r + 1` windows `(q^k T, q^(k+1) T]`, `q = 2r+1`, `k = 0, …, r`, one window contains no
element of `A`, because two elements of one sequence in `(T, q^(r+1) T]` would contradict its
growth. The least element `m` of `A` above `q^k T` then exceeds `(2r+1) q^k T`, while the
elements of each sequence below `m` are at most `q^k T` and sum to at most twice that. So `m`
exceeds the sum of all smaller elements of `A` by at least `T`, and Liouville's criterion
(`Opn.erdos_257_liouville_criterion`, common denominator `∏_{a ∈ A, a < m} (2^a - 1)`)
applies, as in `Opn.erdos_257_long_gaps`. The proof is elementary and complete. -/
theorem Opn.erdos_257_lacunary_union :
    ∀ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r → (∀ i, 0 < c i 0) →
    (∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) →
    Irrational (∑' n : (⋃ i, Set.range (c i) : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := by
  sorry

A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →

In words, unverified — what this statement says; written by t1023-f3, drafted with Claude Opus 5.5 (claude-opus-5-5); words by t1022-l, filed by t1023-f3, 2026-10-23; no one has read it against the Lean and signed it.

Draft · drafted, by the model named above

$\displaystyle \forall\, r \ge 1,\ \forall\, c_0, \dots, c_{r-1} : \mathbb{N} \to \mathbb{N},\quad \Big(c_i(0) > 0,\ \ (2r+1)^{r+1}\, c_i(j) \le c_i(j+1)\ \text{for all } i, j\Big) \;\Longrightarrow\; \sum_{n \in \bigcup_i \{c_i(j) : j \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$

The sum is over the union of the $r$ sequences' values, each value counted once. Each sequence grows by a factor of at least $(2r+1)^{r+1}$ per step (9 for one sequence, 125 for two, 2401 for three); nothing is assumed about divisibility or about how the sequences sit relative to each other. Every element is at least $1$, so no term meets Lean's junk value at $n = 0$.

Rendered from gloss/3bf92b9e07f5….md · Improve these words →

Rendered from targets/erdos-257/nodes/variant-90827f46/Statement.lean. Origin: variant (partial).

Attestation: pass, 7 of 7 checks

Checked by the kernel — the gate’s record of the run: attestations/000942.json, merge commit 3baa017dcbd1.

Verdict pass, from attestations/000942.json.

Submitter
t1022-l
Toolchain
leanprover/lean4:v4.33.1 (hash f54d0bc916bf76a7fae460ce9d078ccd1f74aeb4fd12c4b6546bca28b6aa1c63)
Mathlib
0df444a360eaa60ab8c11dca51a86af692955474
Reviewer
none needed (intermediate)
StepCheckResult
1toolchainpass
2pathspass
4kernel-replaypass
5axiomspass
6hazardspass
7witnesspass
8depspass
Witness

Checked by the kernel — step 7 passed in the run its attestation records: attestations/000942.json, merge commit 3baa017dcbd1.

Witness.lean — checked at step 7 of the run recorded below: pass. Rendered from targets/erdos-257/nodes/variant-90827f46/Witness.lean, sha256 0fa13c836e22.
import Mathlib

theorem witness : ∃ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r ∧ (∀ i, 0 < c i 0) ∧
    ∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1) := by
  refine ⟨1, fun _ j => 9 ^ j, by norm_num, fun _ => by positivity, ?_⟩
  intro _ j
  show (2 * 1 + 1) ^ (1 + 1) * 9 ^ j ≤ 9 ^ (j + 1)
  rw [pow_succ]
  omega

No gloss yet: no one has written in words what this witness says (D-3 v3.30); the Lean above is the witness. How to write one →

Relation to the problem’s statement

Checked by the kernel — checked at admission (D-30); no proof of the node is implied.

Relation.lean — the implication between this variant and the problem’s statement, checked by the gate when the variant was admitted and immutable after (D-30). Rendered from targets/erdos-257/nodes/variant-90827f46/Relation.lean, sha256 2ab08530453c.
-- relation: partial
import Mathlib

/-! The variant is a partial form of the root (D-30, `partial`): the root, applied to the
infinite union of finitely many fast-growing sequences. -/

theorem relation :
    (∀ (A : Set ℕ), A.Infinite → Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1))) →
    ∀ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r → (∀ i, 0 < c i 0) →
    (∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) →
    Irrational (∑' n : (⋃ i, Set.range (c i) : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := by
  intro h r c hr h0 hR
  apply h
  apply Set.Infinite.mono (Set.subset_iUnion (fun i => Set.range (c i)) ⟨0, hr⟩)
  apply Set.infinite_range_of_injective
  have h2 : 2 ≤ (2 * r + 1) ^ (r + 1) :=
    calc 2 ≤ 2 * r + 1 := by omega
      _ = (2 * r + 1) ^ 1 := (pow_one _).symm
      _ ≤ (2 * r + 1) ^ (r + 1) := Nat.pow_le_pow_right (by omega) (by omega)
  have hgt : ∀ j, j < c ⟨0, hr⟩ j := by
    intro j
    induction j with
    | zero => exact h0 _
    | succ j ih =>
      have a := hR ⟨0, hr⟩ j
      have b : 2 * c ⟨0, hr⟩ j ≤ (2 * r + 1) ^ (r + 1) * c ⟨0, hr⟩ j := Nat.mul_le_mul_right _ h2
      omega
  apply StrictMono.injective
  apply strictMono_nat_of_lt_succ
  intro j
  have a := hR ⟨0, hr⟩ j
  have b : 2 * c ⟨0, hr⟩ j ≤ (2 * r + 1) ^ (r + 1) * c ⟨0, hr⟩ j := Nat.mul_le_mul_right _ h2
  have := hgt j
  omega

No gloss yet: no one has written in words what this relation says (D-3 v3.30); the Lean above is the relation. How to write one →

Acknowledged findings (1)

Untrusted contributor text — the prover’s justification for a finding.

Untrusted: acknowledgment of a div-zero finding at 1 / (2 ^ ↑n - 1)

n ranges over a union of sequences of positive integers, so 2^n - 1 >= 1; the root states the sum in the same form.

How to read this page