Replication code for Conservation Is Cheap, Invariance Is Expensive: The dimension of responsibility allocation rules immune to corporate restructuring.
Every numerical claim in the paper is produced by one of the scripts below. All are self-contained, use a fixed random seed, and run in seconds.
python >= 3.10
numpy
pandas
networkx
pip install -r requirements.txt| Script | Reproduces | Paper |
|---|---|---|
code/general_theorem.py |
Characterisation of conservative, universally merger-invariant rules; the family |
Theorem 1, Corollary 2, Remark |
code/gate_C2.py |
The van den Ende-Mandel-Rusinowska measure, verified against |
Section 6 |
code/adjacent.py |
Adjacency-restricted invariance; chaining and cut vertices; the direction-dependent, distance-independent family on a chain; named rules vs exponential discounting | Theorems 2-3, Corollary 4 |
code/connectivity.py |
|
Section 6, final paragraph |
code/pcaf_core.py |
PCAF attribution, three-factor decomposition, merger and price counterfactuals | Corollary 1, Section 7 |
code/verify.py |
Numerical checks of the financed-emissions results | Corollary 1, Section 7 |
| code/test_suite.py | 13-test regression suite covering every theorem-level claim (Lemma 1 conditions, the B>1 example and refinement bound, quotient path-independence, obstruction values, graph bounds, the published-example merger, the covariance formula) | all |
Run everything:
cd code && for f in general_theorem.py gate_C2.py adjacent.py connectivity.py verify.py; do
echo "=== $f ==="; python "$f"; donegate_C2.py first reconstructs
connectivity.py ships with a synthetic generator so that it runs without downloads. To use real data, build the sector-by-sector intermediate flow matrix Z and call:
from connectivity import report
report(Z, label="WIOD 2016, 2014, 56 sectors")The WIOD 2016 release is public at https://www.rug.nl/ggdc/valuechain/wiod/wiod-2016-release.
Code: MIT (see LICENSE). The paper is distributed separately.