"""Check the primary paper's explicit scale dictionary, not its missing witness.""" from decimal import Decimal, localcontext from fractions import Fraction as F import json def main(): physical = { "upper_sum": F(53, 200), "marginal_sum": F(249, 1000), "rough_threshold": F(41, 2500), "rough_cap_1_2": F(31, 200), "rough_cap_ge_3": F(17, 100), } expected = { "upper_sum": F(53, 50), "marginal_sum": F(249, 250), "rough_threshold": F(41, 625), "rough_cap_1_2": F(31, 50), "rough_cap_ge_3": F(17, 25), } assert {key: 4 * value for key, value in physical.items()} == expected i_scale = F(1, 4) ** 45 j_scale = F(1, 4) ** 46 assert j_scale / i_scale == F(1, 4) assert F(4) * j_scale / i_scale == 1 with localcontext() as context: context.prec = 60 prefix = Decimal("4.00438409833460131937") rescaled_prefix = str(prefix / Decimal(4)) print(json.dumps({ "physical_support": {k: str(v) for k, v in physical.items()}, "rescaled_support": {k: str(v) for k, v in expected.items()}, "dimension": 45, "I_scaling": "4^(-45)", "single_J_scaling": "4^(-46)", "physical_sum_J_over_I_factor": "1/4", "physical_threshold": "1", "rescaled_threshold": "4", "scaled_J_in_section_9_includes_factor_45": True, "displayed_quotient_prefix_divided_by_four": rescaled_prefix, "quoted_digits_not_recomputed": True, "exact_witness_not_available_in_inspected_sources": True, }, sort_keys=True, separators=(",", ":"))) if __name__ == "__main__": main()