universal-physics-tensor 10.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (835) hide show
  1. package/README.md +39 -36
  2. package/bin/upt.mjs +13 -1
  3. package/data/applied-cases.json +1892 -0
  4. package/data/applied-cases.schema.json +194 -0
  5. package/data/atlas/atlas.json +25 -25
  6. package/data/atlas/atlas.jsonld +1 -1
  7. package/data/atlas/diffusion.json +6 -6
  8. package/data/atlas/oscillators.json +7 -7
  9. package/data/atlas/waves.json +14 -14
  10. package/data/atlas/witness-results.json +11 -11
  11. package/data/bridge-catalog.json +389 -230
  12. package/data/bridge-catalog.schema.json +45 -7
  13. package/data/units.json +6 -25
  14. package/dist/atlas/applicability.d.ts.map +1 -1
  15. package/dist/atlas/applicability.js +21 -15
  16. package/dist/atlas/applicability.js.map +1 -1
  17. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
  18. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  19. package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
  20. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  21. package/dist/atlas/benchmark/loader.js +2 -2
  22. package/dist/atlas/benchmark/loader.js.map +1 -1
  23. package/dist/atlas/benchmark/stats.d.ts +2 -2
  24. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  25. package/dist/atlas/benchmark/stats.js +9 -15
  26. package/dist/atlas/benchmark/stats.js.map +1 -1
  27. package/dist/atlas/catalog-formal-ref.d.ts +26 -3
  28. package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
  29. package/dist/atlas/catalog-formal-ref.js +52 -5
  30. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  31. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  32. package/dist/atlas/chain-pipeline.js +7 -8
  33. package/dist/atlas/chain-pipeline.js.map +1 -1
  34. package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
  35. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  36. package/dist/atlas/diffusion/bridges-closure.js +8 -12
  37. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  38. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  39. package/dist/atlas/diffusion/bridges.js +27 -39
  40. package/dist/atlas/diffusion/bridges.js.map +1 -1
  41. package/dist/atlas/diffusion/dimensions.d.ts +6 -14
  42. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
  43. package/dist/atlas/diffusion/dimensions.js +8 -16
  44. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  45. package/dist/atlas/diffusion/models.d.ts +3 -3
  46. package/dist/atlas/diffusion/models.d.ts.map +1 -1
  47. package/dist/atlas/diffusion/models.js +5 -10
  48. package/dist/atlas/diffusion/models.js.map +1 -1
  49. package/dist/atlas/diffusion/numerics.d.ts +16 -4
  50. package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
  51. package/dist/atlas/diffusion/numerics.js +38 -24
  52. package/dist/atlas/diffusion/numerics.js.map +1 -1
  53. package/dist/atlas/link-prediction.d.ts +106 -3
  54. package/dist/atlas/link-prediction.d.ts.map +1 -1
  55. package/dist/atlas/link-prediction.js +212 -66
  56. package/dist/atlas/link-prediction.js.map +1 -1
  57. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  58. package/dist/atlas/oscillators/bridges-coarse.js +7 -11
  59. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  60. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  61. package/dist/atlas/oscillators/bridges-exact.js +6 -7
  62. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  63. package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
  64. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  65. package/dist/atlas/oscillators/bridges-limits.js +23 -34
  66. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  67. package/dist/atlas/oscillators/dimensions.d.ts +9 -21
  68. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
  69. package/dist/atlas/oscillators/dimensions.js +9 -21
  70. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  71. package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
  72. package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
  73. package/dist/atlas/oscillators/limit-witnesses.js +17 -15
  74. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  75. package/dist/atlas/oscillators/models.d.ts.map +1 -1
  76. package/dist/atlas/oscillators/models.js +2 -6
  77. package/dist/atlas/oscillators/models.js.map +1 -1
  78. package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
  79. package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
  80. package/dist/atlas/oscillators/pendulum-motion.js +60 -40
  81. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  82. package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
  83. package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
  84. package/dist/atlas/oscillators/phase-translation.js +3 -4
  85. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  86. package/dist/atlas/oscillators/position-translation.d.ts +68 -7
  87. package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
  88. package/dist/atlas/oscillators/position-translation.js +123 -12
  89. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  90. package/dist/atlas/oscillators/rejections.d.ts +0 -2
  91. package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
  92. package/dist/atlas/oscillators/rejections.js +0 -7
  93. package/dist/atlas/oscillators/rejections.js.map +1 -1
  94. package/dist/atlas/physjs-entries.generated.d.ts +35 -25
  95. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  96. package/dist/atlas/physjs-entries.generated.js +37 -25
  97. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  98. package/dist/atlas/physjs-ref.d.ts +34 -31
  99. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  100. package/dist/atlas/physjs-ref.js +55 -53
  101. package/dist/atlas/physjs-ref.js.map +1 -1
  102. package/dist/atlas/physjs-reviewed.d.ts +1 -1
  103. package/dist/atlas/physjs-reviewed.js +15 -15
  104. package/dist/atlas/physjs-reviewed.js.map +1 -1
  105. package/dist/atlas/poster/statements.d.ts +0 -19
  106. package/dist/atlas/poster/statements.d.ts.map +1 -1
  107. package/dist/atlas/poster/statements.js +1 -1
  108. package/dist/atlas/poster/statements.js.map +1 -1
  109. package/dist/atlas/proof-target.d.ts +1 -1
  110. package/dist/atlas/proof-target.js +1 -1
  111. package/dist/atlas/proof-target.js.map +1 -1
  112. package/dist/atlas/regime.d.ts +1 -1
  113. package/dist/atlas/regime.d.ts.map +1 -1
  114. package/dist/atlas/regime.js +1 -1
  115. package/dist/atlas/regime.js.map +1 -1
  116. package/dist/atlas/text-overlap.d.ts +23 -0
  117. package/dist/atlas/text-overlap.d.ts.map +1 -0
  118. package/dist/atlas/text-overlap.js +41 -0
  119. package/dist/atlas/text-overlap.js.map +1 -0
  120. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  121. package/dist/atlas/waves/bridges-closure.js +2 -6
  122. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  123. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  124. package/dist/atlas/waves/bridges.js +32 -48
  125. package/dist/atlas/waves/bridges.js.map +1 -1
  126. package/dist/atlas/waves/models.d.ts +5 -6
  127. package/dist/atlas/waves/models.d.ts.map +1 -1
  128. package/dist/atlas/waves/models.js +7 -13
  129. package/dist/atlas/waves/models.js.map +1 -1
  130. package/dist/atlas/waves/numerics.d.ts.map +1 -1
  131. package/dist/atlas/waves/numerics.js +10 -3
  132. package/dist/atlas/waves/numerics.js.map +1 -1
  133. package/dist/atlas/witness-numeric.d.ts +30 -0
  134. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  135. package/dist/atlas/witness-numeric.js +53 -0
  136. package/dist/atlas/witness-numeric.js.map +1 -1
  137. package/dist/atlas/witness-specs.d.ts.map +1 -1
  138. package/dist/atlas/witness-specs.js +19 -0
  139. package/dist/atlas/witness-specs.js.map +1 -1
  140. package/dist/atlas/witness-symbolic.d.ts +75 -3
  141. package/dist/atlas/witness-symbolic.d.ts.map +1 -1
  142. package/dist/atlas/witness-symbolic.js +116 -10
  143. package/dist/atlas/witness-symbolic.js.map +1 -1
  144. package/dist/bridges/catalog-load.d.ts.map +1 -1
  145. package/dist/bridges/catalog-load.js +13 -8
  146. package/dist/bridges/catalog-load.js.map +1 -1
  147. package/dist/bridges/catalog-types.d.ts +26 -2
  148. package/dist/bridges/catalog-types.d.ts.map +1 -1
  149. package/dist/bridges/catalog-types.js +11 -1
  150. package/dist/bridges/catalog-types.js.map +1 -1
  151. package/dist/bridges/evaluation-errors.d.ts +31 -1
  152. package/dist/bridges/evaluation-errors.d.ts.map +1 -1
  153. package/dist/bridges/evaluation-errors.js +20 -2
  154. package/dist/bridges/evaluation-errors.js.map +1 -1
  155. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  156. package/dist/bridges/evaluator-inputs.js +7 -5
  157. package/dist/bridges/evaluator-inputs.js.map +1 -1
  158. package/dist/bridges/evaluators.d.ts.map +1 -1
  159. package/dist/bridges/evaluators.js +27 -12
  160. package/dist/bridges/evaluators.js.map +1 -1
  161. package/dist/bridges/expr-parse.d.ts +11 -0
  162. package/dist/bridges/expr-parse.d.ts.map +1 -1
  163. package/dist/bridges/expr-parse.js +14 -5
  164. package/dist/bridges/expr-parse.js.map +1 -1
  165. package/dist/bridges/holds.d.ts +35 -3
  166. package/dist/bridges/holds.d.ts.map +1 -1
  167. package/dist/bridges/holds.js +117 -23
  168. package/dist/bridges/holds.js.map +1 -1
  169. package/dist/bridges/notices.d.ts.map +1 -1
  170. package/dist/bridges/notices.js +5 -5
  171. package/dist/bridges/notices.js.map +1 -1
  172. package/dist/bridges/relation-eval.d.ts +4 -4
  173. package/dist/bridges/relation-eval.d.ts.map +1 -1
  174. package/dist/bridges/relation-eval.js +15 -16
  175. package/dist/bridges/relation-eval.js.map +1 -1
  176. package/dist/bridges/sensitivity.d.ts.map +1 -1
  177. package/dist/bridges/sensitivity.js +3 -3
  178. package/dist/bridges/sensitivity.js.map +1 -1
  179. package/dist/bridges/validity.d.ts +33 -0
  180. package/dist/bridges/validity.d.ts.map +1 -0
  181. package/dist/bridges/validity.js +67 -0
  182. package/dist/bridges/validity.js.map +1 -0
  183. package/dist/canonical/entries/atomic.js +1 -3
  184. package/dist/canonical/entries/atomic.js.map +1 -1
  185. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  186. package/dist/canonical/entries/condensed-matter.js +4 -5
  187. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  188. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  189. package/dist/canonical/entries/dimensional-classics.js +3 -4
  190. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  191. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  192. package/dist/canonical/entries/electromagnetism.js +4 -10
  193. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  194. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  195. package/dist/canonical/entries/fluids-waves.js +3 -7
  196. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  197. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  198. package/dist/canonical/entries/mechanics.js +4 -6
  199. package/dist/canonical/entries/mechanics.js.map +1 -1
  200. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  201. package/dist/canonical/entries/nonmonomial.js +9 -17
  202. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  203. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  204. package/dist/canonical/entries/relativity.js +6 -6
  205. package/dist/canonical/entries/relativity.js.map +1 -1
  206. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  207. package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
  208. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  209. package/dist/canonical/fixed-points.d.ts +94 -0
  210. package/dist/canonical/fixed-points.d.ts.map +1 -0
  211. package/dist/canonical/fixed-points.js +81 -0
  212. package/dist/canonical/fixed-points.js.map +1 -0
  213. package/dist/canonical/linkage.d.ts.map +1 -1
  214. package/dist/canonical/linkage.js +25 -44
  215. package/dist/canonical/linkage.js.map +1 -1
  216. package/dist/canonical/normal-form.d.ts.map +1 -1
  217. package/dist/canonical/normal-form.js +5 -11
  218. package/dist/canonical/normal-form.js.map +1 -1
  219. package/dist/canonical/structural.d.ts +21 -21
  220. package/dist/canonical/structural.d.ts.map +1 -1
  221. package/dist/canonical/structural.js +40 -19
  222. package/dist/canonical/structural.js.map +1 -1
  223. package/dist/cases/catalog-checks.d.ts +10 -0
  224. package/dist/cases/catalog-checks.d.ts.map +1 -0
  225. package/dist/cases/catalog-checks.js +241 -0
  226. package/dist/cases/catalog-checks.js.map +1 -0
  227. package/dist/cases/catalog.d.ts +83 -0
  228. package/dist/cases/catalog.d.ts.map +1 -0
  229. package/dist/cases/catalog.js +118 -0
  230. package/dist/cases/catalog.js.map +1 -0
  231. package/dist/cases/engine.d.ts +13 -0
  232. package/dist/cases/engine.d.ts.map +1 -0
  233. package/dist/cases/engine.js +179 -0
  234. package/dist/cases/engine.js.map +1 -0
  235. package/dist/cases/index.d.ts.map +1 -1
  236. package/dist/cases/index.js +5 -7
  237. package/dist/cases/index.js.map +1 -1
  238. package/dist/cases/methods.d.ts +215 -0
  239. package/dist/cases/methods.d.ts.map +1 -0
  240. package/dist/cases/methods.js +743 -0
  241. package/dist/cases/methods.js.map +1 -0
  242. package/dist/cases/quadrature.d.ts +7 -9
  243. package/dist/cases/quadrature.d.ts.map +1 -1
  244. package/dist/cases/quadrature.js +28 -32
  245. package/dist/cases/quadrature.js.map +1 -1
  246. package/dist/cases/types.d.ts +12 -0
  247. package/dist/cases/types.d.ts.map +1 -1
  248. package/dist/cases/types.js.map +1 -1
  249. package/dist/cli/args.d.ts +25 -1
  250. package/dist/cli/args.d.ts.map +1 -1
  251. package/dist/cli/args.js +30 -8
  252. package/dist/cli/args.js.map +1 -1
  253. package/dist/cli/bindings.d.ts.map +1 -1
  254. package/dist/cli/bindings.js +5 -4
  255. package/dist/cli/bindings.js.map +1 -1
  256. package/dist/cli/command.d.ts +11 -1
  257. package/dist/cli/command.d.ts.map +1 -1
  258. package/dist/cli/command.js.map +1 -1
  259. package/dist/cli/commands/_atlas-map.d.ts +0 -9
  260. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  261. package/dist/cli/commands/_atlas-map.js +8 -18
  262. package/dist/cli/commands/_atlas-map.js.map +1 -1
  263. package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
  264. package/dist/cli/commands/_atlas-route.js +6 -2
  265. package/dist/cli/commands/_atlas-route.js.map +1 -1
  266. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  267. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  268. package/dist/cli/commands/_discovery-opts.js +9 -9
  269. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  270. package/dist/cli/commands/atlas.d.ts.map +1 -1
  271. package/dist/cli/commands/atlas.js +8 -5
  272. package/dist/cli/commands/atlas.js.map +1 -1
  273. package/dist/cli/commands/audit.d.ts.map +1 -1
  274. package/dist/cli/commands/audit.js +8 -1
  275. package/dist/cli/commands/audit.js.map +1 -1
  276. package/dist/cli/commands/axes.d.ts.map +1 -1
  277. package/dist/cli/commands/axes.js +20 -1
  278. package/dist/cli/commands/axes.js.map +1 -1
  279. package/dist/cli/commands/confront.d.ts.map +1 -1
  280. package/dist/cli/commands/confront.js +8 -14
  281. package/dist/cli/commands/confront.js.map +1 -1
  282. package/dist/cli/commands/derive.d.ts.map +1 -1
  283. package/dist/cli/commands/derive.js +22 -22
  284. package/dist/cli/commands/derive.js.map +1 -1
  285. package/dist/cli/commands/discover.d.ts.map +1 -1
  286. package/dist/cli/commands/discover.js +122 -73
  287. package/dist/cli/commands/discover.js.map +1 -1
  288. package/dist/cli/commands/eval.d.ts.map +1 -1
  289. package/dist/cli/commands/eval.js +1 -0
  290. package/dist/cli/commands/eval.js.map +1 -1
  291. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  292. package/dist/cli/commands/evaluate.js +67 -39
  293. package/dist/cli/commands/evaluate.js.map +1 -1
  294. package/dist/cli/commands/explain.d.ts.map +1 -1
  295. package/dist/cli/commands/explain.js +24 -3
  296. package/dist/cli/commands/explain.js.map +1 -1
  297. package/dist/cli/commands/ground.d.ts.map +1 -1
  298. package/dist/cli/commands/ground.js +7 -1
  299. package/dist/cli/commands/ground.js.map +1 -1
  300. package/dist/cli/commands/map.d.ts.map +1 -1
  301. package/dist/cli/commands/map.js +84 -11
  302. package/dist/cli/commands/map.js.map +1 -1
  303. package/dist/cli/commands/metric.d.ts.map +1 -1
  304. package/dist/cli/commands/metric.js +12 -9
  305. package/dist/cli/commands/metric.js.map +1 -1
  306. package/dist/cli/commands/path.d.ts +10 -0
  307. package/dist/cli/commands/path.d.ts.map +1 -1
  308. package/dist/cli/commands/path.js +25 -3
  309. package/dist/cli/commands/path.js.map +1 -1
  310. package/dist/cli/commands/probe.d.ts.map +1 -1
  311. package/dist/cli/commands/probe.js +59 -16
  312. package/dist/cli/commands/probe.js.map +1 -1
  313. package/dist/cli/commands/regime.d.ts.map +1 -1
  314. package/dist/cli/commands/regime.js +1 -0
  315. package/dist/cli/commands/regime.js.map +1 -1
  316. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  317. package/dist/cli/commands/retrieve.js +1 -0
  318. package/dist/cli/commands/retrieve.js.map +1 -1
  319. package/dist/cli/commands/search.d.ts.map +1 -1
  320. package/dist/cli/commands/search.js +1 -0
  321. package/dist/cli/commands/search.js.map +1 -1
  322. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  323. package/dist/cli/commands/symbolic.js +19 -28
  324. package/dist/cli/commands/symbolic.js.map +1 -1
  325. package/dist/cli/commands/testplan.d.ts.map +1 -1
  326. package/dist/cli/commands/testplan.js +4 -2
  327. package/dist/cli/commands/testplan.js.map +1 -1
  328. package/dist/cli/determination.d.ts +1 -0
  329. package/dist/cli/determination.d.ts.map +1 -1
  330. package/dist/cli/determination.js.map +1 -1
  331. package/dist/cli/expr-print.d.ts +0 -2
  332. package/dist/cli/expr-print.d.ts.map +1 -1
  333. package/dist/cli/expr-print.js +7 -31
  334. package/dist/cli/expr-print.js.map +1 -1
  335. package/dist/cli/flag-help.d.ts +1 -0
  336. package/dist/cli/flag-help.d.ts.map +1 -1
  337. package/dist/cli/flag-help.js +1 -0
  338. package/dist/cli/flag-help.js.map +1 -1
  339. package/dist/cli/graphs.d.ts +2 -0
  340. package/dist/cli/graphs.d.ts.map +1 -1
  341. package/dist/cli/graphs.js +1 -0
  342. package/dist/cli/graphs.js.map +1 -1
  343. package/dist/cli/main.d.ts +8 -0
  344. package/dist/cli/main.d.ts.map +1 -1
  345. package/dist/cli/main.js +19 -3
  346. package/dist/cli/main.js.map +1 -1
  347. package/dist/cli/numeric-flag.d.ts +12 -0
  348. package/dist/cli/numeric-flag.d.ts.map +1 -0
  349. package/dist/cli/numeric-flag.js +44 -0
  350. package/dist/cli/numeric-flag.js.map +1 -0
  351. package/dist/cli/output.d.ts +28 -0
  352. package/dist/cli/output.d.ts.map +1 -1
  353. package/dist/cli/output.js +23 -0
  354. package/dist/cli/output.js.map +1 -1
  355. package/dist/cli/record-reach.js +2 -2
  356. package/dist/cli/record-reach.js.map +1 -1
  357. package/dist/cli/record-tables.d.ts.map +1 -1
  358. package/dist/cli/record-tables.js +6 -5
  359. package/dist/cli/record-tables.js.map +1 -1
  360. package/dist/cli/record.d.ts +1 -5
  361. package/dist/cli/record.d.ts.map +1 -1
  362. package/dist/cli/record.js +9 -8
  363. package/dist/cli/record.js.map +1 -1
  364. package/dist/cli/search-index.d.ts.map +1 -1
  365. package/dist/cli/search-index.js +7 -6
  366. package/dist/cli/search-index.js.map +1 -1
  367. package/dist/cli/statuses.d.ts +0 -2
  368. package/dist/cli/statuses.d.ts.map +1 -1
  369. package/dist/cli/statuses.js +12 -9
  370. package/dist/cli/statuses.js.map +1 -1
  371. package/dist/cli/stored-results.d.ts +7 -0
  372. package/dist/cli/stored-results.d.ts.map +1 -0
  373. package/dist/cli/stored-results.js +23 -0
  374. package/dist/cli/stored-results.js.map +1 -0
  375. package/dist/cli/version.d.ts +1 -0
  376. package/dist/cli/version.d.ts.map +1 -1
  377. package/dist/cli/version.js +8 -5
  378. package/dist/cli/version.js.map +1 -1
  379. package/dist/cli-api.d.ts +36 -5
  380. package/dist/cli-api.d.ts.map +1 -1
  381. package/dist/cli-api.js +30 -4
  382. package/dist/cli-api.js.map +1 -1
  383. package/dist/composition/algebraic-equivalence.d.ts +43 -0
  384. package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
  385. package/dist/composition/algebraic-equivalence.js +115 -0
  386. package/dist/composition/algebraic-equivalence.js.map +1 -0
  387. package/dist/composition/axes.d.ts +0 -6
  388. package/dist/composition/axes.d.ts.map +1 -1
  389. package/dist/composition/axes.js +6 -6
  390. package/dist/composition/axes.js.map +1 -1
  391. package/dist/composition/axis-audit.d.ts +47 -20
  392. package/dist/composition/axis-audit.d.ts.map +1 -1
  393. package/dist/composition/axis-audit.js +82 -9
  394. package/dist/composition/axis-audit.js.map +1 -1
  395. package/dist/composition/bridge-analysis.d.ts +17 -0
  396. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  397. package/dist/composition/bridge-analysis.js +102 -55
  398. package/dist/composition/bridge-analysis.js.map +1 -1
  399. package/dist/composition/canonical-compare.d.ts +40 -0
  400. package/dist/composition/canonical-compare.d.ts.map +1 -1
  401. package/dist/composition/canonical-compare.js +122 -24
  402. package/dist/composition/canonical-compare.js.map +1 -1
  403. package/dist/composition/canonical-graph.d.ts +3 -3
  404. package/dist/composition/canonical-graph.d.ts.map +1 -1
  405. package/dist/composition/canonical-graph.js +11 -38
  406. package/dist/composition/canonical-graph.js.map +1 -1
  407. package/dist/composition/canonical-json.js +2 -2
  408. package/dist/composition/canonical-json.js.map +1 -1
  409. package/dist/composition/catalog-graph.d.ts.map +1 -1
  410. package/dist/composition/catalog-graph.js +2 -5
  411. package/dist/composition/catalog-graph.js.map +1 -1
  412. package/dist/composition/chain-candidate.d.ts +8 -0
  413. package/dist/composition/chain-candidate.d.ts.map +1 -1
  414. package/dist/composition/chain-candidate.js +9 -2
  415. package/dist/composition/chain-candidate.js.map +1 -1
  416. package/dist/composition/chain-match.d.ts +6 -3
  417. package/dist/composition/chain-match.d.ts.map +1 -1
  418. package/dist/composition/chain-match.js +4 -1
  419. package/dist/composition/chain-match.js.map +1 -1
  420. package/dist/composition/chain-result.d.ts.map +1 -1
  421. package/dist/composition/chain-result.js +2 -14
  422. package/dist/composition/chain-result.js.map +1 -1
  423. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  424. package/dist/composition/compose-symbolic.js +3 -2
  425. package/dist/composition/compose-symbolic.js.map +1 -1
  426. package/dist/composition/compose.d.ts.map +1 -1
  427. package/dist/composition/compose.js +13 -5
  428. package/dist/composition/compose.js.map +1 -1
  429. package/dist/composition/composition-recovery.d.ts.map +1 -1
  430. package/dist/composition/composition-recovery.js +4 -7
  431. package/dist/composition/composition-recovery.js.map +1 -1
  432. package/dist/composition/consequence.d.ts +15 -5
  433. package/dist/composition/consequence.d.ts.map +1 -1
  434. package/dist/composition/consequence.js +6 -4
  435. package/dist/composition/consequence.js.map +1 -1
  436. package/dist/composition/discovery.d.ts +129 -9
  437. package/dist/composition/discovery.d.ts.map +1 -1
  438. package/dist/composition/discovery.js +171 -67
  439. package/dist/composition/discovery.js.map +1 -1
  440. package/dist/composition/edge.d.ts +21 -2
  441. package/dist/composition/edge.d.ts.map +1 -1
  442. package/dist/composition/edge.js +23 -1
  443. package/dist/composition/edge.js.map +1 -1
  444. package/dist/composition/enumerate.d.ts.map +1 -1
  445. package/dist/composition/enumerate.js +18 -3
  446. package/dist/composition/enumerate.js.map +1 -1
  447. package/dist/composition/evaluate-relation.d.ts +35 -11
  448. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  449. package/dist/composition/evaluate-relation.js +60 -39
  450. package/dist/composition/evaluate-relation.js.map +1 -1
  451. package/dist/composition/explain.d.ts +3 -12
  452. package/dist/composition/explain.d.ts.map +1 -1
  453. package/dist/composition/explain.js +7 -20
  454. package/dist/composition/explain.js.map +1 -1
  455. package/dist/composition/expr-eval.d.ts +1 -1
  456. package/dist/composition/expr-eval.d.ts.map +1 -1
  457. package/dist/composition/expr-eval.js +6 -15
  458. package/dist/composition/expr-eval.js.map +1 -1
  459. package/dist/composition/expr-simplify.d.ts +26 -14
  460. package/dist/composition/expr-simplify.d.ts.map +1 -1
  461. package/dist/composition/expr-simplify.js +64 -72
  462. package/dist/composition/expr-simplify.js.map +1 -1
  463. package/dist/composition/formula-shape.d.ts +23 -4
  464. package/dist/composition/formula-shape.d.ts.map +1 -1
  465. package/dist/composition/formula-shape.js +57 -17
  466. package/dist/composition/formula-shape.js.map +1 -1
  467. package/dist/composition/graph-structure.d.ts +98 -0
  468. package/dist/composition/graph-structure.d.ts.map +1 -0
  469. package/dist/composition/graph-structure.js +167 -0
  470. package/dist/composition/graph-structure.js.map +1 -0
  471. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  472. package/dist/composition/graph-viz-svg.js +1 -1
  473. package/dist/composition/graph-viz-svg.js.map +1 -1
  474. package/dist/composition/graph-viz.d.ts.map +1 -1
  475. package/dist/composition/graph-viz.js +8 -37
  476. package/dist/composition/graph-viz.js.map +1 -1
  477. package/dist/composition/grounding.d.ts.map +1 -1
  478. package/dist/composition/grounding.js +19 -7
  479. package/dist/composition/grounding.js.map +1 -1
  480. package/dist/composition/identifiability.d.ts +91 -4
  481. package/dist/composition/identifiability.d.ts.map +1 -1
  482. package/dist/composition/identifiability.js +363 -6
  483. package/dist/composition/identifiability.js.map +1 -1
  484. package/dist/composition/index.d.ts +8 -4
  485. package/dist/composition/index.d.ts.map +1 -1
  486. package/dist/composition/index.js +3 -2
  487. package/dist/composition/index.js.map +1 -1
  488. package/dist/composition/mathts-quiet.d.ts +7 -8
  489. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  490. package/dist/composition/mathts-quiet.js +7 -16
  491. package/dist/composition/mathts-quiet.js.map +1 -1
  492. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  493. package/dist/composition/mathts-scalar-symbols.js +2 -1
  494. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  495. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  496. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  497. package/dist/composition/own-equation-magnitude.js +270 -0
  498. package/dist/composition/own-equation-magnitude.js.map +1 -0
  499. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  500. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  501. package/dist/composition/probe/backend-protocol.js.map +1 -1
  502. package/dist/composition/probe/candidate-store.d.ts +1 -0
  503. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  504. package/dist/composition/probe/candidate-store.js +1 -0
  505. package/dist/composition/probe/candidate-store.js.map +1 -1
  506. package/dist/composition/probe/corpus.d.ts +8 -4
  507. package/dist/composition/probe/corpus.d.ts.map +1 -1
  508. package/dist/composition/probe/corpus.js +23 -12
  509. package/dist/composition/probe/corpus.js.map +1 -1
  510. package/dist/composition/probe/dataset.d.ts +18 -0
  511. package/dist/composition/probe/dataset.d.ts.map +1 -1
  512. package/dist/composition/probe/dataset.js +95 -50
  513. package/dist/composition/probe/dataset.js.map +1 -1
  514. package/dist/composition/probe/experiment-design.d.ts +7 -1
  515. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  516. package/dist/composition/probe/experiment-design.js +44 -24
  517. package/dist/composition/probe/experiment-design.js.map +1 -1
  518. package/dist/composition/probe/falsify.d.ts +2 -0
  519. package/dist/composition/probe/falsify.d.ts.map +1 -1
  520. package/dist/composition/probe/falsify.js +2 -0
  521. package/dist/composition/probe/falsify.js.map +1 -1
  522. package/dist/composition/probe/fit.d.ts +7 -0
  523. package/dist/composition/probe/fit.d.ts.map +1 -1
  524. package/dist/composition/probe/fit.js +46 -22
  525. package/dist/composition/probe/fit.js.map +1 -1
  526. package/dist/composition/probe/frontier.d.ts.map +1 -1
  527. package/dist/composition/probe/frontier.js +33 -15
  528. package/dist/composition/probe/frontier.js.map +1 -1
  529. package/dist/composition/probe/generator.d.ts +30 -1
  530. package/dist/composition/probe/generator.d.ts.map +1 -1
  531. package/dist/composition/probe/generator.js +58 -36
  532. package/dist/composition/probe/generator.js.map +1 -1
  533. package/dist/composition/probe/index.d.ts +14 -0
  534. package/dist/composition/probe/index.d.ts.map +1 -1
  535. package/dist/composition/probe/index.js +6 -0
  536. package/dist/composition/probe/index.js.map +1 -1
  537. package/dist/composition/probe/limits.d.ts +25 -1
  538. package/dist/composition/probe/limits.d.ts.map +1 -1
  539. package/dist/composition/probe/limits.js +53 -11
  540. package/dist/composition/probe/limits.js.map +1 -1
  541. package/dist/composition/probe/pipeline.d.ts +5 -0
  542. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  543. package/dist/composition/probe/pipeline.js +73 -24
  544. package/dist/composition/probe/pipeline.js.map +1 -1
  545. package/dist/composition/probe/power-law.d.ts +121 -0
  546. package/dist/composition/probe/power-law.d.ts.map +1 -0
  547. package/dist/composition/probe/power-law.js +251 -0
  548. package/dist/composition/probe/power-law.js.map +1 -0
  549. package/dist/composition/probe/problem.d.ts +8 -4
  550. package/dist/composition/probe/problem.d.ts.map +1 -1
  551. package/dist/composition/probe/problem.js +177 -49
  552. package/dist/composition/probe/problem.js.map +1 -1
  553. package/dist/composition/probe/report.js +1 -1
  554. package/dist/composition/probe/report.js.map +1 -1
  555. package/dist/composition/probe/residual.d.ts +7 -1
  556. package/dist/composition/probe/residual.d.ts.map +1 -1
  557. package/dist/composition/probe/residual.js +10 -7
  558. package/dist/composition/probe/residual.js.map +1 -1
  559. package/dist/composition/probe/run-manifest.d.ts +1 -0
  560. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  561. package/dist/composition/probe/run-manifest.js.map +1 -1
  562. package/dist/composition/probe/scalar-search.d.ts +50 -0
  563. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  564. package/dist/composition/probe/scalar-search.js +169 -0
  565. package/dist/composition/probe/scalar-search.js.map +1 -0
  566. package/dist/composition/probe/scoring.d.ts +1 -0
  567. package/dist/composition/probe/scoring.d.ts.map +1 -1
  568. package/dist/composition/probe/scoring.js.map +1 -1
  569. package/dist/composition/probe/structure.d.ts +82 -17
  570. package/dist/composition/probe/structure.d.ts.map +1 -1
  571. package/dist/composition/probe/structure.js +129 -55
  572. package/dist/composition/probe/structure.js.map +1 -1
  573. package/dist/composition/probe/study.d.ts +31 -9
  574. package/dist/composition/probe/study.d.ts.map +1 -1
  575. package/dist/composition/probe/study.js +235 -184
  576. package/dist/composition/probe/study.js.map +1 -1
  577. package/dist/composition/probe/t-tail.d.ts +16 -0
  578. package/dist/composition/probe/t-tail.d.ts.map +1 -0
  579. package/dist/composition/probe/t-tail.js +29 -0
  580. package/dist/composition/probe/t-tail.js.map +1 -0
  581. package/dist/composition/probe/types.d.ts +3 -0
  582. package/dist/composition/probe/types.d.ts.map +1 -1
  583. package/dist/composition/probe/types.js.map +1 -1
  584. package/dist/composition/proposed-bridges.d.ts +52 -12
  585. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  586. package/dist/composition/proposed-bridges.js +107 -60
  587. package/dist/composition/proposed-bridges.js.map +1 -1
  588. package/dist/composition/quantity-clusters.d.ts +48 -0
  589. package/dist/composition/quantity-clusters.d.ts.map +1 -0
  590. package/dist/composition/quantity-clusters.js +98 -0
  591. package/dist/composition/quantity-clusters.js.map +1 -0
  592. package/dist/composition/rational-exponent.d.ts +40 -0
  593. package/dist/composition/rational-exponent.d.ts.map +1 -0
  594. package/dist/composition/rational-exponent.js +65 -0
  595. package/dist/composition/rational-exponent.js.map +1 -0
  596. package/dist/composition/representative-values.d.ts +22 -0
  597. package/dist/composition/representative-values.d.ts.map +1 -1
  598. package/dist/composition/representative-values.js +29 -0
  599. package/dist/composition/representative-values.js.map +1 -1
  600. package/dist/composition/retrodiction.d.ts +15 -0
  601. package/dist/composition/retrodiction.d.ts.map +1 -1
  602. package/dist/composition/retrodiction.js +12 -4
  603. package/dist/composition/retrodiction.js.map +1 -1
  604. package/dist/composition/user-equation.d.ts +1 -0
  605. package/dist/composition/user-equation.d.ts.map +1 -1
  606. package/dist/composition/user-equation.js +3 -2
  607. package/dist/composition/user-equation.js.map +1 -1
  608. package/dist/core/assignment.d.ts +19 -0
  609. package/dist/core/assignment.d.ts.map +1 -0
  610. package/dist/core/assignment.js +19 -0
  611. package/dist/core/assignment.js.map +1 -0
  612. package/dist/core/compare.d.ts +32 -0
  613. package/dist/core/compare.d.ts.map +1 -0
  614. package/dist/core/compare.js +46 -0
  615. package/dist/core/compare.js.map +1 -0
  616. package/dist/core/constants.d.ts +42 -41
  617. package/dist/core/constants.d.ts.map +1 -1
  618. package/dist/core/constants.js +71 -51
  619. package/dist/core/constants.js.map +1 -1
  620. package/dist/core/data-file.d.ts +7 -0
  621. package/dist/core/data-file.d.ts.map +1 -1
  622. package/dist/core/data-file.js +17 -0
  623. package/dist/core/data-file.js.map +1 -1
  624. package/dist/core/format.d.ts +36 -0
  625. package/dist/core/format.d.ts.map +1 -0
  626. package/dist/core/format.js +39 -0
  627. package/dist/core/format.js.map +1 -0
  628. package/dist/core/hash.d.ts +14 -0
  629. package/dist/core/hash.d.ts.map +1 -0
  630. package/dist/core/hash.js +17 -0
  631. package/dist/core/hash.js.map +1 -0
  632. package/dist/core/json-schema.d.ts +2 -0
  633. package/dist/core/json-schema.d.ts.map +1 -1
  634. package/dist/core/json-schema.js +14 -13
  635. package/dist/core/json-schema.js.map +1 -1
  636. package/dist/core/labeled-tensor.d.ts.map +1 -1
  637. package/dist/core/labeled-tensor.js +0 -8
  638. package/dist/core/labeled-tensor.js.map +1 -1
  639. package/dist/core/mathts-read.d.ts +25 -0
  640. package/dist/core/mathts-read.d.ts.map +1 -0
  641. package/dist/core/mathts-read.js +51 -0
  642. package/dist/core/mathts-read.js.map +1 -0
  643. package/dist/core/tensor.d.ts.map +1 -1
  644. package/dist/core/tensor.js +24 -0
  645. package/dist/core/tensor.js.map +1 -1
  646. package/dist/core/types.d.ts +5 -5
  647. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  648. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  649. package/dist/diff/bridge-ast-gradient.js +75 -173
  650. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  651. package/dist/diff/bridge-gradient.d.ts +19 -6
  652. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  653. package/dist/diff/bridge-gradient.js +19 -11
  654. package/dist/diff/bridge-gradient.js.map +1 -1
  655. package/dist/diff/bridge-specs.d.ts.map +1 -1
  656. package/dist/diff/bridge-specs.js +3 -0
  657. package/dist/diff/bridge-specs.js.map +1 -1
  658. package/dist/dimensional/algebra.d.ts +18 -0
  659. package/dist/dimensional/algebra.d.ts.map +1 -1
  660. package/dist/dimensional/algebra.js +41 -1
  661. package/dist/dimensional/algebra.js.map +1 -1
  662. package/dist/dimensional/ast-builders.d.ts +7 -0
  663. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  664. package/dist/dimensional/ast-builders.js +11 -0
  665. package/dist/dimensional/ast-builders.js.map +1 -1
  666. package/dist/dimensional/ast-leaves.d.ts +81 -0
  667. package/dist/dimensional/ast-leaves.d.ts.map +1 -0
  668. package/dist/dimensional/ast-leaves.js +146 -0
  669. package/dist/dimensional/ast-leaves.js.map +1 -0
  670. package/dist/dimensional/ast-types.d.ts +15 -0
  671. package/dist/dimensional/ast-types.d.ts.map +1 -1
  672. package/dist/dimensional/ast-types.js.map +1 -1
  673. package/dist/dimensional/buckingham.d.ts.map +1 -1
  674. package/dist/dimensional/buckingham.js +15 -27
  675. package/dist/dimensional/buckingham.js.map +1 -1
  676. package/dist/dimensional/constant-rows.js +9 -9
  677. package/dist/dimensional/constant-rows.js.map +1 -1
  678. package/dist/dimensional/curvature-composite.d.ts +1 -1
  679. package/dist/dimensional/curvature-composite.js.map +1 -1
  680. package/dist/dimensional/dimension-inference.d.ts.map +1 -1
  681. package/dist/dimensional/dimension-inference.js +1 -2
  682. package/dist/dimensional/dimension-inference.js.map +1 -1
  683. package/dist/dimensional/errors.d.ts +1 -1
  684. package/dist/dimensional/errors.d.ts.map +1 -1
  685. package/dist/dimensional/errors.js +1 -15
  686. package/dist/dimensional/errors.js.map +1 -1
  687. package/dist/dimensional/exact-scale.d.ts +24 -11
  688. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  689. package/dist/dimensional/exact-scale.js +122 -130
  690. package/dist/dimensional/exact-scale.js.map +1 -1
  691. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  692. package/dist/dimensional/gauge-field.js +2 -2
  693. package/dist/dimensional/gauge-field.js.map +1 -1
  694. package/dist/dimensional/hyphen-names.d.ts +12 -2
  695. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  696. package/dist/dimensional/hyphen-names.js +44 -19
  697. package/dist/dimensional/hyphen-names.js.map +1 -1
  698. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  699. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  700. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  701. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  702. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  703. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  704. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  705. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  706. package/dist/dimensional/metric.d.ts.map +1 -1
  707. package/dist/dimensional/metric.js +0 -1
  708. package/dist/dimensional/metric.js.map +1 -1
  709. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  710. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  711. package/dist/dimensional/scalar-lowering.js +45 -0
  712. package/dist/dimensional/scalar-lowering.js.map +1 -0
  713. package/dist/dimensional/symbolic-constants.d.ts +9 -0
  714. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  715. package/dist/dimensional/symbolic-constants.js +13 -1
  716. package/dist/dimensional/symbolic-constants.js.map +1 -1
  717. package/dist/dimensional/types.d.ts +36 -0
  718. package/dist/dimensional/types.d.ts.map +1 -1
  719. package/dist/dimensional/types.js +45 -7
  720. package/dist/dimensional/types.js.map +1 -1
  721. package/dist/dimensional/unit-data.d.ts +5 -1
  722. package/dist/dimensional/unit-data.d.ts.map +1 -1
  723. package/dist/dimensional/unit-data.js +30 -6
  724. package/dist/dimensional/unit-data.js.map +1 -1
  725. package/dist/dimensional/units.d.ts +2 -0
  726. package/dist/dimensional/units.d.ts.map +1 -1
  727. package/dist/dimensional/units.js +59 -3
  728. package/dist/dimensional/units.js.map +1 -1
  729. package/dist/dimensional/validator.d.ts +2 -0
  730. package/dist/dimensional/validator.d.ts.map +1 -1
  731. package/dist/dimensional/validator.js.map +1 -1
  732. package/dist/index.d.ts +9 -3
  733. package/dist/index.d.ts.map +1 -1
  734. package/dist/index.js +10 -4
  735. package/dist/index.js.map +1 -1
  736. package/dist/numerical/christoffel-flat.d.ts.map +1 -1
  737. package/dist/numerical/christoffel-flat.js +3 -2
  738. package/dist/numerical/christoffel-flat.js.map +1 -1
  739. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  740. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  741. package/dist/numerical/connection-lowering-helpers.js +11 -15
  742. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  743. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  744. package/dist/numerical/covariant-eikonal.js +34 -11
  745. package/dist/numerical/covariant-eikonal.js.map +1 -1
  746. package/dist/numerical/curvature-lowering-helpers.js +3 -2
  747. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  748. package/dist/numerical/errors.d.ts.map +1 -1
  749. package/dist/numerical/errors.js +0 -3
  750. package/dist/numerical/errors.js.map +1 -1
  751. package/dist/numerical/finite-difference.d.ts +22 -0
  752. package/dist/numerical/finite-difference.d.ts.map +1 -0
  753. package/dist/numerical/finite-difference.js +27 -0
  754. package/dist/numerical/finite-difference.js.map +1 -0
  755. package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
  756. package/dist/numerical/geodesic-integrator.js +22 -14
  757. package/dist/numerical/geodesic-integrator.js.map +1 -1
  758. package/dist/numerical/geometrized.d.ts.map +1 -1
  759. package/dist/numerical/geometrized.js +0 -1
  760. package/dist/numerical/geometrized.js.map +1 -1
  761. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  762. package/dist/numerical/mathts-engine.js +10 -24
  763. package/dist/numerical/mathts-engine.js.map +1 -1
  764. package/dist/numerical/metric-inverse.d.ts.map +1 -1
  765. package/dist/numerical/metric-inverse.js +83 -46
  766. package/dist/numerical/metric-inverse.js.map +1 -1
  767. package/dist/numerical/null-ray-integrator.d.ts +2 -1
  768. package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
  769. package/dist/numerical/null-ray-integrator.js +12 -12
  770. package/dist/numerical/null-ray-integrator.js.map +1 -1
  771. package/dist/numerical/painleve-gullstrand-metric.js +2 -2
  772. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  773. package/dist/numerical/pderiv.d.ts.map +1 -1
  774. package/dist/numerical/pderiv.js +2 -6
  775. package/dist/numerical/pderiv.js.map +1 -1
  776. package/dist/numerical/perihelion-finder.d.ts +0 -36
  777. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  778. package/dist/numerical/perihelion-finder.js +41 -87
  779. package/dist/numerical/perihelion-finder.js.map +1 -1
  780. package/dist/numerical/quadrature.d.ts.map +1 -1
  781. package/dist/numerical/quadrature.js +11 -13
  782. package/dist/numerical/quadrature.js.map +1 -1
  783. package/dist/numerical/rk4-trajectory.d.ts +10 -0
  784. package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
  785. package/dist/numerical/rk4-trajectory.js +37 -0
  786. package/dist/numerical/rk4-trajectory.js.map +1 -0
  787. package/dist/numerical/schwarzschild.d.ts +14 -0
  788. package/dist/numerical/schwarzschild.d.ts.map +1 -0
  789. package/dist/numerical/schwarzschild.js +17 -0
  790. package/dist/numerical/schwarzschild.js.map +1 -0
  791. package/dist/numerical/spacetime-metrics.d.ts +12 -0
  792. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  793. package/dist/numerical/spacetime-metrics.js +72 -56
  794. package/dist/numerical/spacetime-metrics.js.map +1 -1
  795. package/dist/numerical/statistics.d.ts +24 -0
  796. package/dist/numerical/statistics.d.ts.map +1 -0
  797. package/dist/numerical/statistics.js +52 -0
  798. package/dist/numerical/statistics.js.map +1 -0
  799. package/dist/numerical/strides.d.ts +3 -2
  800. package/dist/numerical/strides.d.ts.map +1 -1
  801. package/dist/numerical/strides.js +3 -10
  802. package/dist/numerical/strides.js.map +1 -1
  803. package/dist/numerical/tensor-engine.d.ts +21 -0
  804. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  805. package/dist/numerical/tensor-engine.js +12 -0
  806. package/dist/numerical/tensor-engine.js.map +1 -1
  807. package/dist/relations/regime.d.ts +10 -0
  808. package/dist/relations/regime.d.ts.map +1 -1
  809. package/dist/relations/regime.js +18 -1
  810. package/dist/relations/regime.js.map +1 -1
  811. package/package.json +9 -12
  812. package/dist/cases/brownian-sphere.d.ts +0 -68
  813. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  814. package/dist/cases/brownian-sphere.js +0 -354
  815. package/dist/cases/brownian-sphere.js.map +0 -1
  816. package/dist/cases/damped-resonator.d.ts +0 -23
  817. package/dist/cases/damped-resonator.d.ts.map +0 -1
  818. package/dist/cases/damped-resonator.js +0 -224
  819. package/dist/cases/damped-resonator.js.map +0 -1
  820. package/dist/cases/kepler-rv.d.ts +0 -13
  821. package/dist/cases/kepler-rv.d.ts.map +0 -1
  822. package/dist/cases/kepler-rv.js +0 -172
  823. package/dist/cases/kepler-rv.js.map +0 -1
  824. package/dist/cases/lumped-cooling.d.ts +0 -46
  825. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  826. package/dist/cases/lumped-cooling.js +0 -261
  827. package/dist/cases/lumped-cooling.js.map +0 -1
  828. package/dist/cases/resistor-noise.d.ts +0 -14
  829. package/dist/cases/resistor-noise.d.ts.map +0 -1
  830. package/dist/cases/resistor-noise.js +0 -215
  831. package/dist/cases/resistor-noise.js.map +0 -1
  832. package/dist/cases/skin-depth.d.ts +0 -21
  833. package/dist/cases/skin-depth.d.ts.map +0 -1
  834. package/dist/cases/skin-depth.js +0 -174
  835. package/dist/cases/skin-depth.js.map +0 -1
@@ -1,20 +1,25 @@
1
1
  /**
2
- * Reviewed `formalRef`s keyed by the vendored PhysJS bridge manifest.
3
- *
4
- * The manifest file is `formal/physjs/manifest.json` (PhysJS `manifest/bridges.json`
5
- * at the commit that file records). `src/` cannot import a file outside its root,
6
- * so `physjs-entries.generated.ts` is the table this module reads.
7
- * `bun run physjs:table` writes that file from the manifest and writes nothing else.
8
- * `tests/atlas/physjs-manifest.test.ts` fails when the file and that table disagree
9
- * on the commit, a theorem, a key, or the coverage phrase.
10
- *
11
- * The commit is `PHYSJS_COMMIT`, copied from the manifest. Which PhysJS pull
12
- * request added which keys, and what the pin was before, is history and lives
13
- * in `NOTES.md` and `CHANGELOG.md`, not here.
2
+ * Reviewed `formalRef`s keyed by this repository's Lean manifest.
3
+ *
4
+ * The Lean proofs are this repository's `lean/` (they moved from PhysJS in
5
+ * 11.0.0, with their history; the `PhysJS.*` theorem names are Lean
6
+ * namespaces, not a dependency). The manifest file is `formal/lean/manifest.json`.
7
+ * `src/` cannot import a file outside its root, so `physjs-entries.generated.ts`
8
+ * is the table this module reads. `bun run physjs:table` writes that file from
9
+ * the manifest and writes nothing else. `tests/atlas/physjs-manifest.test.ts`
10
+ * fails when the file and that table disagree on the toolchain, a theorem, a
11
+ * key, or the coverage phrase. CI's `lean` job builds every file under `lean/`
12
+ * and audits its axioms; this module does not run Lean.
13
+ *
14
+ * Permalinks name `lean/<File>.lean` at the release tag `LEAN_SOURCE_TAG`
15
+ * (`v` and the package version), so a published version links to the proofs
16
+ * it shipped with. Which PhysJS pull request added which keys, and the PhysJS
17
+ * pins before the move, are history in `NOTES.md` and `CHANGELOG.md`.
14
18
  *
15
19
  * Each statement's `kind`, nested ones included, is the manifest's own field
16
- * (schema `physjs-bridge-manifest/v2`), which PhysJS reads from the kind line
17
- * of the Lean file that declares the theorem; this module keeps no override
20
+ * (schema `upt-lean-manifest/v1`), the kind line of the Lean file that
21
+ * declares the theorem (`scripts/lean-index.ts --check` compares the two);
22
+ * this module keeps no override
18
23
  * and does not parse the covers line for it. A field of a manifest entry
19
24
  * outside the base fields is a nested statement: a second theorem on the same
20
25
  * entry, named by the field, with no key. It is recorded and compared, and it
@@ -30,11 +35,11 @@
30
35
  */
31
36
  import type { FormalFidelity, FormalRef, FormalRefKind } from './types.js';
32
37
  /**
33
- * PhysJS commit the vendored manifest records.
38
+ * The release tag whose `lean/` tree the permalinks name.
34
39
  *
35
40
  * @internal
36
41
  */
37
- export { PHYSJS_COMMIT } from './physjs-entries.generated.js';
42
+ export { LEAN_SOURCE_TAG } from './physjs-entries.generated.js';
38
43
  /** One statement the manifest records: an entry's own, or a nested one. */
39
44
  interface PhysjsStatement {
40
45
  readonly theorem: string;
@@ -47,7 +52,7 @@ interface PhysjsStatement {
47
52
  }
48
53
  /** A compiled statement: the manifest's fields and the Lean file that declares its theorem. */
49
54
  interface PhysjsCompiledStatement extends PhysjsStatement {
50
- /** `<File>.lean` under `lean/` at the pin, from `formal/physjs/theorem-files.json`. */
55
+ /** `<File>.lean` under `lean/`, from `formal/lean/theorem-files.json`. */
51
56
  readonly file: string;
52
57
  }
53
58
  /** A nested statement, named by its manifest field. No key. Not a `formalRef`. */
@@ -65,7 +70,7 @@ interface PhysjsEntry extends PhysjsCompiledStatement {
65
70
  readonly nested: readonly PhysjsNestedStatement[];
66
71
  }
67
72
  /**
68
- * One manifest entry as PhysJS writes it: the base fields, and each nested
73
+ * One manifest entry as `formal/lean/manifest.json` writes it: the base fields, and each nested
69
74
  * statement under a field of its own (`planeWave`, `corollary`).
70
75
  * @internal
71
76
  */
@@ -88,10 +93,9 @@ export declare function physjsNestedStatements(entry: PhysjsManifestEntry): {
88
93
  })[];
89
94
  readonly problems: readonly string[];
90
95
  };
91
- /** The vendored manifest, as this module compares it. @internal */
96
+ /** The Lean manifest, as this module compares it. @internal */
92
97
  export interface PhysjsManifestFile {
93
98
  readonly schema: string;
94
- readonly commit: string;
95
99
  readonly toolchain: string;
96
100
  readonly mathlib: string;
97
101
  readonly physlib: string;
@@ -107,9 +111,9 @@ export interface PhysjsManifestFile {
107
111
  */
108
112
  export declare function physjsTheorem(key: string): string | undefined;
109
113
  /**
110
- * Lean file name that contains `theorem` at the pinned commit.
114
+ * Lean file name under `lean/` that declares `theorem`.
111
115
  *
112
- * Read from the compiled table, which copies `formal/physjs/theorem-files.json`:
116
+ * Read from the compiled table, which copies `formal/lean/theorem-files.json`:
113
117
  * the file is where the theorem is declared, not its namespace
114
118
  * (`PhysJS.Einstein.friedmann_corollary` is in `VacuumFriedmann.lean`;
115
119
  * `PhysJS.SpringLc` is a namespace inside `OscillatorDictionary.lean`).
@@ -119,20 +123,19 @@ export declare function physjsTheorem(key: string): string | undefined;
119
123
  */
120
124
  export declare function physjsLeanFile(theorem: string): string;
121
125
  /**
122
- * Permalink to one Lean file at the pinned commit.
126
+ * Permalink to one Lean file of this repository at the release tag.
123
127
  *
124
- * PhysJS #63 stores sources at `lean/<File>.lean`. This is the only builder
125
- * of those URLs.
128
+ * Sources are `lean/<File>.lean`. This is the only builder of those URLs.
126
129
  *
127
130
  * @internal
128
131
  */
129
132
  export declare function physjsFileUrl(file: string): string;
130
133
  /**
131
- * True when `key` is ahead of the catalog: PhysJS proved the statement for a
134
+ * True when `key` is ahead of the catalog: `lean/` proves the statement for a
132
135
  * catalog id the catalog has not reached yet. That is an id above the
133
136
  * catalog's highest, with every id between them also a key of `keys` (the
134
137
  * manifest's), so the ahead keys are one unbroken run that starts right after
135
- * the catalog. Such an entry is vendored and compared, and it is not a seed
138
+ * the catalog. Such an entry is compiled and compared, and it is not a seed
136
139
  * and not a problem until the catalog entry exists. A missing id inside the
137
140
  * catalog's range is not ahead, nor is an id past a gap in the run (a typo
138
141
  * such as an extra digit), nor an atlas key.
@@ -173,7 +176,7 @@ export interface PhysjsReviewedRow {
173
176
  }[];
174
177
  }
175
178
  /**
176
- * The row of a manifest entry as PhysJS writes it, in the shape
179
+ * The row of a manifest entry as the manifest writes it, in the shape
177
180
  * {@link physjsRowHash} reads. @internal
178
181
  */
179
182
  export declare function physjsManifestRow(entry: PhysjsManifestEntry): PhysjsReviewedRow;
@@ -216,11 +219,11 @@ compiledEntries?: readonly PhysjsEntry[]): FormalFidelity;
216
219
  */
217
220
  export declare function physjsFormalRef(key: string): FormalRef;
218
221
  /**
219
- * Problems in the vendored manifest against the bridges that claim to be keyed
222
+ * Problems in the Lean manifest against the bridges that claim to be keyed
220
223
  * by it. Empty means every entry resolves to a `lean4-physjs` reference whose
221
- * theorem, axioms, commit and coverage phrase are the entry's own.
224
+ * theorem, axioms, version and coverage phrase are the entry's own.
222
225
  *
223
- * A wrong commit, theorem, key or coverage phrase is a problem. A manifest
226
+ * A wrong toolchain, version, theorem, key or coverage phrase is a problem. A manifest
224
227
  * entry with no bridge is a problem. A `lean4-physjs` reference with no entry
225
228
  * is a problem: the gate does not skip that system. A nested object is kept
226
229
  * and compared; naming it as the `formalRef` is a problem. The top-level
@@ -1 +1 @@
1
- {"version":3,"file":"physjs-ref.d.ts","sourceRoot":"","sources":["../../src/atlas/physjs-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,C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5D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM;AACX,qEAAqE;AACrE,eAAe,GAAE,SAAS,WAAW,EAAmB,GACvD,cAAc,CAMhB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAatD;AAsCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;IACrF,qEAAqE;IACrE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CACnD,GAAG,MAAM,EAAE,CAgJX"}
@@ -1,20 +1,25 @@
1
1
  /**
2
- * Reviewed `formalRef`s keyed by the vendored PhysJS bridge manifest.
2
+ * Reviewed `formalRef`s keyed by this repository's Lean manifest.
3
3
  *
4
- * The manifest file is `formal/physjs/manifest.json` (PhysJS `manifest/bridges.json`
5
- * at the commit that file records). `src/` cannot import a file outside its root,
6
- * so `physjs-entries.generated.ts` is the table this module reads.
7
- * `bun run physjs:table` writes that file from the manifest and writes nothing else.
8
- * `tests/atlas/physjs-manifest.test.ts` fails when the file and that table disagree
9
- * on the commit, a theorem, a key, or the coverage phrase.
4
+ * The Lean proofs are this repository's `lean/` (they moved from PhysJS in
5
+ * 11.0.0, with their history; the `PhysJS.*` theorem names are Lean
6
+ * namespaces, not a dependency). The manifest file is `formal/lean/manifest.json`.
7
+ * `src/` cannot import a file outside its root, so `physjs-entries.generated.ts`
8
+ * is the table this module reads. `bun run physjs:table` writes that file from
9
+ * the manifest and writes nothing else. `tests/atlas/physjs-manifest.test.ts`
10
+ * fails when the file and that table disagree on the toolchain, a theorem, a
11
+ * key, or the coverage phrase. CI's `lean` job builds every file under `lean/`
12
+ * and audits its axioms; this module does not run Lean.
10
13
  *
11
- * The commit is `PHYSJS_COMMIT`, copied from the manifest. Which PhysJS pull
12
- * request added which keys, and what the pin was before, is history and lives
13
- * in `NOTES.md` and `CHANGELOG.md`, not here.
14
+ * Permalinks name `lean/<File>.lean` at the release tag `LEAN_SOURCE_TAG`
15
+ * (`v` and the package version), so a published version links to the proofs
16
+ * it shipped with. Which PhysJS pull request added which keys, and the PhysJS
17
+ * pins before the move, are history in `NOTES.md` and `CHANGELOG.md`.
14
18
  *
15
19
  * Each statement's `kind`, nested ones included, is the manifest's own field
16
- * (schema `physjs-bridge-manifest/v2`), which PhysJS reads from the kind line
17
- * of the Lean file that declares the theorem; this module keeps no override
20
+ * (schema `upt-lean-manifest/v1`), the kind line of the Lean file that
21
+ * declares the theorem (`scripts/lean-index.ts --check` compares the two);
22
+ * this module keeps no override
18
23
  * and does not parse the covers line for it. A field of a manifest entry
19
24
  * outside the base fields is a nested statement: a second theorem on the same
20
25
  * entry, named by the field, with no key. It is recorded and compared, and it
@@ -28,17 +33,17 @@
28
33
  *
29
34
  * @module atlas/physjs-ref
30
35
  */
31
- import { createHash } from 'node:crypto';
36
+ import { sha256Hex } from '../core/hash.js';
32
37
  import { FORMAL_REF_KINDS } from '../relations/types.js';
33
38
  import { catalogEntries, catalogIdNumber } from '../bridges/catalog-load.js';
34
39
  import { PHYSJS_REVIEWED_ROWS, PHYSJS_SANITY_LEMMA_KEYS } from './physjs-reviewed.js';
35
- import { PHYSJS_COMMIT, PHYSJS_MATHLIB, PHYSJS_PHYS_LIB, PHYSJS_TOOLCHAIN, PHYSJS_ENTRIES as GENERATED_PHYSJS_ENTRIES, } from './physjs-entries.generated.js';
40
+ import { LEAN_MATHLIB, LEAN_PHYSLIB, LEAN_SOURCE_TAG, LEAN_TOOLCHAIN, PHYSJS_ENTRIES as GENERATED_PHYSJS_ENTRIES, } from './physjs-entries.generated.js';
36
41
  /**
37
- * PhysJS commit the vendored manifest records.
42
+ * The release tag whose `lean/` tree the permalinks name.
38
43
  *
39
44
  * @internal
40
45
  */
41
- export { PHYSJS_COMMIT } from './physjs-entries.generated.js';
46
+ export { LEAN_SOURCE_TAG } from './physjs-entries.generated.js';
42
47
  /**
43
48
  * Every reviewed PhysJS reference covers its statement only. A lemma about
44
49
  * `bound.delta` does not certify the regime, the horizon, or the side conditions.
@@ -47,8 +52,9 @@ const PHYSJS_COVERAGE = 'covers its statement only';
47
52
  /**
48
53
  * The axioms a complete Lean 4 proof over Mathlib may rest on. `#print axioms`
49
54
  * of a proof with a `sorry` adds `sorryAx`, and Lean still exits 0 (TOOLS.md),
50
- * so every statement's list is held to this set; PhysJS reports the list and
51
- * this repository does not re-measure it.
55
+ * so every statement's list is held to this set. The manifest records the
56
+ * list; CI's `lean` job audits the axioms of every declaration in `lean/`
57
+ * against the same set, and this module does not re-measure them.
52
58
  */
53
59
  const PHYSJS_ALLOWED_AXIOMS = new Set(['propext', 'Classical.choice', 'Quot.sound']);
54
60
  /** The fields of a manifest entry. Any other field is a nested statement. */
@@ -90,14 +96,14 @@ const FILE_BY_THEOREM = new Map(PHYSJS_ENTRIES.flatMap((entry) => [entry, ...ent
90
96
  export function physjsTheorem(key) {
91
97
  return entryByKey.get(key)?.theorem;
92
98
  }
93
- /** `formalRef.version` for the pinned manifest. */
99
+ /** `formalRef.version`: the release tag of `lean/` and the toolchain it builds with. */
94
100
  function physjsVersion() {
95
- return `physjs@${PHYSJS_COMMIT} ${PHYSJS_TOOLCHAIN} mathlib:${PHYSJS_MATHLIB} physlib@${PHYSJS_PHYS_LIB}`;
101
+ return `upt-lean@${LEAN_SOURCE_TAG} ${LEAN_TOOLCHAIN} mathlib:${LEAN_MATHLIB} physlib@${LEAN_PHYSLIB}`;
96
102
  }
97
103
  /**
98
- * Lean file name that contains `theorem` at the pinned commit.
104
+ * Lean file name under `lean/` that declares `theorem`.
99
105
  *
100
- * Read from the compiled table, which copies `formal/physjs/theorem-files.json`:
106
+ * Read from the compiled table, which copies `formal/lean/theorem-files.json`:
101
107
  * the file is where the theorem is declared, not its namespace
102
108
  * (`PhysJS.Einstein.friedmann_corollary` is in `VacuumFriedmann.lean`;
103
109
  * `PhysJS.SpringLc` is a namespace inside `OscillatorDictionary.lean`).
@@ -108,32 +114,31 @@ function physjsVersion() {
108
114
  export function physjsLeanFile(theorem) {
109
115
  const file = FILE_BY_THEOREM.get(theorem);
110
116
  if (file === undefined)
111
- throw new Error(`PhysJS theorem '${theorem}' is not a statement of the vendored manifest`);
117
+ throw new Error(`PhysJS theorem '${theorem}' is not a statement of the Lean manifest`);
112
118
  return file;
113
119
  }
114
120
  /**
115
- * Permalink to one Lean file at the pinned commit.
121
+ * Permalink to one Lean file of this repository at the release tag.
116
122
  *
117
- * PhysJS #63 stores sources at `lean/<File>.lean`. This is the only builder
118
- * of those URLs.
123
+ * Sources are `lean/<File>.lean`. This is the only builder of those URLs.
119
124
  *
120
125
  * @internal
121
126
  */
122
127
  export function physjsFileUrl(file) {
123
- return `https://github.com/danielsimonjr/PhysJS/blob/${PHYSJS_COMMIT}/lean/${file}`;
128
+ return `https://github.com/danielsimonjr/Universal-Physics-Tensor/blob/${LEAN_SOURCE_TAG}/lean/${file}`;
124
129
  }
125
- /** Permalink to the Lean file that contains `theorem` at the pinned commit. */
130
+ /** Permalink to the Lean file that declares `theorem`, at the release tag. */
126
131
  function physjsStatementUrl(theorem) {
127
132
  return physjsFileUrl(physjsLeanFile(theorem));
128
133
  }
129
134
  /** The highest id in the bridge catalog. */
130
135
  const CATALOG_MAX_ID = Math.max(...catalogEntries().map((entry) => entry.id));
131
136
  /**
132
- * True when `key` is ahead of the catalog: PhysJS proved the statement for a
137
+ * True when `key` is ahead of the catalog: `lean/` proves the statement for a
133
138
  * catalog id the catalog has not reached yet. That is an id above the
134
139
  * catalog's highest, with every id between them also a key of `keys` (the
135
140
  * manifest's), so the ahead keys are one unbroken run that starts right after
136
- * the catalog. Such an entry is vendored and compared, and it is not a seed
141
+ * the catalog. Such an entry is compiled and compared, and it is not a seed
137
142
  * and not a problem until the catalog entry exists. A missing id inside the
138
143
  * catalog's range is not ahead, nor is an id past a gap in the run (a typo
139
144
  * such as an extra digit), nor an atlas key.
@@ -167,7 +172,7 @@ export function physjsKeysAheadOfCatalog() {
167
172
  return PHYSJS_ENTRIES.filter((entry) => physjsAheadOfCatalog(entry.key)).map((entry) => entry.key);
168
173
  }
169
174
  /**
170
- * The row of a manifest entry as PhysJS writes it, in the shape
175
+ * The row of a manifest entry as the manifest writes it, in the shape
171
176
  * {@link physjsRowHash} reads. @internal
172
177
  */
173
178
  export function physjsManifestRow(entry) {
@@ -207,7 +212,7 @@ export function physjsRowHash(row) {
207
212
  [...row.axioms],
208
213
  row.nested.map((n) => [n.name, n.theorem, n.kind, n.covers, n.leanProof, [...n.axioms]]),
209
214
  ];
210
- return createHash('sha256').update(JSON.stringify(columns)).digest('hex');
215
+ return sha256Hex(JSON.stringify(columns));
211
216
  }
212
217
  /**
213
218
  * The fidelity a manifest key earns, derived from what checks it:
@@ -230,7 +235,7 @@ export function physjsFidelity(key,
230
235
  compiledEntries = PHYSJS_ENTRIES) {
231
236
  const entry = compiledEntries.find((candidate) => candidate.key === key);
232
237
  if (entry === undefined)
233
- throw new Error(`PhysJS manifest has no entry for '${key}'`);
238
+ throw new Error(`the Lean manifest has no entry for '${key}'`);
234
239
  if (physjsAheadOfCatalog(key))
235
240
  return 'unreviewed';
236
241
  if (PHYSJS_REVIEWED_ROWS[key] !== physjsRowHash(entry))
@@ -248,7 +253,7 @@ compiledEntries = PHYSJS_ENTRIES) {
248
253
  export function physjsFormalRef(key) {
249
254
  const entry = entryByKey.get(key);
250
255
  if (entry === undefined)
251
- throw new Error(`PhysJS manifest has no entry for '${key}'`);
256
+ throw new Error(`the Lean manifest has no entry for '${key}'`);
252
257
  return {
253
258
  system: 'lean4-physjs',
254
259
  statement: entry.theorem,
@@ -285,11 +290,11 @@ function isFormalRefKind(kind) {
285
290
  return typeof kind === 'string' && FORMAL_REF_KINDS.includes(kind);
286
291
  }
287
292
  /**
288
- * Problems in the vendored manifest against the bridges that claim to be keyed
293
+ * Problems in the Lean manifest against the bridges that claim to be keyed
289
294
  * by it. Empty means every entry resolves to a `lean4-physjs` reference whose
290
- * theorem, axioms, commit and coverage phrase are the entry's own.
295
+ * theorem, axioms, version and coverage phrase are the entry's own.
291
296
  *
292
- * A wrong commit, theorem, key or coverage phrase is a problem. A manifest
297
+ * A wrong toolchain, version, theorem, key or coverage phrase is a problem. A manifest
293
298
  * entry with no bridge is a problem. A `lean4-physjs` reference with no entry
294
299
  * is a problem: the gate does not skip that system. A nested object is kept
295
300
  * and compared; naming it as the `formalRef` is a problem. The top-level
@@ -308,20 +313,17 @@ function isFormalRefKind(kind) {
308
313
  export function physjsManifestProblems(input) {
309
314
  const problems = [];
310
315
  const manifest = input.manifest;
311
- if (manifest.schema !== 'physjs-bridge-manifest/v2') {
312
- problems.push(`manifest schema is '${manifest.schema}', expected 'physjs-bridge-manifest/v2'`);
316
+ if (manifest.schema !== 'upt-lean-manifest/v1') {
317
+ problems.push(`manifest schema is '${manifest.schema}', expected 'upt-lean-manifest/v1'`);
313
318
  }
314
- if (manifest.commit !== PHYSJS_COMMIT) {
315
- problems.push(`manifest commit is '${manifest.commit}', expected '${PHYSJS_COMMIT}'`);
319
+ if (manifest.toolchain !== LEAN_TOOLCHAIN) {
320
+ problems.push(`manifest toolchain is '${manifest.toolchain}', expected '${LEAN_TOOLCHAIN}'`);
316
321
  }
317
- if (manifest.toolchain !== PHYSJS_TOOLCHAIN) {
318
- problems.push(`manifest toolchain is '${manifest.toolchain}', expected '${PHYSJS_TOOLCHAIN}'`);
322
+ if (manifest.mathlib !== LEAN_MATHLIB) {
323
+ problems.push(`manifest mathlib is '${manifest.mathlib}', expected '${LEAN_MATHLIB}'`);
319
324
  }
320
- if (manifest.mathlib !== PHYSJS_MATHLIB) {
321
- problems.push(`manifest mathlib is '${manifest.mathlib}', expected '${PHYSJS_MATHLIB}'`);
322
- }
323
- if (manifest.physlib !== PHYSJS_PHYS_LIB) {
324
- problems.push(`manifest physlib is '${manifest.physlib}', expected '${PHYSJS_PHYS_LIB}'`);
325
+ if (manifest.physlib !== LEAN_PHYSLIB) {
326
+ problems.push(`manifest physlib is '${manifest.physlib}', expected '${LEAN_PHYSLIB}'`);
325
327
  }
326
328
  const compiledEntries = input.compiledEntries ?? PHYSJS_ENTRIES;
327
329
  const compiledByKey = new Map(compiledEntries.map((entry) => [entry.key, entry]));
@@ -365,12 +367,12 @@ export function physjsManifestProblems(input) {
365
367
  problems.push(`${statement.name} axioms for '${entry.key}' [${statement.axioms.join(', ')}] are not a subset of [${[...PHYSJS_ALLOWED_AXIOMS].join(', ')}]`);
366
368
  }
367
369
  if (!fileByTheorem.has(statement.theorem)) {
368
- problems.push(`manifest theorem '${statement.theorem}' (${entry.key}.${statement.name}) has no Lean file in formal/physjs/theorem-files.json`);
370
+ problems.push(`manifest theorem '${statement.theorem}' (${entry.key}.${statement.name}) has no Lean file in formal/lean/theorem-files.json`);
369
371
  }
370
372
  }
371
373
  const file = fileByTheorem.get(entry.theorem);
372
374
  if (file === undefined) {
373
- problems.push(`manifest theorem '${entry.theorem}' has no Lean file in formal/physjs/theorem-files.json`);
375
+ problems.push(`manifest theorem '${entry.theorem}' has no Lean file in formal/lean/theorem-files.json`);
374
376
  }
375
377
  const compiled = compiledByKey.get(entry.key);
376
378
  if (compiled === undefined) {
@@ -383,7 +385,7 @@ export function physjsManifestProblems(input) {
383
385
  compiled.leanProof !== entry.leanProof ||
384
386
  !sameAxioms(compiled.axioms, entry.axioms) ||
385
387
  !sameNested(compiled.nested, nested)) {
386
- problems.push(`compiled entry for '${entry.key}' disagrees with the vendored manifest`);
388
+ problems.push(`compiled entry for '${entry.key}' disagrees with the Lean manifest`);
387
389
  }
388
390
  const bridge = byId.get(entry.key);
389
391
  if (bridge === undefined) {
@@ -413,8 +415,8 @@ export function physjsManifestProblems(input) {
413
415
  if (!ref.covers.includes(entry.covers)) {
414
416
  problems.push(`bridge '${entry.key}' covers line does not record '${entry.covers}'`);
415
417
  }
416
- if (ref.version !== physjsVersion() || !ref.version.includes(`physjs@${manifest.commit}`)) {
417
- problems.push(`bridge '${entry.key}' version '${ref.version}' does not record commit '${manifest.commit}'`);
418
+ if (ref.version !== physjsVersion()) {
419
+ problems.push(`bridge '${entry.key}' version '${ref.version}' is not '${physjsVersion()}'`);
418
420
  }
419
421
  if (ref.fidelity === 'unreviewed') {
420
422
  problems.push(`bridge '${entry.key}' formalRef is unreviewed`);
@@ -1 +1 @@
1
- {"version":3,"file":"physjs-ref.js","sourceRoot":"","sources":["../../src/atlas/physjs-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,IAAI,wBAAwB,GAC3C,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D;;;GAGG;AACH,MAAM,eAAe,GAAG,2BAA2B,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC,CAAC;AAa1G,6EAA6E;AAC7E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAA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CAAC;QACD,IAAI,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,GAAG,2BAA2B,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;YAC5B,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,GAAG,cAAc,GAAG,CAAC,IAAI,gBAAgB,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1D,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,GAAG,aAAa,GAAG,CAAC,GAAG,gBAAgB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,SAAS,EAAE,MAAM,KAAK,cAAc;YAAE,SAAS;QAC1D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YACzB,QAAQ,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Reviewed `formalRef`s keyed by the vendored PhysJS bridge manifest.\n *\n * The manifest file is `formal/physjs/manifest.json` (PhysJS `manifest/bridges.json`\n * at the commit that file records). `src/` cannot import a file outside its root,\n * so `physjs-entries.generated.ts` is the table this module reads.\n * `bun run physjs:table` writes that file from the manifest and writes nothing else.\n * `tests/atlas/physjs-manifest.test.ts` fails when the file and that table disagree\n * on the commit, a theorem, a key, or the coverage phrase.\n *\n * The commit is `PHYSJS_COMMIT`, copied from the manifest. Which PhysJS pull\n * request added which keys, and what the pin was before, is history and lives\n * in `NOTES.md` and `CHANGELOG.md`, not here.\n *\n * Each statement's `kind`, nested ones included, is the manifest's own field\n * (schema `physjs-bridge-manifest/v2`), which PhysJS reads from the kind line\n * of the Lean file that declares the theorem; this module keeps no override\n * and does not parse the covers line for it. A field of a manifest entry\n * outside the base fields is a nested statement: a second theorem on the same\n * entry, named by the field, with no key. It is recorded and compared, and it\n * is not a `formalRef`. The generator reads it by its shape, so a new nested\n * name needs no edit here.\n *\n * A reference's `fidelity` is DERIVED here, never typed on a record:\n * `physjsFidelity` reads the reviewed-row table (`physjs-reviewed.ts`) and the\n * sanity-lemma key list, and a key ahead of the catalog, or whose row is not\n * in that table, is `'unreviewed'`.\n *\n * @module atlas/physjs-ref\n */\n\nimport { createHash } from 'node:crypto';\nimport type { FormalFidelity, FormalRef, FormalRefKind } from './types.js';\nimport { FORMAL_REF_KINDS } from '../relations/types.js';\nimport { catalogEntries, catalogIdNumber } from '../bridges/catalog-load.js';\nimport { PHYSJS_REVIEWED_ROWS, PHYSJS_SANITY_LEMMA_KEYS } from './physjs-reviewed.js';\nimport {\n PHYSJS_COMMIT,\n PHYSJS_MATHLIB,\n PHYSJS_PHYS_LIB,\n PHYSJS_TOOLCHAIN,\n PHYSJS_ENTRIES as GENERATED_PHYSJS_ENTRIES,\n} from './physjs-entries.generated.js';\n\n/**\n * PhysJS commit the vendored manifest records.\n *\n * @internal\n */\nexport { PHYSJS_COMMIT } from './physjs-entries.generated.js';\n\n/**\n * Every reviewed PhysJS reference covers its statement only. A lemma about\n * `bound.delta` does not certify the regime, the horizon, or the side conditions.\n */\nconst PHYSJS_COVERAGE = 'covers its statement only';\n\n/**\n * The axioms a complete Lean 4 proof over Mathlib may rest on. `#print axioms`\n * of a proof with a `sorry` adds `sorryAx`, and Lean still exits 0 (TOOLS.md),\n * so every statement's list is held to this set; PhysJS reports the list and\n * this repository does not re-measure it.\n */\nconst PHYSJS_ALLOWED_AXIOMS: ReadonlySet<string> = new Set(['propext', 'Classical.choice', 'Quot.sound']);\n\n/** One statement the manifest records: an entry's own, or a nested one. */\ninterface PhysjsStatement {\n readonly theorem: string;\n /** How the theorem relates to the equation the key names, as the manifest writes it. */\n readonly kind: string;\n readonly covers: string;\n readonly coverage: string;\n readonly leanProof: string;\n readonly axioms: readonly string[];\n}\n\n/** The fields of a manifest entry. Any other field is a nested statement. */\nconst BASE_FIELDS = new Set<string>(['key', 'bridgeId', 'theorem', 'kind', 'covers', 'coverage', 'leanProof', 'axioms', 'imports']);\n\n/** The fields of a statement, sorted. A nested field with exactly these is a statement. */\nconst STATEMENT_FIELDS = ['axioms', 'coverage', 'covers', 'kind', 'leanProof', 'theorem'] as const;\n\n/** A compiled statement: the manifest's fields and the Lean file that declares its theorem. */\ninterface PhysjsCompiledStatement extends PhysjsStatement {\n /** `<File>.lean` under `lean/` at the pin, from `formal/physjs/theorem-files.json`. */\n readonly file: string;\n}\n\n/** A nested statement, named by its manifest field. No key. Not a `formalRef`. */\ninterface PhysjsNestedStatement extends PhysjsCompiledStatement {\n readonly name: string;\n readonly kind: FormalRefKind;\n}\n\n/** One compiled entry: its own statement, and every nested statement by name. */\ninterface PhysjsEntry extends PhysjsCompiledStatement {\n readonly key: string;\n readonly bridgeId: string;\n /** The manifest's kind: how the theorem relates to the equation the key names. */\n readonly kind: FormalRefKind;\n readonly imports?: string;\n readonly nested: readonly PhysjsNestedStatement[];\n}\n\n/**\n * One manifest entry as PhysJS writes it: the base fields, and each nested\n * statement under a field of its own (`planeWave`, `corollary`).\n * @internal\n */\nexport interface PhysjsManifestEntry extends PhysjsStatement {\n readonly key: string;\n readonly bridgeId: string;\n readonly kind: string;\n readonly imports?: string;\n readonly [field: string]: unknown;\n}\n\n/**\n * The nested statements of a manifest entry, in field order: every field\n * outside the base fields whose value has exactly the statement fields. A\n * field that is neither is returned in `problems`.\n * @internal\n */\nexport function physjsNestedStatements(entry: PhysjsManifestEntry): {\n readonly nested: readonly (PhysjsStatement & { readonly name: string })[];\n readonly problems: readonly string[];\n} {\n const nested: (PhysjsStatement & { readonly name: string })[] = [];\n const problems: string[] = [];\n for (const [field, value] of Object.entries(entry)) {\n if (BASE_FIELDS.has(field)) continue;\n const keys = typeof value === 'object' && value !== null && !Array.isArray(value) ? Object.keys(value).sort() : [];\n if (keys.join() === STATEMENT_FIELDS.join()) nested.push({ name: field, ...(value as PhysjsStatement) });\n else problems.push(`manifest entry '${entry.key}' has unexpected field '${field}'`);\n }\n return { nested, problems };\n}\n\n/** The vendored manifest, as this module compares it. @internal */\nexport interface PhysjsManifestFile {\n readonly schema: string;\n readonly commit: string;\n readonly toolchain: string;\n readonly mathlib: string;\n readonly physlib: string;\n readonly entries: readonly PhysjsManifestEntry[];\n}\n\nconst PHYSJS_ENTRIES: readonly PhysjsEntry[] = GENERATED_PHYSJS_ENTRIES;\n\nconst entryByKey = new Map(PHYSJS_ENTRIES.map((entry) => [entry.key, entry]));\n\n/** Theorem → its Lean file, for every statement of the compiled table, nested ones included. */\nconst FILE_BY_THEOREM: ReadonlyMap<string, string> = new Map(\n PHYSJS_ENTRIES.flatMap((entry) => [entry, ...entry.nested].map((statement) => [statement.theorem, statement.file] as const)),\n);\n\n/**\n * Theorem name on the compiled manifest copy for `key`.\n *\n * This reads the compiled table. It does not build a formal reference\n * and it does not derive an evidence tag.\n *\n * @internal\n */\nexport function physjsTheorem(key: string): string | undefined {\n return entryByKey.get(key)?.theorem;\n}\n\n/** `formalRef.version` for the pinned manifest. */\nfunction physjsVersion(): string {\n return `physjs@${PHYSJS_COMMIT} ${PHYSJS_TOOLCHAIN} mathlib:${PHYSJS_MATHLIB} physlib@${PHYSJS_PHYS_LIB}`;\n}\n\n/**\n * Lean file name that contains `theorem` at the pinned commit.\n *\n * Read from the compiled table, which copies `formal/physjs/theorem-files.json`:\n * the file is where the theorem is declared, not its namespace\n * (`PhysJS.Einstein.friedmann_corollary` is in `VacuumFriedmann.lean`;\n * `PhysJS.SpringLc` is a namespace inside `OscillatorDictionary.lean`).\n * Throws for a theorem the manifest does not name.\n *\n * @internal\n */\nexport function physjsLeanFile(theorem: string): string {\n const file = FILE_BY_THEOREM.get(theorem);\n if (file === undefined) throw new Error(`PhysJS theorem '${theorem}' is not a statement of the vendored manifest`);\n return file;\n}\n\n/**\n * Permalink to one Lean file at the pinned commit.\n *\n * PhysJS #63 stores sources at `lean/<File>.lean`. This is the only builder\n * of those URLs.\n *\n * @internal\n */\nexport function physjsFileUrl(file: string): string {\n return `https://github.com/danielsimonjr/PhysJS/blob/${PHYSJS_COMMIT}/lean/${file}`;\n}\n\n/** Permalink to the Lean file that contains `theorem` at the pinned commit. */\nfunction physjsStatementUrl(theorem: string): string {\n return physjsFileUrl(physjsLeanFile(theorem));\n}\n\n/** The highest id in the bridge catalog. */\nconst CATALOG_MAX_ID = Math.max(...catalogEntries().map((entry) => entry.id));\n\n/**\n * True when `key` is ahead of the catalog: PhysJS proved the statement for a\n * catalog id the catalog has not reached yet. That is an id above the\n * catalog's highest, with every id between them also a key of `keys` (the\n * manifest's), so the ahead keys are one unbroken run that starts right after\n * the catalog. Such an entry is vendored and compared, and it is not a seed\n * and not a problem until the catalog entry exists. A missing id inside the\n * catalog's range is not ahead, nor is an id past a gap in the run (a typo\n * such as an extra digit), nor an atlas key.\n *\n * @internal\n */\nexport function physjsAheadOfCatalog(\n key: string,\n keys: readonly string[] = PHYSJS_ENTRIES.map((entry) => entry.key),\n): boolean {\n const id = catalogIdNumber(key);\n if (id === undefined || id <= CATALOG_MAX_ID) return false;\n const ids = new Set(keys.map(catalogIdNumber));\n for (let n = CATALOG_MAX_ID + 1; n < id; n++) if (!ids.has(n)) return false;\n return true;\n}\n\n/**\n * Manifest keys of kind `bridge`, the theorem stating the equation its key\n * names, that resolve to a bridge: every such atlas key, and every such\n * catalog key whose catalog entry exists. The kind is the manifest's own\n * field. A caller-supplied overlay entry is read the same way. The return\n * value is not stored on a bridge.\n *\n * @internal\n */\nexport function bridgeSeedKeys(\n entries: readonly { readonly key: string; readonly kind: FormalRefKind }[] = PHYSJS_ENTRIES,\n): readonly string[] {\n return entries.filter((entry) => entry.kind === 'bridge' && !physjsAheadOfCatalog(entry.key)).map((entry) => entry.key);\n}\n\n/** Every manifest key ahead of the catalog, in manifest order. @internal */\nexport function physjsKeysAheadOfCatalog(): readonly string[] {\n return PHYSJS_ENTRIES.filter((entry) => physjsAheadOfCatalog(entry.key)).map((entry) => entry.key);\n}\n\n/** The fields of one manifest row that a review reads, nested statements included. @internal */\nexport interface PhysjsReviewedRow {\n readonly key: string;\n readonly theorem: string;\n readonly kind: string;\n readonly covers: string;\n readonly leanProof: string;\n readonly axioms: readonly string[];\n readonly nested: readonly {\n readonly name: string;\n readonly theorem: string;\n readonly kind: string;\n readonly covers: string;\n readonly leanProof: string;\n readonly axioms: readonly string[];\n }[];\n}\n\n/**\n * The row of a manifest entry as PhysJS writes it, in the shape\n * {@link physjsRowHash} reads. @internal\n */\nexport function physjsManifestRow(entry: PhysjsManifestEntry): PhysjsReviewedRow {\n return {\n key: entry.key,\n theorem: entry.theorem,\n kind: entry.kind,\n covers: entry.covers,\n leanProof: entry.leanProof,\n axioms: entry.axioms,\n nested: physjsNestedStatements(entry).nested.map((statement) => ({\n name: statement.name,\n theorem: statement.theorem,\n kind: statement.kind,\n covers: statement.covers,\n leanProof: statement.leanProof,\n axioms: statement.axioms,\n })),\n };\n}\n\n/**\n * SHA-256 of one row: `[key, theorem, kind, covers, leanProof, axioms,\n * nested[]]`, each nested statement as `[name, theorem, kind, covers,\n * leanProof, axioms]`. A swapped theorem or key, a changed kind, a reworded\n * covers line, a proof status, an axiom, or a nested statement changes it.\n * This is what `physjs-reviewed.ts` pins per key.\n *\n * @internal\n */\nexport function physjsRowHash(row: PhysjsReviewedRow): string {\n const columns = [\n row.key,\n row.theorem,\n row.kind,\n row.covers,\n row.leanProof,\n [...row.axioms],\n row.nested.map((n) => [n.name, n.theorem, n.kind, n.covers, n.leanProof, [...n.axioms]]),\n ];\n return createHash('sha256').update(JSON.stringify(columns)).digest('hex');\n}\n\n/**\n * The fidelity a manifest key earns, derived from what checks it:\n *\n * - `'unreviewed'` when the key is ahead of the catalog\n * ({@link physjsAheadOfCatalog}): no bridge exists to read the row against;\n * - `'unreviewed'` when the compiled row's hash is not the one\n * `PHYSJS_REVIEWED_ROWS` records for the key, or the key has no entry there;\n * - `'sanity-lemmas'` when the row is reviewed AND the key is in\n * `PHYSJS_SANITY_LEMMA_KEYS`, whose statements\n * `tests/atlas/formal-sanity.test.ts` instantiates on known cases;\n * - `'reviewed-manifest'` when the row is reviewed and no sanity lemma exists.\n *\n * A key the manifest does not name throws, like {@link physjsFormalRef}.\n *\n * @internal\n */\nexport function physjsFidelity(\n key: string,\n /** Defaults to the generated table. A test passes a mutated copy. */\n compiledEntries: readonly PhysjsEntry[] = PHYSJS_ENTRIES,\n): FormalFidelity {\n const entry = compiledEntries.find((candidate) => candidate.key === key);\n if (entry === undefined) throw new Error(`PhysJS manifest has no entry for '${key}'`);\n if (physjsAheadOfCatalog(key)) return 'unreviewed';\n if (PHYSJS_REVIEWED_ROWS[key] !== physjsRowHash(entry)) return 'unreviewed';\n return PHYSJS_SANITY_LEMMA_KEYS.includes(key) ? 'sanity-lemmas' : 'reviewed-manifest';\n}\n\n/**\n * The reference for a manifest key, with its derived fidelity. Throws when\n * the key is not an entry, so a typo cannot ship a bridge with no reference.\n * A key ahead of the catalog, or whose row is not reviewed, is returned\n * `'unreviewed'` and derives no proof tag.\n *\n * @internal\n */\nexport function physjsFormalRef(key: string): FormalRef {\n const entry = entryByKey.get(key);\n if (entry === undefined) throw new Error(`PhysJS manifest has no entry for '${key}'`);\n return {\n system: 'lean4-physjs',\n statement: entry.theorem,\n version: physjsVersion(),\n axioms: entry.axioms,\n fidelity: physjsFidelity(key),\n kind: entry.kind,\n url: physjsStatementUrl(entry.theorem),\n covers: `${entry.covers} — ${entry.coverage}`,\n };\n}\n\n/** The axioms of a statement that are outside {@link PHYSJS_ALLOWED_AXIOMS}. */\nfunction disallowedAxioms(axioms: readonly string[]): readonly string[] {\n return axioms.filter((axiom) => !PHYSJS_ALLOWED_AXIOMS.has(axiom));\n}\n\nfunction sameAxioms(recorded: readonly string[], manifest: readonly string[]): boolean {\n return recorded.length === manifest.length && recorded.every((axiom, i) => axiom === manifest[i]);\n}\n\nfunction sameStatement(compiled: PhysjsStatement, manifest: PhysjsStatement): boolean {\n return (\n compiled.theorem === manifest.theorem &&\n compiled.kind === manifest.kind &&\n compiled.covers === manifest.covers &&\n compiled.coverage === manifest.coverage &&\n compiled.leanProof === manifest.leanProof &&\n sameAxioms(compiled.axioms, manifest.axioms)\n );\n}\n\n/** The compiled nested statements are the manifest's: the same names, in order, each the same statement. */\nfunction sameNested(\n compiled: readonly PhysjsNestedStatement[],\n manifest: readonly (PhysjsStatement & { readonly name: string })[],\n): boolean {\n return (\n compiled.length === manifest.length &&\n compiled.every((statement, i) => statement.name === manifest[i]!.name && sameStatement(statement, manifest[i]!))\n );\n}\n\n/** The kind of a manifest entry is one of the formal-reference kinds. */\nfunction isFormalRefKind(kind: unknown): kind is FormalRefKind {\n return typeof kind === 'string' && (FORMAL_REF_KINDS as readonly string[]).includes(kind);\n}\n\n/**\n * Problems in the vendored manifest against the bridges that claim to be keyed\n * by it. Empty means every entry resolves to a `lean4-physjs` reference whose\n * theorem, axioms, commit and coverage phrase are the entry's own.\n *\n * A wrong commit, theorem, key or coverage phrase is a problem. A manifest\n * entry with no bridge is a problem. A `lean4-physjs` reference with no entry\n * is a problem: the gate does not skip that system. A nested object is kept\n * and compared; naming it as the `formalRef` is a problem. The top-level\n * theorem stays the reference. The reference's kind is the entry's\n * `kind`; a kind outside the formal-reference kinds is a problem. An axiom\n * outside {@link PHYSJS_ALLOWED_AXIOMS} on any statement is a problem. A `be-`\n * key in the unbroken run above the catalog's highest id is ahead of the\n * catalog and is not a problem (`physjsAheadOfCatalog`); any other key with\n * no bridge is. Every structural check (fields, kinds, coverage, proof\n * status, axioms, Lean file, compiled copy) runs for every entry, ahead keys\n * included; only the checks against a bridge's reference are skipped for a\n * key that has no bridge yet.\n *\n * @internal\n */\nexport function physjsManifestProblems(input: {\n readonly manifest: PhysjsManifestFile;\n readonly bridges: readonly { readonly id: string; readonly formalRef?: FormalRef }[];\n /** Defaults to the generated table. A test passes a mutated copy. */\n readonly compiledEntries?: readonly PhysjsEntry[];\n}): string[] {\n const problems: string[] = [];\n const manifest = input.manifest;\n if (manifest.schema !== 'physjs-bridge-manifest/v2') {\n problems.push(`manifest schema is '${manifest.schema}', expected 'physjs-bridge-manifest/v2'`);\n }\n if (manifest.commit !== PHYSJS_COMMIT) {\n problems.push(`manifest commit is '${manifest.commit}', expected '${PHYSJS_COMMIT}'`);\n }\n if (manifest.toolchain !== PHYSJS_TOOLCHAIN) {\n problems.push(`manifest toolchain is '${manifest.toolchain}', expected '${PHYSJS_TOOLCHAIN}'`);\n }\n if (manifest.mathlib !== PHYSJS_MATHLIB) {\n problems.push(`manifest mathlib is '${manifest.mathlib}', expected '${PHYSJS_MATHLIB}'`);\n }\n if (manifest.physlib !== PHYSJS_PHYS_LIB) {\n problems.push(`manifest physlib is '${manifest.physlib}', expected '${PHYSJS_PHYS_LIB}'`);\n }\n\n const compiledEntries = input.compiledEntries ?? PHYSJS_ENTRIES;\n const compiledByKey = new Map(compiledEntries.map((entry) => [entry.key, entry]));\n /** Theorem → Lean file over the compiled table under test, nested statements included. */\n const fileByTheorem = new Map(\n compiledEntries.flatMap((entry) => [entry, ...entry.nested].map((statement) => [statement.theorem, statement.file] as const)),\n );\n const byId = new Map(input.bridges.map((bridge) => [bridge.id, bridge]));\n const seen = new Set<string>();\n const manifestKeys = manifest.entries.map((entry) => entry.key);\n for (const entry of manifest.entries) {\n if (seen.has(entry.key)) problems.push(`manifest key '${entry.key}' is duplicated`);\n seen.add(entry.key);\n const { nested, problems: fieldProblems } = physjsNestedStatements(entry);\n problems.push(...fieldProblems);\n if (entry.key !== entry.bridgeId) {\n problems.push(`manifest key '${entry.key}' does not equal bridgeId '${entry.bridgeId}'`);\n }\n if (entry.coverage !== PHYSJS_COVERAGE) {\n problems.push(\n `coverage phrase for '${entry.key}' is '${entry.coverage}', expected '${PHYSJS_COVERAGE}'`,\n );\n }\n if (entry.leanProof !== 'complete') {\n problems.push(`leanProof for '${entry.key}' is '${entry.leanProof}', expected 'complete'`);\n }\n if (!isFormalRefKind(entry.kind)) {\n problems.push(`manifest key '${entry.key}' kind '${String(entry.kind)}' is not one of ${FORMAL_REF_KINDS.join(', ')}`);\n }\n if (disallowedAxioms(entry.axioms).length > 0) {\n problems.push(\n `manifest key '${entry.key}' axioms [${entry.axioms.join(', ')}] are not a subset of [${[...PHYSJS_ALLOWED_AXIOMS].join(', ')}]`,\n );\n }\n for (const statement of nested) {\n if (!isFormalRefKind(statement.kind)) {\n problems.push(\n `${statement.name} kind for '${entry.key}' is '${String(statement.kind)}', not one of ${FORMAL_REF_KINDS.join(', ')}`,\n );\n }\n if (statement.coverage !== PHYSJS_COVERAGE) {\n problems.push(\n `${statement.name} coverage phrase for '${entry.key}' is '${statement.coverage}', expected '${PHYSJS_COVERAGE}'`,\n );\n }\n if (statement.leanProof !== 'complete') {\n problems.push(`${statement.name} leanProof for '${entry.key}' is '${statement.leanProof}', expected 'complete'`);\n }\n if (disallowedAxioms(statement.axioms).length > 0) {\n problems.push(\n `${statement.name} axioms for '${entry.key}' [${statement.axioms.join(', ')}] are not a subset of [${[...PHYSJS_ALLOWED_AXIOMS].join(', ')}]`,\n );\n }\n if (!fileByTheorem.has(statement.theorem)) {\n problems.push(`manifest theorem '${statement.theorem}' (${entry.key}.${statement.name}) has no Lean file in formal/physjs/theorem-files.json`);\n }\n }\n const file = fileByTheorem.get(entry.theorem);\n if (file === undefined) {\n problems.push(`manifest theorem '${entry.theorem}' has no Lean file in formal/physjs/theorem-files.json`);\n }\n const compiled = compiledByKey.get(entry.key);\n if (compiled === undefined) {\n problems.push(`manifest key '${entry.key}' is not in the compiled entry table`);\n } else if (\n compiled.theorem !== entry.theorem ||\n compiled.kind !== entry.kind ||\n compiled.covers !== entry.covers ||\n compiled.coverage !== entry.coverage ||\n compiled.leanProof !== entry.leanProof ||\n !sameAxioms(compiled.axioms, entry.axioms) ||\n !sameNested(compiled.nested, nested)\n ) {\n problems.push(`compiled entry for '${entry.key}' disagrees with the vendored manifest`);\n }\n const bridge = byId.get(entry.key);\n if (bridge === undefined) {\n if (!physjsAheadOfCatalog(entry.key, manifestKeys)) problems.push(`manifest key '${entry.key}' does not resolve to a bridge`);\n continue;\n }\n const ref = bridge.formalRef;\n if (ref === undefined || ref.system !== 'lean4-physjs') {\n problems.push(\n `bridge '${entry.key}' has no lean4-physjs formalRef (system '${ref?.system ?? 'none'}')`,\n );\n continue;\n }\n for (const statement of nested) {\n if (ref.statement === statement.theorem) {\n problems.push(\n `bridge '${entry.key}' formalRef names the nested ${statement.name} theorem '${statement.theorem}'; the top-level theorem stays the reference`,\n );\n }\n }\n if (ref.statement !== entry.theorem) {\n problems.push(`bridge '${entry.key}' theorem is '${ref.statement}', manifest theorem is '${entry.theorem}'`);\n }\n if (!sameAxioms(ref.axioms, entry.axioms)) {\n problems.push(\n `bridge '${entry.key}' axioms [${ref.axioms.join(', ')}] differ from the manifest [${entry.axioms.join(', ')}]`,\n );\n }\n if (!ref.covers.includes(PHYSJS_COVERAGE)) {\n problems.push(`bridge '${entry.key}' covers line does not say '${PHYSJS_COVERAGE}'`);\n }\n if (!ref.covers.includes(entry.covers)) {\n problems.push(`bridge '${entry.key}' covers line does not record '${entry.covers}'`);\n }\n if (ref.version !== physjsVersion() || !ref.version.includes(`physjs@${manifest.commit}`)) {\n problems.push(`bridge '${entry.key}' version '${ref.version}' does not record commit '${manifest.commit}'`);\n }\n if (ref.fidelity === 'unreviewed') {\n problems.push(`bridge '${entry.key}' formalRef is unreviewed`);\n }\n if (ref.kind !== entry.kind) {\n problems.push(`bridge '${entry.key}' kind is '${ref.kind}', expected '${entry.kind}'`);\n }\n if (file !== undefined && ref.url !== physjsFileUrl(file)) {\n problems.push(`bridge '${entry.key}' url is '${ref.url}', expected '${physjsFileUrl(file)}'`);\n }\n }\n\n for (const bridge of input.bridges) {\n if (bridge.formalRef?.system !== 'lean4-physjs') continue;\n if (!seen.has(bridge.id)) {\n problems.push(`lean4-physjs formalRef on '${bridge.id}' has no manifest entry`);\n }\n }\n return problems;\n}\n"]}
1
+ {"version":3,"file":"physjs-ref.js","sourceRoot":"","sources":["../../src/atlas/physjs-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,IAAI,wBAAwB,GAC3C,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;;GAGG;AACH,MAAM,eAAe,GAAG,2BAA2B,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC,CAAC;AAa1G,6EAA6E;AAC7E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAEpI,2FAA2F;AAC3F,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,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,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,GAAG,aAAa,GAAG,CAAC,GAAG,gBAAgB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,SAAS,EAAE,MAAM,KAAK,cAAc;YAAE,SAAS;QAC1D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YACzB,QAAQ,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Reviewed `formalRef`s keyed by this repository's Lean manifest.\n *\n * The Lean proofs are this repository's `lean/` (they moved from PhysJS in\n * 11.0.0, with their history; the `PhysJS.*` theorem names are Lean\n * namespaces, not a dependency). The manifest file is `formal/lean/manifest.json`.\n * `src/` cannot import a file outside its root, so `physjs-entries.generated.ts`\n * is the table this module reads. `bun run physjs:table` writes that file from\n * the manifest and writes nothing else. `tests/atlas/physjs-manifest.test.ts`\n * fails when the file and that table disagree on the toolchain, a theorem, a\n * key, or the coverage phrase. CI's `lean` job builds every file under `lean/`\n * and audits its axioms; this module does not run Lean.\n *\n * Permalinks name `lean/<File>.lean` at the release tag `LEAN_SOURCE_TAG`\n * (`v` and the package version), so a published version links to the proofs\n * it shipped with. Which PhysJS pull request added which keys, and the PhysJS\n * pins before the move, are history in `NOTES.md` and `CHANGELOG.md`.\n *\n * Each statement's `kind`, nested ones included, is the manifest's own field\n * (schema `upt-lean-manifest/v1`), the kind line of the Lean file that\n * declares the theorem (`scripts/lean-index.ts --check` compares the two);\n * this module keeps no override\n * and does not parse the covers line for it. A field of a manifest entry\n * outside the base fields is a nested statement: a second theorem on the same\n * entry, named by the field, with no key. It is recorded and compared, and it\n * is not a `formalRef`. The generator reads it by its shape, so a new nested\n * name needs no edit here.\n *\n * A reference's `fidelity` is DERIVED here, never typed on a record:\n * `physjsFidelity` reads the reviewed-row table (`physjs-reviewed.ts`) and the\n * sanity-lemma key list, and a key ahead of the catalog, or whose row is not\n * in that table, is `'unreviewed'`.\n *\n * @module atlas/physjs-ref\n */\n\nimport { sha256Hex } from '../core/hash.js';\nimport type { FormalFidelity, FormalRef, FormalRefKind } from './types.js';\nimport { FORMAL_REF_KINDS } from '../relations/types.js';\nimport { catalogEntries, catalogIdNumber } from '../bridges/catalog-load.js';\nimport { PHYSJS_REVIEWED_ROWS, PHYSJS_SANITY_LEMMA_KEYS } from './physjs-reviewed.js';\nimport {\n LEAN_MATHLIB,\n LEAN_PHYSLIB,\n LEAN_SOURCE_TAG,\n LEAN_TOOLCHAIN,\n PHYSJS_ENTRIES as GENERATED_PHYSJS_ENTRIES,\n} from './physjs-entries.generated.js';\n\n/**\n * The release tag whose `lean/` tree the permalinks name.\n *\n * @internal\n */\nexport { LEAN_SOURCE_TAG } from './physjs-entries.generated.js';\n\n/**\n * Every reviewed PhysJS reference covers its statement only. A lemma about\n * `bound.delta` does not certify the regime, the horizon, or the side conditions.\n */\nconst PHYSJS_COVERAGE = 'covers its statement only';\n\n/**\n * The axioms a complete Lean 4 proof over Mathlib may rest on. `#print axioms`\n * of a proof with a `sorry` adds `sorryAx`, and Lean still exits 0 (TOOLS.md),\n * so every statement's list is held to this set. The manifest records the\n * list; CI's `lean` job audits the axioms of every declaration in `lean/`\n * against the same set, and this module does not re-measure them.\n */\nconst PHYSJS_ALLOWED_AXIOMS: ReadonlySet<string> = new Set(['propext', 'Classical.choice', 'Quot.sound']);\n\n/** One statement the manifest records: an entry's own, or a nested one. */\ninterface PhysjsStatement {\n readonly theorem: string;\n /** How the theorem relates to the equation the key names, as the manifest writes it. */\n readonly kind: string;\n readonly covers: string;\n readonly coverage: string;\n readonly leanProof: string;\n readonly axioms: readonly string[];\n}\n\n/** The fields of a manifest entry. Any other field is a nested statement. */\nconst BASE_FIELDS = new Set<string>(['key', 'bridgeId', 'theorem', 'kind', 'covers', 'coverage', 'leanProof', 'axioms', 'imports']);\n\n/** The fields of a statement, sorted. A nested field with exactly these is a statement. */\nconst STATEMENT_FIELDS = ['axioms', 'coverage', 'covers', 'kind', 'leanProof', 'theorem'] as const;\n\n/** A compiled statement: the manifest's fields and the Lean file that declares its theorem. */\ninterface PhysjsCompiledStatement extends PhysjsStatement {\n /** `<File>.lean` under `lean/`, from `formal/lean/theorem-files.json`. */\n readonly file: string;\n}\n\n/** A nested statement, named by its manifest field. No key. Not a `formalRef`. */\ninterface PhysjsNestedStatement extends PhysjsCompiledStatement {\n readonly name: string;\n readonly kind: FormalRefKind;\n}\n\n/** One compiled entry: its own statement, and every nested statement by name. */\ninterface PhysjsEntry extends PhysjsCompiledStatement {\n readonly key: string;\n readonly bridgeId: string;\n /** The manifest's kind: how the theorem relates to the equation the key names. */\n readonly kind: FormalRefKind;\n readonly imports?: string;\n readonly nested: readonly PhysjsNestedStatement[];\n}\n\n/**\n * One manifest entry as `formal/lean/manifest.json` writes it: the base fields, and each nested\n * statement under a field of its own (`planeWave`, `corollary`).\n * @internal\n */\nexport interface PhysjsManifestEntry extends PhysjsStatement {\n readonly key: string;\n readonly bridgeId: string;\n readonly kind: string;\n readonly imports?: string;\n readonly [field: string]: unknown;\n}\n\n/**\n * The nested statements of a manifest entry, in field order: every field\n * outside the base fields whose value has exactly the statement fields. A\n * field that is neither is returned in `problems`.\n * @internal\n */\nexport function physjsNestedStatements(entry: PhysjsManifestEntry): {\n readonly nested: readonly (PhysjsStatement & { readonly name: string })[];\n readonly problems: readonly string[];\n} {\n const nested: (PhysjsStatement & { readonly name: string })[] = [];\n const problems: string[] = [];\n for (const [field, value] of Object.entries(entry)) {\n if (BASE_FIELDS.has(field)) continue;\n const keys = typeof value === 'object' && value !== null && !Array.isArray(value) ? Object.keys(value).sort() : [];\n if (keys.join() === STATEMENT_FIELDS.join()) nested.push({ name: field, ...(value as PhysjsStatement) });\n else problems.push(`manifest entry '${entry.key}' has unexpected field '${field}'`);\n }\n return { nested, problems };\n}\n\n/** The Lean manifest, as this module compares it. @internal */\nexport interface PhysjsManifestFile {\n readonly schema: string;\n readonly toolchain: string;\n readonly mathlib: string;\n readonly physlib: string;\n readonly entries: readonly PhysjsManifestEntry[];\n}\n\nconst PHYSJS_ENTRIES: readonly PhysjsEntry[] = GENERATED_PHYSJS_ENTRIES;\n\nconst entryByKey = new Map(PHYSJS_ENTRIES.map((entry) => [entry.key, entry]));\n\n/** Theorem → its Lean file, for every statement of the compiled table, nested ones included. */\nconst FILE_BY_THEOREM: ReadonlyMap<string, string> = new Map(\n PHYSJS_ENTRIES.flatMap((entry) => [entry, ...entry.nested].map((statement) => [statement.theorem, statement.file] as const)),\n);\n\n/**\n * Theorem name on the compiled manifest copy for `key`.\n *\n * This reads the compiled table. It does not build a formal reference\n * and it does not derive an evidence tag.\n *\n * @internal\n */\nexport function physjsTheorem(key: string): string | undefined {\n return entryByKey.get(key)?.theorem;\n}\n\n/** `formalRef.version`: the release tag of `lean/` and the toolchain it builds with. */\nfunction physjsVersion(): string {\n return `upt-lean@${LEAN_SOURCE_TAG} ${LEAN_TOOLCHAIN} mathlib:${LEAN_MATHLIB} physlib@${LEAN_PHYSLIB}`;\n}\n\n/**\n * Lean file name under `lean/` that declares `theorem`.\n *\n * Read from the compiled table, which copies `formal/lean/theorem-files.json`:\n * the file is where the theorem is declared, not its namespace\n * (`PhysJS.Einstein.friedmann_corollary` is in `VacuumFriedmann.lean`;\n * `PhysJS.SpringLc` is a namespace inside `OscillatorDictionary.lean`).\n * Throws for a theorem the manifest does not name.\n *\n * @internal\n */\nexport function physjsLeanFile(theorem: string): string {\n const file = FILE_BY_THEOREM.get(theorem);\n if (file === undefined) throw new Error(`PhysJS theorem '${theorem}' is not a statement of the Lean manifest`);\n return file;\n}\n\n/**\n * Permalink to one Lean file of this repository at the release tag.\n *\n * Sources are `lean/<File>.lean`. This is the only builder of those URLs.\n *\n * @internal\n */\nexport function physjsFileUrl(file: string): string {\n return `https://github.com/danielsimonjr/Universal-Physics-Tensor/blob/${LEAN_SOURCE_TAG}/lean/${file}`;\n}\n\n/** Permalink to the Lean file that declares `theorem`, at the release tag. */\nfunction physjsStatementUrl(theorem: string): string {\n return physjsFileUrl(physjsLeanFile(theorem));\n}\n\n/** The highest id in the bridge catalog. */\nconst CATALOG_MAX_ID = Math.max(...catalogEntries().map((entry) => entry.id));\n\n/**\n * True when `key` is ahead of the catalog: `lean/` proves the statement for a\n * catalog id the catalog has not reached yet. That is an id above the\n * catalog's highest, with every id between them also a key of `keys` (the\n * manifest's), so the ahead keys are one unbroken run that starts right after\n * the catalog. Such an entry is compiled and compared, and it is not a seed\n * and not a problem until the catalog entry exists. A missing id inside the\n * catalog's range is not ahead, nor is an id past a gap in the run (a typo\n * such as an extra digit), nor an atlas key.\n *\n * @internal\n */\nexport function physjsAheadOfCatalog(\n key: string,\n keys: readonly string[] = PHYSJS_ENTRIES.map((entry) => entry.key),\n): boolean {\n const id = catalogIdNumber(key);\n if (id === undefined || id <= CATALOG_MAX_ID) return false;\n const ids = new Set(keys.map(catalogIdNumber));\n for (let n = CATALOG_MAX_ID + 1; n < id; n++) if (!ids.has(n)) return false;\n return true;\n}\n\n/**\n * Manifest keys of kind `bridge`, the theorem stating the equation its key\n * names, that resolve to a bridge: every such atlas key, and every such\n * catalog key whose catalog entry exists. The kind is the manifest's own\n * field. A caller-supplied overlay entry is read the same way. The return\n * value is not stored on a bridge.\n *\n * @internal\n */\nexport function bridgeSeedKeys(\n entries: readonly { readonly key: string; readonly kind: FormalRefKind }[] = PHYSJS_ENTRIES,\n): readonly string[] {\n return entries.filter((entry) => entry.kind === 'bridge' && !physjsAheadOfCatalog(entry.key)).map((entry) => entry.key);\n}\n\n/** Every manifest key ahead of the catalog, in manifest order. @internal */\nexport function physjsKeysAheadOfCatalog(): readonly string[] {\n return PHYSJS_ENTRIES.filter((entry) => physjsAheadOfCatalog(entry.key)).map((entry) => entry.key);\n}\n\n/** The fields of one manifest row that a review reads, nested statements included. @internal */\nexport interface PhysjsReviewedRow {\n readonly key: string;\n readonly theorem: string;\n readonly kind: string;\n readonly covers: string;\n readonly leanProof: string;\n readonly axioms: readonly string[];\n readonly nested: readonly {\n readonly name: string;\n readonly theorem: string;\n readonly kind: string;\n readonly covers: string;\n readonly leanProof: string;\n readonly axioms: readonly string[];\n }[];\n}\n\n/**\n * The row of a manifest entry as the manifest writes it, in the shape\n * {@link physjsRowHash} reads. @internal\n */\nexport function physjsManifestRow(entry: PhysjsManifestEntry): PhysjsReviewedRow {\n return {\n key: entry.key,\n theorem: entry.theorem,\n kind: entry.kind,\n covers: entry.covers,\n leanProof: entry.leanProof,\n axioms: entry.axioms,\n nested: physjsNestedStatements(entry).nested.map((statement) => ({\n name: statement.name,\n theorem: statement.theorem,\n kind: statement.kind,\n covers: statement.covers,\n leanProof: statement.leanProof,\n axioms: statement.axioms,\n })),\n };\n}\n\n/**\n * SHA-256 of one row: `[key, theorem, kind, covers, leanProof, axioms,\n * nested[]]`, each nested statement as `[name, theorem, kind, covers,\n * leanProof, axioms]`. A swapped theorem or key, a changed kind, a reworded\n * covers line, a proof status, an axiom, or a nested statement changes it.\n * This is what `physjs-reviewed.ts` pins per key.\n *\n * @internal\n */\nexport function physjsRowHash(row: PhysjsReviewedRow): string {\n const columns = [\n row.key,\n row.theorem,\n row.kind,\n row.covers,\n row.leanProof,\n [...row.axioms],\n row.nested.map((n) => [n.name, n.theorem, n.kind, n.covers, n.leanProof, [...n.axioms]]),\n ];\n return sha256Hex(JSON.stringify(columns));\n}\n\n/**\n * The fidelity a manifest key earns, derived from what checks it:\n *\n * - `'unreviewed'` when the key is ahead of the catalog\n * ({@link physjsAheadOfCatalog}): no bridge exists to read the row against;\n * - `'unreviewed'` when the compiled row's hash is not the one\n * `PHYSJS_REVIEWED_ROWS` records for the key, or the key has no entry there;\n * - `'sanity-lemmas'` when the row is reviewed AND the key is in\n * `PHYSJS_SANITY_LEMMA_KEYS`, whose statements\n * `tests/atlas/formal-sanity.test.ts` instantiates on known cases;\n * - `'reviewed-manifest'` when the row is reviewed and no sanity lemma exists.\n *\n * A key the manifest does not name throws, like {@link physjsFormalRef}.\n *\n * @internal\n */\nexport function physjsFidelity(\n key: string,\n /** Defaults to the generated table. A test passes a mutated copy. */\n compiledEntries: readonly PhysjsEntry[] = PHYSJS_ENTRIES,\n): FormalFidelity {\n const entry = compiledEntries.find((candidate) => candidate.key === key);\n if (entry === undefined) throw new Error(`the Lean manifest has no entry for '${key}'`);\n if (physjsAheadOfCatalog(key)) return 'unreviewed';\n if (PHYSJS_REVIEWED_ROWS[key] !== physjsRowHash(entry)) return 'unreviewed';\n return PHYSJS_SANITY_LEMMA_KEYS.includes(key) ? 'sanity-lemmas' : 'reviewed-manifest';\n}\n\n/**\n * The reference for a manifest key, with its derived fidelity. Throws when\n * the key is not an entry, so a typo cannot ship a bridge with no reference.\n * A key ahead of the catalog, or whose row is not reviewed, is returned\n * `'unreviewed'` and derives no proof tag.\n *\n * @internal\n */\nexport function physjsFormalRef(key: string): FormalRef {\n const entry = entryByKey.get(key);\n if (entry === undefined) throw new Error(`the Lean manifest has no entry for '${key}'`);\n return {\n system: 'lean4-physjs',\n statement: entry.theorem,\n version: physjsVersion(),\n axioms: entry.axioms,\n fidelity: physjsFidelity(key),\n kind: entry.kind,\n url: physjsStatementUrl(entry.theorem),\n covers: `${entry.covers} — ${entry.coverage}`,\n };\n}\n\n/** The axioms of a statement that are outside {@link PHYSJS_ALLOWED_AXIOMS}. */\nfunction disallowedAxioms(axioms: readonly string[]): readonly string[] {\n return axioms.filter((axiom) => !PHYSJS_ALLOWED_AXIOMS.has(axiom));\n}\n\nfunction sameAxioms(recorded: readonly string[], manifest: readonly string[]): boolean {\n return recorded.length === manifest.length && recorded.every((axiom, i) => axiom === manifest[i]);\n}\n\nfunction sameStatement(compiled: PhysjsStatement, manifest: PhysjsStatement): boolean {\n return (\n compiled.theorem === manifest.theorem &&\n compiled.kind === manifest.kind &&\n compiled.covers === manifest.covers &&\n compiled.coverage === manifest.coverage &&\n compiled.leanProof === manifest.leanProof &&\n sameAxioms(compiled.axioms, manifest.axioms)\n );\n}\n\n/** The compiled nested statements are the manifest's: the same names, in order, each the same statement. */\nfunction sameNested(\n compiled: readonly PhysjsNestedStatement[],\n manifest: readonly (PhysjsStatement & { readonly name: string })[],\n): boolean {\n return (\n compiled.length === manifest.length &&\n compiled.every((statement, i) => statement.name === manifest[i]!.name && sameStatement(statement, manifest[i]!))\n );\n}\n\n/** The kind of a manifest entry is one of the formal-reference kinds. */\nfunction isFormalRefKind(kind: unknown): kind is FormalRefKind {\n return typeof kind === 'string' && (FORMAL_REF_KINDS as readonly string[]).includes(kind);\n}\n\n/**\n * Problems in the Lean manifest against the bridges that claim to be keyed\n * by it. Empty means every entry resolves to a `lean4-physjs` reference whose\n * theorem, axioms, version and coverage phrase are the entry's own.\n *\n * A wrong toolchain, version, theorem, key or coverage phrase is a problem. A manifest\n * entry with no bridge is a problem. A `lean4-physjs` reference with no entry\n * is a problem: the gate does not skip that system. A nested object is kept\n * and compared; naming it as the `formalRef` is a problem. The top-level\n * theorem stays the reference. The reference's kind is the entry's\n * `kind`; a kind outside the formal-reference kinds is a problem. An axiom\n * outside {@link PHYSJS_ALLOWED_AXIOMS} on any statement is a problem. A `be-`\n * key in the unbroken run above the catalog's highest id is ahead of the\n * catalog and is not a problem (`physjsAheadOfCatalog`); any other key with\n * no bridge is. Every structural check (fields, kinds, coverage, proof\n * status, axioms, Lean file, compiled copy) runs for every entry, ahead keys\n * included; only the checks against a bridge's reference are skipped for a\n * key that has no bridge yet.\n *\n * @internal\n */\nexport function physjsManifestProblems(input: {\n readonly manifest: PhysjsManifestFile;\n readonly bridges: readonly { readonly id: string; readonly formalRef?: FormalRef }[];\n /** Defaults to the generated table. A test passes a mutated copy. */\n readonly compiledEntries?: readonly PhysjsEntry[];\n}): string[] {\n const problems: string[] = [];\n const manifest = input.manifest;\n if (manifest.schema !== 'upt-lean-manifest/v1') {\n problems.push(`manifest schema is '${manifest.schema}', expected 'upt-lean-manifest/v1'`);\n }\n if (manifest.toolchain !== LEAN_TOOLCHAIN) {\n problems.push(`manifest toolchain is '${manifest.toolchain}', expected '${LEAN_TOOLCHAIN}'`);\n }\n if (manifest.mathlib !== LEAN_MATHLIB) {\n problems.push(`manifest mathlib is '${manifest.mathlib}', expected '${LEAN_MATHLIB}'`);\n }\n if (manifest.physlib !== LEAN_PHYSLIB) {\n problems.push(`manifest physlib is '${manifest.physlib}', expected '${LEAN_PHYSLIB}'`);\n }\n\n const compiledEntries = input.compiledEntries ?? PHYSJS_ENTRIES;\n const compiledByKey = new Map(compiledEntries.map((entry) => [entry.key, entry]));\n /** Theorem → Lean file over the compiled table under test, nested statements included. */\n const fileByTheorem = new Map(\n compiledEntries.flatMap((entry) => [entry, ...entry.nested].map((statement) => [statement.theorem, statement.file] as const)),\n );\n const byId = new Map(input.bridges.map((bridge) => [bridge.id, bridge]));\n const seen = new Set<string>();\n const manifestKeys = manifest.entries.map((entry) => entry.key);\n for (const entry of manifest.entries) {\n if (seen.has(entry.key)) problems.push(`manifest key '${entry.key}' is duplicated`);\n seen.add(entry.key);\n const { nested, problems: fieldProblems } = physjsNestedStatements(entry);\n problems.push(...fieldProblems);\n if (entry.key !== entry.bridgeId) {\n problems.push(`manifest key '${entry.key}' does not equal bridgeId '${entry.bridgeId}'`);\n }\n if (entry.coverage !== PHYSJS_COVERAGE) {\n problems.push(\n `coverage phrase for '${entry.key}' is '${entry.coverage}', expected '${PHYSJS_COVERAGE}'`,\n );\n }\n if (entry.leanProof !== 'complete') {\n problems.push(`leanProof for '${entry.key}' is '${entry.leanProof}', expected 'complete'`);\n }\n if (!isFormalRefKind(entry.kind)) {\n problems.push(`manifest key '${entry.key}' kind '${String(entry.kind)}' is not one of ${FORMAL_REF_KINDS.join(', ')}`);\n }\n if (disallowedAxioms(entry.axioms).length > 0) {\n problems.push(\n `manifest key '${entry.key}' axioms [${entry.axioms.join(', ')}] are not a subset of [${[...PHYSJS_ALLOWED_AXIOMS].join(', ')}]`,\n );\n }\n for (const statement of nested) {\n if (!isFormalRefKind(statement.kind)) {\n problems.push(\n `${statement.name} kind for '${entry.key}' is '${String(statement.kind)}', not one of ${FORMAL_REF_KINDS.join(', ')}`,\n );\n }\n if (statement.coverage !== PHYSJS_COVERAGE) {\n problems.push(\n `${statement.name} coverage phrase for '${entry.key}' is '${statement.coverage}', expected '${PHYSJS_COVERAGE}'`,\n );\n }\n if (statement.leanProof !== 'complete') {\n problems.push(`${statement.name} leanProof for '${entry.key}' is '${statement.leanProof}', expected 'complete'`);\n }\n if (disallowedAxioms(statement.axioms).length > 0) {\n problems.push(\n `${statement.name} axioms for '${entry.key}' [${statement.axioms.join(', ')}] are not a subset of [${[...PHYSJS_ALLOWED_AXIOMS].join(', ')}]`,\n );\n }\n if (!fileByTheorem.has(statement.theorem)) {\n problems.push(`manifest theorem '${statement.theorem}' (${entry.key}.${statement.name}) has no Lean file in formal/lean/theorem-files.json`);\n }\n }\n const file = fileByTheorem.get(entry.theorem);\n if (file === undefined) {\n problems.push(`manifest theorem '${entry.theorem}' has no Lean file in formal/lean/theorem-files.json`);\n }\n const compiled = compiledByKey.get(entry.key);\n if (compiled === undefined) {\n problems.push(`manifest key '${entry.key}' is not in the compiled entry table`);\n } else if (\n compiled.theorem !== entry.theorem ||\n compiled.kind !== entry.kind ||\n compiled.covers !== entry.covers ||\n compiled.coverage !== entry.coverage ||\n compiled.leanProof !== entry.leanProof ||\n !sameAxioms(compiled.axioms, entry.axioms) ||\n !sameNested(compiled.nested, nested)\n ) {\n problems.push(`compiled entry for '${entry.key}' disagrees with the Lean manifest`);\n }\n const bridge = byId.get(entry.key);\n if (bridge === undefined) {\n if (!physjsAheadOfCatalog(entry.key, manifestKeys)) problems.push(`manifest key '${entry.key}' does not resolve to a bridge`);\n continue;\n }\n const ref = bridge.formalRef;\n if (ref === undefined || ref.system !== 'lean4-physjs') {\n problems.push(\n `bridge '${entry.key}' has no lean4-physjs formalRef (system '${ref?.system ?? 'none'}')`,\n );\n continue;\n }\n for (const statement of nested) {\n if (ref.statement === statement.theorem) {\n problems.push(\n `bridge '${entry.key}' formalRef names the nested ${statement.name} theorem '${statement.theorem}'; the top-level theorem stays the reference`,\n );\n }\n }\n if (ref.statement !== entry.theorem) {\n problems.push(`bridge '${entry.key}' theorem is '${ref.statement}', manifest theorem is '${entry.theorem}'`);\n }\n if (!sameAxioms(ref.axioms, entry.axioms)) {\n problems.push(\n `bridge '${entry.key}' axioms [${ref.axioms.join(', ')}] differ from the manifest [${entry.axioms.join(', ')}]`,\n );\n }\n if (!ref.covers.includes(PHYSJS_COVERAGE)) {\n problems.push(`bridge '${entry.key}' covers line does not say '${PHYSJS_COVERAGE}'`);\n }\n if (!ref.covers.includes(entry.covers)) {\n problems.push(`bridge '${entry.key}' covers line does not record '${entry.covers}'`);\n }\n if (ref.version !== physjsVersion()) {\n problems.push(`bridge '${entry.key}' version '${ref.version}' is not '${physjsVersion()}'`);\n }\n if (ref.fidelity === 'unreviewed') {\n problems.push(`bridge '${entry.key}' formalRef is unreviewed`);\n }\n if (ref.kind !== entry.kind) {\n problems.push(`bridge '${entry.key}' kind is '${ref.kind}', expected '${entry.kind}'`);\n }\n if (file !== undefined && ref.url !== physjsFileUrl(file)) {\n problems.push(`bridge '${entry.key}' url is '${ref.url}', expected '${physjsFileUrl(file)}'`);\n }\n }\n\n for (const bridge of input.bridges) {\n if (bridge.formalRef?.system !== 'lean4-physjs') continue;\n if (!seen.has(bridge.id)) {\n problems.push(`lean4-physjs formalRef on '${bridge.id}' has no manifest entry`);\n }\n }\n return problems;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The reviewed PhysJS manifest rows, pinned per key.
2
+ * The reviewed Lean manifest rows (`formal/lean/manifest.json`), pinned per key.
3
3
  *
4
4
  * Each value is `physjsRowHash` of the row as the manifest writes it:
5
5
  * `[key, theorem, kind, covers, leanProof, axioms, nested statements]`. A key