Skip to content

research(cantor-diagonalization-oq-04-oq-01): S2 — trivial setoid + refinement-descent (build pending)#17030

Draft
rjwalters wants to merge 1 commit into
mainfrom
research/cantor-oq04-oq01-trivial-setoid
Draft

research(cantor-diagonalization-oq-04-oq-01): S2 — trivial setoid + refinement-descent (build pending)#17030
rjwalters wants to merge 1 commit into
mainfrom
research/cantor-oq04-oq01-trivial-setoid

Conversation

@rjwalters
Copy link
Copy Markdown
Owner

Summary

Session 2 rounding-out of the Lawvere FPT for Setoids in proofs/Proofs/CantorDiagonalizationOQ04OQ01.lean. S1 (PR #16393) established the failure side (Bool/discrete-setoid impossibility, ℕ-mod-parity impossibility, Cantor diagonal); S2 establishes the success side and the refinement structure that organizes both.

File: 166 → 221 lines, 8 → 12 theorems, 3 → 5 definitions, 0 sorries unchanged, 0 axioms unchanged. Status remains verified / original.

Part VIII — Trivial setoid (success side)

def trivialSetoid (Y : Type*) : Setoid Y where
  r := fun _ _ => True
  iseqv := ⟨fun _ => trivial, fun _ => trivial, fun _ _ => trivial⟩

theorem trivial_setoid_codes_endomorphisms (Y : Type*) [Inhabited Y] :
    CodesEndomorphismsSetoid Y (trivialSetoid Y) where
  encode := fun _ => default
  decode := fun _ => id
  retract := fun _ _ => trivial

theorem bool_trivial_setoid_codes_endomorphisms :
    CodesEndomorphismsSetoid Bool (trivialSetoid Bool) :=
  trivial_setoid_codes_endomorphisms Bool

The pair bool_trivial_setoid_codes_endomorphismscannot_code_endomorphisms_bool_setoid (S1) shows directly that coding-feasibility is genuinely setoid-dependent, not a fixed property of the underlying type.

Part IX — Refinement-descent

def IsRefinement {Y : Type*} (s t : Setoid Y) : Prop :=
  ∀ a b : Y, s.r a b → t.r a b

theorem coding_descends_to_coarser {Y : Type*} {s t : Setoid Y}
    (hst : IsRefinement s t) (c : CodesEndomorphismsSetoid Y s) :
    CodesEndomorphismsSetoid Y t where
  encode := c.encode
  decode := c.decode
  retract := fun g y => hst _ _ (c.retract g y)

theorem refines_trivial {Y : Type*} (s : Setoid Y) : IsRefinement s (trivialSetoid Y) :=
  fun _ _ _ => trivial

coding_descends_to_coarser shows coding-existence is monotone-downward in the refinement lattice on Setoid Y: finer admits coding ⇒ coarser does too. refines_trivial places the trivial setoid at the canonical top of that lattice. Together with the discrete setoid (canonical bottom, discreteSetoid from S1), they bracket the full coding spectrum.

Why this is real progress (and the limit thereof)

  • Establishes the success side: S1 had three failure witnesses (Bool/discrete, ℕ/parity, Cantor). The trivial-setoid result is the canonical success witness — every inhabited type codes vacuously under the one-class setoid.
  • Sets up OQ-04-OQ-01-OQ-02 (characterization): the refinement-descent lemma is the structural backbone for a future characterization of admissible setoids — they form a downward-closed subset of the refinement lattice on Setoid Y. The boundary is open (cardinality? algebraic? Lawvere-style?).
  • No axiom/sorry delta: this is a structural rounding-out, not Phase-3 work. Status remains verified / original.
  • Honesty: the four new theorems are all 1-2 line proofs. The trivial-setoid case is genuinely vacuous (the retract holds because True is always provable). The refinement-descent lemma is essentially function composition. This is solid structural setup, not a deep result.

Build status: pending

The worktree's proofs/.lake is the recursive self-symlink (per feedback_researcher_lake_symlink_broken.md), forcing every Docker build to fresh-clone Mathlib (~10–15 min) + cache get (~10 min) — total ~45 min. Following the established convention from PRs #16936 (cantor-OQ-01-OQ-01-OQ-02-OQ-01 S5) and #17008 (ehrhart-cube-proven-oq-02 S4), this PR is opened as draft.

The new theorems use only basic Mathlib primitives already exercised in this file:

  • Setoid constructor with Equivalence proof from anonymous tuple
  • default (from Inhabited), id, trivial
  • Anonymous constructor of CodesEndomorphismsSetoid records using fields

Risk of build failure is low; review of the proof bodies should be straightforward by inspection.

Files Modified

  • proofs/Proofs/CantorDiagonalizationOQ04OQ01.lean (+55 lines: 2 defs + 4 theorems + 2 section dividers + module-header Key Results list extended)
  • src/data/proofs/cantor-diagonalization-oq-04-oq-01/meta.json (lineCount 166→221, theoremCount 8→12, definitionCount 3→5 in both meta and leanFile blocks; +4 originalContributions; +2 sections for Parts VIII/IX; conclusion summary updated)
  • src/data/research/problems/cantor-diagonalization-oq-04-oq-01.json (phase COMPLETED→ACT, status completed→active, iteration 1→2; +6 builtItems, +4 insights, +3 nextSteps; lastUpdate; leanFiles entry)
  • research/problems/cantor-diagonalization-oq-04-oq-01/knowledge.md (Session 2 narrative)

Test plan

  • Re-run ./proofs/scripts/docker-build.sh Proofs.CantorDiagonalizationOQ04OQ01 from a worktree with warm Mathlib cache
  • Confirm trivialSetoid, trivial_setoid_codes_endomorphisms, bool_trivial_setoid_codes_endomorphisms, IsRefinement, coding_descends_to_coarser, refines_trivial type-check
  • pnpm build for gallery integration

Related

  • Session 1 (PR research(cantor-diagonalization-oq-04-oq-01): Lawvere FPT for Setoids #16393): initial Lawvere FPT for Setoids — 8 theorems, 3 definitions, 0 sorries/axioms
  • Parent: cantor-diagonalization-oq-04 (Type-level retraction version of Lawvere FPT)
  • Sibling: cantor-diagonalization-oq-03 (surjection version, candidate for parallel setoid generalization)
  • Open follow-up: cantor-diagonalization-oq-04-oq-01-oq-02 (characterization of admissible setoids — S2 lays the structural backbone)

🤖 Generated by researcher-3

…efinement-descent (build pending)

Round out the spectrum of coding-feasibility on `Setoid Y`:

Part VIII (success side):
- `trivialSetoid Y` — collapses Y to a single equivalence class (≈ ≡ True).
- `trivial_setoid_codes_endomorphisms` — every inhabited Y vacuously codes its
  endomorphisms under the trivial setoid (encode = const default, decode = const id).
- `bool_trivial_setoid_codes_endomorphisms` — explicit Bool corollary, contrasting
  with `cannot_code_endomorphisms_bool_setoid` from S1. Demonstrates that
  coding-feasibility is genuinely setoid-dependent.

Part IX (refinement structure):
- `IsRefinement s t : Prop` — s.r implies t.r (s finer, t coarser).
- `coding_descends_to_coarser` — coding under finer setoid descends to any
  coarser setoid via the same encode/decode (retract weakens trivially).
- `refines_trivial` — every setoid refines trivial; trivial is the canonical top.

File: 166 → 221 lines, 8 → 12 theorems, 3 → 5 definitions, 0 sorries unchanged,
0 axioms unchanged. Status remains verified/original.

Build pending: worktree's `proofs/.lake` is the recursive self-symlink (per
feedback_researcher_lake_symlink_broken.md), so a fresh Mathlib clone (~45 min)
is required. Following PRs #16936 and #17008, this opens as draft.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rjwalters rjwalters added the research Research agent work label May 8, 2026
rjwalters added a commit that referenced this pull request May 16, 2026
…p + currentState.nextAction realignment + sessions/ bootstrap + knowledge.md handoff (doc-only) (#19637)

The 2026-05-13/14 STATE-SYNC (PR #18953) was a thorough top-level
refresh (top-level JSON phase/status/progressSummary + leanFiles[0]
counts to S7 outcome; removed a duplicate stale S6 block). S8 absorbs
the residual drift it did not explicitly scope:

* knowledge.nextSteps 3 -> 4 items: drop 2 already-discharged (S7
  slicing-prototype DONE in PR #17362; S8 sorryCount=0/status=verified
  DONE per JSON top-level); keep S9 reframed as "dedicated-slug
  candidate" for central Delannoy upstream Mathlib contribution; add 3
  cosmetic follow-ups from state.md "Follow-Up (optional,
  post-completion)" list (set/refine cosmetic refactor; le_or_lt
  deprecation warning; permutohedron/hypersimplex/flow-polytope
  dedicated-slug candidates).
* currentState.nextAction rewritten to match state.md Follow-Up +
  cross-reference S8 memo §3 for knowledge.md staleness handoff.
* sessions/ subdirectory bootstrapped with new S8 memo (~218 LOC, 8
  sections). The existing session-5-slicing-spec.md is LEFT IN PLACE
  at the slug-dir root (do not git-mv; more invasive than S8 scope).
* knowledge.md line ~10 ("Two sorries remain") factual staleness
  FLAGGED in S8 memo §3 as a ready-to-paste diff for downstream
  mechanic/researcher; not edited here (knowledge.md is
  research/domain territory, not STATE-SYNC territory).

3 files, conflict-free (no open PRs for this slug; PR #17030 surfaced
by search is for cantor-diagonalization-oq-04-oq-01 via cross-ref):
* research/problems/<slug>/state.md (head + S8 entry)
* src/data/research/problems/<slug>.json (5 fields: iteration/focus/
  nextAction/nextSteps/lastUpdate)
* research/problems/<slug>/sessions/2026-05-16-s8-state-sync-nextsteps-cleanup.md (NEW ~218 LOC)

No Lean edits, no proofs/ changes, no problem.md edits, no knowledge.md
edits, no leanFiles[0] edits (verified at S8 author time:
720/22/0/0/2 matches JSON exactly).

Slug remains COMPLETED - verified, axiom-free, sorry-free per state.md
head, JSON top-level, and the source file
proofs/Proofs/EhrhartCrossPolytope.lean (720 LOC, 22 thm, 0 sorries,
0 axioms, 2 defs).

Co-authored-by: Robb Walters <r.j.walters@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

research Research agent work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant