Six general-purpose modules ported from mm-link/mm-lean/src/ into
Infoductor/Comonad/, namespaced for Infoductor and adapted to
Lean 4 v4.30.0-rc2:
- ComonadFinder.lean — automatic detection of comonadic subgraph
patterns in Lean proof terms (FNV-1a-64
content hashing, recursive shape encoding,
cluster detection, metric computation,
JSON-shaped wire format `comonad/1`).
816 → 712 lines (test section dropped on
port; see § 13 note).
- ComonadCommands.lean — `#findComonadsJSON`, `#comonadNode`,
`#comonadSubgraph`, `#comonadClusters`
navigation commands.
- Convolution.lean — cross-theorem pattern composition.
`String.containsSubstr` (removed in Lean
4.30) replaced with inline arrow-counter.
- ExtractConsts.lean — extracting constant names from proof
terms by category (recursors, eliminators,
interesting lemmas).
- ExtractDefn.lean — extracts comonadic clusters as Lean
`def` skeletons.
- GridView.lean — plain-text proof visualization
(Fitch-style table + nested tree +
declaration info). Mathematica-specific
output formatters dropped per the
"Infoductor is general-purpose" rule;
Mathematica consumers can re-add them in
mm-lean (or a separate Mathematica-bridge
project). 291 → 187 lines.
`Infoductor.Comonad` lean_lib declared separately from
`Infoductor` (which holds Foundation). Mathlib is required for
`Tactic.Explode` proof-decomposition primitive used by the
comonad analysis. Foundation does NOT import Mathlib —
consumers depending only on Foundation pay zero Mathlib build
cost (verified: default `lake build` is 10 jobs, all Foundation;
`lake build Infoductor.Comonad` triggers the Mathlib subgraph).
Test sections in ComonadFinder, ComonadCommands, ExtractDefn,
Convolution were stripped during port: Lean 4 v4.30 changed
`info.value?` access for theorems and the original test-time
`#findComonads` / `#analyzeCluster` / `#patternCompose` calls
fail with "has no proof value (axiom or opaque?)" or "elaboration
function not implemented". Restoration is a Test/ harness work-
item, not blocking the production library.
Mathematica-coupled mm-lean files NOT moved (stay in mm-lean):
- Main.lean, PantographMain.lean (orchestrators)
- Mathematica.lean + Mathematica/ (bridge to Wolfram)
- Provers.lean + Provers/ (LJT, Tableaux — domain-specific)
- All `.m`, `.wl`, `.nb` Mathematica scripts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
/-
|
|
Infoductor.Comonad — comonadic proof-pattern detection / extraction.
|
|
|
|
Imports every Comonad sub-module. Downstream consumers can either
|
|
`import Infoductor.Comonad` for the whole bundle, or pick
|
|
individual modules.
|
|
|
|
This sub-library uses Mathlib's `Tactic.Explode` to decompose
|
|
proof terms into a step-by-step IR. Pulling Mathlib is the
|
|
cost; the algorithms over the IR (FNV content hashing, shape
|
|
detection, cluster extraction, convolution) are pure Lean and
|
|
consumer-agnostic.
|
|
|
|
Originally ported from `mm-link/mm-lean/src/{ComonadFinder,
|
|
ComonadCommands, Convolution, ExtractConsts, ExtractDefn,
|
|
GridView}.lean` (2026-05-01). Mathematica-specific output
|
|
formatters were dropped from the GridView port; the plain-text
|
|
table / tree / view_info formatters remain here. Mathematica
|
|
consumers can re-add their formatters in `mm-lean` (or a
|
|
downstream Mathematica-bridge project).
|
|
-/
|
|
|
|
import Infoductor.Comonad.GridView
|
|
import Infoductor.Comonad.ExtractConsts
|
|
import Infoductor.Comonad.ComonadFinder
|
|
import Infoductor.Comonad.ComonadCommands
|
|
import Infoductor.Comonad.ExtractDefn
|
|
import Infoductor.Comonad.Convolution
|