crosslang/Common.lean
Maximus Gorog a0b719e170 Initial commit: Common — cross-language abstraction over TGC, TOC, TSM.
A new Lake project with path dependencies on the three sibling kernels
(golang-lean, octive-lean, tsm-lean). Provides typeclass abstractions
that capture what's structurally shared.

Common/ — three files:

  Lang.lean — two typeclasses:
    BigStepLang: Term, Value, State, Eval, deterministic.
                 Captures TGC's and TOC's big-step shape.
    SmallStepLang: State, step.
                   Captures TSM's small-step shape (determinism is
                   automatic from `step` being a function).
    Generic theorems exported once:
      BigStepLang.unique_value, BigStepLang.unique_state
      SmallStepLang.step_deterministic
    Plus a `CompileCorrect` structure for substrate-projection
    theorems (the categorical kernel of CompCert-style results).

  Instances.lean — three instances:
    TGCLang : BigStepLang   (State := Heap × Env)
    TOCLang : BigStepLang   (State := Env)
    TSMLang : SmallStepLang (State := TSM.State)
    Each instance bridges the local kernel's existing
    `BigStep`/`step` + `deterministic` proof into the typeclass.

  Demo.lean — three application examples:
    The SAME `BigStepLang.unique_value` theorem applied to TGC and
    TOC; `SmallStepLang.step_deterministic` to TSM. One abstract
    definition, three concrete payoffs.

The factoring is real: any new theorem stated over the typeclasses
applies to all instances. Future theorems (compilation correctness,
type soundness, simulation) can be expressed abstractly and proved
once.

Zero sorries / axioms / admits across all four projects.
2026-05-10 06:52:25 -06:00

3 lines
62 B
Text

import Common.Lang
import Common.Instances
import Common.Demo