Repository navigation
feat(persistence): execute the Rips simplex list of an integer distance table (#1009) - #1010
Conversation
…ce table (#1009) Add TDA.Persistence.Reduction.RipsInput: DistanceTable with a decidable Valid, the integer diameter, the executed list ripsInput in the FiniteInput format (ordered by grade, cardinality and label order), ripsInput? and ripsRun, which return none for an invalid table. The list satisfies FiniteInput.Valid for every table; for a valid table its faces and grades are identified with Rips.fullComplex and Rips.filter of the table metric. The diagram comparison is not part of this unit (#922, part 1). Fixtures in RipsInputExamples, pins appended, docs/api.md, docs/math/finite-ph-computation.md and CHANGELOG.md updated. Two carried-over wording fixes in docs/math/mapper.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RfoZqCRSgoUin4otWc6fXL
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Reviewed-by: claude-opus read-only reviewer (session distinct from the implementer) Reviewed head: Verdict: pass with non-substantive notes. No substantive findings. Findings
What I checked
Not doneI did not run Generated by Claude Code |
Closes #1009
Summary
First unit of #922: the executable half. An integer distance table on the labels
Fin Nis validated as a metric and turned into the complete Rips simplex list in the format ofFiniteInput.TDA/Persistence/Reduction/RipsInput.lean:DistanceTable Nwith a decidableValid(nonnegative entries, symmetry, zero diagonal, positive distance between distinct labels, every triangle inequality); the integerdiameter; the enumerationfaceLists; the executed listripsInput, ordered by grade, then cardinality, then lexicographically in the increasing label lists;ripsInput?andripsRun, which returnnonefor an invalid table. Nothing is repaired and no metric certificate is supplied by the caller.ripsInput_validproves the five conditions of the existingFiniteInput.Valid, for every table.mem_ripsInput,ripsInput_pairwise,nodup_faces_ripsInputandlength_ripsInputdescribe the entries, their order and their number2 ^ N - 1.metricis the metric on the labels,cast_diameteridentifies the integer diameter withRips.diameter,complex_ripsInputidentifies the represented complex with the image ofRips.fullComplex (Fin N), andgradeFilter_ripsFaceidentifies the grade read byFiniteInput.gradeFilterwith the value ofRips.filter.ripsRunreturns the occurrence records of the existing reduction on the list and does not validate the list again (ripsRun_eq_bind_run).TDA/Persistence/Reduction/RipsInputExamples.lean, routed throughTDA/Persistence/Examples.lean: the complete value ofripsInput?for no label, one label, two labels, a tied table, a line and its relabelling, and the four-cycle (15 entries);ripsRunfor no label, one label and two labels; five kinds of invalid table returningnone; the grade of a diagonal of the four-cycle transferred to the actualRips.filter.O(N² 2 ^ N)label and integer operations; the cost of the existing reduction is separate, not bounded here and at least quadratic in the number of faces.docs/api.md, a new section indocs/math/finite-ph-computation.md, and aCHANGELOG.mdUnreleased entry.docs/math/mapper.md, subsection "Executable incidence extraction":extractReebDataIsois now said to composegraphPLExtractIsowith the inverse ofreebDataIso, and the sentence on the validation cost comes before the clause saying the counts are documented, not proved.Branch lifecycle
Ordinary develop topic based on
f726ed2ff9304852411d2907021d3a0ef8ed5123, targetdevelop, squash merge. Target scope: metric computation under #922 / #227. Release version: undecided. Propagation: N/A.Public declarations added / changed
Added in
TDA.Persistence.Reduction(all in the contract of #1009):DistanceTable,DistanceTable.Valid,DistanceTable.instDecidableValid,DistanceTable.metric,metric_distdiameter,diameter_le_iff,diameter_nonneg,dist_le_diameter,diameter_mono,diameter_singleton,cast_diameterfaceLists,mem_faceLists,nodup_faceListsentry,entries,ripsInput,ripsInput?,ripsRunripsInput?_eq_some_iff,ripsInput?_eq_none_iff,ripsRun_eq_some_iff,ripsRun_eq_none_iffmem_ripsInput,mem_faces_ripsInput,mk_mem_ripsInput,ripsInput_pairwise,nodup_faces_ripsInput,length_ripsInputripsInput_valid,ripsRun_eq_bind_runmem_complex_ripsInput,complex_ripsInput,ripsFace,ripsFace_val,ripsFace_bijective,gradeFilter_ripsFace_eq_diameter,gradeFilter_ripsFaceAdded in
TDA.Persistence.Reduction.RipsInputExamples: the fixturesempty,single,pair,pairInput,edgeMatrix,tied,line,relabelled,fourCycle,diagonal,oneWay,merged,shortcut,loop,negativeand their checked statements (43 declarations).Nothing beyond the contract was added to the library module: its public declarations are exactly those of the contract block, and its helpers are private. No listed statement changed. No existing public declaration changed. All 82 new public declarations are pinned by appending to
scripts/print_axioms/Persistence.lean.Source ↔ Lean correspondence
Library-derived; no external source. Governing specification #922, statement contract #1009. The statements of the contract were checked before admission by an independent read-only reviewer, who elaborated the contract block against the base and proved or argued each statement independently; the record is in the Admission section of #1009. The Lean signatures in this PR are those of the contract. Added after that review: only the fixture names and statements of the examples module, which follow the fixture list of the Acceptance section; as the reviewer advised, the examples do not evaluate the relation of
ripsInput_pairwisein the kernel and check the order through the complete value of each list.Conventions: the labels
0, …, N - 1are transported into the vertex typeℕofFiniteInputbyFin.valEmbedding, and no metric onℕis introduced.diameterfolds over all ordered pairs with seed0, asRips.diameterdoes. Nonnegativity is redundant inValidand kept because #922 lists it.Validation
4e2a7412faedb415cb70ae2d0bd216c9bb230074, basef726ed2ff9304852411d2907021d3a0ef8ed5123.scripts/check.shon the tree of this head:CHECK OK.AXIOM AUDIT OK — 13795 declaration(s)(base 13713)PRIVATE AUDIT — 10559(base 10536)COVERAGE OK — 11079public theorems, all pinned (base 11024)scripts/check.sh --incremental): green; the push was made without bypassing it.checkfor this head: success — https://github.com/uda-lab/tda-lib/actions/runs/44724913333/job/136249757023 (conclusion read from the check run of head4e2a7412faedb415cb70ae2d0bd216c9bb230074; its log was not re-read for the counts, which are those of the local run above).ripsRunis kernel-checked up to two labels, and the four-cycle occurrence records are not checked in this unit.Remaining sorry / custom-axiom footprint
None.
Independent review evidence
4e2a7412faedb415cb70ae2d0bd216c9bb230074: pass with non-substantive notes — feat(persistence): execute the Rips simplex list of an integer distance table (#1009) #1010 (comment) . Its two wording notes (docs/api.md: a module name that reads like a declaration;docs/math/finite-ph-computation.md: sayFiniteInput.Validwhere "the five conditions ofValid" is meant) were not acted on, so the reviewed head is the head evaluated above; they are carried into the next unit of [Metric computation] Generate certified Rips simplex input from integer distances #922.