{
  "slug": "erdos49-erdos-49-variants-primes-maximal",
  "mode": "formalized",
  "challenge_sha256": "sha256:fa02c199ebd97c3a896fa3faa14627d1e9029d1f50d5ca43d162c597b36e1cc9",
  "class": "d",
  "plan": "The exact target asks for a finite upper bound at every endpoint: no strictly increasing subsequence of φ(1),…,φ(N) may be longer than the prime sequence. The known bounds control only asymptotic maxima and leave possible lower-order excess, so they do not yield equality pointwise. Extending the exact LIS scan can find a finite refutation but cannot prove the universal statement; a proof needs a new finite extremal argument. Chance of a complete proof or refutation this run is estimated at 0.1%.",
  "chance_pct": 0.1,
  "inventory": {
    "slug": "erdos49-erdos-49-variants-primes-maximal",
    "statement": "∀ (N : ℕ), 2 ≤ N → Erdos49.f N = N.primeCounting",
    "source": "FormalConjectures/ErdosProblems/49.lean at 6adcbe13652f4e7c69ad02a783465ae2a99d5cb3, reconstructed from base 7d1a8c9912747679d0093f6d1216420c33ee5ffa plus the verified audit patch",
    "attempts": {
      "formalized": 0,
      "counterexample": 0,
      "observed_at_utc": "2026-11-26T09:19:48Z"
    },
    "bounty": {
      "amount_usd": "2957.83",
      "amount_rao": "8249578413442",
      "as_of_utc": "2026-11-26T09:19:00Z"
    },
    "live_page_display": "$2,956; the live display and the pinned inventory snapshot differ slightly.",
    "challenge_modes": {
      "formalized": {
        "challenge_sha256": "sha256:fa02c199ebd97c3a896fa3faa14627d1e9029d1f50d5ca43d162c597b36e1cc9",
        "attempts": 0
      },
      "counterexample": {
        "challenge_sha256": "sha256:b88218c2fd25e132b8d952cdc3f4e4bf7b9bb374dd23b99814d1841d24dcef3d",
        "attempts": 0
      }
    }
  },
  "literature": {
    "checked_on": "2026-11-26",
    "complete_prior_solution_matching_exact_target": false,
    "status": "No complete prior solution matching the exact strict finite hypotheses was located. This is not an exhaustive literature guarantee.",
    "items": [
      {
        "date": "1995",
        "url": "https://revistas.usp.br/resenhasimeusp/article/download/74798/78366/0",
        "scope": "Erdős, Some of my Favourite Problems..., §I.9, printed p. 171. It defines the longest strictly increasing totient sequence and records “Probably t=π(n)”, followed by weaker asymptotic/density questions."
      },
      {
        "date": "2013 (online 2012)",
        "url": "https://campus.lakeforest.edu/trevino/monotone4.pdf",
        "scope": "Pollack, Pomerance, Treviño, Sets of monotonicity for Euler’s totient function. Read theorem statements and §9 numerics. Their extremal computations concern nondecreasing totients; the strict upper bound is not exact pointwise extremality."
      },
      {
        "date": "2023 preprint; published 2024",
        "url": "https://arxiv.org/abs/2309.02325",
        "scope": "Tao, Monotone non-decreasing sequences of the Euler totient function. Read abstract, introduction, and Theorem 1.1 in the HTML. The theorem concerns the weak/nondecreasing maximum and gives an asymptotic estimate, not equality of the strict finite maximum with π(N)."
      },
      {
        "date": "2026-11-26 access",
        "url": "https://erdosproblems.ai/wiki/problems/primes/E0049",
        "scope": "Secondary research audit separating the exact strict clause from the asymptotic clauses. It reports that no located source asserts or refutes exact strict extremality; it also describes checking erdosproblems.com discussion/history and 2025–2026 literature."
      },
      {
        "date": "2026-09-04 commit; inspected 2026-11-26",
        "url": "https://raw.githubusercontent.com/plby/lean-proofs/1e0ec64f07933c62401e0053041e5bece2cbe325/src/latest/ErdosProblems/Erdos49.lean",
        "scope": "Public Lean development. It proves Tao’s quantitative weak bound and strict o(N) result, including the prime lower-bound example, but does not state or prove exact strict prime maximality."
      },
      {
        "date": "2026-11-26 access",
        "url": "https://www.erdosproblems.com/49",
        "scope": "Direct read attempted; HTTP 403. The linked forum thread was also inaccessible. Therefore direct review of current comments was unavailable. The secondary audit reports no forum comments at its check."
      }
    ]
  },
  "attempted_steps": [
    {
      "step": "Read pinned inventory, metadata, both challenge modes, source module, and comments/docstrings. Confirmed the exact target type and SHA256.",
      "range": "Pinned catalog commit 3d3f3a09d60c67992738413746463076008eb894; Formal Conjectures source commit 6adcbe13652f4e7c69ad02a783465ae2a99d5cb3.",
      "result": "Formalized target; 0 attempts in both modes. Exact target is stronger than Tao’s asymptotic weak-max theorem."
    },
    {
      "step": "Reconstructed and built the pinned source module.",
      "range": "Formal Conjectures base 7d1a8c9912747679d0093f6d1216420c33ee5ffa plus patch SHA256 352280407fbbe83e636aa07a5c090aab15c6353c7cd77c0491284cd40df51275.",
      "result": "Patch SHA verified before applying; lake exe cache get and lake build of FormalConjectures.ErdosProblems.«49» succeeded."
    },
    {
      "step": "Ran strict totient LIS scan with predecessor retention.",
      "range": "Every prefix N=2…3,000,000; φ sieve indices 1…3,000,000; strict patience sorting with lower_bound/bisect_left.",
      "result": "No N in range had LIS > π(N). At 3,000,000, LIS=π=216,816. Final reconstructed LIS is strictly increasing in φ, starts at n=2, ends n=2,999,999; 216,811 of its indices are composite. φ(1)=φ(2)=1.",
      "verification": "UNVERIFIED as a formal result: this is a standalone Python sieve/LIS computation, not Lean kernel-checked."
    },
    {
      "step": "Registered the exact Challenge module and pinned TaskSupport in a scratch Lake project, then compiled named helper lemmas.",
      "range": "Lean v4.35.0-rc2; Mathlib 065356127b1dc0016f66b7283ce0ce2c4055aa55; TaskSupport commit 57c969e87cad845b60908cef474c8d1c0b6e43c5.",
      "result": "Challenge and Lemmas built. Checked endpoint values and prime totient formula. Their #print axioms are only the three permitted axioms."
    },
    {
      "step": "Tested the requested numerical route; did not run a separate prime-poor splice search.",
      "range": "Through N=3,000,000.",
      "result": "No counterexample; finite computation does not prove the universal equality."
    }
  ],
  "compiled_lemmas": [
    "E49Attempt.totient_one_eq_one",
    "E49Attempt.totient_two_eq_one",
    "E49Attempt.totient_prime_eq_sub_one"
  ],
  "obstruction": "The scan found no finite counterexample through three million. Existing cited theorems are asymptotic and/or for weak monotonicity, so they do not provide the exact pointwise upper bound required. No proof strategy closing that gap was found. The class is d, so there is no live a–c route for follow-up.",
  "status": "none",
  "followup": false,
  "chat_logs": "missing_original_chat_export",
  "files": {
    "Lemmas.lean": "import Challenge\n\n/-! Small checked endpoint facts used in the finite scan audit. -/\n\nnamespace E49Attempt\n\nlemma totient_one_eq_one : Nat.totient 1 = 1 := by decide\n\nlemma totient_two_eq_one : Nat.totient 2 = 1 := by decide\n\nlemma totient_prime_eq_sub_one {p : ℕ} (hp : p.Prime) : Nat.totient p = p - 1 :=\n  Nat.totient_prime hp\n\nend E49Attempt\n",
    "scan.py": "from bisect import bisect_left\nN=3_000_000\nphi=list(range(N+1))\nfor p in range(2,N+1):\n    if phi[p]==p:\n        for k in range(p,N+1,p): phi[k]-=phi[k]//p\ncomposite=bytearray(N+1)\nfor p in range(2,int(N**0.5)+1):\n    if not composite[p]: composite[p*p:N+1:p]=b'\\1'*(((N-p*p)//p)+1)\ntails=[]; tail_idx=[]; pred=[-1]*(N+1); pc=0; bad=None\nfor n in range(1,N+1):\n    if n>=2 and not composite[n]: pc+=1\n    j=bisect_left(tails,phi[n])\n    if j: pred[n]=tail_idx[j-1]\n    if j==len(tails): tails.append(phi[n]);tail_idx.append(n)\n    else: tails[j]=phi[n];tail_idx[j]=n\n    if n>=2 and len(tails)>pc:\n        bad=n;break\nprint(f'range=2..{N} first_bad={bad} LIS_at_N={len(tails)} pi_at_N={pc}')\nseq=[];k=tail_idx[-1]\nwhile k!=-1: seq.append((k,phi[k]));k=pred[k]\nseq.reverse()\nprint(f'endpoint_phi_1={phi[1]} endpoint_phi_2={phi[2]}')\nprint(f'final_LIS_length={len(seq)} final_LIS_first_last={seq[0][0]},{seq[-1][0]} nonprime_indices={sum(not composite[n] for n,_ in seq)}')\nprint(f'final_LIS_phi_strict={all(seq[i][1] < seq[i+1][1] for i in range(len(seq)-1))}')\n",
    "build.log": "Pinned inputs\n- Lean: leanprover/lean4:v4.35.0-rc2, commit 11acb17ec6b07a8f9e9173e6845197929540936b (release binary)\n- Mathlib: leanprover-community/mathlib4 065356127b1dc0016f66b7283ce0ce2c4055aa55\n- Formal Conjectures base: google-deepmind/formal-conjectures 7d1a8c9912747679d0093f6d1216420c33ee5ffa\n- Audit patch from conjectures-io/conjectures-tasks f5dab9b843c460bf946e0ec7b0e6ad2f2f739eb8; expected SHA256 352280407fbbe83e636aa07a5c090aab15c6353c7cd77c0491284cd40df51275; verified before apply. The resulting 49.lean SHA256 is 1f9b9bbca22a988c14926e1a8f4587d13be94cf09c90172816bcdaa7cbf22073.\n- Task archive SHA256 verified: a7c5f50e0efef665c045c3c0a5d4381fce5f2deec298841bc1a4fd0e01d0242b\n- Challenge.lean SHA256 verified: fa02c199ebd97c3a896fa3faa14627d1e9029d1f50d5ca43d162c597b36e1cc9\n- TaskSupport: conjectures-io/conjectures-validator 57c969e87cad845b60908cef474c8d1c0b6e43c5; SHA256 verified against metadata: 58a80a223dbd7383d92eb2a57b1ec207c0991131a1a1bf24585a4452777c257e\n\nCommands and results\n0. An initial optional C++ scan compile (`g++ -O3 -std=c++17 scan.cpp`) could not run because `g++` is not installed (shell exit 127). The requested scan was completed with the Python implementation in scan.py.\n1. In the Formal Conjectures root, `lake exe cache get` — exit 0. Cache tool reported 8,915 files decompressed; completed successfully. Package revisions came from the pinned FC manifest, including Mathlib above.\n2. In the Formal Conjectures root, `lake build 'FormalConjectures.ErdosProblems.«49»'` — exit 0. Output: `Build completed successfully (9198 jobs).`\n3. In the scratch Lake project, `lake build Challenge Lemmas` — exit 0. Output: `Build completed successfully (9204 jobs).` The exact published Challenge module emitted the expected warning that it contains `sorry`; this is not a proof build. `Lemmas` compiled the endpoint and prime-totient helper facts.\n4. In the scratch project, `lake env lean Axioms.lean` — exit 0. The three `#print axioms` outputs are in axioms.txt and use only propext, Classical.choice, and Quot.sound.\n5. No `Main.lean` was created or built because no full candidate was found. The challenge module still has its original placeholder.\n6. Numerical scan: `python3 scan.py` — exit 0. Output: `range=2..3000000 first_bad=None LIS_at_N=216816 pi_at_N=216816`; `endpoint_phi_1=1 endpoint_phi_2=1`; `final_LIS_length=216816 final_LIS_first_last=2,2999999 nonprime_indices=216811`; `final_LIS_phi_strict=True`. Ordinary computation only; not kernel checked.\n",
    "axioms.txt": "#print axioms E49Attempt.totient_one_eq_one\n'E49Attempt.totient_one_eq_one' depends on axioms: [propext, Classical.choice, Quot.sound]\n#print axioms E49Attempt.totient_two_eq_one\n'E49Attempt.totient_two_eq_one' depends on axioms: [propext, Classical.choice, Quot.sound]\n#print axioms E49Attempt.totient_prime_eq_sub_one\n'E49Attempt.totient_prime_eq_sub_one' depends on axioms: [propext, Classical.choice, Quot.sound]\n\nThese are checked helper lemmas, not a proof of Bounty.target. Bounty.target is not printed because the challenge imports its own sorry placeholder.\n",
    "explanation.md": "# e49 triage and attempt\n\nThe pinned target is the universal finite identity `Erdos49.f N = N.primeCounting` for every `N ≥ 2`. Here `f N` is the maximum cardinality of a subset of `[1,N]` on which Euler's totient is strictly increasing. The primes give the evident lower bound. The unresolved direction is to rule out any strictly increasing totient subsequence longer than the prime sequence, for every endpoint.\n\nI classified this as **d (genuinely hard)**. The source paper records the equality as Erdős's expectation; Tao's later theorem controls the weakly nondecreasing maximum asymptotically, which implies only an asymptotic estimate for the strict maximum. Pollack–Pomerance–Treviño's computational findings and the `π(x)+64` phenomenon are also for the weak version and do not refute this strict target. The public Lean development I checked formalizes the weak quantitative estimate and the strict `o(N)` result, not exact finite extremality. I found no complete prior result with the exact strict hypotheses and conclusion. Direct access to the erdosproblems.com problem and forum URLs returned 403/restricted errors; the cited primary paper, arXiv paper, public Lean source, and secondary source audit were readable.\n\nThe requested scan used a totient sieve through 3,000,000 and patience sorting with `bisect_left`, which computes strict LIS lengths; it retained a predecessor index for every input. For each prefix from `N=2` through `3,000,000`, it compared the LIS length to a sieve count of primes. No prefix exceeded `π(N)`. At `N=3,000,000`, both values were 216,816. The reconstructed final LIS has strictly increasing totients, starts at index 2, ends at 2,999,999, and contains 216,811 composite indices. The scan explicitly got `φ(1)=φ(2)=1`; these equal initial values cannot both enter a strict subsequence. This is an ordinary local computation, not a kernel-checked proof and not a universal bound.\n\nThree helper lemmas compile in the pinned scratch Lake project: the two endpoint totient values and the standard prime totient formula. Their printed dependencies are exactly `propext`, `Classical.choice`, and `Quot.sound`. No lemma bounding `f N` from above was found, so there is no candidate `Main.lean`; the target is unresolved. The challenge module itself contains its published `sorry` placeholder, and its successful build is only an import/elaboration check.\n\n**Plan and chance.** An exact proof would need a finite extremal argument that excludes a longer strict totient subsequence at each `N`; the known asymptotic estimates leave room for a bounded or otherwise lower-order excess and provide no such exact argument. Searching further endpoints may discover a refutation, but a longer search cannot prove the universal identity. A local splice search was not run after the requested full LIS scan found no counterexample. Estimated chance of a complete proof or refutation in this run: 0.1%.\n\n## Literature check (2026-11-26)\n\n- Erdős, “Some of my Favourite Problems in Number Theory, Combinatorics, and Geometry” (1995), §I.9, printed p. 171: states the strict increasing-totient maximum and “Probably t=π(n)”; asks weaker asymptotic/density questions. URL: https://revistas.usp.br/resenhasimeusp/article/download/74798/78366/0\n- Tao, “Monotone non-decreasing sequences of the Euler totient function,” arXiv:2309.02325 (2023 preprint; published in 2024), Theorem 1.1: an asymptotic upper bound for the **weakly** nondecreasing maximum. It does not imply exact equality of the strict finite maximum and `π(N)`. URL: https://arxiv.org/abs/2309.02325\n- Pollack, Pomerance, Treviño, “Sets of monotonicity for Euler's totient function” (2013), Theorem 1.2 and §9: density-zero/weak monotonicity bounds and weak-maximum computations, including `M↑(10^7)=π(10^7)+64`. Those computations concern a nondecreasing maximum, not this strict target. URL: https://campus.lakeforest.edu/trevino/monotone4.pdf\n- Formalization checked: Boris Alexeev et al., `Erdos49.lean`, commit `1e0ec64f07933c62401e0053041e5bece2cbe325`; it proves Tao's quantitative weak bound and a strict `o(N)` result, but no theorem asserting exact strict extremality. URL: https://raw.githubusercontent.com/plby/lean-proofs/1e0ec64f07933c62401e0053041e5bece2cbe325/src/latest/ErdosProblems/Erdos49.lean\n- The erdosproblems.ai Problem 49 research record explicitly separates the exact strict question from the asymptotic clauses and reports no located result proving or refuting it. Its audit describes checks of the source discussion/history and 2025–2026 literature searches. This is secondary research, not a primary proof. URL: https://erdosproblems.ai/wiki/problems/primes/E0049\n\nThe original erdosproblems.com problem and forum pages were attempted directly but were inaccessible from this run; I therefore do not claim a fresh direct review of their comments. The secondary audit reports no forum comments when it checked. No complete prior proof matching the pinned exact target was found in the accessible sources. Status: **UNVERIFIED as to exhaustive literature coverage**.\n\n## Chat export\n\nNo task-provided original chat export was present in the available inputs. No chat was reconstructed. `chat_logs` is recorded as `missing_original_chat_export`.\n"
  }
}
