Finite Record Constraints — Definitions
DefinitionAPFPaper1_RecordConstraintsA finite response signature carrying a unit, retained products, linear and order relations, sharp/effect typing, preparation equivalence, convex preparation mixtures and behavior; valid responses and joint state families; finite faithful record realization; profile reduction; and the full finite set of structurally admissible Boolean assignments. Finiteness of the atom carrier is existential in the general model. Boolean specialization is limited to the all-sharp theorem.
import Definitions.Def_APFPaper1_ProbabilityTransport
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.Pi
set_option autoImplicit false
open scoped BigOperators
namespace APFPaper1.RecordConstraints
structure Signature (W P : Type) [Fintype W] [Fintype P] where
unit : W
products : Finset (W × W × W)
linearRelations : Finset (W → ℝ)
orderRelations : Finset (W × W)
sharp : Finset W
effects : Finset W
preparationRelation : Setoid P
mixtures : Finset (P × (P → ℝ))
mixture_nonnegative : ∀ m ∈ mixtures, ∀ p, 0 ≤ m.2 p
mixture_mass : ∀ m ∈ mixtures, ∑ p, m.2 p = 1
behavior : P → W → ℝ
def ValidResponse {W P : Type} [Fintype W] [Fintype P] (D : Signature W P)
(r : W → ℝ) : Prop :=
r D.unit = 1 ∧
(∀ t ∈ D.products, r t.1 = r t.2.1 * r t.2.2) ∧
(∀ c ∈ D.linearRelations, ∑ w, c w * r w = 0) ∧
(∀ t ∈ D.orderRelations, r t.1 ≤ r t.2) ∧
(∀ w ∈ D.sharp, r w * r w = r w) ∧
(∀ w ∈ D.effects, 0 ≤ r w ∧ r w ≤ 1)
def JointStateFamily {W P A : Type} [Fintype W] [Fintype P] [Fintype A]
(D : Signature W P) (ρ : W → A → ℝ) (p : P → A → ℝ) : Prop :=
(∀ s a, 0 ≤ p s a) ∧
(∀ s, ∑ a, p s a = 1) ∧
(∀ s t, D.preparationRelation.r s t → p s = p t) ∧
(∀ m ∈ D.mixtures, p m.1 = fun a => ∑ s, m.2 s * p s a) ∧
(∀ s w, ∑ a, p s a * ρ w a = D.behavior s w)
def ValidModel {W P A : Type} [Fintype W] [Fintype P] [Fintype A]
(D : Signature W P) (ρ : W → A → ℝ) (p : P → A → ℝ) : Prop :=
(∀ a, ValidResponse D (fun w => ρ w a)) ∧ JointStateFamily D ρ p
def Faithful {W A : Type} (ρ : W → A → ℝ) : Prop := Function.Injective ρ
def Reduced {W A : Type} (ρ : W → A → ℝ) : Prop :=
Function.Injective (fun a => fun w => ρ w a)
def booleanValues {W : Type} (b : W → Bool) (w : W) : ℝ := if b w then 1 else 0
def BooleanAtoms {W P : Type} [Fintype W] [Fintype P] (D : Signature W P) :=
{b : W → Bool // ValidResponse D (booleanValues b)}
noncomputable instance booleanAtomsFintype {W P : Type} [Fintype W] [Fintype P]
(D : Signature W P) : Fintype (BooleanAtoms D) := by
classical
unfold BooleanAtoms
infer_instance
def booleanResponse {W P : Type} [Fintype W] [Fintype P]
(D : Signature W P) (w : W) (b : BooleanAtoms D) : ℝ := booleanValues b.1 w
def FiniteRealization {W P : Type} [Fintype W] [Fintype P] (D : Signature W P) : Prop :=
∃ (A : Type) (_ : Fintype A) (ρ : W → A → ℝ) (p : P → A → ℝ),
ValidModel D ρ p ∧ Faithful ρ
end APFPaper1.RecordConstraints
Read-back
What the Lean code literally says, in plain math · Codex (GPT-6)
Blind mathematical read-backs
Auditor model identity exposed in this task: GPT-6. No more specific backend model identifier is exposed.
Signature. For types and , each equipped with a finite enumeration, a signature is a record containing a distinguished element ; finite sets , , , and ; an equivalence relation on ; a finite set ; and an arbitrary function . The record also contains proofs that, for every , one has for every and . There are no further conditions on these data: in particular, no equations or inequalities involving are part of this record. The element forces to be nonempty. The type may be empty, in which case is empty and its two conditions are vacuous; all the other listed finite sets may also be empty.
ValidResponse. Let be types with finite enumerations, and let be a record comprising , finite sets , , , , an equivalence relation on , a finite set of pairs with , , and , and a function . For any function , this predicate is the conjunction of the following requirements: ; for every ; for every ; for every ; for every ; and for every . The equivalence relation, mixtures, and function impose no additional conditions in this predicate. Each condition indexed by an empty finite set is vacuous. The existence of excludes empty , but may be empty; values of have no bounds or idempotence requirements except those imposed by the displayed conditions.
JointStateFamily. Let be types with finite enumerations. Let contain , finite sets , , , , an equivalence relation on , a finite set whose pairs satisfy for every and , and a function . Given functions and , this predicate requires for all ; for every ; equality of the entire functions whenever ; for every and every ; and for every . The data impose no further conditions in this predicate, and there are no separate sign or size restrictions on . The type is nonempty because exists. If is empty then is empty and every requirement is vacuous; if is nonempty and is empty then the normalization requirement reads and cannot hold. If is empty its mixture requirement is vacuous.
ValidModel. Let be types with finite enumerations. Let comprise , finite sets , , , , an equivalence relation on , a finite set of pairs with , , for every , and , and a function . For functions and , this predicate requires, for every , all of , for , for , for , for , and for . It further requires for all , for every , whenever , for every and every , and for every . Neither injectivity of nor injectivity of is required. The type is necessarily nonempty. Empty indexing sets give vacuous conditions; if both and are empty the whole predicate holds, whereas if is nonempty and is empty it cannot hold because normalization would require .
Faithful. For arbitrary types and any function , with no finiteness assumptions, this predicate means that the map from to the set of real-valued functions on is injective. Explicitly, for every , if for every , then . No sign, normalization, or other equations for are assumed or required. If has at most one element the predicate holds for every ; if is empty the predicate holds exactly when has at most one element, since equality of the functions on the empty type is automatic.
Reduced. For arbitrary types and any function , with no finiteness assumptions, this predicate means that the map from to the set of real-valued functions on is injective. Explicitly, for every , if for every , then . No sign, normalization, or other equations for are assumed or required. If has at most one element the predicate holds for every ; if is empty it holds exactly when has at most one element, since equality of the functions on the empty type is automatic.
booleanValues. For any type , with no finiteness assumption, a function , and an element , this definition returns the real number if and the real number if . Thus it turns a Boolean-valued function into its real-valued – function. When is empty there is still a unique Boolean-valued function and a unique corresponding real-valued function on , but there is no element at which to evaluate it.
BooleanAtoms. Let be types with finite enumerations, and let consist of , finite sets , , , , an equivalence relation on , a finite set of pairs with , , and , and a function . This definition forms the type of Boolean-valued functions equipped with a proof of the following conditions, where is the real number for and otherwise: ; for every ; for every ; for every ; for every ; and for every . The last two conditions hold automatically for these – values but are included in the defining predicate. The equivalence relation, mixtures, and add no conditions here. Empty finite sets contribute vacuous requirements; is nonempty because of , may be empty, and this type of Boolean functions may itself be empty because its remaining requirements need not have a simultaneous solution.
booleanAtomsFintype. For any types equipped with finite enumerations and any record containing , finite sets , , , , an equivalence relation on , a finite set of pairs with , , and , and a function , this noncomputable instance supplies a finite enumeration of the following type: Boolean functions on equipped with proofs that their real-valued indicators , defined as on true and on false, satisfy , for , for , for , for , and for . The equivalence relation, mixtures, and enter no additional membership conditions. The enumeration includes exactly the Boolean functions satisfying these conditions; it need not contain any elements, since no existence of such a function is asserted. The ambient type is nonempty because of , may be empty, and requirements indexed by empty finite sets are vacuous.
booleanResponse. Let be types with finite enumerations, and let contain , finite sets , , , , an equivalence relation on , a finite set of pairs with , , and , and a function . Given and a Boolean function equipped with a proof that its real indicator satisfies , for , for , for , for , and for , this definition returns : the real number if is true and if it is false. The proof carried by imposes these admissibility conditions; the returned value uses only its underlying Boolean function. The equivalence relation, mixtures, and impose no further conditions on or on the returned value. The type is nonempty, may be empty, and if there is no Boolean function satisfying the stated requirements then there is no permissible argument .
FiniteRealization. Let be types equipped with finite enumerations, and let consist of , finite sets , , , , an equivalence relation on , a finite set of pairs with , , for every , and , and a function . This predicate asserts the existence of a type , a finite enumeration of , and functions and such that the following all hold: for every , , for , for , for , for , and for ; for all , ; for every , ; whenever ; for every and every ; for every ; and for every , equality for all implies . There is no uniqueness requirement for these witnesses, no specified bound on the size of , and no injectivity requirement for . The type is nonempty because exists. Empty indexing sets produce vacuous conditions, and the quantified type is allowed to be empty: an empty can witness this predicate exactly when is empty and has one element, because its normalization conditions then are vacuous and its required injectivity reduces to having at most one element.