Repository navigation
Expand file tree
/
Copy pathnotation.py
More file actions
870 lines (827 loc) · 77.4 KB
/
Copy pathnotation.py
File metadata and controls
870 lines (827 loc) · 77.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
"""Single catalog for manuscript symbols and symbolic equation expansion."""
import re
from dataclasses import dataclass, replace
from fractions import Fraction
from typing import Final
from .analytic_witnesses import (
CONSTANT_MULTIPLIER,
FOCAL_WEIGHT,
INITIAL_FREQUENCY,
MEAN_CENSUS,
OTHER_WEIGHT,
VARIABLE_MULTIPLIERS,
finite_mean,
growth_ranking,
)
from .probability import ProbabilityError
from .rg_memory_design import SLIP_RESOLVED, SLIP_UNRESOLVED
@dataclass(frozen=True, slots=True)
class Symbol:
"""A TeX symbol with its mathematical interpretation and domain."""
key: str
tex: str
meaning: str
domain: str
index: str = ""
orientation: str = ""
units: str = ""
_SYMBOL_DATA: Final = r"""g | g | Inherited ancestor type | Finite type index
h | h | Descendant type | Finite type index
s | s | Current hidden state | Finite state index
next_s | s' | Next hidden state | Finite state index
o | o | Observed outcome | Finite outcome index
next_o | o' | Predicted outcome | Finite outcome index
a | a | Action | Finite action index
b | b | Alternative action | Finite action index
world_A | A^* | World observation kernel | Outcomes by states; column stochastic
world_B | B^* | World transition kernel | Next state by state by action; column stochastic
rho | \rho | World initial law | State simplex
A | A_g | Agent likelihood | Outcomes by states; column stochastic
B | B_g | Agent transition kernel | Next state by state by action; column stochastic
D | D_g | Agent initial belief | State simplex
utility | c_g | Raw preference utilities | Real outcome vector
C | C_g | Normalized outcome preferences | Strictly positive outcome simplex
d | d | Prior at observation update | State simplex
q | q | Recognition belief or comparison law | Simplex on the stated carrier
posterior | q_g | Posterior conditioned on observed outcome | State simplex; positive evidence required
Z | Z_g | Observation evidence | Positive probability
predictive | Q_a | Action-conditioned predictive law | State, outcome, or joint simplex as specified
F | F_g | Variational free energy | Extended real nats
G | \mathcal G_g | Single-step expected free energy | Finite real nats
policy | \pi_g | Single-step action distribution | Action simplex
precision | \gamma | Action precision | Finite nonnegative inverse nats
R | R | Offspring multiplier | Positive state by action array
cost | k | Action cost | Real log-growth units
growth | \ell_g | Expected episode log growth | Real log offspring factor
weight | w | Reproductive weight | Nonnegative type vector with positive population mean
weight_g | w_g | Type reproductive weight | Nonnegative scalar
mean_weight | \bar w | Population mean reproductive weight | Positive scalar
p | p | Population or fine-scale probability law | Simplex on the stated carrier
p_g | p_g | Ancestor type frequency | Unit interval
selected | p_g^{\mathrm{sel}} | Selected ancestor frequency | Unit interval
next_frequency | p_h^{\mathrm{next}} | Descendant frequency after transmission | Unit interval
M | M_{hg} | Transmission probability from ancestor to descendant | Column-stochastic type kernel entry
population | N | Haploid population size | Positive integer
parent_group | J_{\mathrm{grp}} | Observed grouping of ancestors | Finite group label under the ancestral law
ancestral_count | k_{\mathrm{anc}} | Current number of focal-type individuals | Integer from zero through census size
descendant_count | k_{\mathrm{off}} | Descendant number of focal-type individuals (finite count process) | Integer from zero through census size
focal_parent_probability | q(k_{\mathrm{anc}}) | Focal-type probability in a descendant draw | Unit interval; conditional on the stated reproduction law
census_history | H_{\mathrm{eco}} | Realized shared cues, actions and following resource | Finite history given the current resource and count
history_parent_probability | q_H | Focal-type parent probability given the shared history | Unit interval after normalizing external reproductive weights
census_indicator | Y | Focal-type indicator for a descendant slot | Bernoulli given a reproductive history
descendant_fraction | f_{\mathrm{off}} | Focal type fraction after the census | Between zero and one
mean_history_probability | \bar q_H | Mean parent probability across shared histories | Unit interval under the current census state
z | z | Ancestor trait | Real type vector
descendant_z | z' | Mean assigned descendant trait | Real type vector
mean_z | \bar z | Population trait mean | Real scalar
mean_vector_z | \bar{\mathbf z} | Population mean trait vector | Real trait vector
genetic_covariance | \mathbf G | Additive genetic covariance | Symmetric positive-semidefinite trait matrix
gradient | \boldsymbol\beta | Relative-fitness gradient | Real inverse-trait vector
T | T | Stochastic coarse graining | Coarse by fine column-stochastic matrix
coarse_weight | \widetilde w | Proposed coarse reproductive weights | Nonnegative coarse vector
entropy | H | Shannon entropy | Nats on a finite simplex
information | I | Mutual information | Nonnegative nats
kl | D_{\mathrm{KL}} | Kullback-Leibler divergence | Extended nonnegative nats
expectation | \mathbb E | Expectation under indicated law | Integrable functions
covariance | \operatorname{Cov} | Population-weighted covariance | Finite second moments
selection_operator | \operatorname{Sel} | Normalized reproductive reweighting | Simplex and admissible weight vector
horizon | \mathcal T_{\mathrm{hor}} | Remaining planning horizon | Positive integer bounded by implementation
discount | \delta | Continuation discount | Unit interval
action_value | J | Cumulative single-step EFE action value | Real nats indexed by remaining horizon
value | V | Policy-weighted continuation value | Real nats indexed by remaining horizon
tree_policy | \pi | Recursive action distribution | Action simplex indexed by remaining horizon
bayes_operator | \operatorname{Bayes} | Condition predicted state on outcome | Belief, action, supported outcome to state simplex
alpha | \alpha | Dirichlet likelihood concentrations | Strictly positive outcomes by states matrix
updated_alpha | \alpha^+ | Updated Dirichlet concentrations | Strictly positive outcomes by states matrix
counts | n | Observed-state outcome counts | Nonnegative integer outcomes by states matrix
soft_counts | \widetilde n | Approximate fractional outcome counts | Nonnegative real outcomes by states matrix
beta_function | \mathrm B | Multivariate beta function | Positive concentration column to positive scalar
sequence | \mathcal D | Ordered observed outcome and state labels | Finite labeled sequence
likelihood | P | Probability of sequence conditional on state labels | Unit interval
replicates | n_{\mathrm{rep}} | Independent Monte Carlo replicate count | Integer greater than one
i | i | Replicate index | Integers from one through replicate count
sample | X | Monte Carlo replicate value | Finite real scalar or trait coordinate
mean | \bar X | Monte Carlo sample mean | Real scalar or trait coordinate
sd | \widehat\sigma | Sample standard deviation | Nonnegative; sample-value units
mcse | \operatorname{MCSE} | Monte Carlo standard error of the mean | Nonnegative; sample-value units
left | X^{\mathrm{left}} | Left condition replicate | Real value with justified within-row pairing
right | X^{\mathrm{right}} | Right condition replicate | Real value with justified within-row pairing
difference | D | Paired left-minus-right replicate | Real scalar or trait coordinate
mean_difference | \bar D | Mean paired effect | Real scalar or trait coordinate
bootstrap_mean | \bar D^* | Mean of resampled paired differences | Conditional bootstrap distribution
quantile | \operatorname{Quantile} | Quantile under indicated empirical law | Unit-interval probability to real value
breeder_response | R_{\mathrm{breed}} | Univariate response to selection | Real trait units
heritability | h^2 | Narrow-sense heritability | Unit interval under justified additive inheritance model
selection_differential | S | Phenotypic selection differential | Real trait units
time | t | Trajectory time | Real time coordinate
trajectory | x_t | State on a single trajectory | Specified state space
trajectory_integrand | f | Function integrated along a trajectory | Integrable real function
path_weight | W | Functional of an entire path | Integrable path functional
path_law | P_{\mathrm{path}} | Probability law on paths | Specified path measure
lineage_divisions | d_{\mathrm{div}} | Number of divisions along a root-to-leaf path | Nonnegative integer
lineage_leaves | N_{\mathrm{leaf}} | Terminal leaf count in a realized tree | Positive integer for a nonempty census
path | \chi | Full trajectory | Path space
likelihood_scale | c | Common proportionality between weights and likelihood | Positive real scalar
type_likelihood | \mathcal L_g | Observation likelihood conditional on inherited type | Unit interval
drift_counts | \mathbf n | Haploid descendant counts | Nonnegative type counts summing to population size
tail | \eta | Tail probability of a bootstrap interval | Positive and smaller than its complement
log_payoff | U | Realized episode log offspring factor | Finite real log offspring units
geometric_weight | w_g^{\mathrm{geom}} | Geometric reproductive weight | Positive scalar
arithmetic_weight | w_g^{\mathrm{arith}} | Arithmetic reproductive weight | Positive scalar
fitness_variance | \operatorname{Var} | Population-weighted variance | Finite nonnegative scalar
count_next | \mathbf m | Descendant count state | Nonnegative integer counts summing to population size
count_probabilities | \boldsymbol v | Transmitted type law for count state | Type simplex
chain_kernel | \mathbb K_N | Exact finite-population count-chain transition law | Row-stochastic ancestor-to-descendant matrix
fixation_deadline_probability | h^{\mathrm{fix}} | Probability of focal fixation by a deadline | Indexed by remaining generations and current count
fixation_conditioned_kernel | \mathbb K^{\mathrm{fix}} | Count-chain transition conditioned on fixation by a deadline | Row stochastic on positive-evidence counts
chain_law | \lambda | Probability law over population count states | Finite count-state simplex
generation_index | j | Discrete generation index | Nonnegative integer
exact_replicates | n_{\mathrm{exact}} | Replicate count for exact-chain comparison | Positive integer
standardized_difference | Z_{\mathrm{MC}} | Simulation-mean discrepancy in exact MCSE units | Real diagnostic; no normality assertion
payoff_tilt | \tau | State-dependent log-offspring tilt | Finite real scalar
added_cost | \kappa | Additional cost of action zero | Finite nonnegative log offspring units
allele_frequency | x | Focal haploid allele frequency | Unit interval
allele_selected | x^{\mathrm{sel}} | Focal allele frequency immediately after selection | Unit interval
fitness_one | w_1 | Focal allele reproductive weight | Positive offspring per carrier
fitness_zero | w_0 | Alternative allele reproductive weight | Positive offspring per carrier
forward_mutation | u | Mutation probability from focal to alternative allele | Unit interval
back_mutation | v | Mutation probability from alternative to focal allele | Unit interval
breeding_value | \mathbf a | Additive breeding value | Trait vector with unbiased mean transmission
phenotype_vector | \mathbf z | Phenotypic trait vector | Additive breeding value plus environmental residual
environment_vector | \mathbf e | Environmental trait contribution | Trait vector independent of breeding value in Gaussian settings
phenotypic_covariance | \mathbf P | Phenotypic covariance | Genetic plus environmental covariance in the additive setting
environmental_covariance | \mathbf E | Environmental covariance | Symmetric positive-semidefinite trait matrix
relative_fitness | w_r | Relative reproductive output | Fitness divided by its population mean
regression_residual | \epsilon | Residual of a relative-fitness regression | Mean zero; genetic orthogonality must be separately justified
reaction_contrast | \mathbf c | Contrast across reaction-norm environments | Real vector of environment-specific coefficients
age_projection | \mathbf L_{\mathrm{age}} | Expected demographic contribution by age or stage | Nonnegative destination-by-source projection in a fixed reference environment
age_value | \mathbf v_{\mathrm{age}} | Stage reproductive value | Positive left Perron vector, written as a column
age_growth | \lambda_{\mathrm{age}} | Perron multiplier of the reference projection | Positive per-census multiplier
stage_abundance | \mathbf n_{\mathrm{age}} | Expected census counts by stage | Nonnegative stage vector
census_contribution | b_{ji} | Expected individuals at destination state j per ancestor at i | Nonnegative entries, including assigned survivors
census_value_plan | K^{(v)} | Descendant assignment after stage-value weighting | Destination-by-source kernel, chosen arbitrarily on zero-output columns
family_size | F_i | Offspring assigned to parent i | Nonnegative integer, sum over parents equals census size
family_history | H_{\mathrm{fam}} | Shared history of a parentage census | Conditioning information for a common parent allocation law
family_parent_probability | \pi_i^{\mathrm{par}} | Parent i probability in an offspring slot | History-conditioned parent simplex
family_pair_probability | \kappa_{\mathrm{pair}} | Single-generation pair coalescence probability | Same immediate parent for distinct offspring slots
selection_vector | \mathbf S | Phenotypic selection differential | Covariance of phenotype with relative fitness
genetic_variance | V_A | Additive genetic variance | Nonnegative squared trait units
phenotypic_variance | V_P | Phenotypic variance | Positive squared trait units
phenology_mean | \mu | Mean flowering date before selection | Days
phenology_optimum | \theta | Optimum flowering date | Days
selection_width | \omega^2 | Gaussian stabilizing-selection width squared | Positive days squared
scalar_gradient | \beta | Population directional selection gradient | Inverse days
flowering_date | y | Flowering date phenotype | Days
generator | Q | Fine continuous-time Markov generator | Column-conservative finite rate matrix
aggregation | C_{\mathrm{RG}} | Deterministic partition aggregation | Coarse by fine; each column sums to one
lifting | L_{\mathrm{RG}} | Stationary conditional lifting | Fine by coarse; aggregation times lifting is identity
stationary | p_* | Unique fine stationary probability law | Strictly positive state simplex
time_dilation | a_{\mathrm{RG}} | Time rescaling factor | Positive scalar
coarse_generator | Q' | Renormalized Markov generator | Conservative coarse rate matrix
coarse_time | \tau_{\mathrm{RG}} | Time after rescaling | Fine time divided by time dilation
hidden_projection | R_{\perp} | Eliminated-state projection | Identity minus lifting times aggregation
scaled_generator | G_{\mathrm{RG}} | Time-rescaled fine generator | Time dilation times fine generator
memory_kernel | K_{\mathrm{mem}} | Exact eliminated-memory kernel | Coarse by coarse matrix function
phase_state | k_t | Hidden sequence phase | Finite phase index
sensor | y_{jt} | Synaptic observation | Real sensor value
sensor_vector | \mathbf y_t | Synaptic observation vector | Real sensor vector at a single time
emission_mean | m_{jk} | Expected sensor mean at phase | Real sensor by phase matrix
sensor_precision | \lambda_j | Synaptic observation precision | Strictly positive inverse variance
filter_prior | d_t | Phase predictive prior | Phase simplex
filter_posterior | q_t | Filtered phase posterior | Phase simplex
conditional_score | \ell_{\mathrm{pred}} | Conditional sequential predictive log likelihood | Real nats at fixed model parameters
selection_log_weight | \ell^{\mathrm{sel}} | Supplied log reproductive weight | Finite real type function
selection_normalizer | \mathcal Z | Normalizer of finite reproductive reweighting | Strictly positive scalar; not automatically model evidence
selection_law | p^{\mathrm{sel}} | Population law after selection | Simplex with ancestral support
candidate_law | r | Candidate population law in variational selection | Finite simplex absolutely continuous with respect to ancestors
selection_functional | \mathcal F_{\ell} | Specified selection variational functional | Dimensionless nats; not physical free energy
transmission_matrix | K | General stochastic transmission matrix for inherited types | Destination by source; may be rectangular
transmitted_trait | K^\mathsf T z | Conditional descendant trait mean | Real function on ancestral types
descendant_observable | y_{\mathrm{desc}} | Independently supplied descendant observable | Real function on descendant types; units commensurable with the parental observable
reproductive_action_value | V_{\mathrm{rep}} | Conditional expected episode log offspring for an assigned action | Finite real log offspring units under the supplied world law
reproductive_policy | \pi^{\mathrm{rep}} | Hypothetical entropy-regularized reproductive-value policy | Finite action simplex with uniform prior; analytical comparison only
reproductive_precision | \eta_{\mathrm{rep}} | Precision of the hypothetical reproductive-value policy | Finite nonnegative inverse log offspring units
world_cue_posterior | \rho^* | World hidden-state law conditional on a cue | State simplex; conditioned cue must have positive probability under the world law
updated_weight | w^+ | Function used to evaluate fitness after transmission | Finite nonnegative function on the same carrier as w; commensurable offspring units
descendant_law | p^+ | Law after selection and normalized transmission | Descendant simplex; the changing-fitness decomposition requires the same type carrier
eco_resource | r_t | Shared resource state at a census | Finite resource carrier in the ecological illustration
eco_diagram_state | x_{\mathrm{eco}} | Ecological state in the graphical abstract | Resource and inherited count in the reset model; augmented as needed for persistent private state
eco_resource_kernel | \mathsf K_{\mathrm{res}} | Joint-action resource-transition update in the graphical abstract | Conditional probability on the next resource, given current resource and joint action
eco_state | \xi | Augmented shared-world state | Resource state, physical organism states, and private agent memories; finite carrier in the proposed kernel
eco_joint_kernel | \mathsf K_{\mathrm{eco}} | Proposed joint ecological transition kernel | Normalized next augmented state given current augmented state
eco_observation_kernel | \mathsf O_{\mathrm{eco}} | Proposed joint cue kernel | Joint observations given the augmented physical state; cues may be correlated
eco_transition_kernel | \mathsf T_{\mathrm{eco}} | Proposed joint physical and memory transition | Normalized next augmented state given current state, cues, and actions
agent_memory | \mathfrak m | Private agent internal state | Memory or belief representation retained inside the augmented Markov state
agent_policy | \varpi | Local policy in the proposed shared-world model | Finite action law conditioned on private memory and cue; private randomization factorization is an assumption
agent_index | \nu | Agent index in the proposed shared-world model | The declared agents in the displayed construction
nonlinear_state | \mathbf x | State of a nonlinear biological dynamical model | Real vector in the specified admissible state space; constrained tangents must be respected
nonlinear_input | \mathbf u | Controlled or environmental input to a nonlinear model | Real input vector in a declared local neighborhood
nonlinear_field | \mathbf f | Nonlinear biological vector field | Continuously differentiable to second order near the displayed operating point
local_jacobian | \mathbf J_{\mathrm{loc}} | State derivative at the operating point | Linear map on admissible state perturbations; local rather than global response
input_jacobian | \mathbf B_{\mathrm{in}} | Input derivative at the operating point | Linear map from input perturbations to state rates
density_operator | \varrho | Finite density operator | Positive-semidefinite complex matrix of unit trace; diagonal embedding is explicitly specified
state_channel | \mathsf K_{\mathrm{state}} | Selected authored GNN state-transition matrix | Column-stochastic next-state by current-state matrix for a fixed action; separate from inherited-type transmission
kraus_operator | \mathsf L | Kraus operator of the explicit classical-channel embedding | Matrix unit weighted by a square-root transition probability
operator_channel | \Phi | Explicit completely positive trace-preserving map | Finite Kraus construction; no physical hardware or biological quantum execution is inferred
projector_z | \Pi^Z | Projector in the standard Z measurement basis | Standard basis ordered by outcomes zero then one
projector_x | \Pi^X | Projector in the X measurement basis | Plus then minus basis ordered by outcomes zero then one
sequential_measurement_law | \mathsf P_{\mathrm{seq}} | Joint output law for a stated sequential measurement protocol | Z outcome indexes rows and X outcome indexes columns for each protocol order
joint_cues | \boldsymbol o_{\mathrm{joint}} | Joint cue vector in the prospective ecological world | A cue for each declared agent; dependencies are represented by the joint observation kernel
joint_actions | \boldsymbol a_{\mathrm{joint}} | Joint action vector in the prospective ecological world | An action for each declared agent; distinct from the breeding-value vector
later_weight | v_{\mathrm{sel}} | Weight at a later reweighting stage | Nonnegative finite function; positive product mean required
formal_policy | \varphi | Policy label in the upstream finite generative model | Finite policy carrier; distinct from an emitted action
formal_state_prior | p_{\varphi} | Policy-conditioned predicted state law | Normalized finite state law
formal_likelihood | L_o | Likelihood of the same observation | Nonnegative state function with positive predictive evidence
formal_evidence | Z_{\varphi}(o) | Predictive probability of the supported outcome | Strictly positive scalar
formal_posterior | p_{\varphi,o} | Exact upstream posterior state law | Finite state law; can be sparse
formal_F | F_{\mathrm{fin}} | Upstream posterior-form variational free energy | Finite totalized real-valued divergence plus surprisal; ordinary-log interpretation needs support conditions
formal_kl | D_{\mathrm{fin}} | Upstream finite weighted klFun divergence | Totalized finite-law interface; not extended-real KL on support violations
formal_efe | \mathcal G_{\mathrm{fin}} | Imported generative-model expected free energy | Real policy score under the stated model support convention
formal_precision | \gamma_{\mathrm{fin}} | Precision in the imported formal policy identity | Finite real scalar; behavioral applications use a nonnegative specialization
formal_action_joint | J^{\mathrm{act}}_{\gamma_{\mathrm{fin}}} | Imported infer-select-act joint law | Policy, emitted action and next-state carrier
formal_action_map | a_{\Pi} | Policy-to-emitted-action map | Supplied ActionInterface with transition consistency
formal_policy_prior | P_{\Pi} | Upstream prior on finite policies | Normalized finite policy law
formal_policy_law | Q_{\gamma_{\mathrm{fin}}} | Upstream Boltzmann policy posterior | Policy law; model FullSupport licenses the EFE interface
external_output | r_{\mathrm{ext}} | Independently supplied output observable | Real function of emitted action and next state; nonnegative for offspring interpretation
switch_abundance | \boldsymbol n^{\mathrm{sw}} | Expected phenotype abundance vector | Nonnegative real abundances conditional on a shared environment history
switch_matrix | \mathsf M | Phenotype offspring matrix in environment e | Positive reproductive factors times stochastic cue-action allocation; not a stochastic transition matrix
switch_phenotype | h_{\mathrm{sw}} | Parental phenotype in the switching application | Binary phenotype carrier
switch_next | h_{\mathrm{sw}}' | Offspring phenotype in the switching application | Binary phenotype carrier
switch_environment | e | Shared environmental state | Binary Markov environment external to individual actions
switch_offspring | R_{\mathrm{sw}} | Switching application offspring factor | Positive environment by expressed-phenotype array
switch_cost | c_{\mathrm{sw}} | Cost of switching the expressed phenotype | Nonnegative log-offspring cost
switch_path | \boldsymbol e_{\mathrm{sw}} | Common environmental history | Binary path of the declared finite horizon
switch_growth | g_T | Finite-horizon log abundance per generation | Natural log total abundance ratio divided by horizon
rg_projection | P_{\mathrm{RG}} | Resolved-state projection | n by n; L_RG C_RG; orthogonal in the stationary inverse-mass inner product
rg_coarse_law | p_{\mathrm c} | Resolved probability law | m-dimensional simplex; C_RG p in coarse time
rg_unresolved | h_{\mathrm u} | Unresolved signed component | n-vector in range(R_perp); not a probability law
rg_block_a | A_{\mathrm{RG}} | Resolved generator block | m by m; C_RG G_RG L_RG, equal to Q-prime
rg_block_b | B_{\mathrm{RG}} | Unresolved-to-resolved feedback | m by n; C_RG G_RG R_perp; not a stochastic kernel
rg_block_e | E_{\mathrm{RG}} | Resolved-to-unresolved drive | n by m; R_perp G_RG L_RG; not a stochastic kernel
rg_block_d | D_{\mathrm{RG}} | Unresolved evolution block | n by n; R_perp G_RG R_perp; generally not a Markov generator
rg_initial_forcing | f_{\mathrm u} | Resolved forcing from the initial unresolved component | m-vector function of coarse time; signed
rg_memory_transform | \widehat K_{\mathrm{mem}} | Laplace transform of the projected memory kernel | m by m at a positive real Laplace rate
rg_resolvent | H_{\mathrm{RG}} | Resolved transfer resolvent | m by m; C_RG(zeta I-G_RG)^(-1)L_RG
rg_laplace_rate | \zeta_{\mathrm{RG}} | Laplace rate | Positive real in inverse coarse-time units
rg_coarse_transform | \widehat p_{\mathrm c} | Laplace transform of the resolved law | m-vector; not normalized as a probability law
rg_total_c | C_{\mathrm{tot}} | Composed aggregation | C_RG^(2) C_RG^(1); coarse-most by fine
rg_total_l | L_{\mathrm{tot}} | Compatible composed lifting | L_RG^(1) L_RG^(2); fine by coarse-most
rg_total_a | a_{\mathrm{tot}} | Composed time dilation | a_RG^(2) a_RG^(1)>0
rg_intermediate_projection | P_1 | Fine-space projection onto the first retained level | L_RG^(1) C_RG^(1)
rg_final_projection | P_2 | Fine-space projection onto the final retained level | L_tot C_tot; nested inside P_1
rg_common_propagator | U_{\mathrm{tot}} | Fine propagator on the final clock | exp(u a_tot Q) evaluated at a final-clock lag
rg_final_kernel | K_2 | Lifted final projected propagator | C_tot U_tot L_tot; not necessarily a semigroup
rg_ck_defect | \Delta_{\mathrm{CK}} | Composed-lag Chapman–Kolmogorov defect | Signed difference between direct and lifted-composition final kernels
rg_fine_defect | \Delta_{\mathrm f} | Semigroup defect from discarded fine coordinates | Complement of the first fine-space projection
rg_intermediate_defect | \Delta_{\mathrm m} | Semigroup defect from discarded intermediate coordinates | Difference between nested fine-space projections
rg_fine_kl | D_{\mathrm f} | Fine relative entropy to stationarity | Nats on the fine carrier
rg_visible_kl | D_{\mathrm{vis}} | Relative entropy of the observed coarse law | Nats on the declared aggregation
rg_hidden_kl | D_{\mathrm h} | Within-block relative entropy to the conditional lift | Fine KL from the lift of its own aggregate
rg_observation_posterior | \rho_o | Fine posterior for a fixed supported observation | Positive on the stated posterior support
rg_observation_lift | \Lambda_o | Conditional lift under the fine posterior | Fine microstate distribution within each retained observation block
rg_fine_vfe | \mathcal F | Fine variational free energy for a fixed observation | Posterior KL minus shared log evidence
rg_coarse_vfe | \mathcal F_C | Coarse variational free energy for the same observation | Aggregate posterior KL minus shared log evidence
rg_living_mass | u_t | Coarse living mass before conditioning | Nonnegative vector summing to survival probability
rg_survival_evidence | Z_t^{\mathrm S} | Evidence for survival through the stated census | Probability including zero, positive for conditioning
rg_survivor_law | \rho_t^{\mathrm S} | Retained state law conditional on survival | Coarse simplex at positive survival evidence
rg_slip_strength | \varepsilon_{\mathrm{RG}} | Nonreversible outer-product perturbation strength | Strictly between zero and one; configured value must be injected separately
rg_slip_u | \mathbf u_{\mathrm{RG}} | Resolved perturbation direction | @SLIP_U_DIMENSION@-vector @SLIP_U@ transpose
rg_slip_v | \mathbf v_{\mathrm{RG}} | Unresolved perturbation direction | @SLIP_V_DIMENSION@-vector @SLIP_V@ transpose
rg_basis_law | \mathbf e_0 | Pure initial law for the first fine state | @SLIP_U_DIMENSION@-state simplex; an off-lift initial law
passage_time | \tau_{\mathrm{exit}} | First biological exit from the mixed census | Nonnegative integer or infinity under the full process; a finite record establishes only survival through its observation limit
passage_cause | J_{\mathrm{exit}} | Competing biological first-exit cause | Loss or fixation; distinct from administrative censoring
passage_limit | H_{\mathrm{obs}} | Administrative observation limit | Fixed nonnegative census horizon inside the recorded window
passage_record | R_H | Record observed through the administrative limit | Observed exit census and cause, or a separate censored-at-H label
rg_killed_kernel | M_{\mathrm S} | Fine single-census killed transition | P diag(w), with survival probabilities w in the unit interval; columns may lose mass
rg_lagged_kernel | K_{\mathrm{lag}}(t) | Reduced kernel formed after a fine lag | C_RG M_S^t L_RG; a single lift across the entire census lag
rg_iterated_kernel | K_{\mathrm{iter}}(t) | Repeated single-census reduced kernel | (C_RG M_S L_RG)^t; unresolved state is reset at each intermediate census
paper_scale_states | \mathsf X^{(i)} | Source-paper state/trajectory descriptor collection at scale i | Schematic adaptation of the paper set notation; not a CTMC probability vector
paper_scale_particles | \symup{\Pi}^{(i)} | Source-paper grouped particle descriptors at scale i | Schematic collection partitioned by sparse coupling
paper_grouping | \mathfrak G_i | Source-paper grouping operation at scale i | Sparse-coupling-based particular grouping; not implemented by a prescribed count partition
paper_reduction | \mathfrak R_i | Source-paper reduction operation at scale i | Retention of invariant/slow descriptors; distinct from R_perp
encounter_state | X_t | Biological state reached at census t | Finite state preceding the encounter record
encounter_end | H_{\mathrm{rec}} | Last census in the declared encounter schedule | Nonnegative census index
rg_state_readout | c_{\mathrm{RG}} | Map from fine states to retained labels | Deterministic state partition
marked_step | P_t^{o} | Transition matrix weighted by a specified encounter record | Nonnegative next-state by state; summing over records gives a stochastic matrix
encounter_forward | a_t | Unnormalized forward mass | Joint mass of the fine state and the observed prefix
encounter_backward | b_t | Future-record likelihood at the fine state | Unit interval; terminal likelihood equals one
encounter_evidence | Z_{\mathrm{rec}} | Probability of the complete encounter record | Nonnegative; a normalized smoother requires positive evidence
encounter_target | J_{\mathrm{fut}} | Biological forecast target at the stated future census | Finite outcome; separate from the observed report
paired_cause_mass | \pi_c | True mass of exit cause c | Unit interval at the shared census
paired_sensitivity_one | s_{1c} | First observer's detection probability for cause c | Unit interval conditional on cause c
paired_sensitivity_two | s_{2c} | Second observer's detection probability for cause c | Unit interval conditional on cause c
paired_marginal_one | m_{1c} | Probability that the first observer confirms cause c | Unconditional over the census cohort
paired_marginal_two | m_{2c} | Probability that the second observer confirms cause c | Unconditional over the census cohort
paired_overlap | j_c | Probability that every observer confirms the same cause c | Joint probability across the paired reads
paired_union | u_c | Probability that some observer confirms cause c | Lower bound on true cause mass under perfect specificity
paired_total_exit | \pi_{\mathrm{E}} | Externally known true mass of all exits | Sum of loss and fixation probabilities in the closed census
paired_loss_mass | \pi_{\mathrm{L}} | True mass of loss | Partially identified by the specific paired readout when dependence is allowed
encounter_coarse_record | R_{\mathrm{c}} | Coarsened label of a detailed recorded outcome | Deterministic map of the record, conditional on the declared procedure
"""
_READING_DATA: Final = r"""A | outcome o, state s | Column-stochastic; each column is the outcome law given a single state | Probability
B | next state s', state s, action a | Column-stochastic; each column is the next-state law given state and action | Probability
M | descendant h, ancestor g | Column-stochastic; each column is the descendant-type law of an ancestor type | Probability
transmission_matrix | destination, source | Column-stochastic, source to destination; may be rectangular | Probability
chain_kernel | ancestral count, descendant count | Row-stochastic; each row is the next-census count law | Probability
memory_kernel | coarse destination, coarse source | Matrix function of coarse time | Inverse coarse-time units squared
rg_lagged_kernel | coarse destination, coarse source | Column-stochastic, source to destination, after t fine census lags | Probability
F | type g, fixed observation | Scalar per ancestor type | Nats
G | type g, action a | Scalar per action | Nats
kl | law, reference law | Scalar; infinite on support violations | Nats
precision | action | Scalar scaling expected free energy inside the softmax | Inverse nats
growth | type g | Scalar per ancestor type | Log offspring factor per episode
"""
_READING_ROWS: Final = {
cells[0]: (cells[1], cells[2], cells[3])
for cells in (line.split(" | ") for line in _READING_DATA.splitlines())
}
_READING_ORDER: Final = tuple(_READING_ROWS)
def _fill_slip(row: str) -> str:
"""Write the initial-slip dimensions and directions from their definition."""
if len(SLIP_RESOLVED) != len(SLIP_UNRESOLVED):
raise ProbabilityError("slip directions must share a dimension")
return (
row.replace("@SLIP_U_DIMENSION@", str(len(SLIP_RESOLVED)))
.replace("@SLIP_V_DIMENSION@", str(len(SLIP_UNRESOLVED)))
.replace("@SLIP_U@", _tuple_text(SLIP_RESOLVED))
.replace("@SLIP_V@", _tuple_text(SLIP_UNRESOLVED))
)
def _tuple_text(values: tuple[int, ...]) -> str:
return "(" + ",".join(map(str, values)) + ")"
def _build_symbols() -> tuple[Symbol, ...]:
entries = tuple(
Symbol(*_fill_slip(row).split(" | ")) for row in _SYMBOL_DATA.splitlines()
)
unknown = set(_READING_ROWS) - {entry.key for entry in entries}
if unknown:
raise ProbabilityError(f"unknown reading-guide symbol: {sorted(unknown)}")
built: list[Symbol] = []
for entry in entries:
reading = _READING_ROWS.get(entry.key)
if reading is None:
built.append(entry)
else:
index, orientation, units = reading
built.append(
replace(entry, index=index, orientation=orientation, units=units)
)
return tuple(built)
_SYMBOLS: Final = _build_symbols()
def _tfrac(value: Fraction) -> str:
"""Render an exact rational as an inline TeX fraction, or an integer."""
if value.denominator == 1:
return str(value.numerator)
numerator, denominator = str(value.numerator), str(value.denominator)
if len(numerator) == len(denominator) == 1:
return rf"\tfrac{numerator}{denominator}"
return rf"\tfrac{{{numerator}}}{{{denominator}}}"
def _fill(template: str, **parts: str) -> str:
for name, text in parts.items():
template = template.replace("@" + name + "@", text)
return template
def growth_ranking_equation() -> str:
ranking = growth_ranking()
low, high = VARIABLE_MULTIPLIERS
template = (
r"\begin{aligned} R_{\mathrm{var}}&\in\{@low@,@high@\}\ "
+ r"\text{equiprobably},\quad R_{\mathrm{const}}=@constant@,\\ "
+ r"[[expectation]][R_{\mathrm{var}}]&=@arithmetic@>@constant@="
+ r"[[expectation]][R_{\mathrm{const}}],\\ "
+ r"\exp([[expectation]][\log R_{\mathrm{var}}])&=@geometric@<@constant@="
+ r"\exp([[expectation]][\log R_{\mathrm{const}}]).\end{aligned}"
)
return _fill(
template,
low=_tfrac(low),
high=_tfrac(high),
constant=_tfrac(CONSTANT_MULTIPLIER),
arithmetic=_tfrac(ranking.arithmetic_variable),
geometric=_tfrac(ranking.geometric_variable),
)
def _whole(value: Fraction) -> int:
if value.denominator != 1:
raise ValueError("The displayed update needs whole reproductive weights")
return value.numerator
def finite_mean_equation() -> str:
update = finite_mean()
focal, other = _whole(FOCAL_WEIGHT), _whole(OTHER_WEIGHT)
gap = focal - other
probabilities = ",".join(rf"\Pr(K_1={k})" for k in range(len(update.count_law)))
law = ",".join(_tfrac(p) for p in update.count_law)
template = (
r"\begin{aligned}q(x)&=\frac{@focal@x}{@other@+@gap@x},"
+ r"\qquad x_0=@start@,\\ "
+ r"\bigl(@probabilities@\bigr)&=(@law@),\qquad x_1=K_1/@census@,\\ "
+ r"[[expectation]][q(x_1)]&=@mean_of_update@,\qquad "
+ r"q([[expectation]][x_1])=q(@mean@)=@update_of_mean@.\end{aligned}"
)
return _fill(
template,
focal=str(focal),
other=str(other),
gap="" if gap == 1 else str(gap),
start=_tfrac(INITIAL_FREQUENCY),
probabilities=probabilities,
law=law,
census=str(MEAN_CENSUS),
mean_of_update=_tfrac(update.mean_of_update),
mean=_tfrac(update.mean_frequency),
update_of_mean=_tfrac(update.update_of_mean),
)
_EQUATIONS: Final[dict[str, str]] = {
"ecosystem_observed_record": (
r"\begin{aligned}"
r"[[passage_record]]&=\begin{cases}([[passage_time]],[[passage_cause]]),"
r"&[[passage_time]]\le[[passage_limit]],\\"
r"([[passage_limit]],\mathrm{censored}),&[[passage_time]]>[[passage_limit]],\end{cases}\\"
r"\Pr([[passage_record]]=(t,j))&=\Pr([[passage_time]]=t,[[passage_cause]]=j),"
r"\quad 0\le t\le[[passage_limit]],\\"
r"\Pr([[passage_record]]=([[passage_limit]],\mathrm{censored}))"
r"&=\Pr([[passage_time]]>[[passage_limit]])."
r"\end{aligned}"
),
"rg_survival_lag_split": (
r"\begin{aligned}"
r"[[rg_lagged_kernel]]&=[[aggregation]][[rg_killed_kernel]]^t[[lifting]],"
r"\quad [[rg_iterated_kernel]]=([[aggregation]][[rg_killed_kernel]][[lifting]])^t,\\"
r"[[aggregation]][[rg_killed_kernel]]^t-[[rg_iterated_kernel]][[aggregation]]"
r"&=\underbrace{[[aggregation]][[rg_killed_kernel]]^t-"
r"[[rg_lagged_kernel]][[aggregation]]}_{\text{fixed-lag preparation loss}}\\"
r"&\quad+\underbrace{([[rg_lagged_kernel]]-[[rg_iterated_kernel]])"
r"[[aggregation]]}_{\text{repeated-reduction error}}."
r"\end{aligned}"
),
"reaction_norm_response": (
"\\begin{aligned}"
"\\Delta\\overline{[[breeding_value]]}_{\\mathrm{env}}"
"&=[[genetic_covariance]]_{\\mathrm{env}}[[gradient]]_{\\mathrm{env}},\\\\ "
"[[genetic_covariance]]_{\\mathrm{env}}[[reaction_contrast]]&=0"
"\\quad\\Longrightarrow\\quad [[reaction_contrast]]^\\mathsf T"
"\\Delta\\overline{[[breeding_value]]}_{\\mathrm{env}}=0."
"\\end{aligned}"
),
"stage_reproductive_value": (
"\\begin{aligned}"
"[[age_value]]^\\mathsf T[[age_projection]]"
"&=[[age_growth]][[age_value]]^\\mathsf T,\\\\ "
"[[stage_abundance]](t+1)&=[[age_projection]][[stage_abundance]](t),\\\\ "
"[[age_value]]^\\mathsf T[[stage_abundance]](t+1)"
"&=[[age_growth]][[age_value]]^\\mathsf T[[stage_abundance]](t)."
"\\end{aligned}"
),
"reproductive_value_price_weights": (
"\\begin{aligned}"
"p_i^{(v)}&=\\frac{p_i v_i}{\\sum_k p_k v_k},"
"\\qquad w_i^{(v)}=\\frac{\\sum_j [[census_contribution]]v_j}{v_i},\\\\ "
"[[census_value_plan]]_{ji}&=\\frac{v_j [[census_contribution]]}"
"{\\sum_\\ell b_{\\ell i}v_\\ell}"
"\\quad\\text{when }w_i^{(v)}>0."
"\\end{aligned}"
),
"family_pair_coalescence": (
"\\begin{aligned}"
"\\Pr(J_1=J_2\\mid ([[family_size]])_i)"
"&=\\frac{\\sum_i [[family_size]]([[family_size]]-1)}{[[population]]([[population]]-1)},\\\\ "
"[[family_pair_probability]]"
"&=[[expectation]]_{[[family_history]]}\\sum_i"
"[[family_parent_probability]]([[family_history]])^2"
"\\\\ &="
"\\sum_i(\\bar\\pi_i^{\\mathrm{par}})^2"
"+\\sum_i\\operatorname{Var}_{[[family_history]]}"
"\\!\\left([[family_parent_probability]]([[family_history]])\\right)"
"."
"\\end{aligned}"
),
"growth_arithmetic_geometric": "\\exp\\!\\left([[expectation]][\\log [[R]]]\\right)\\leq [[expectation]][[[R]]].",
"finite_binomial_census": "[[descendant_count]]\\mid [[ancestral_count]]\\sim\\operatorname{Binomial}\\!\\left([[population]],[[focal_parent_probability]]\\right).",
"price_group_covariance": "\\begin{aligned}[[covariance]]([[weight]],[[z]])={}&[[expectation]]\\!\\left[[[covariance]]([[weight]],[[z]]\\mid [[parent_group]])\\right]\\\\ &+[[covariance]]\\!\\left([[expectation]][[[weight]]\\mid [[parent_group]]],\\,[[expectation]][[[z]]\\mid [[parent_group]]]\\right).\\end{aligned}",
"breeder_projection_residual": "\\begin{aligned}m([[z]])&=a+b[[z]]+r([[z]]),\\qquad [[covariance]]([[z]],r([[z]]))=0,\\\\ \\Delta[[mean_z]]&=[[expectation]][m([[z]])-[[z]]]+b[[selection_differential]]+[[covariance]]([[relative_fitness]],r([[z]])).\\end{aligned}",
"growth_ranking_counterexample": growth_ranking_equation(),
"finite_mean_counterexample": finite_mean_equation(),
"shared_history_census_variance": "\\begin{aligned}[[census_indicator]]_1,[[census_indicator]]_2\\mid [[census_history]]&\\overset{\\mathrm{iid}}{\\sim}\\operatorname{Bernoulli}([[history_parent_probability]]),\\\\ [[descendant_fraction]]&=( [[census_indicator]]_1+[[census_indicator]]_2)/2,\\qquad [[mean_history_probability]]=[[expectation]][[[history_parent_probability]]],\\\\ [[covariance]]([[census_indicator]]_1,[[census_indicator]]_2)&=\\operatorname{Var}([[history_parent_probability]]),\\\\ \\operatorname{Var}([[descendant_fraction]])&=\\frac{[[expectation]][[[history_parent_probability]](1-[[history_parent_probability]])]}{2}+\\operatorname{Var}([[history_parent_probability]]),\\\\ \\operatorname{Var}([[descendant_fraction]])-\\frac{[[mean_history_probability]](1-[[mean_history_probability]])}{2}&=\\frac{\\operatorname{Var}([[history_parent_probability]])}{2}.\\end{aligned}",
"selection_information": "\\begin{aligned}\\log[[selection_normalizer]]&=\\log\\sum_{[[g]]}[[p_g]]\\exp([[selection_log_weight]]_{[[g]]}),\\\\ [[selection_law]]_{[[g]]}&=[[p_g]]\\exp([[selection_log_weight]]_{[[g]]}-\\log[[selection_normalizer]]),\\\\ [[kl]]([[selection_law]]\\Vert[[p]])&=[[expectation]]_{[[selection_law]]}[[[selection_log_weight]]]-\\log[[selection_normalizer]].\\end{aligned}",
"retrospective_tree_sampling": (
r"\begin{aligned}"
r"[[p]]([[path]])&=2^{-[[lineage_divisions]]([[path]])},\qquad "
r"[[selection_normalizer]]=[[expectation]]_{[[p]]}[2^{[[lineage_divisions]]}]=[[lineage_leaves]],\\ "
r"[[selection_law]]([[path]])&=\frac{[[p]]([[path]])2^{[[lineage_divisions]]([[path]])}}"
r"{[[selection_normalizer]]}=\frac{1}{[[lineage_leaves]]},\\ "
r"[[kl]]([[selection_law]]\Vert[[p]])"
r"&=(\log 2)[[expectation]]_{[[selection_law]]}[[[lineage_divisions]]]"
r"-\log [[selection_normalizer]]."
r"\end{aligned}"
),
"selection_variational_gap": "\\begin{aligned}[[selection_functional]]([[candidate_law]])&=[[kl]]([[candidate_law]]\\Vert[[p]])-[[expectation]]_{[[candidate_law]]}[[[selection_log_weight]]],\\\\ [[selection_functional]]([[candidate_law]])+\\log[[selection_normalizer]]&=[[kl]]([[candidate_law]]\\Vert[[selection_law]])\\geq0.\\end{aligned}",
"transmission_information": "[[kl]]([[transmission_matrix]][[selection_law]]\\Vert[[transmission_matrix]][[p]])\\leq[[kl]]([[selection_law]]\\Vert[[p]]).",
"transmission_price": "[[expectation]]_{[[transmission_matrix]][[selection_operator]]([[p]],[[weight]])}[[[z]]]-[[expectation]]_{[[p]]}[[[z]]]=\\frac{[[covariance]]_{[[p]]}([[weight]],[[z]])}{[[mean_weight]]}+\\frac{[[expectation]]_{[[p]]}[[[weight]]([[transmitted_trait]]-[[z]])]}{[[mean_weight]]}.",
"generator_rg": "\\begin{aligned}\\frac{d[[p]]}{d[[time]]}&=[[generator]][[p]],\\quad [[lifting]]_{ia}=\\frac{[[stationary]]_i[[aggregation]]_{ai}}{([[aggregation]][[stationary]])_a},\\quad [[aggregation]][[lifting]]=I,\\\\ [[coarse_generator]]&=[[time_dilation]][[aggregation]][[generator]][[lifting]],\\quad [[coarse_time]]=[[time]]/[[time_dilation]].\\end{aligned}",
"rg_closure": "[[time_dilation]][[aggregation]][[generator]]=[[coarse_generator]][[aggregation]]\\ \\Longrightarrow\\ [[aggregation]]e^{[[time_dilation]][[generator]][[coarse_time]]}=e^{[[coarse_generator]][[coarse_time]]}[[aggregation]].",
"rg_memory": "\\begin{aligned}[[scaled_generator]]&=[[time_dilation]][[generator]],\\quad [[hidden_projection]]=I-[[lifting]][[aggregation]],\\\\ [[memory_kernel]](u)&=[[aggregation]][[scaled_generator]]e^{u[[hidden_projection]][[scaled_generator]]}[[hidden_projection]][[scaled_generator]][[lifting]].\\end{aligned}",
"synaptic_filter": "\\begin{aligned}\\log p([[sensor_vector]]\\mid[[phase_state]]=k,[[sensor_precision]])&=-\\frac12\\sum_j\\left[\\log(2\\pi)-\\log[[sensor_precision]]+[[sensor_precision]]([[sensor]]-[[emission_mean]])^2\\right],\\\\ [[filter_posterior]](k)&=\\frac{[[filter_prior]](k)p([[sensor_vector]]\\mid k,[[sensor_precision]])}{\\sum_r[[filter_prior]](r)p([[sensor_vector]]\\mid r,[[sensor_precision]])},\\\\ [[conditional_score]]&=\\sum_t\\log\\sum_k[[filter_prior]](k)p([[sensor_vector]]\\mid k,[[sensor_precision]]).\\end{aligned}",
"allele_response": "\\begin{aligned}[[mean_weight]]&=[[allele_frequency]][[fitness_one]]+(1-[[allele_frequency]])[[fitness_zero]],\\\\ [[allele_selected]]&=\\frac{[[allele_frequency]][[fitness_one]]}{[[mean_weight]]},\\\\ \\Delta[[allele_frequency]]&=\\frac{[[allele_frequency]](1-[[allele_frequency]])([[fitness_one]]-[[fitness_zero]])}{[[mean_weight]]}-[[forward_mutation]][[allele_selected]]+[[back_mutation]](1-[[allele_selected]]).\\end{aligned}",
"genetic_price": "\\Delta\\overline{[[breeding_value]]}=[[covariance]]([[breeding_value]],[[relative_fitness]]),\\quad [[relative_fitness]]=[[weight]]/[[mean_weight]].",
"breeder_conditions": "\\begin{aligned}[[phenotype_vector]]&=[[breeding_value]]+[[environment_vector]],\\quad [[phenotypic_covariance]]=[[genetic_covariance]]+[[environmental_covariance]],\\\\ [[relative_fitness]]&=1+[[gradient]]^\\top([[phenotype_vector]]-[[mean_vector_z]])+[[regression_residual]],\\\\ \\Delta\\overline{[[breeding_value]]}&=[[genetic_covariance]][[gradient]]+[[covariance]]([[breeding_value]],[[regression_residual]]),\\\\ [[selection_vector]]&=[[phenotypic_covariance]][[gradient]]\\quad\\text{if }[[covariance]]([[phenotype_vector]],[[regression_residual]])=0.\\end{aligned}",
"phenology_response": "\\begin{aligned}[[weight]]([[flowering_date]])&=\\exp\\!\\left[-\\frac{([[flowering_date]]-[[phenology_optimum]])^2}{2[[selection_width]]}\\right],\\quad [[flowering_date]]\\sim\\mathcal N([[phenology_mean]],[[phenotypic_variance]]),\\\\ [[scalar_gradient]]&=\\frac{[[phenology_optimum]]-[[phenology_mean]]}{[[phenotypic_variance]]+[[selection_width]]},\\quad [[selection_differential]]=[[phenotypic_variance]][[scalar_gradient]],\\\\ [[breeder_response]]&=[[genetic_variance]][[scalar_gradient]]=[[heritability]][[selection_differential]],\\quad [[heritability]]=[[genetic_variance]]/[[phenotypic_variance]].\\end{aligned}",
"exponential_response": "[[weight]]([[phenotype_vector]])=\\exp([[gradient]]^\\top[[phenotype_vector]]),\\quad [[selection_vector]]=[[phenotypic_covariance]][[gradient]],\\quad \\Delta\\overline{[[breeding_value]]}=[[genetic_covariance]][[gradient]].",
"reproductive_bridges": "\\begin{aligned}[[log_payoff]]&=\\log[[R]]([[next_s]],[[a]])-[[cost]]([[a]]),\\\\ [[geometric_weight]]&=\\exp([[expectation]][[[log_payoff]]]),\\quad [[arithmetic_weight]]=[[expectation]][\\exp([[log_payoff]])],\\\\ \\log[[arithmetic_weight]]-\\log[[geometric_weight]]&\\geq 0.\\end{aligned}",
"fitness_gain": "[[expectation]]_{[[selection_operator]]([[p]],[[weight]])}[[[weight]]]-[[mean_weight]]=\\frac{[[fitness_variance]]_{[[p]]}([[weight]])}{[[mean_weight]]}\\geq 0.",
"finite_population": "\\begin{aligned}[[count_probabilities]]([[drift_counts]])&=[[M]][[selection_operator]]([[drift_counts]]/[[population]],[[weight]]),\\\\ [[chain_kernel]]([[drift_counts]],[[count_next]])&=\\frac{[[population]]!}{\\prod_{[[h]]}[[count_next]]_{[[h]]}!}\\prod_{[[h]]}[[count_probabilities]]_{[[h]]}([[drift_counts]])^{[[count_next]]_{[[h]]}},\\quad\\sum_{[[h]]}[[count_next]]_{[[h]]}=[[population]],\\\\ [[chain_law]]_{[[generation_index]]+1}([[count_next]])&=\\sum_{[[drift_counts]]}[[chain_law]]_{[[generation_index]]}([[drift_counts]])[[chain_kernel]]([[drift_counts]],[[count_next]]).\\end{aligned}",
"family_triple_coalescence": (
"\\Pr(J_1=J_2=J_3\\mid ([[family_size]])_i)"
"=\\frac{\\sum_i [[family_size]]([[family_size]]-1)([[family_size]]-2)}"
"{[[population]]([[population]]-1)([[population]]-2)}."
),
"coarsened_report_loss": (
r"\mathbb{E}\bigl[-\log \Pr(J\mid R)\bigr]"
r"-\mathbb{E}\bigl[-\log \Pr(J\mid O)\bigr]"
r"=H(J\mid R)-H(J\mid O)=I(J;O\mid R)\ge 0,\qquad R=\psi(O)."
),
"rg_defect_bound": (
r"\begin{aligned}"
r"E&=[[time_dilation]][[aggregation]][[generator]]"
r"-[[coarse_generator]][[aggregation]],\\ "
r"[[aggregation]]e^{[[time_dilation]][[generator]][[coarse_time]]}"
r"-e^{[[coarse_generator]][[coarse_time]]}[[aggregation]]"
r"&=\int_0^{[[coarse_time]]}e^{([[coarse_time]]-u)[[coarse_generator]]}"
r"\,E\,e^{u[[time_dilation]][[generator]]}\,du,\\ "
r"\max_k\tfrac12\bigl\lVert\bigl([[aggregation]]"
r"e^{[[time_dilation]][[generator]][[coarse_time]]}"
r"-e^{[[coarse_generator]][[coarse_time]]}[[aggregation]]\bigr)"
r"\mathbf e_k\bigr\rVert_1"
r"&\le\min\bigl\{1,\tfrac12[[coarse_time]]\lVert E\rVert_1\bigr\}."
r"\end{aligned}"
),
"hoeffding_union_radius": (
r"\varepsilon=\sqrt{\frac{\log(2m/\alpha)}{2n}},\qquad "
r"\Pr\Bigl(\max_{j\le m}\lvert\hat p_j-p_j\rvert>\varepsilon\Bigr)"
r"\le\alpha."
),
"wf_fixation_conditioning": (
r"\begin{aligned}"
r"[[fixation_deadline_probability]]_0(k)&=\mathbf 1_{\{k=[[population]]\}},\\ "
r"[[fixation_deadline_probability]]_m(k)&=\sum_{\ell=0}^{[[population]]}"
r"[[chain_kernel]](k,\ell)[[fixation_deadline_probability]]_{m-1}(\ell),\\ "
r"[[fixation_conditioned_kernel]]_m(k,\ell)&=\frac{[[chain_kernel]](k,\ell)"
r"[[fixation_deadline_probability]]_{m-1}(\ell)}"
r"{[[fixation_deadline_probability]]_m(k)}."
r"\end{aligned}"
),
"exact_mcse": "[[mcse]]_{\\mathrm{exact}}=\\sqrt{\\frac{[[fitness_variance]]_{[[chain_law]]}([[sample]])}{[[exact_replicates]]}},\\qquad [[standardized_difference]]=\\frac{[[mean]]-[[expectation]]_{[[chain_law]]}[[[sample]]]}{[[mcse]]_{\\mathrm{exact}}}.",
"finite_population_moments": (
"\\begin{aligned}"
"[[expectation]][[[count_next]]/[[population]]\\mid[[drift_counts]]]"
"&=[[count_probabilities]]([[drift_counts]]),\\\\"
"[[covariance]]([[count_next]]/[[population]]\\mid[[drift_counts]])"
"&=\\frac{\\operatorname{diag}([[count_probabilities]])-"
"[[count_probabilities]][[count_probabilities]]^\\mathsf T}{[[population]]},"
"\\quad [[count_probabilities]]=[[count_probabilities]]([[drift_counts]])."
"\\end{aligned}"
),
"payoff_surface": "[[log_payoff]]_{[[payoff_tilt]],[[added_cost]]}=[[log_payoff]]+[[payoff_tilt]](2\\,\\mathbf1_{[[next_s]]=1}-1)-[[added_cost]]\\,\\mathbf1_{[[a]]=0}.",
"bayes": "[[Z]]([[o]])=\\sum_{[[s]]}[[d]]([[s]])[[A]]([[o]]\\mid[[s]]),\\qquad [[posterior]]([[s]]\\mid[[o]])=\\frac{[[d]]([[s]])[[A]]([[o]]\\mid[[s]])}{[[Z]]([[o]])}.",
"vfe": "[[F]]([[q]],[[o]])=\\sum_{[[s]]}[[q]]([[s]])\\log\\frac{[[q]]([[s]])}{[[d]]([[s]])[[A]]([[o]]\\mid[[s]])}=[[kl]]([[q]]\\Vert[[posterior]](\\cdot\\mid[[o]]))-\\log[[Z]]([[o]]).",
"prediction": "[[predictive]]([[next_s]])=\\sum_{[[s]]}[[B]]([[next_s]]\\mid[[s]],[[a]])[[q]]([[s]]),\\qquad [[predictive]]([[next_o]])=\\sum_{[[next_s]]}[[A]]([[next_o]]\\mid[[next_s]])[[predictive]]([[next_s]]).",
"efe": "[[G]]([[a]])=[[kl]]([[predictive]]([[next_o]])\\Vert[[C]]([[next_o]]))+\\sum_{[[next_s]]}[[predictive]]([[next_s]])[[entropy]][[[A]](\\cdot\\mid[[next_s]])]=[[expectation]]_{[[predictive]]([[next_o]])}[-\\log[[C]]([[next_o]])]-[[information]]_{[[predictive]]}([[next_s]];[[next_o]]).",
"policy": "[[policy]]([[a]]\\mid[[o]])=\\frac{\\exp[-[[precision]][[G]]([[a]])]}{\\sum_{[[b]]}\\exp[-[[precision]][[G]]([[b]])]}.",
"growth": "[[growth]]=\\sum_{[[s]],[[o]],[[a]],[[next_s]]}[[rho]]([[s]])[[world_A]]([[o]]\\mid[[s]])[[policy]]([[a]]\\mid[[o]])[[world_B]]([[next_s]]\\mid[[s]],[[a]])[\\log[[R]]([[next_s]],[[a]])-[[cost]]([[a]])],\\quad [[weight_g]]=\\exp([[growth]]).",
"selection": "[[mean_weight]]=\\sum_{[[g]]}[[p_g]][[weight_g]],\\qquad [[selected]]=\\frac{[[p_g]][[weight_g]]}{[[mean_weight]]}.",
"mutation": "[[next_frequency]]=\\sum_{[[g]]}[[M]][[selected]].",
"price": "\\Delta[[mean_z]]=\\frac{[[covariance]]_{[[p]]}([[weight]],[[z]])}{[[mean_weight]]}+\\frac{[[expectation]]_{[[p]]}[[[weight]]([[descendant_z]]-[[z]])]}{[[mean_weight]]},\\quad [[covariance]]_{[[p]]}([[weight]],[[z]])=[[expectation]]_{[[p]]}[[[weight]][[z]]]-[[expectation]]_{[[p]]}[[[weight]]][[expectation]]_{[[p]]}[[[z]]].",
"genetics": "\\Delta\\overline{[[breeding_value]]}=[[genetic_covariance]][[gradient]],\\qquad \\Delta[[mean_vector_z]]=\\Delta\\overline{[[breeding_value]]}\\quad\\text{if }\\Delta\\overline{[[environment_vector]]}=0.",
"coarse_graining": "[[kl]]([[T]][[p]]\\Vert[[T]][[q]])\\leq[[kl]]([[p]]\\Vert[[q]]),\\qquad [[T]][[selection_operator]]([[p]],[[weight]])\\ne[[selection_operator]]([[T]][[p]],[[coarse_weight]])\\quad\\text{in general}.",
"planning": "\\begin{aligned}[[action_value]]_{[[horizon]]}([[q]],[[a]])&=[[G]]([[a]];[[q]])+[[discount]]\\sum_{[[o]]}[[predictive]]([[o]])[[value]]_{[[horizon]]-1}([[bayes_operator]]([[q]],[[a]],[[o]])),\\\\ [[value]]_0([[q]])&=0,\\quad [[value]]_{[[horizon]]}([[q]])=\\sum_{[[a]]}[[tree_policy]]_{[[horizon]]}([[a]]\\mid[[q]])[[action_value]]_{[[horizon]]}([[q]],[[a]]),\\\\ [[tree_policy]]_{[[horizon]]}([[a]]\\mid[[q]])&=\\frac{\\exp[-[[precision]][[action_value]]_{[[horizon]]}([[q]],[[a]])]}{\\sum_{[[b]]}\\exp[-[[precision]][[action_value]]_{[[horizon]]}([[q]],[[b]])]}.\\end{aligned}",
"dirichlet_update": "[[updated_alpha]]=[[alpha]]+[[counts]]\\quad\\text{(observed states)},\\qquad [[updated_alpha]]\\approx[[alpha]]+[[soft_counts]]\\quad\\text{(fractional-count approximation)}.",
"dirichlet_evidence": "\\log[[likelihood]]([[sequence]]\\mid[[alpha]],\\text{state labels})=\\sum_{[[s]]}\\left[\\log[[beta_function]]([[alpha]]_{\\cdot,[[s]]}+[[counts]]_{\\cdot,[[s]]})-\\log[[beta_function]]([[alpha]]_{\\cdot,[[s]]})\\right].",
"mcse": "[[mean]]=\\frac{1}{[[replicates]]}\\sum_{[[i]]=1}^{[[replicates]]}[[sample]]_{[[i]]},\\qquad [[sd]]^2=\\frac{\\sum_{[[i]]=1}^{[[replicates]]}([[sample]]_{[[i]]}-[[mean]])^2}{[[replicates]]-1},\\qquad [[mcse]]([[mean]])=\\frac{[[sd]]}{\\sqrt{[[replicates]]}}.",
"paired_effect": "[[difference]]_{[[i]]}=[[left]]_{[[i]]}-[[right]]_{[[i]]},\\quad [[mean_difference]]=\\frac{1}{[[replicates]]}\\sum_{[[i]]=1}^{[[replicates]]}[[difference]]_{[[i]]},\\quad \\left[[[quantile]]_{[[tail]]}([[bootstrap_mean]]),[[quantile]]_{1-[[tail]]}([[bootstrap_mean]])\\right].",
"objective_alignment": "\\begin{aligned}[[reproductive_action_value]]([[a]],[[o]])&=\\sum_{[[s]],[[next_s]]}[[world_cue_posterior]]([[s]]\\mid[[o]])[[world_B]]([[next_s]]\\mid[[s]],[[a]])[\\log[[R]]([[next_s]],[[a]])-[[cost]]([[a]])],\\\\ [[reproductive_policy]]([[a]]\\mid[[o]])&=\\frac{\\exp\\{[[reproductive_precision]][[reproductive_action_value]]([[a]],[[o]])\\}}{\\sum_{[[b]]}\\exp\\{[[reproductive_precision]][[reproductive_action_value]]([[b]],[[o]])\\}},\\\\ \\log\\frac{[[policy]]([[a]]\\mid[[o]])}{[[policy]]([[b]]\\mid[[o]])}&=-[[precision]]\\{[[G]]([[a]];[[o]])-[[G]]([[b]];[[o]])\\},\\\\ [[policy]](\\cdot\\mid[[o]])=[[reproductive_policy]](\\cdot\\mid[[o]])&\\Longleftrightarrow\\\\ -[[precision]]\\{[[G]]([[a]];[[o]])-[[G]]([[b]];[[o]])\\}&=[[reproductive_precision]]\\{[[reproductive_action_value]]([[a]],[[o]])-[[reproductive_action_value]]([[b]],[[o]])\\}\\quad(\\forall [[a]],[[b]]).\\end{aligned}",
"transmission_information_loss": "\\begin{aligned}[[p]]([[g]]\\mid[[h]])&=\\frac{[[transmission_matrix]]_{[[h]][[g]]}[[p_g]]}{([[transmission_matrix]][[p]])_{[[h]]}},\\qquad [[selection_law]]([[g]]\\mid[[h]])=\\frac{[[transmission_matrix]]_{[[h]][[g]]}[[selection_law]]_{[[g]]}}{([[transmission_matrix]][[selection_law]])_{[[h]]}},\\\\ [[kl]]([[selection_law]]\\Vert[[p]])-[[kl]]([[transmission_matrix]][[selection_law]]\\Vert[[transmission_matrix]][[p]])&=\\sum_{[[h]]:([[transmission_matrix]][[selection_law]])_{[[h]]}>0}([[transmission_matrix]][[selection_law]])_{[[h]]}[[kl]]\\!\\left([[selection_law]](\\cdot\\mid[[h]])\\Vert[[p]](\\cdot\\mid[[h]])\\right).\\end{aligned}",
"rectangular_price": "[[expectation]]_{[[transmission_matrix]][[selection_operator]]([[p]],[[weight]])}[[[descendant_observable]]]-[[expectation]]_{[[p]]}[[[z]]]=\\frac{[[covariance]]_{[[p]]}([[weight]],[[z]])}{[[mean_weight]]}+\\frac{[[expectation]]_{[[p]]}[[[weight]]([[transmission_matrix]]^\\mathsf T[[descendant_observable]]-[[z]])]}{[[mean_weight]]}.",
"changing_fitness_accounting": "\\begin{aligned}[[descendant_law]]&=[[transmission_matrix]][[selection_operator]]([[p]],[[weight]]),\\\\ [[expectation]]_{[[descendant_law]]}[[[updated_weight]]]-[[expectation]]_{[[p]]}[[[weight]]]&=\\frac{[[fitness_variance]]_{[[p]]}([[weight]])}{[[mean_weight]]}+\\frac{[[expectation]]_{[[p]]}[[[weight]]([[transmission_matrix]]^\\mathsf T[[weight]]-[[weight]])]}{[[mean_weight]]}\\\\ &\\quad+[[expectation]]_{[[descendant_law]]}[[[updated_weight]]-[[weight]]].\\end{aligned}",
"local_jacobian_response": "\\begin{aligned}\\dot{[[nonlinear_state]]}&=[[nonlinear_field]]([[nonlinear_state]],[[nonlinear_input]]),\\qquad [[nonlinear_field]]([[nonlinear_state]]_*,[[nonlinear_input]]_*)=0,\\\\ [[local_jacobian]]&=D_{[[nonlinear_state]]}[[nonlinear_field]]([[nonlinear_state]]_*,[[nonlinear_input]]_*),\\qquad [[input_jacobian]]=D_{[[nonlinear_input]]}[[nonlinear_field]]([[nonlinear_state]]_*,[[nonlinear_input]]_*),\\\\ \\frac{d\\,\\delta[[nonlinear_state]]}{d[[time]]}&=[[local_jacobian]]\\delta[[nonlinear_state]]+[[input_jacobian]]\\delta[[nonlinear_input]]+O\\!\\left((\\|\\delta[[nonlinear_state]]\\|+\\|\\delta[[nonlinear_input]]\\|)^2\\right).\\end{aligned}",
"joint_resource_world": "[[eco_joint_kernel]]([[eco_state]]'\\mid[[eco_state]])=\\sum_{[[joint_cues]],[[joint_actions]]}[[eco_observation_kernel]]([[joint_cues]]\\mid[[eco_state]])\\prod_{[[agent_index]]=1}^{2}[[agent_policy]]_{[[agent_index]]}([[a]]_{[[agent_index]]}\\mid[[agent_memory]]_{[[agent_index]]},[[o]]_{[[agent_index]]})\\,[[eco_transition_kernel]]([[eco_state]]'\\mid[[eco_state]],[[joint_cues]],[[joint_actions]]).",
"diagonal_CPTP_limit": "\\begin{aligned}[[state_channel]]_{[[next_s]][[s]]}&=[[B]]([[next_s]]\\mid[[s]],[[a]]),\\qquad [[density_operator]]=\\operatorname{diag}([[D]]),\\\\ [[kraus_operator]]_{[[next_s]][[s]]}&=\\sqrt{[[state_channel]]_{[[next_s]][[s]]}}\\lvert[[next_s]]\\rangle\\langle[[s]]\\rvert,\\qquad \\sum_{[[next_s]],[[s]]}[[kraus_operator]]_{[[next_s]][[s]]}^{\\dagger}[[kraus_operator]]_{[[next_s]][[s]]}=\\mathbb I,\\\\ [[operator_channel]]_{[[state_channel]]}([[density_operator]])&=\\sum_{[[next_s]],[[s]]}[[kraus_operator]]_{[[next_s]][[s]]}[[density_operator]][[kraus_operator]]_{[[next_s]][[s]]}^{\\dagger}=\\operatorname{diag}([[state_channel]][[D]]).\\end{aligned}",
"measurement_order": "\\begin{aligned}[[density_operator]]_0&=\\lvert0\\rangle\\langle0\\rvert,\\qquad \\lvert\\pm\\rangle=\\frac{\\lvert0\\rangle\\pm\\lvert1\\rangle}{\\sqrt2},\\\\ [[projector_z]]_0&=\\lvert0\\rangle\\langle0\\rvert,\\quad [[projector_z]]_1=\\lvert1\\rangle\\langle1\\rvert,\\quad [[projector_x]]_0=\\lvert+\\rangle\\langle+\\rvert,\\quad [[projector_x]]_1=\\lvert-\\rangle\\langle-\\rvert,\\\\ [[sequential_measurement_law]]^{Z\\to X}([[o]]_Z,[[o]]_X)&=\\operatorname{tr}([[projector_x]]_{[[o]]_X}[[projector_z]]_{[[o]]_Z}[[density_operator]]_0[[projector_z]]_{[[o]]_Z}[[projector_x]]_{[[o]]_X}),\\\\ [[sequential_measurement_law]]^{X\\to Z}([[o]]_Z,[[o]]_X)&=\\operatorname{tr}([[projector_z]]_{[[o]]_Z}[[projector_x]]_{[[o]]_X}[[density_operator]]_0[[projector_x]]_{[[o]]_X}[[projector_z]]_{[[o]]_Z}),\\\\ [[sequential_measurement_law]]^{Z\\to X}&=\\begin{pmatrix}\\frac12&\\frac12\\\\0&0\\end{pmatrix},\\qquad [[sequential_measurement_law]]^{X\\to Z}=\\frac14\\begin{pmatrix}1&1\\\\1&1\\end{pmatrix}.\\end{aligned}",
"sequential_selection": "[[selection_operator]]([[selection_operator]]([[p]],[[weight]]),[[later_weight]])=[[selection_operator]]([[p]],[[weight]]\\,[[later_weight]]).",
"formal_vfe_selection": "\\begin{aligned}[[formal_evidence]]&=\\sum_{[[s]]}[[formal_state_prior]]([[s]])[[formal_likelihood]]([[s]])>0,\\quad [[formal_posterior]]=[[selection_operator]]([[formal_state_prior]],[[formal_likelihood]]),\\\\ [[formal_F]]([[q]];[[o]],[[formal_policy]])&=[[formal_kl]]([[q]]\\Vert[[formal_posterior]])-\\log[[formal_evidence]],\\\\ [[formal_F]]([[formal_posterior]];[[o]],[[formal_policy]])&=-\\log[[formal_evidence]],\\\\ [[formal_F]]([[q]];[[o]],[[formal_policy]])=-\\log[[formal_evidence]]&\\Longleftrightarrow [[q]]=[[formal_posterior]].\\end{aligned}",
"formal_policy_selection": "\\begin{aligned}[[formal_policy_law]]([[formal_policy]])&=\\frac{[[formal_policy_prior]]([[formal_policy]])\\exp\\{-[[formal_precision]][[formal_efe]]([[formal_policy]])\\}}{\\sum_{\\psi}[[formal_policy_prior]](\\psi)\\exp\\{-[[formal_precision]][[formal_efe]](\\psi)\\}},\\\\ [[formal_policy_law]]&=[[selection_operator]]([[formal_policy_prior]],\\exp\\{-[[formal_precision]][[formal_efe]]\\}).\\end{aligned}",
"formal_action_output": "\\begin{aligned}\\mathbb E_{[[formal_action_joint]]}[[[external_output]]]&=\\sum_{[[formal_policy]],[[next_s]]}[[formal_policy_law]]([[formal_policy]])[[formal_state_prior]]([[next_s]])[[external_output]]([[formal_action_map]]([[formal_policy]]),[[next_s]]).\\end{aligned}",
"switching_abundance": "\\begin{aligned}[[switch_matrix]]_{[[switch_environment]]}([[switch_next]],[[switch_phenotype]])&=[[switch_offspring]]([[switch_environment]],[[switch_next]])\\sum_{[[o]]}P^*([[o]]\\mid[[switch_environment]],[[switch_phenotype]])\\\\ &\\quad\\times\\sum_{[[a]]}[[policy]]([[a]]\\mid[[o]])\\mathbf1\\{[[switch_next]]=[[switch_phenotype]]\\oplus[[a]]\\}e^{-[[switch_cost]][[a]]},\\\\ [[switch_abundance]]_{t+1}&=[[switch_matrix]]_{e_t}[[switch_abundance]]_t.\\end{aligned}",
"switching_history_growth": "\\begin{aligned}[[switch_growth]]([[switch_path]])&=\\frac1T\\log\\frac{\\boldsymbol1^\\mathsf T[[switch_abundance]]_T}{\\boldsymbol1^\\mathsf T[[switch_abundance]]_0},\\\\ \\mathbb E[[[switch_growth]]]&=\\sum_{[[switch_path]]}P(e_0)\\prod_{t=1}^{T-1}P(e_t\\mid e_{t-1})[[switch_growth]]([[switch_path]]).\\end{aligned}",
"rg_hierarchy": "\\begin{aligned}[[rg_total_c]]&=[[aggregation]]^{(2)}[[aggregation]]^{(1)},\\quad [[rg_total_l]]=[[lifting]]^{(1)}[[lifting]]^{(2)},\\quad [[rg_total_a]]=[[time_dilation]]^{(2)}[[time_dilation]]^{(1)},\\\\ [[generator]]^{(2)}&=[[time_dilation]]^{(2)}[[aggregation]]^{(2)}\\bigl([[time_dilation]]^{(1)}[[aggregation]]^{(1)}[[generator]]^{(0)}[[lifting]]^{(1)}\\bigr)[[lifting]]^{(2)}=[[rg_total_a]][[rg_total_c]][[generator]]^{(0)}[[rg_total_l]],\\\\ \\left\\{\\begin{aligned}[[time_dilation]]^{(1)}[[aggregation]]^{(1)}[[generator]]^{(0)}&=[[generator]]^{(1)}[[aggregation]]^{(1)},\\\\ [[time_dilation]]^{(2)}[[aggregation]]^{(2)}[[generator]]^{(1)}&=[[generator]]^{(2)}[[aggregation]]^{(2)}\\end{aligned}\\right. &\\Longrightarrow [[rg_total_a]][[rg_total_c]][[generator]]^{(0)}=[[generator]]^{(2)}[[rg_total_c]].\\end{aligned}",
"rg_nested_semigroup_defect": (
r"\begin{aligned}"
r"[[rg_common_propagator]](u)&=e^{u[[rg_total_a]][[generator]]},\qquad "
r"[[rg_final_kernel]](u)=[[rg_total_c]][[rg_common_propagator]](u)[[rg_total_l]],\\"
r"[[rg_intermediate_projection]]&=[[lifting]]^{(1)}[[aggregation]]^{(1)},\qquad "
r"[[rg_final_projection]]=[[rg_total_l]][[rg_total_c]],\\"
r"[[rg_ck_defect]](u,v)&=[[rg_final_kernel]](u+v)-[[rg_final_kernel]](u)[[rg_final_kernel]](v)"
r"=[[rg_fine_defect]](u,v)+[[rg_intermediate_defect]](u,v),\\"
r"[[rg_fine_defect]](u,v)&=[[rg_total_c]][[rg_common_propagator]](u)"
r"(I-[[rg_intermediate_projection]])[[rg_common_propagator]](v)[[rg_total_l]],\\"
r"[[rg_intermediate_defect]](u,v)&=[[rg_total_c]][[rg_common_propagator]](u)"
r"([[rg_intermediate_projection]]-[[rg_final_projection]])[[rg_common_propagator]](v)[[rg_total_l]]."
r"\end{aligned}"
),
"rg_entropy_chain": (
r"\begin{aligned}"
r"[[rg_fine_kl]]([[p]])&=[[kl]]([[p]]\Vert[[stationary]])"
r"=[[rg_visible_kl]]([[p]])+[[rg_hidden_kl]]([[p]]),\\"
r"[[rg_visible_kl]]([[p]])&=[[kl]]([[aggregation]][[p]]\Vert"
r"[[aggregation]][[stationary]]),\\"
r"[[rg_hidden_kl]]([[p]])&=[[kl]]([[p]]\Vert[[lifting]][[aggregation]][[p]])"
r"\ge 0,\quad [[rg_hidden_kl]]([[p]])=0"
r"\iff [[p]]=[[lifting]][[aggregation]][[p]]."
r"\end{aligned}"
),
"rg_entropy_budget": (
r"\begin{aligned}"
r"[[rg_visible_kl]]([[p]]_v)-[[rg_visible_kl]]([[p]]_u)"
r"&=\bigl[[[rg_hidden_kl]]([[p]]_u)-[[rg_hidden_kl]]([[p]]_v)\bigr]\\"
r"&\quad-\bigl[[[rg_fine_kl]]([[p]]_u)-[[rg_fine_kl]]([[p]]_v)\bigr]\\"
r"&\le [[rg_hidden_kl]]([[p]]_u)-[[rg_hidden_kl]]([[p]]_v)"
r"\le [[rg_hidden_kl]]([[p]]_u),\qquad v\ge u."
r"\end{aligned}"
),
"rg_observation_vfe_gap": (
r"\begin{aligned}"
r"[[rg_fine_vfe]]([[q]],o)&=[[kl]]([[q]]\Vert[[rg_observation_posterior]])"
r"-\log Z(o),\\"
r"[[rg_coarse_vfe]]([[aggregation]][[q]],o)&=[[kl]]([[aggregation]][[q]]"
r"\Vert[[aggregation]][[rg_observation_posterior]])-\log Z(o),\\"
r"[[rg_fine_vfe]]([[q]],o)-[[rg_coarse_vfe]]([[aggregation]][[q]],o)"
r"&=[[kl]]([[q]]\Vert[[rg_observation_lift]][[aggregation]][[q]])\ge 0."
r"\end{aligned}"
),
"rg_stationary_visible_slip": (
r"\begin{aligned}"
r"[[p]]_0&=[[stationary]]+\tfrac18[[rg_slip_v]],"
r"\qquad [[aggregation]][[p]]_0=[[aggregation]][[stationary]]"
r"=\tfrac12(1,1)^{\mathsf T},\\"
r"[[aggregation]][[p]]([[coarse_time]])&=[[aggregation]][[stationary]]"
r"+\tfrac12 [[rg_slip_strength]][[time_dilation]][[coarse_time]]"
r"e^{-4[[time_dilation]][[coarse_time]]}(1,-1)^{\mathsf T}."
r"\end{aligned}"
),
"rg_filtering_joint": (
r"\begin{aligned}"
r"s&=e^{[[coarse_time]][[scaled_generator]]}[[p]]_0,\qquad "
r"m=[[aggregation]]s,\qquad"
r"\widetilde m=[[aggregation]] e^{[[coarse_time]][[scaled_generator]]}"
r"[[lifting]][[aggregation]][[p]]_0,\\"
r"J(y,o)&=\sum_x [[aggregation]]_{yx}s_x A(o\mid x)"
r"=m_y \bar A(o\mid y),\qquad"
r"\bar A(o\mid y)=J(y,o)/m_y,\\"
r"\widetilde J(y,o)&=\widetilde m_y A_L(o\mid y),\qquad "
r"A_L(o\mid y)=\sum_x [[lifting]]_{xy}A(o\mid x)."
r"\end{aligned}"
),
"rg_filtering_error_split": (
r"\begin{aligned}"
r"[[kl]](J\Vert\widetilde J)&=[[kl]](m\Vert\widetilde m)"
r"+\sum_y m_y [[kl]]\!\left(\bar A(\cdot\mid y)\Vert A_L(\cdot\mid y)\right)\\"
r"&=[[kl]](b\Vert\widetilde b)+"
r"\sum_o b_o [[kl]](r_o\Vert\widetilde r_o)."
r"\end{aligned}"
),
"encounter_forward_backward": (
r"\begin{aligned}"
r"[[encounter_forward]]&=P_t^{o_t}a_{t-1},"
r"\qquad [[encounter_backward]]=(P_{t+1}^{o_{t+1}})^{\mathsf T}b_{t+1},\\"
r"[[encounter_evidence]]&=[[encounter_forward]]^{\mathsf T}[[encounter_backward]],"
r"\qquad \Pr([[encounter_state]]=x\mid o_{1:[[encounter_end]]})="
r"\frac{[[encounter_forward]](x)[[encounter_backward]](x)}{[[encounter_evidence]]}."
r"\end{aligned}"
),
"rg_marked_closure": (
r"\begin{aligned}"
r"[[aggregation]]P_t^o&=\bar P_t^o[[aggregation]]"
r"\qquad \text{for every }t,o.\\"
r"\big([[aggregation]]P_t^o\big)_{c(x'),x}"
r"&=\big(\bar P_t^o\big)_{c(x'),c(x)},"
r"\qquad \text{for all fine }x,x'."
r"\end{aligned}"
),
"rg_future_evidence_factorization": (
r"\begin{aligned}"
r"\sum_x [[p]](x)[[encounter_backward]](x)"
r"&=\sum_y ([[aggregation]][[p]])(y)\,\bar b_t(y)"
r"\quad \text{for every }[[p]]\\"
r"&\Longleftrightarrow\quad "
r"[[encounter_backward]](x)=\bar b_t(c(x))\quad\text{for every }x."
r"\end{aligned}"
),
"encounter_predictive_readout": (
r"\begin{aligned}"
r"[[encounter_coarse_record]]&=\psi(O),\\"
r"\Pr([[encounter_target]]=j\mid [[encounter_coarse_record]]=r)"
r"&=\sum_{o:\psi(o)=r}\Pr(O=o\mid [[encounter_coarse_record]]=r)"
r"\Pr([[encounter_target]]=j\mid O=o)."
r"\end{aligned}"
),
"paired_cause_calibration": (
r"\begin{aligned}"
r"[[paired_marginal_one]]&=[[paired_cause_mass]][[paired_sensitivity_one]],"
r"\qquad [[paired_marginal_two]]=[[paired_cause_mass]][[paired_sensitivity_two]],\\"
r"[[paired_overlap]]&=[[paired_cause_mass]][[paired_sensitivity_one]][[paired_sensitivity_two]],"
r"\qquad [[paired_cause_mass]]=\frac{[[paired_marginal_one]][[paired_marginal_two]]}{[[paired_overlap]]}"
r"\quad ([[paired_overlap]]>0),\\"
r"[[paired_sensitivity_one]]&=\frac{[[paired_overlap]]}{[[paired_marginal_two]]},"
r"\qquad [[paired_sensitivity_two]]=\frac{[[paired_overlap]]}{[[paired_marginal_one]]}."
r"\end{aligned}"
),
"paired_exit_bounds": (
r"\begin{aligned}"
r"[[paired_union]]&=[[paired_marginal_one]]+[[paired_marginal_two]]-[[paired_overlap]],\\"
r"[[paired_loss_mass]]&\in [u_{\mathrm{L}},\,[[paired_total_exit]]-u_{\mathrm{F}}]."
r"\end{aligned}"
),
"rg_survival_closure": (
r"\begin{aligned}"
r"M&=P\operatorname{diag}(s),\qquad \bar M=[[aggregation]]M[[lifting]],\\"
r"[[rg_living_mass]]&=[[aggregation]]M^t[[p]]_0,\qquad "
r"\widetilde u_t=\bar M^t[[aggregation]][[p]]_0,\\"
r"[[aggregation]]M=\bar M[[aggregation]]&\iff u_1=\widetilde u_1"
r"\ \text{for every }[[p]]_0"
r"\quad\Longrightarrow\quad [[rg_living_mass]]=\widetilde u_t\ \text{for all }t\ge0."
r"\end{aligned}"
),
"rg_survival_kl": (
r"\begin{aligned}"
r"[[rg_survival_evidence]]&=\boldsymbol 1^{\mathsf T}[[rg_living_mass]],\qquad "
r"[[rg_survivor_law]]=[[rg_living_mass]]/[[rg_survival_evidence]],\qquad "
r"J_t=([[rg_living_mass]],1-[[rg_survival_evidence]]),\\"
r"[[kl]](J_t\Vert\widetilde J_t)"
r"&=[[kl]]\!\left(\operatorname{Bern}([[rg_survival_evidence]])\Vert"
r"\operatorname{Bern}(\widetilde Z_t^{\mathrm S})\right)"
r"+[[rg_survival_evidence]][[kl]]([[rg_survivor_law]]\Vert\widetilde\rho_t^{\mathrm S})."
r"\end{aligned}"
),
"rg_projected_blocks": "\\begin{aligned}[[rg_projection]]&=[[lifting]][[aggregation]],\\quad [[hidden_projection]]=I-[[rg_projection]],\\quad [[rg_coarse_law]]=[[aggregation]][[p]],\\quad [[rg_unresolved]]=[[hidden_projection]][[p]],\\\\ [[rg_block_a]]&=[[aggregation]][[scaled_generator]][[lifting]],\\quad [[rg_block_b]]=[[aggregation]][[scaled_generator]][[hidden_projection]],\\\\ [[rg_block_e]]&=[[hidden_projection]][[scaled_generator]][[lifting]],\\quad [[rg_block_d]]=[[hidden_projection]][[scaled_generator]][[hidden_projection]],\\\\ \\frac{d}{d[[coarse_time]]}\\begin{pmatrix}[[rg_coarse_law]]\\\\[[rg_unresolved]]\\end{pmatrix}&=\\begin{pmatrix}[[rg_block_a]]&[[rg_block_b]]\\\\[[rg_block_e]]&[[rg_block_d]]\\end{pmatrix}\\begin{pmatrix}[[rg_coarse_law]]\\\\[[rg_unresolved]]\\end{pmatrix}.\\end{aligned}",
"rg_full_memory": "\\begin{aligned}\\frac{d[[rg_coarse_law]]}{d[[coarse_time]]}&=[[rg_block_a]][[rg_coarse_law]]([[coarse_time]])+[[rg_initial_forcing]]([[coarse_time]])+\\int_0^{[[coarse_time]]}[[memory_kernel]]([[coarse_time]]-u)[[rg_coarse_law]](u)\\,du,\\\\ [[rg_initial_forcing]]([[coarse_time]])&=[[rg_block_b]]e^{[[coarse_time]][[rg_block_d]]}[[rg_unresolved]](0),\\qquad [[memory_kernel]]([[coarse_time]])=[[rg_block_b]]e^{[[coarse_time]][[rg_block_d]]}[[rg_block_e]].\\end{aligned}",
"rg_resolvent_transfer": "\\begin{aligned}[[rg_memory_transform]]([[rg_laplace_rate]])&=[[rg_block_b]]([[rg_laplace_rate]]I-[[rg_block_d]])^{-1}[[rg_block_e]],\\\\ [[rg_resolvent]]([[rg_laplace_rate]])&=[[aggregation]]([[rg_laplace_rate]]I-[[scaled_generator]])^{-1}[[lifting]]=[[[rg_laplace_rate]]I-[[rg_block_a]]-[[rg_memory_transform]]([[rg_laplace_rate]])]^{-1},\\\\ [[rg_coarse_transform]]([[rg_laplace_rate]])&=[[rg_resolvent]]([[rg_laplace_rate]])\\{[[rg_coarse_law]](0)+[[rg_block_b]]([[rg_laplace_rate]]I-[[rg_block_d]])^{-1}[[rg_unresolved]](0)\\}.\\end{aligned}",
"rg_closure_classes": "\\begin{aligned}[[aggregation]][[scaled_generator]]=[[rg_block_a]][[aggregation]]&\\Longleftrightarrow [[rg_block_b]]=0\\ \\Longrightarrow\\ [[memory_kernel]]\\equiv0,\\ [[rg_initial_forcing]]\\equiv0\\ \\text{for every }[[p]]_0,\\\\ [[scaled_generator]][[lifting]]=[[lifting]][[rg_block_a]]&\\Longleftrightarrow [[rg_block_e]]=0\\ \\Longrightarrow\\ [[memory_kernel]]\\equiv0,\\\\ [[rg_unresolved]](0)=0&\\Longrightarrow [[rg_initial_forcing]]\\equiv0.\\end{aligned}",
"rg_initial_slip_counterexample": "\\begin{aligned}[[generator]]_{\\varepsilon}&=\\boldsymbol1\\boldsymbol1^{\\mathsf T}-4I+[[rg_slip_strength]][[rg_slip_u]][[rg_slip_v]]^{\\mathsf T},\\quad 0<[[rg_slip_strength]]<1,\\\\ [[rg_slip_u]]&=(1,1,-1,-1)^{\\mathsf T},\\quad [[rg_slip_v]]=(1,-1,0,0)^{\\mathsf T},\\quad [[p]]_0=[[rg_basis_law]],\\\\ [[rg_block_e]]&=0,\\quad [[memory_kernel]]\\equiv0,\\quad [[rg_initial_forcing]]([[coarse_time]])=2[[rg_slip_strength]][[time_dilation]]e^{-4[[time_dilation]][[coarse_time]]}(1,-1)^{\\mathsf T},\\\\ [[rg_coarse_law]]([[coarse_time]])-e^{[[coarse_time]][[rg_block_a]]}[[rg_coarse_law]](0)&=2[[rg_slip_strength]][[time_dilation]][[coarse_time]]e^{-4[[time_dilation]][[coarse_time]]}(1,-1)^{\\mathsf T},\\\\ \\operatorname{TV}\\!\\left([[rg_coarse_law]]([[coarse_time]]),e^{[[coarse_time]][[rg_block_a]]}[[rg_coarse_law]](0)\\right)&=2[[rg_slip_strength]][[time_dilation]][[coarse_time]]e^{-4[[time_dilation]][[coarse_time]]}>0\\quad([[coarse_time]]>0).\\end{aligned}",
"paper_rg_operators": "[[paper_scale_states]]\\xrightarrow{[[paper_grouping]]}[[paper_scale_particles]]\\xrightarrow{[[paper_reduction]]}\\mathsf X^{(i+1)}\\xrightarrow{\\mathfrak G_{i+1}}\\symup{\\Pi}^{(i+1)}\\xrightarrow{\\mathfrak R_{i+1}}\\cdots",
}
_TOKEN: Final = re.compile(r"\[\[([A-Za-z_]+)\]\]")
def symbols() -> tuple[Symbol, ...]:
return _SYMBOLS
def equation_keys() -> tuple[str, ...]:
return tuple(_EQUATIONS)
_BLANK: Final = "\u2014"
"""Em dash printed where a symbol has no registered orientation or units."""
def render_symbol_table() -> str:
"""Full catalog; an em dash marks an unregistered orientation or units."""
rows = [
"| Symbol | Meaning | Domain | Orientation | Units |",
"|--|-----------|-----|------------|----|",
]
rows.extend(
f"| ${s.tex}$ | {s.meaning} | {s.domain} | {s.orientation or _BLANK} | {s.units or _BLANK} |"
for s in symbols()
)
return "\n".join(rows)
def render_reading_guide_table() -> str:
"""Compact table of index, orientation and units for the most used symbols."""
by_key = {s.key: s for s in symbols()}
rows = [
"| Quantity | Indices | Orientation | Units |",
"|----|---|------|--|",
]
rows.extend(
" | ".join(
(
f"| ${by_key[key].tex}$ {by_key[key].meaning}",
by_key[key].index,
by_key[key].orientation,
by_key[key].units + " |",
)
)
for key in _READING_ORDER
)
return "\n".join(rows)
def render_equation(key: str, *, catalog: tuple[Symbol, ...] | None = None) -> str:
"""Expand registered symbols; reject missing or ambiguous catalog entries."""
if key not in _EQUATIONS:
raise ProbabilityError(f"unknown equation: {key}")
entries = symbols() if catalog is None else catalog
mapping = {symbol.key: symbol.tex for symbol in entries}
if len(mapping) != len(entries):
raise ProbabilityError("duplicate symbol key")
def replace(match: re.Match[str]) -> str:
symbol_key = match.group(1)
if symbol_key not in mapping:
raise ProbabilityError(f"unknown symbol: {symbol_key}")
return "{ " + mapping[symbol_key] + " }"
return numbered_equation(key, _TOKEN.sub(replace, _EQUATIONS[key]))
def numbered_equation(key: str, tex: str) -> str:
if re.fullmatch(r"[a-z][a-zA-Z0-9_.]*", key) is None:
raise ProbabilityError("invalid equation label")
return (
"```{=latex}\n\\begin{equation}\\label{eq:"
+ key
+ "}\n"
+ tex
+ "\n\\end{equation}\n```"
)