Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Aether Catalog definitions — Bridges_ThermodynamicStonePrimeCompleteness

Definition
Bridges_ThermodynamicStonePrimeCompleteness

by raver1975 · Sep 16, 2026 · Mathlib c5ea003 (Lean v4.30.0)

aether-catalogbridges

Definition bundle for the Aether Catalog module Bridges.ThermodynamicStonePrimeCompleteness, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.

Definition code
-- Def bundle generated from Bridges/ThermodynamicStonePrimeCompleteness.lean by skeleton subtraction
import Mathlib
/-
Copyright (c) 2025. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.

# Thermodynamic Stone–Prime Completeness for Closure-Generated Proof Semirings
# via Free-Energy Separation

This file establishes a completeness theorem connecting derivability in a
proof semiring to validity across all thermodynamic/Lawvere valuation states
on the prime congruence spectrum.

## Main results

* `thermodynamic_stone_prime_completeness` — derivability is equivalent to
  universal thermodynamic validity across all prime points and inverse temperatures.
* `thermodynamic_prime_separation` — non-derivability yields a separating
  prime point together with a quantitative free-energy gap.
* `nonderivable_has_positive_freeEnergyGap` — the separation witness has
  strictly positive free-energy defect.
* `finite_temperature_countermodel_search` — algorithmic countermodel
  extraction when the prime spectrum is finite.
* `finite_grid_countermodel_search` — countermodel extraction over finite
  prime × temperature grids.

## Mathematical overview

The key conceptual innovation is the unification of three semantic regimes:

1. **Prime spectral semantics**: geometric witnesses of non-derivability via
   prime points in the congruence spectrum.
2. **Lawvere/max-plus semantics**: entailment as quantitative order comparison
   under enriched valuations.
3. **Thermodynamic semantics**: introduction of inverse temperature β and
   free energy, importing variational principles into proof theory.

The completeness theorem shows that proof failure is detectable as a strictly
positive free-energy defect at a prime state — a quantitative energetic
separation that upgrades classical Stone duality from a static representation
theorem to a variational semantics of proof.

## References

* Stone, M.H. — The theory of representations for Boolean algebras (1936)
* Lawvere, F.W. — Metric spaces, generalized logic, and closed categories (1973)
-/


/-!
## Thermodynamic State and Evaluation
-/

/-- A thermodynamic state packages a prime point with a non-negative
inverse temperature β. This represents a point in the product of the
prime congruence spectrum with the temperature half-line [0, ∞). -/
structure ThermoState (S P : Type*) where
  /-- The prime point in the congruence spectrum -/
  point : P
  /-- Inverse temperature parameter -/
  beta : ℝ
  /-- Inverse temperature is non-negative -/
  beta_nonneg : 0 ≤ beta

/-- Thermodynamic evaluation combining a base Lawvere valuation with
an energy term scaled by inverse temperature β.

Given a base evaluation `baseEval : P → S → ℝ` (the Lawvere valuation
at zero temperature) and an energy function `energy : P → S → ℝ`,
the thermodynamic evaluation at state ω is:

  F(ω, x) = baseEval(ω.point, x) + ω.beta * energy(ω.point, x)

This models the free-energy functional from statistical mechanics,
where β controls the trade-off between the "entropic" base valuation
and the "energetic" contribution. -/
def thermoEval
    {S P : Type*} [Semiring S]
    (baseEval : P → S → ℝ)
    (energy : P → S → ℝ)
    (ω : ThermoState S P)
    (x : S) : ℝ :=
  baseEval ω.point x + ω.beta * energy ω.point x

/-!
## Primary Semantic Predicates
-/


/-- Parameterized thermodynamic validity with explicit prime point and
inverse temperature. This is the primary form used in the completeness
theorem. -/
def ThermoValidβ
    {S P : Type*} [Semiring S]
    (eval : P → ℝ → S → ℝ)
    (x y : S) : Prop :=
  ∀ p : P, ∀ β : ℝ, 0 ≤ β → eval p β x ≤ eval p β y

/-!
## Free-Energy Gap
-/

/-- The free-energy gap measures the quantitative separation between
two elements at a given thermodynamic state. A positive gap at some
state witnesses non-derivability.

  FreeEnergyGap(p, β, x, y) = eval(p, β, x) - eval(p, β, y)

When this is strictly positive, the state (p, β) separates x from y:
the evaluation of x strictly exceeds that of y, witnessing that x ≤ y
fails at this thermodynamic point. -/
def FreeEnergyGap
    {S P : Type*} [Semiring S]
    (eval : P → ℝ → S → ℝ)
    (p : P) (β : ℝ) (x y : S) : ℝ :=
  eval p β x - eval p β y

/-!
## Key Bridge Lemmas

These lemmas form the technical core connecting the Stone/Lawvere semantics
with the thermodynamic deformation.
-/

section BridgeLemmas

variable {S P : Type*} [Semiring S]









end BridgeLemmas

/-!
## Completeness from Soundness and Separation

The central meta-theorem: given soundness and separation, completeness follows.
This is parameterized over arbitrary derivability relations and evaluation
functions, making it applicable to any proof semiring with thermodynamic semantics.
-/

section Completeness

variable {S P : Type*} [Semiring S]


end Completeness

/-!
## Thermodynamic Prime Separation
-/

section Separation

variable {S P : Type*} [Semiring S]



end Separation

/-!
## Quantitative Free-Energy Gap Corollary
-/

section FreeEnergyGapResults

variable {S P : Type*} [Semiring S]



end FreeEnergyGapResults

/-!
## Zero-Temperature Specialization

When the thermodynamic semantics extends a base Stone/Lawvere semantics and
separation is available at zero temperature, we obtain completeness as a
special case. This is the most common instantiation.
-/

section ZeroTemperature

variable {S P : Type*} [Semiring S]



end ZeroTemperature

/-!
## Finite/Coherent Fragment: Algorithmic Countermodel Extraction
-/

section FiniteSearch

variable {S P : Type*} [Semiring S]



end FiniteSearch

/-!
## Concrete Instantiation: Additive Thermodynamic Evaluation

We provide a concrete instantiation of the thermodynamic evaluation using
the additive free-energy formula `F(p, β, x) = baseEval(p, x) + β * energy(p, x)`.
-/

section ConcreteInstantiation

variable {S P : Type*} [Semiring S]

/-- The additive thermodynamic evaluation function. -/
noncomputable def additiveThermoEval
    (baseEval : P → S → ℝ)
    (energy : P → S → ℝ)
    (p : P) (β : ℝ) (x : S) : ℝ :=
  baseEval p x + β * energy p x




end ConcreteInstantiation

/-!
## Monotonicity and Functoriality
-/

section Monotonicity

variable {S P : Type*} [Semiring S]



end Monotonicity

/-!
## ThermoValidβ is equivalent to the completeness condition

This section shows that `ThermoValidβ` is exactly the right-hand side
of the completeness biconditional, providing a clean API.
-/

section API

variable {S P : Type*} [Semiring S]



end API

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me