partitionFn
plain-language theorem explainer
The Gibbs partition function for a discrete virtue-action set is the sum of Boltzmann weights under a recognition-temperature policy. Anyone wiring the RS-to-RL bridge cites it as the normalizer for thermodynamic action probabilities and free energy. The body is a one-line list map-and-sum of the policy weight at a fixed moral state.
Claim. For a Gibbs policy $g$ with recognition temperature $T_R>0$ and cost $J$, a moral state $s$, and a finite list $A$ of virtue actions, the partition function is $Z_g(s,A):=\sum_{a\in A} w_g(s,a)$, where $w_g(s,a)$ is the policy Boltzmann weight of action $a$ in state $s$.
background
The RS→RL bridge treats Recognition Science as already-specified control theory. A moral state carries reciprocity skew σ, energy budget, value functional, and max harm. A virtue action is a 14-coefficient vector over the DREAM-complete minimal generators; the policy explores in that basis, not raw moves.
A Gibbs policy packages a positive recognition temperature $T_R$ and a cost $J(s,a)$, with unnormalized weights of Boltzmann form $p(a|s)\propto\exp(-J(s,a)/T_R)$. The module states this is the RS thermodynamic rule, equivalent to soft actor-critic / maximum-entropy RL but grounded in the RS cost rather than an ad-hoc entropy bonus.
Design separates propose (policy) from project (LACompletion onto the σ=0 feasible set) and evaluates over undiscounted eight-tick windows forced by T6 minimality.
proof idea
Pure definition: map each virtue action through the policy weight at the given moral state, then take the real sum of that list. No lemmas, no tactics; List.map of g.weight s followed by List.sum.
why it matters
This is the normalizer that makes the discrete Gibbs law a probability and that enters free energy. Downstream, action probability is weight over partition function, and free energy is $F_R=-T_R\log Z$. The positivity theorem for nonempty action lists (and its RL-goal wrapper) depends on this def so that division and log are well-defined.
In the framework it anchors the thermodynamic-learning clause of the RS→RL bridge: admissible exploration is the Gibbs distribution on virtue coefficients, not an arbitrary softmax. It sits beside the eight-tick cadence and the lexicographic feasible→harm-minimax→value→robustness selector, translating RS cost structure into trainable RL machinery without inventing a separate discount schedule.
Switch to Lean above to see the machine-checked source, dependencies, and usage graph.