universal-physics-tensor 10.0.0 → 11.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 (720) hide show
  1. package/README.md +4 -3
  2. package/bin/upt.mjs +13 -1
  3. package/data/atlas/atlas.json +25 -25
  4. package/data/atlas/atlas.jsonld +1 -1
  5. package/data/atlas/diffusion.json +6 -6
  6. package/data/atlas/oscillators.json +7 -7
  7. package/data/atlas/waves.json +14 -14
  8. package/data/atlas/witness-results.json +11 -11
  9. package/data/bridge-catalog.json +371 -228
  10. package/data/bridge-catalog.schema.json +45 -7
  11. package/dist/atlas/applicability.d.ts.map +1 -1
  12. package/dist/atlas/applicability.js +21 -15
  13. package/dist/atlas/applicability.js.map +1 -1
  14. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
  15. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  16. package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
  17. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  18. package/dist/atlas/benchmark/loader.js +2 -2
  19. package/dist/atlas/benchmark/loader.js.map +1 -1
  20. package/dist/atlas/benchmark/stats.d.ts +2 -2
  21. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  22. package/dist/atlas/benchmark/stats.js +15 -7
  23. package/dist/atlas/benchmark/stats.js.map +1 -1
  24. package/dist/atlas/catalog-formal-ref.d.ts +26 -3
  25. package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
  26. package/dist/atlas/catalog-formal-ref.js +52 -5
  27. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  28. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  29. package/dist/atlas/chain-pipeline.js +7 -8
  30. package/dist/atlas/chain-pipeline.js.map +1 -1
  31. package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
  32. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  33. package/dist/atlas/diffusion/bridges-closure.js +8 -12
  34. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  35. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  36. package/dist/atlas/diffusion/bridges.js +27 -39
  37. package/dist/atlas/diffusion/bridges.js.map +1 -1
  38. package/dist/atlas/diffusion/dimensions.d.ts +6 -14
  39. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
  40. package/dist/atlas/diffusion/dimensions.js +8 -16
  41. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  42. package/dist/atlas/diffusion/models.d.ts +3 -3
  43. package/dist/atlas/diffusion/models.d.ts.map +1 -1
  44. package/dist/atlas/diffusion/models.js +5 -10
  45. package/dist/atlas/diffusion/models.js.map +1 -1
  46. package/dist/atlas/diffusion/numerics.d.ts +16 -4
  47. package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
  48. package/dist/atlas/diffusion/numerics.js +38 -24
  49. package/dist/atlas/diffusion/numerics.js.map +1 -1
  50. package/dist/atlas/link-prediction.d.ts +106 -3
  51. package/dist/atlas/link-prediction.d.ts.map +1 -1
  52. package/dist/atlas/link-prediction.js +212 -66
  53. package/dist/atlas/link-prediction.js.map +1 -1
  54. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  55. package/dist/atlas/oscillators/bridges-coarse.js +7 -11
  56. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  57. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  58. package/dist/atlas/oscillators/bridges-exact.js +6 -7
  59. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  60. package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
  61. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  62. package/dist/atlas/oscillators/bridges-limits.js +23 -34
  63. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  64. package/dist/atlas/oscillators/dimensions.d.ts +9 -21
  65. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
  66. package/dist/atlas/oscillators/dimensions.js +9 -21
  67. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  68. package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
  69. package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
  70. package/dist/atlas/oscillators/limit-witnesses.js +17 -15
  71. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  72. package/dist/atlas/oscillators/models.d.ts.map +1 -1
  73. package/dist/atlas/oscillators/models.js +2 -6
  74. package/dist/atlas/oscillators/models.js.map +1 -1
  75. package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
  76. package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
  77. package/dist/atlas/oscillators/pendulum-motion.js +60 -40
  78. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  79. package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
  80. package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
  81. package/dist/atlas/oscillators/phase-translation.js +3 -4
  82. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  83. package/dist/atlas/oscillators/position-translation.d.ts +68 -7
  84. package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
  85. package/dist/atlas/oscillators/position-translation.js +123 -12
  86. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  87. package/dist/atlas/oscillators/rejections.d.ts +0 -2
  88. package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
  89. package/dist/atlas/oscillators/rejections.js +0 -7
  90. package/dist/atlas/oscillators/rejections.js.map +1 -1
  91. package/dist/atlas/physjs-entries.generated.d.ts +25 -24
  92. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  93. package/dist/atlas/physjs-entries.generated.js +25 -24
  94. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  95. package/dist/atlas/physjs-ref.d.ts +34 -31
  96. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  97. package/dist/atlas/physjs-ref.js +55 -53
  98. package/dist/atlas/physjs-ref.js.map +1 -1
  99. package/dist/atlas/physjs-reviewed.d.ts +1 -1
  100. package/dist/atlas/physjs-reviewed.js +15 -15
  101. package/dist/atlas/physjs-reviewed.js.map +1 -1
  102. package/dist/atlas/poster/statements.d.ts +0 -19
  103. package/dist/atlas/poster/statements.d.ts.map +1 -1
  104. package/dist/atlas/poster/statements.js +1 -1
  105. package/dist/atlas/poster/statements.js.map +1 -1
  106. package/dist/atlas/proof-target.d.ts +1 -1
  107. package/dist/atlas/proof-target.js +1 -1
  108. package/dist/atlas/proof-target.js.map +1 -1
  109. package/dist/atlas/regime.d.ts +1 -1
  110. package/dist/atlas/regime.d.ts.map +1 -1
  111. package/dist/atlas/regime.js +1 -1
  112. package/dist/atlas/regime.js.map +1 -1
  113. package/dist/atlas/text-overlap.d.ts +23 -0
  114. package/dist/atlas/text-overlap.d.ts.map +1 -0
  115. package/dist/atlas/text-overlap.js +41 -0
  116. package/dist/atlas/text-overlap.js.map +1 -0
  117. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  118. package/dist/atlas/waves/bridges-closure.js +2 -6
  119. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  120. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  121. package/dist/atlas/waves/bridges.js +32 -48
  122. package/dist/atlas/waves/bridges.js.map +1 -1
  123. package/dist/atlas/waves/models.d.ts +5 -6
  124. package/dist/atlas/waves/models.d.ts.map +1 -1
  125. package/dist/atlas/waves/models.js +7 -13
  126. package/dist/atlas/waves/models.js.map +1 -1
  127. package/dist/atlas/waves/numerics.d.ts.map +1 -1
  128. package/dist/atlas/waves/numerics.js +10 -3
  129. package/dist/atlas/waves/numerics.js.map +1 -1
  130. package/dist/atlas/witness-numeric.d.ts +30 -0
  131. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  132. package/dist/atlas/witness-numeric.js +53 -0
  133. package/dist/atlas/witness-numeric.js.map +1 -1
  134. package/dist/atlas/witness-specs.d.ts.map +1 -1
  135. package/dist/atlas/witness-specs.js +19 -0
  136. package/dist/atlas/witness-specs.js.map +1 -1
  137. package/dist/atlas/witness-symbolic.d.ts +75 -3
  138. package/dist/atlas/witness-symbolic.d.ts.map +1 -1
  139. package/dist/atlas/witness-symbolic.js +116 -10
  140. package/dist/atlas/witness-symbolic.js.map +1 -1
  141. package/dist/bridges/catalog-load.d.ts.map +1 -1
  142. package/dist/bridges/catalog-load.js +13 -8
  143. package/dist/bridges/catalog-load.js.map +1 -1
  144. package/dist/bridges/catalog-types.d.ts +26 -2
  145. package/dist/bridges/catalog-types.d.ts.map +1 -1
  146. package/dist/bridges/catalog-types.js +11 -1
  147. package/dist/bridges/catalog-types.js.map +1 -1
  148. package/dist/bridges/evaluation-errors.d.ts +31 -1
  149. package/dist/bridges/evaluation-errors.d.ts.map +1 -1
  150. package/dist/bridges/evaluation-errors.js +20 -2
  151. package/dist/bridges/evaluation-errors.js.map +1 -1
  152. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  153. package/dist/bridges/evaluator-inputs.js +7 -5
  154. package/dist/bridges/evaluator-inputs.js.map +1 -1
  155. package/dist/bridges/evaluators.d.ts.map +1 -1
  156. package/dist/bridges/evaluators.js +27 -12
  157. package/dist/bridges/evaluators.js.map +1 -1
  158. package/dist/bridges/expr-parse.d.ts +11 -0
  159. package/dist/bridges/expr-parse.d.ts.map +1 -1
  160. package/dist/bridges/expr-parse.js +14 -5
  161. package/dist/bridges/expr-parse.js.map +1 -1
  162. package/dist/bridges/holds.d.ts +35 -3
  163. package/dist/bridges/holds.d.ts.map +1 -1
  164. package/dist/bridges/holds.js +117 -23
  165. package/dist/bridges/holds.js.map +1 -1
  166. package/dist/bridges/notices.d.ts.map +1 -1
  167. package/dist/bridges/notices.js +5 -5
  168. package/dist/bridges/notices.js.map +1 -1
  169. package/dist/bridges/relation-eval.d.ts +4 -4
  170. package/dist/bridges/relation-eval.d.ts.map +1 -1
  171. package/dist/bridges/relation-eval.js +15 -16
  172. package/dist/bridges/relation-eval.js.map +1 -1
  173. package/dist/bridges/sensitivity.d.ts.map +1 -1
  174. package/dist/bridges/sensitivity.js +3 -3
  175. package/dist/bridges/sensitivity.js.map +1 -1
  176. package/dist/bridges/validity.d.ts +33 -0
  177. package/dist/bridges/validity.d.ts.map +1 -0
  178. package/dist/bridges/validity.js +67 -0
  179. package/dist/bridges/validity.js.map +1 -0
  180. package/dist/canonical/entries/atomic.js +1 -3
  181. package/dist/canonical/entries/atomic.js.map +1 -1
  182. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  183. package/dist/canonical/entries/condensed-matter.js +4 -5
  184. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  185. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  186. package/dist/canonical/entries/dimensional-classics.js +3 -4
  187. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  188. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  189. package/dist/canonical/entries/electromagnetism.js +4 -10
  190. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  191. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  192. package/dist/canonical/entries/fluids-waves.js +3 -7
  193. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  194. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  195. package/dist/canonical/entries/mechanics.js +4 -6
  196. package/dist/canonical/entries/mechanics.js.map +1 -1
  197. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  198. package/dist/canonical/entries/nonmonomial.js +9 -17
  199. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  200. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  201. package/dist/canonical/entries/relativity.js +6 -6
  202. package/dist/canonical/entries/relativity.js.map +1 -1
  203. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  204. package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
  205. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  206. package/dist/canonical/fixed-points.d.ts +94 -0
  207. package/dist/canonical/fixed-points.d.ts.map +1 -0
  208. package/dist/canonical/fixed-points.js +81 -0
  209. package/dist/canonical/fixed-points.js.map +1 -0
  210. package/dist/canonical/linkage.d.ts.map +1 -1
  211. package/dist/canonical/linkage.js +25 -44
  212. package/dist/canonical/linkage.js.map +1 -1
  213. package/dist/canonical/normal-form.d.ts.map +1 -1
  214. package/dist/canonical/normal-form.js +5 -11
  215. package/dist/canonical/normal-form.js.map +1 -1
  216. package/dist/canonical/structural.d.ts +21 -21
  217. package/dist/canonical/structural.d.ts.map +1 -1
  218. package/dist/canonical/structural.js +40 -19
  219. package/dist/canonical/structural.js.map +1 -1
  220. package/dist/cases/brownian-sphere.d.ts +3 -3
  221. package/dist/cases/brownian-sphere.d.ts.map +1 -1
  222. package/dist/cases/brownian-sphere.js +6 -5
  223. package/dist/cases/brownian-sphere.js.map +1 -1
  224. package/dist/cases/damped-resonator.d.ts.map +1 -1
  225. package/dist/cases/damped-resonator.js +6 -9
  226. package/dist/cases/damped-resonator.js.map +1 -1
  227. package/dist/cases/kepler-rv.d.ts +1 -1
  228. package/dist/cases/kepler-rv.d.ts.map +1 -1
  229. package/dist/cases/kepler-rv.js +3 -2
  230. package/dist/cases/kepler-rv.js.map +1 -1
  231. package/dist/cases/lumped-cooling.d.ts +8 -3
  232. package/dist/cases/lumped-cooling.d.ts.map +1 -1
  233. package/dist/cases/lumped-cooling.js +21 -23
  234. package/dist/cases/lumped-cooling.js.map +1 -1
  235. package/dist/cases/quadrature.d.ts +7 -9
  236. package/dist/cases/quadrature.d.ts.map +1 -1
  237. package/dist/cases/quadrature.js +28 -32
  238. package/dist/cases/quadrature.js.map +1 -1
  239. package/dist/cases/resistor-noise.js +4 -4
  240. package/dist/cases/resistor-noise.js.map +1 -1
  241. package/dist/cases/skin-depth.d.ts +0 -4
  242. package/dist/cases/skin-depth.d.ts.map +1 -1
  243. package/dist/cases/skin-depth.js +3 -7
  244. package/dist/cases/skin-depth.js.map +1 -1
  245. package/dist/cli/args.d.ts +23 -1
  246. package/dist/cli/args.d.ts.map +1 -1
  247. package/dist/cli/args.js +30 -8
  248. package/dist/cli/args.js.map +1 -1
  249. package/dist/cli/bindings.d.ts.map +1 -1
  250. package/dist/cli/bindings.js +5 -4
  251. package/dist/cli/bindings.js.map +1 -1
  252. package/dist/cli/command.d.ts +8 -1
  253. package/dist/cli/command.d.ts.map +1 -1
  254. package/dist/cli/command.js.map +1 -1
  255. package/dist/cli/commands/_atlas-map.d.ts +0 -9
  256. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  257. package/dist/cli/commands/_atlas-map.js +8 -18
  258. package/dist/cli/commands/_atlas-map.js.map +1 -1
  259. package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
  260. package/dist/cli/commands/_atlas-route.js +6 -2
  261. package/dist/cli/commands/_atlas-route.js.map +1 -1
  262. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  263. package/dist/cli/commands/_discovery-opts.js +8 -9
  264. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  265. package/dist/cli/commands/atlas.d.ts.map +1 -1
  266. package/dist/cli/commands/atlas.js +8 -5
  267. package/dist/cli/commands/atlas.js.map +1 -1
  268. package/dist/cli/commands/audit.d.ts.map +1 -1
  269. package/dist/cli/commands/audit.js +8 -1
  270. package/dist/cli/commands/audit.js.map +1 -1
  271. package/dist/cli/commands/axes.d.ts.map +1 -1
  272. package/dist/cli/commands/axes.js +20 -1
  273. package/dist/cli/commands/axes.js.map +1 -1
  274. package/dist/cli/commands/confront.d.ts.map +1 -1
  275. package/dist/cli/commands/confront.js +8 -14
  276. package/dist/cli/commands/confront.js.map +1 -1
  277. package/dist/cli/commands/derive.d.ts.map +1 -1
  278. package/dist/cli/commands/derive.js +22 -22
  279. package/dist/cli/commands/derive.js.map +1 -1
  280. package/dist/cli/commands/discover.d.ts.map +1 -1
  281. package/dist/cli/commands/discover.js +6 -2
  282. package/dist/cli/commands/discover.js.map +1 -1
  283. package/dist/cli/commands/eval.d.ts.map +1 -1
  284. package/dist/cli/commands/eval.js +1 -0
  285. package/dist/cli/commands/eval.js.map +1 -1
  286. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  287. package/dist/cli/commands/evaluate.js +65 -37
  288. package/dist/cli/commands/evaluate.js.map +1 -1
  289. package/dist/cli/commands/explain.d.ts.map +1 -1
  290. package/dist/cli/commands/explain.js +2 -1
  291. package/dist/cli/commands/explain.js.map +1 -1
  292. package/dist/cli/commands/ground.d.ts.map +1 -1
  293. package/dist/cli/commands/ground.js +1 -0
  294. package/dist/cli/commands/ground.js.map +1 -1
  295. package/dist/cli/commands/map.d.ts.map +1 -1
  296. package/dist/cli/commands/map.js +75 -5
  297. package/dist/cli/commands/map.js.map +1 -1
  298. package/dist/cli/commands/metric.d.ts.map +1 -1
  299. package/dist/cli/commands/metric.js +12 -9
  300. package/dist/cli/commands/metric.js.map +1 -1
  301. package/dist/cli/commands/path.d.ts +10 -0
  302. package/dist/cli/commands/path.d.ts.map +1 -1
  303. package/dist/cli/commands/path.js +25 -3
  304. package/dist/cli/commands/path.js.map +1 -1
  305. package/dist/cli/commands/probe.d.ts.map +1 -1
  306. package/dist/cli/commands/probe.js +59 -16
  307. package/dist/cli/commands/probe.js.map +1 -1
  308. package/dist/cli/commands/regime.d.ts.map +1 -1
  309. package/dist/cli/commands/regime.js +1 -0
  310. package/dist/cli/commands/regime.js.map +1 -1
  311. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  312. package/dist/cli/commands/retrieve.js +1 -0
  313. package/dist/cli/commands/retrieve.js.map +1 -1
  314. package/dist/cli/commands/search.d.ts.map +1 -1
  315. package/dist/cli/commands/search.js +1 -0
  316. package/dist/cli/commands/search.js.map +1 -1
  317. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  318. package/dist/cli/commands/symbolic.js +19 -28
  319. package/dist/cli/commands/symbolic.js.map +1 -1
  320. package/dist/cli/commands/testplan.d.ts.map +1 -1
  321. package/dist/cli/commands/testplan.js +4 -2
  322. package/dist/cli/commands/testplan.js.map +1 -1
  323. package/dist/cli/expr-print.d.ts +0 -2
  324. package/dist/cli/expr-print.d.ts.map +1 -1
  325. package/dist/cli/expr-print.js +7 -31
  326. package/dist/cli/expr-print.js.map +1 -1
  327. package/dist/cli/main.d.ts +7 -0
  328. package/dist/cli/main.d.ts.map +1 -1
  329. package/dist/cli/main.js +18 -3
  330. package/dist/cli/main.js.map +1 -1
  331. package/dist/cli/numeric-flag.d.ts +12 -0
  332. package/dist/cli/numeric-flag.d.ts.map +1 -0
  333. package/dist/cli/numeric-flag.js +44 -0
  334. package/dist/cli/numeric-flag.js.map +1 -0
  335. package/dist/cli/output.d.ts +20 -0
  336. package/dist/cli/output.d.ts.map +1 -1
  337. package/dist/cli/output.js +15 -0
  338. package/dist/cli/output.js.map +1 -1
  339. package/dist/cli/record-reach.js +2 -2
  340. package/dist/cli/record-reach.js.map +1 -1
  341. package/dist/cli/record-tables.d.ts.map +1 -1
  342. package/dist/cli/record-tables.js +6 -5
  343. package/dist/cli/record-tables.js.map +1 -1
  344. package/dist/cli/record.d.ts +1 -5
  345. package/dist/cli/record.d.ts.map +1 -1
  346. package/dist/cli/record.js +9 -8
  347. package/dist/cli/record.js.map +1 -1
  348. package/dist/cli/search-index.d.ts.map +1 -1
  349. package/dist/cli/search-index.js +7 -6
  350. package/dist/cli/search-index.js.map +1 -1
  351. package/dist/cli/statuses.d.ts +0 -2
  352. package/dist/cli/statuses.d.ts.map +1 -1
  353. package/dist/cli/statuses.js +0 -7
  354. package/dist/cli/statuses.js.map +1 -1
  355. package/dist/cli/stored-results.d.ts +7 -0
  356. package/dist/cli/stored-results.d.ts.map +1 -0
  357. package/dist/cli/stored-results.js +23 -0
  358. package/dist/cli/stored-results.js.map +1 -0
  359. package/dist/cli/version.d.ts.map +1 -1
  360. package/dist/cli/version.js +7 -5
  361. package/dist/cli/version.js.map +1 -1
  362. package/dist/cli-api.d.ts +34 -5
  363. package/dist/cli-api.d.ts.map +1 -1
  364. package/dist/cli-api.js +28 -4
  365. package/dist/cli-api.js.map +1 -1
  366. package/dist/composition/algebraic-equivalence.d.ts +43 -0
  367. package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
  368. package/dist/composition/algebraic-equivalence.js +115 -0
  369. package/dist/composition/algebraic-equivalence.js.map +1 -0
  370. package/dist/composition/axes.d.ts +0 -6
  371. package/dist/composition/axes.d.ts.map +1 -1
  372. package/dist/composition/axes.js +6 -6
  373. package/dist/composition/axes.js.map +1 -1
  374. package/dist/composition/axis-audit.d.ts +47 -20
  375. package/dist/composition/axis-audit.d.ts.map +1 -1
  376. package/dist/composition/axis-audit.js +82 -9
  377. package/dist/composition/axis-audit.js.map +1 -1
  378. package/dist/composition/bridge-analysis.d.ts +17 -0
  379. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  380. package/dist/composition/bridge-analysis.js +102 -55
  381. package/dist/composition/bridge-analysis.js.map +1 -1
  382. package/dist/composition/canonical-compare.d.ts +40 -0
  383. package/dist/composition/canonical-compare.d.ts.map +1 -1
  384. package/dist/composition/canonical-compare.js +122 -24
  385. package/dist/composition/canonical-compare.js.map +1 -1
  386. package/dist/composition/canonical-graph.d.ts +1 -1
  387. package/dist/composition/canonical-graph.d.ts.map +1 -1
  388. package/dist/composition/canonical-graph.js +9 -36
  389. package/dist/composition/canonical-graph.js.map +1 -1
  390. package/dist/composition/canonical-json.js +2 -2
  391. package/dist/composition/canonical-json.js.map +1 -1
  392. package/dist/composition/catalog-graph.d.ts.map +1 -1
  393. package/dist/composition/catalog-graph.js +2 -5
  394. package/dist/composition/catalog-graph.js.map +1 -1
  395. package/dist/composition/chain-candidate.d.ts +8 -0
  396. package/dist/composition/chain-candidate.d.ts.map +1 -1
  397. package/dist/composition/chain-candidate.js +9 -2
  398. package/dist/composition/chain-candidate.js.map +1 -1
  399. package/dist/composition/chain-match.d.ts +6 -3
  400. package/dist/composition/chain-match.d.ts.map +1 -1
  401. package/dist/composition/chain-match.js +4 -1
  402. package/dist/composition/chain-match.js.map +1 -1
  403. package/dist/composition/chain-result.d.ts.map +1 -1
  404. package/dist/composition/chain-result.js +2 -14
  405. package/dist/composition/chain-result.js.map +1 -1
  406. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  407. package/dist/composition/compose-symbolic.js +3 -2
  408. package/dist/composition/compose-symbolic.js.map +1 -1
  409. package/dist/composition/compose.d.ts.map +1 -1
  410. package/dist/composition/compose.js +13 -5
  411. package/dist/composition/compose.js.map +1 -1
  412. package/dist/composition/composition-recovery.d.ts.map +1 -1
  413. package/dist/composition/composition-recovery.js +4 -7
  414. package/dist/composition/composition-recovery.js.map +1 -1
  415. package/dist/composition/discovery.d.ts +56 -0
  416. package/dist/composition/discovery.d.ts.map +1 -1
  417. package/dist/composition/discovery.js +114 -60
  418. package/dist/composition/discovery.js.map +1 -1
  419. package/dist/composition/edge.d.ts +21 -2
  420. package/dist/composition/edge.d.ts.map +1 -1
  421. package/dist/composition/edge.js +23 -1
  422. package/dist/composition/edge.js.map +1 -1
  423. package/dist/composition/enumerate.d.ts.map +1 -1
  424. package/dist/composition/enumerate.js +18 -3
  425. package/dist/composition/enumerate.js.map +1 -1
  426. package/dist/composition/evaluate-relation.d.ts +35 -11
  427. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  428. package/dist/composition/evaluate-relation.js +60 -39
  429. package/dist/composition/evaluate-relation.js.map +1 -1
  430. package/dist/composition/explain.d.ts +3 -12
  431. package/dist/composition/explain.d.ts.map +1 -1
  432. package/dist/composition/explain.js +7 -20
  433. package/dist/composition/explain.js.map +1 -1
  434. package/dist/composition/expr-eval.d.ts.map +1 -1
  435. package/dist/composition/expr-eval.js +2 -11
  436. package/dist/composition/expr-eval.js.map +1 -1
  437. package/dist/composition/expr-simplify.d.ts +16 -0
  438. package/dist/composition/expr-simplify.d.ts.map +1 -1
  439. package/dist/composition/expr-simplify.js +15 -20
  440. package/dist/composition/expr-simplify.js.map +1 -1
  441. package/dist/composition/formula-shape.d.ts +23 -4
  442. package/dist/composition/formula-shape.d.ts.map +1 -1
  443. package/dist/composition/formula-shape.js +57 -17
  444. package/dist/composition/formula-shape.js.map +1 -1
  445. package/dist/composition/graph-structure.d.ts +98 -0
  446. package/dist/composition/graph-structure.d.ts.map +1 -0
  447. package/dist/composition/graph-structure.js +167 -0
  448. package/dist/composition/graph-structure.js.map +1 -0
  449. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  450. package/dist/composition/graph-viz-svg.js +1 -1
  451. package/dist/composition/graph-viz-svg.js.map +1 -1
  452. package/dist/composition/graph-viz.d.ts.map +1 -1
  453. package/dist/composition/graph-viz.js +8 -37
  454. package/dist/composition/graph-viz.js.map +1 -1
  455. package/dist/composition/identifiability.d.ts +91 -4
  456. package/dist/composition/identifiability.d.ts.map +1 -1
  457. package/dist/composition/identifiability.js +363 -6
  458. package/dist/composition/identifiability.js.map +1 -1
  459. package/dist/composition/index.d.ts +8 -4
  460. package/dist/composition/index.d.ts.map +1 -1
  461. package/dist/composition/index.js +3 -2
  462. package/dist/composition/index.js.map +1 -1
  463. package/dist/composition/mathts-quiet.d.ts +4 -3
  464. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  465. package/dist/composition/mathts-quiet.js +4 -3
  466. package/dist/composition/mathts-quiet.js.map +1 -1
  467. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  468. package/dist/composition/mathts-scalar-symbols.js +2 -1
  469. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  470. package/dist/composition/probe/corpus.d.ts +4 -2
  471. package/dist/composition/probe/corpus.d.ts.map +1 -1
  472. package/dist/composition/probe/corpus.js +20 -9
  473. package/dist/composition/probe/corpus.js.map +1 -1
  474. package/dist/composition/probe/dataset.d.ts +17 -0
  475. package/dist/composition/probe/dataset.d.ts.map +1 -1
  476. package/dist/composition/probe/dataset.js +95 -50
  477. package/dist/composition/probe/dataset.js.map +1 -1
  478. package/dist/composition/probe/experiment-design.d.ts +5 -1
  479. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  480. package/dist/composition/probe/experiment-design.js +44 -24
  481. package/dist/composition/probe/experiment-design.js.map +1 -1
  482. package/dist/composition/probe/falsify.d.ts.map +1 -1
  483. package/dist/composition/probe/falsify.js +2 -0
  484. package/dist/composition/probe/falsify.js.map +1 -1
  485. package/dist/composition/probe/fit.d.ts +6 -0
  486. package/dist/composition/probe/fit.d.ts.map +1 -1
  487. package/dist/composition/probe/fit.js +46 -22
  488. package/dist/composition/probe/fit.js.map +1 -1
  489. package/dist/composition/probe/frontier.d.ts.map +1 -1
  490. package/dist/composition/probe/frontier.js +33 -15
  491. package/dist/composition/probe/frontier.js.map +1 -1
  492. package/dist/composition/probe/generator.d.ts +27 -1
  493. package/dist/composition/probe/generator.d.ts.map +1 -1
  494. package/dist/composition/probe/generator.js +53 -30
  495. package/dist/composition/probe/generator.js.map +1 -1
  496. package/dist/composition/probe/index.d.ts +14 -0
  497. package/dist/composition/probe/index.d.ts.map +1 -1
  498. package/dist/composition/probe/index.js +6 -0
  499. package/dist/composition/probe/index.js.map +1 -1
  500. package/dist/composition/probe/limits.d.ts +24 -1
  501. package/dist/composition/probe/limits.d.ts.map +1 -1
  502. package/dist/composition/probe/limits.js +53 -11
  503. package/dist/composition/probe/limits.js.map +1 -1
  504. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  505. package/dist/composition/probe/pipeline.js +10 -4
  506. package/dist/composition/probe/pipeline.js.map +1 -1
  507. package/dist/composition/probe/power-law.d.ts +121 -0
  508. package/dist/composition/probe/power-law.d.ts.map +1 -0
  509. package/dist/composition/probe/power-law.js +255 -0
  510. package/dist/composition/probe/power-law.js.map +1 -0
  511. package/dist/composition/probe/problem.d.ts +7 -4
  512. package/dist/composition/probe/problem.d.ts.map +1 -1
  513. package/dist/composition/probe/problem.js +177 -49
  514. package/dist/composition/probe/problem.js.map +1 -1
  515. package/dist/composition/probe/report.js +1 -1
  516. package/dist/composition/probe/report.js.map +1 -1
  517. package/dist/composition/probe/residual.d.ts +6 -1
  518. package/dist/composition/probe/residual.d.ts.map +1 -1
  519. package/dist/composition/probe/residual.js +9 -7
  520. package/dist/composition/probe/residual.js.map +1 -1
  521. package/dist/composition/probe/structure.d.ts +82 -17
  522. package/dist/composition/probe/structure.d.ts.map +1 -1
  523. package/dist/composition/probe/structure.js +129 -55
  524. package/dist/composition/probe/structure.js.map +1 -1
  525. package/dist/composition/probe/study.d.ts +31 -9
  526. package/dist/composition/probe/study.d.ts.map +1 -1
  527. package/dist/composition/probe/study.js +236 -181
  528. package/dist/composition/probe/study.js.map +1 -1
  529. package/dist/composition/probe/t-tail.d.ts +17 -0
  530. package/dist/composition/probe/t-tail.d.ts.map +1 -0
  531. package/dist/composition/probe/t-tail.js +32 -0
  532. package/dist/composition/probe/t-tail.js.map +1 -0
  533. package/dist/composition/probe/types.d.ts +3 -0
  534. package/dist/composition/probe/types.d.ts.map +1 -1
  535. package/dist/composition/probe/types.js.map +1 -1
  536. package/dist/composition/proposed-bridges.d.ts +41 -10
  537. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  538. package/dist/composition/proposed-bridges.js +100 -55
  539. package/dist/composition/proposed-bridges.js.map +1 -1
  540. package/dist/composition/quantity-clusters.d.ts +48 -0
  541. package/dist/composition/quantity-clusters.d.ts.map +1 -0
  542. package/dist/composition/quantity-clusters.js +98 -0
  543. package/dist/composition/quantity-clusters.js.map +1 -0
  544. package/dist/composition/rational-exponent.d.ts +40 -0
  545. package/dist/composition/rational-exponent.d.ts.map +1 -0
  546. package/dist/composition/rational-exponent.js +65 -0
  547. package/dist/composition/rational-exponent.js.map +1 -0
  548. package/dist/composition/representative-values.d.ts +22 -0
  549. package/dist/composition/representative-values.d.ts.map +1 -1
  550. package/dist/composition/representative-values.js +23 -0
  551. package/dist/composition/representative-values.js.map +1 -1
  552. package/dist/composition/retrodiction.d.ts.map +1 -1
  553. package/dist/composition/retrodiction.js +2 -1
  554. package/dist/composition/retrodiction.js.map +1 -1
  555. package/dist/composition/user-equation.d.ts.map +1 -1
  556. package/dist/composition/user-equation.js +2 -2
  557. package/dist/composition/user-equation.js.map +1 -1
  558. package/dist/core/assignment.d.ts +19 -0
  559. package/dist/core/assignment.d.ts.map +1 -0
  560. package/dist/core/assignment.js +19 -0
  561. package/dist/core/assignment.js.map +1 -0
  562. package/dist/core/compare.d.ts +32 -0
  563. package/dist/core/compare.d.ts.map +1 -0
  564. package/dist/core/compare.js +46 -0
  565. package/dist/core/compare.js.map +1 -0
  566. package/dist/core/constants.d.ts +30 -30
  567. package/dist/core/constants.d.ts.map +1 -1
  568. package/dist/core/constants.js +47 -30
  569. package/dist/core/constants.js.map +1 -1
  570. package/dist/core/data-file.d.ts +7 -0
  571. package/dist/core/data-file.d.ts.map +1 -1
  572. package/dist/core/data-file.js +17 -0
  573. package/dist/core/data-file.js.map +1 -1
  574. package/dist/core/format.d.ts +36 -0
  575. package/dist/core/format.d.ts.map +1 -0
  576. package/dist/core/format.js +39 -0
  577. package/dist/core/format.js.map +1 -0
  578. package/dist/core/hash.d.ts +14 -0
  579. package/dist/core/hash.d.ts.map +1 -0
  580. package/dist/core/hash.js +17 -0
  581. package/dist/core/hash.js.map +1 -0
  582. package/dist/core/json-schema.d.ts +2 -0
  583. package/dist/core/json-schema.d.ts.map +1 -1
  584. package/dist/core/json-schema.js +14 -13
  585. package/dist/core/json-schema.js.map +1 -1
  586. package/dist/core/labeled-tensor.d.ts.map +1 -1
  587. package/dist/core/labeled-tensor.js +0 -8
  588. package/dist/core/labeled-tensor.js.map +1 -1
  589. package/dist/core/mathts-read.d.ts +25 -0
  590. package/dist/core/mathts-read.d.ts.map +1 -0
  591. package/dist/core/mathts-read.js +51 -0
  592. package/dist/core/mathts-read.js.map +1 -0
  593. package/dist/core/tensor.d.ts.map +1 -1
  594. package/dist/core/tensor.js +24 -0
  595. package/dist/core/tensor.js.map +1 -1
  596. package/dist/core/types.d.ts +5 -5
  597. package/dist/diff/bridge-gradient.d.ts +19 -6
  598. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  599. package/dist/diff/bridge-gradient.js +19 -11
  600. package/dist/diff/bridge-gradient.js.map +1 -1
  601. package/dist/diff/bridge-specs.d.ts.map +1 -1
  602. package/dist/diff/bridge-specs.js +3 -0
  603. package/dist/diff/bridge-specs.js.map +1 -1
  604. package/dist/dimensional/algebra.d.ts +18 -0
  605. package/dist/dimensional/algebra.d.ts.map +1 -1
  606. package/dist/dimensional/algebra.js +41 -1
  607. package/dist/dimensional/algebra.js.map +1 -1
  608. package/dist/dimensional/ast-builders.d.ts +7 -0
  609. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  610. package/dist/dimensional/ast-builders.js +11 -0
  611. package/dist/dimensional/ast-builders.js.map +1 -1
  612. package/dist/dimensional/ast-leaves.d.ts +81 -0
  613. package/dist/dimensional/ast-leaves.d.ts.map +1 -0
  614. package/dist/dimensional/ast-leaves.js +146 -0
  615. package/dist/dimensional/ast-leaves.js.map +1 -0
  616. package/dist/dimensional/buckingham.d.ts.map +1 -1
  617. package/dist/dimensional/buckingham.js +15 -27
  618. package/dist/dimensional/buckingham.js.map +1 -1
  619. package/dist/dimensional/constant-rows.js +9 -9
  620. package/dist/dimensional/constant-rows.js.map +1 -1
  621. package/dist/dimensional/dimension-inference.d.ts.map +1 -1
  622. package/dist/dimensional/dimension-inference.js +1 -2
  623. package/dist/dimensional/dimension-inference.js.map +1 -1
  624. package/dist/dimensional/errors.d.ts +1 -1
  625. package/dist/dimensional/errors.d.ts.map +1 -1
  626. package/dist/dimensional/errors.js +1 -15
  627. package/dist/dimensional/errors.js.map +1 -1
  628. package/dist/dimensional/exact-scale.d.ts +0 -17
  629. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  630. package/dist/dimensional/exact-scale.js +8 -8
  631. package/dist/dimensional/exact-scale.js.map +1 -1
  632. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  633. package/dist/dimensional/gauge-field.js +2 -2
  634. package/dist/dimensional/gauge-field.js.map +1 -1
  635. package/dist/dimensional/hyphen-names.d.ts +12 -2
  636. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  637. package/dist/dimensional/hyphen-names.js +44 -19
  638. package/dist/dimensional/hyphen-names.js.map +1 -1
  639. package/dist/dimensional/metric.d.ts.map +1 -1
  640. package/dist/dimensional/metric.js +0 -1
  641. package/dist/dimensional/metric.js.map +1 -1
  642. package/dist/dimensional/symbolic-constants.d.ts +9 -0
  643. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  644. package/dist/dimensional/symbolic-constants.js +13 -1
  645. package/dist/dimensional/symbolic-constants.js.map +1 -1
  646. package/dist/dimensional/types.d.ts +36 -0
  647. package/dist/dimensional/types.d.ts.map +1 -1
  648. package/dist/dimensional/types.js +45 -7
  649. package/dist/dimensional/types.js.map +1 -1
  650. package/dist/dimensional/unit-data.js +2 -2
  651. package/dist/dimensional/unit-data.js.map +1 -1
  652. package/dist/index.d.ts +9 -3
  653. package/dist/index.d.ts.map +1 -1
  654. package/dist/index.js +10 -4
  655. package/dist/index.js.map +1 -1
  656. package/dist/numerical/christoffel-flat.d.ts.map +1 -1
  657. package/dist/numerical/christoffel-flat.js +3 -2
  658. package/dist/numerical/christoffel-flat.js.map +1 -1
  659. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  660. package/dist/numerical/covariant-eikonal.js +34 -11
  661. package/dist/numerical/covariant-eikonal.js.map +1 -1
  662. package/dist/numerical/curvature-lowering-helpers.js +3 -2
  663. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  664. package/dist/numerical/errors.d.ts.map +1 -1
  665. package/dist/numerical/errors.js +0 -3
  666. package/dist/numerical/errors.js.map +1 -1
  667. package/dist/numerical/finite-difference.d.ts +22 -0
  668. package/dist/numerical/finite-difference.d.ts.map +1 -0
  669. package/dist/numerical/finite-difference.js +27 -0
  670. package/dist/numerical/finite-difference.js.map +1 -0
  671. package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
  672. package/dist/numerical/geodesic-integrator.js +22 -14
  673. package/dist/numerical/geodesic-integrator.js.map +1 -1
  674. package/dist/numerical/geometrized.d.ts.map +1 -1
  675. package/dist/numerical/geometrized.js +0 -1
  676. package/dist/numerical/geometrized.js.map +1 -1
  677. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  678. package/dist/numerical/mathts-engine.js +10 -24
  679. package/dist/numerical/mathts-engine.js.map +1 -1
  680. package/dist/numerical/metric-inverse.d.ts.map +1 -1
  681. package/dist/numerical/metric-inverse.js +83 -46
  682. package/dist/numerical/metric-inverse.js.map +1 -1
  683. package/dist/numerical/null-ray-integrator.d.ts +2 -1
  684. package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
  685. package/dist/numerical/null-ray-integrator.js +12 -12
  686. package/dist/numerical/null-ray-integrator.js.map +1 -1
  687. package/dist/numerical/painleve-gullstrand-metric.js +2 -2
  688. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  689. package/dist/numerical/perihelion-finder.d.ts +0 -36
  690. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  691. package/dist/numerical/perihelion-finder.js +41 -87
  692. package/dist/numerical/perihelion-finder.js.map +1 -1
  693. package/dist/numerical/quadrature.d.ts.map +1 -1
  694. package/dist/numerical/quadrature.js +8 -10
  695. package/dist/numerical/quadrature.js.map +1 -1
  696. package/dist/numerical/rk4-trajectory.d.ts +10 -0
  697. package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
  698. package/dist/numerical/rk4-trajectory.js +37 -0
  699. package/dist/numerical/rk4-trajectory.js.map +1 -0
  700. package/dist/numerical/schwarzschild.d.ts +14 -0
  701. package/dist/numerical/schwarzschild.d.ts.map +1 -0
  702. package/dist/numerical/schwarzschild.js +17 -0
  703. package/dist/numerical/schwarzschild.js.map +1 -0
  704. package/dist/numerical/spacetime-metrics.d.ts +12 -0
  705. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  706. package/dist/numerical/spacetime-metrics.js +72 -56
  707. package/dist/numerical/spacetime-metrics.js.map +1 -1
  708. package/dist/numerical/statistics.d.ts +24 -0
  709. package/dist/numerical/statistics.d.ts.map +1 -0
  710. package/dist/numerical/statistics.js +52 -0
  711. package/dist/numerical/statistics.js.map +1 -0
  712. package/dist/numerical/tensor-engine.d.ts +21 -0
  713. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  714. package/dist/numerical/tensor-engine.js +12 -0
  715. package/dist/numerical/tensor-engine.js.map +1 -1
  716. package/dist/relations/regime.d.ts +10 -0
  717. package/dist/relations/regime.d.ts.map +1 -1
  718. package/dist/relations/regime.js +18 -1
  719. package/dist/relations/regime.js.map +1 -1
  720. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"link-prediction.js","sourceRoot":"","sources":["../../src/atlas/link-prediction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAwCH,MAAM,MAAM,GAAG,CAAC,IAAY,EAAe,EAAE,CAC3C,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAEnF,MAAM,OAAO,GAAG,CAAC,CAAsB,EAAE,CAAsB,EAAU,EAAE;IACzE,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,KAAK,EAAE,CAAC;IACzC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,mFAAmF;AACnF,SAAS,IAAI,CAAC,UAA6B,EAAE,KAAwC;IACnF,OAAO,CAAC,GAAG,UAA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6, S6.3 — link prediction over the typed model graph: ONE result,\n * stated as a hypothesis about the representation.\n *\n * Design note: `docs/planning/Atlas-Phase-6-Design.md` §1.\n *\n * The graph: every model in every registered family is a node; every\n * premise→conclusion pair of every bridge is an undirected edge. The test is\n * leave-one-bridge-out: remove a bridge's edges, then ask each predictor to rank\n * the conclusion among every model not already adjacent to the premise. A hit is\n * the held-out conclusion inside the top k.\n *\n * - **structural predictor** — common neighbours in the remaining graph, ties\n * broken by sharing the premise's family, then by id;\n * - **text baseline** — word-token overlap between the models' dynamics and\n * state-space descriptions, ties broken by id.\n *\n * ⚠ **What this result cannot carry.** The graph is small (24 models, 22 pairs)\n * and was curated by the same agent that runs the test, in-distribution. It is a\n * statement about how this representation behaves on its own content — not a\n * discovery claim, not a hub or gap claim, and not evidence about physics the\n * atlas does not contain. ROADMAP Phase 6 asks for it as a hypothesis test, and\n * that is its whole scope. Product A (`src/composition/discovery.ts`) is not\n * touched: a test pins that nothing under `src/atlas/` imports it.\n *\n * @module atlas/link-prediction\n * @internal\n */\n\nimport type { AtlasFamily } from './family.js';\nimport type { AtlasModel } from './model.js';\n\n/** One held-out pair and whether each predictor recovered it. @internal */\nexport interface LinkPredictionTrial {\n readonly bridgeId: string;\n readonly premise: string;\n readonly conclusion: string;\n /** 1-based rank of the held-out conclusion; Infinity when it was not a candidate. */\n readonly structuralRank: number;\n readonly textRank: number;\n /** How many candidates the conclusion competed against. */\n readonly candidates: number;\n}\n\n/** The whole leave-one-bridge-out run. @internal */\nexport interface LinkPredictionResult {\n readonly k: number;\n readonly trials: readonly LinkPredictionTrial[];\n /**\n * Held-out pairs whose endpoints stay adjacent through ANOTHER bridge. Such a\n * pair is not a missing link — the conclusion cannot even be a candidate — so\n * it is excluded from the trials and counted here instead of silently.\n */\n readonly stillConnected: number;\n readonly structuralHits: number;\n readonly textHits: number;\n /**\n * The hit rate a RANDOM ranking would get: the mean over trials of\n * min(k, candidates)/candidates. On a small graph this is high, and a\n * predictor's recall means nothing until it is read against it.\n */\n readonly chanceRecall: number;\n /** Mean reciprocal rank of the held-out conclusion. */\n readonly structuralMrr: number;\n readonly textMrr: number;\n}\n\nconst tokens = (text: string): Set<string> =>\n new Set(text.toLowerCase().split(/[^\\p{L}\\p{N}]+/u).filter((t) => t.length > 0));\n\nconst jaccard = (a: ReadonlySet<string>, b: ReadonlySet<string>): number => {\n if (a.size === 0 && b.size === 0) return 0;\n let inter = 0;\n for (const x of a) if (b.has(x)) inter++;\n return inter / (a.size + b.size - inter);\n};\n\n/** Rank candidates by descending score list (lexicographic), then ascending id. */\nfunction rank(candidates: readonly string[], score: (id: string) => readonly number[]): string[] {\n return [...candidates].sort((x, y) => {\n const sx = score(x);\n const sy = score(y);\n for (let i = 0; i < sx.length; i++) if (sx[i] !== sy[i]) return sy[i]! - sx[i]!;\n return x < y ? -1 : x > y ? 1 : 0;\n });\n}\n\n/**\n * Run leave-one-bridge-out link prediction over the families' model graph.\n *\n * @param families - the atlas families (normally `ATLAS_FAMILIES`).\n * @param k - the depth a hit must fall within (10, as pre-registered for recall).\n * @internal\n */\nexport function runLinkPrediction(families: readonly AtlasFamily[], k = 10): LinkPredictionResult {\n const models = new Map<string, AtlasModel>();\n for (const f of families) for (const m of f.models) models.set(m.id, m);\n const bridges = families.flatMap((f) => f.bridges);\n\n const edgesOf = (b: (typeof bridges)[number]): Array<readonly [string, string]> =>\n b.premises.map((p) => [p, b.conclusion] as const);\n\n const trials: LinkPredictionTrial[] = [];\n let stillConnected = 0;\n for (const held of bridges) {\n // The graph WITHOUT the held-out bridge.\n const adj = new Map<string, Set<string>>();\n for (const id of models.keys()) adj.set(id, new Set());\n for (const b of bridges) {\n if (b === held) continue;\n for (const [u, v] of edgesOf(b)) {\n adj.get(u)?.add(v);\n adj.get(v)?.add(u);\n }\n }\n for (const [premise, conclusion] of edgesOf(held)) {\n const pModel = models.get(premise);\n if (pModel === undefined) continue;\n const neighbours = adj.get(premise) ?? new Set<string>();\n if (neighbours.has(conclusion)) {\n stillConnected++;\n continue;\n }\n const candidates = [...models.keys()].filter((id) => id !== premise && !neighbours.has(id));\n const common = (id: string): number => {\n let n = 0;\n for (const x of adj.get(id) ?? []) if (neighbours.has(x)) n++;\n return n;\n };\n const structural = rank(candidates, (id) => [common(id), models.get(id)!.family === pModel.family ? 1 : 0]);\n const pText = tokens(`${pModel.dynamics} ${pModel.stateSpace}`);\n const text = rank(candidates, (id) => {\n const m = models.get(id)!;\n return [jaccard(pText, tokens(`${m.dynamics} ${m.stateSpace}`))];\n });\n const at = (list: string[]): number => {\n const i = list.indexOf(conclusion);\n return i < 0 ? Number.POSITIVE_INFINITY : i + 1;\n };\n trials.push({\n bridgeId: held.id,\n premise,\n conclusion,\n structuralRank: at(structural),\n textRank: at(text),\n candidates: candidates.length,\n });\n }\n }\n const mean = (xs: readonly number[]): number => (xs.length === 0 ? Number.NaN : xs.reduce((a, b) => a + b, 0) / xs.length);\n return {\n k,\n trials,\n stillConnected,\n structuralHits: trials.filter((t) => t.structuralRank <= k).length,\n textHits: trials.filter((t) => t.textRank <= k).length,\n chanceRecall: mean(trials.map((t) => Math.min(k, t.candidates) / t.candidates)),\n structuralMrr: mean(trials.map((t) => 1 / t.structuralRank)),\n textMrr: mean(trials.map((t) => 1 / t.textRank)),\n };\n}\n"]}
1
+ {"version":3,"file":"link-prediction.js","sourceRoot":"","sources":["../../src/atlas/link-prediction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIpF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAkDpD,uGAAuG;AACvG,MAAM,CAAC,MAAM,gBAAgB,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AC,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,EAAE;KAC7G,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Atlas Phase 6, S6.3 — link prediction over the typed model graph: ONE result,\n * stated as a hypothesis about the representation.\n *\n * Design note: `docs/planning/Atlas-Phase-6-Design.md` §1.\n *\n * The graph: every model in every registered family is a node; every\n * premise→conclusion pair of every bridge is an undirected edge. The test is\n * leave-one-bridge-out: remove a bridge's edges, then ask each predictor to rank\n * the conclusion among every model not already adjacent to the premise. A hit is\n * the held-out conclusion inside the top k.\n *\n * - **structural predictor** — common neighbours in the remaining graph, ties\n * broken by sharing the premise's family, then by id;\n * - **text baseline** — word-token overlap between the models' dynamics and\n * state-space descriptions (`text-overlap.ts`), ties broken by id.\n *\n * **The recorded result stands.** The negative result (typed neighbourhood below text\n * overlap on twenty trials; NOTES.md, \"Link prediction is NEGATIVE\") is reproduced by\n * {@link runLinkPrediction} exactly as recorded and is not re-run for a better answer. What\n * was added beside it, never inside it: a seeded percentile-bootstrap interval on every\n * recall and MRR (MathTS `bootstrapCI`), a seeded permutation test on the two per-trial\n * reciprocal-rank vectors (MathTS `permutationTest`, stated for what it is), and McNemar's\n * exact p on the paired hits (`benchmark/stats.ts`). The Katz-index predictor\n * ({@link runKatzLinkPrediction}) is a SEPARATE result: every record it returns carries\n * `postHoc: true` and the label, and it is never a field of the recorded comparison.\n *\n * ⚠ **What this result cannot carry.** The graph is small (24 models, 22 pairs)\n * and was curated by the same agent that runs the test, in-distribution. It is a\n * statement about how this representation behaves on its own content — not a\n * discovery claim, not a hub or gap claim, and not evidence about physics the\n * atlas does not contain. ROADMAP Phase 6 asks for it as a hypothesis test, and\n * that is its whole scope. Product A (`src/composition/discovery.ts`) is not\n * touched: a test pins that nothing under `src/atlas/` imports it, and the Katz\n * predictor is not wired into discovery, whose candidates are in different\n * components by construction (every path score there is 0).\n *\n * @module atlas/link-prediction\n * @internal\n */\n\nimport { bootstrapCI, inv, permutationTest } from '@danielsimonjr/mathts-functions';\nimport type { AtlasFamily } from './family.js';\nimport type { AtlasModel } from './model.js';\nimport type { AtlasBridge } from './types.js';\nimport { jaccard, rankBy, tokens } from './text-overlap.js';\nimport { mcnemar } from './benchmark/stats.js';\nimport { meanOf } from '../numerical/statistics.js';\n\n/** One held-out pair and whether each predictor recovered it. @internal */\nexport interface LinkPredictionTrial {\n readonly bridgeId: string;\n readonly premise: string;\n readonly conclusion: string;\n /** 1-based rank of the held-out conclusion; Infinity when it was not a candidate. */\n readonly structuralRank: number;\n readonly textRank: number;\n /** How many candidates the conclusion competed against. */\n readonly candidates: number;\n}\n\n/** A percentile-bootstrap interval with the point estimate it brackets (MathTS `bootstrapCI`). @internal */\nexport interface BootstrapInterval {\n readonly estimate: number;\n readonly lower: number;\n readonly upper: number;\n /** The confidence level, 0.95. */\n readonly confidence: number;\n}\n\n/** The seeded intervals of the recorded comparison. @internal */\nexport interface LinkPredictionIntervals {\n /** The seed every resample used; stated so the interval is reproducible. */\n readonly seed: number;\n readonly resamples: number;\n readonly structuralRecall: BootstrapInterval;\n readonly textRecall: BootstrapInterval;\n readonly structuralMrr: BootstrapInterval;\n readonly textMrr: BootstrapInterval;\n}\n\n/** The seeded permutation test on the two per-trial reciprocal-rank vectors. @internal */\nexport interface ReciprocalRankPermutation {\n /** Mean structural reciprocal rank minus mean text reciprocal rank (the observed MRR difference). */\n readonly statistic: number;\n /** Two-tailed p from MathTS `permutationTest`. */\n readonly pValue: number;\n readonly seed: number;\n readonly resamples: number;\n /**\n * What the test is. MathTS has no paired permutation: `permutationTest` pools the two vectors\n * and re-splits them, so the trial pairing is not kept and the null is looser than a sign-flip\n * test's. The paired test on the hits is `mcnemarExactP`.\n */\n readonly kind: typeof PERMUTATION_KIND;\n}\n\n/** The statement of the permutation test's kind, so no reader takes it for a paired test. @internal */\nexport const PERMUTATION_KIND =\n 'two-sample permutation of the reciprocal-rank vectors (pooled re-split; the pairing is not kept)' as const;\n\n/** The whole leave-one-bridge-out run. @internal */\nexport interface LinkPredictionResult {\n readonly k: number;\n readonly trials: readonly LinkPredictionTrial[];\n /**\n * Held-out pairs whose endpoints stay adjacent through ANOTHER bridge. Such a\n * pair is not a missing link — the conclusion cannot even be a candidate — so\n * it is excluded from the trials and counted here instead of silently.\n */\n readonly stillConnected: number;\n readonly structuralHits: number;\n readonly textHits: number;\n /**\n * The hit rate a RANDOM ranking would get: the mean over trials of\n * min(k, candidates)/candidates. On a small graph this is high, and a\n * predictor's recall means nothing until it is read against it.\n */\n readonly chanceRecall: number;\n /** Mean reciprocal rank of the held-out conclusion. */\n readonly structuralMrr: number;\n readonly textMrr: number;\n /** Seeded bootstrap intervals on the four numbers above. */\n readonly intervals: LinkPredictionIntervals;\n /** The seeded permutation test on the per-trial reciprocal ranks. */\n readonly permutation: ReciprocalRankPermutation;\n /** McNemar's exact p on the paired hit table (both, structural only, text only, neither). */\n readonly mcnemarExactP: number;\n}\n\n/** The label every Katz record carries. @internal */\nexport const POST_HOC_LABEL = 'post hoc: added after the negative result was recorded' as const;\n\n/** One held-out pair under the Katz-index predictor. @internal */\nexport interface KatzTrial {\n readonly bridgeId: string;\n readonly premise: string;\n readonly conclusion: string;\n /** 1-based rank of the held-out conclusion by Katz index; Infinity when it was not a candidate. */\n readonly katzRank: number;\n /** The Katz index K[premise][conclusion] = ((I − βA)⁻¹ − I)[premise][conclusion]; 0 when no path. */\n readonly katzScore: number;\n readonly candidates: number;\n /** This trial's attenuation β = 1/(2·max degree) of its own held-out graph. */\n readonly beta: number;\n readonly postHoc: true;\n}\n\n/** The Katz-index run: a separate, post-hoc result, never merged into the recorded comparison. @internal */\nexport interface KatzLinkPredictionResult {\n readonly postHoc: true;\n readonly label: typeof POST_HOC_LABEL;\n readonly k: number;\n /**\n * `[min, max]` of the trials' attenuations. Each held-out graph has its own maximum degree, so\n * β = 1/(2·max degree) is per trial (`KatzTrial.beta`), each below its graph's spectral bound\n * 1/λ_max since λ_max ≤ max degree. The result once reported one β, the last trial's.\n */\n readonly betaRange: readonly [number, number];\n readonly trials: readonly KatzTrial[];\n readonly stillConnected: number;\n readonly katzHits: number;\n readonly katzMrr: number;\n readonly chanceRecall: number;\n readonly intervals: {\n readonly seed: number;\n readonly resamples: number;\n readonly recall: BootstrapInterval;\n readonly mrr: BootstrapInterval;\n };\n}\n\n/** The one seed every resample in this module uses, and the resample count. Stated, not hidden. */\nconst RESAMPLE_SEED = 20260924;\nconst RESAMPLES = 10000;\n\n/** One leave-one-bridge-out query: the graph without the bridge, and the candidates. */\ninterface HoldOut {\n readonly held: AtlasBridge;\n readonly premise: string;\n readonly conclusion: string;\n readonly premiseModel: AtlasModel;\n /** The undirected graph WITHOUT the held-out bridge. */\n readonly adj: ReadonlyMap<string, ReadonlySet<string>>;\n readonly candidates: readonly string[];\n}\n\n/** Every held-out query of the families, and the pairs excluded as still connected. */\nfunction holdOuts(families: readonly AtlasFamily[]): {\n readonly models: ReadonlyMap<string, AtlasModel>;\n readonly queries: readonly HoldOut[];\n readonly stillConnected: number;\n} {\n const models = new Map<string, AtlasModel>();\n for (const f of families) for (const m of f.models) models.set(m.id, m);\n const bridges = families.flatMap((f) => f.bridges);\n const edgesOf = (b: AtlasBridge): Array<readonly [string, string]> => b.premises.map((p) => [p, b.conclusion] as const);\n\n const queries: HoldOut[] = [];\n let stillConnected = 0;\n for (const held of bridges) {\n const adj = new Map<string, Set<string>>();\n for (const id of models.keys()) adj.set(id, new Set());\n for (const b of bridges) {\n if (b === held) continue;\n for (const [u, v] of edgesOf(b)) {\n adj.get(u)?.add(v);\n adj.get(v)?.add(u);\n }\n }\n for (const [premise, conclusion] of edgesOf(held)) {\n const premiseModel = models.get(premise);\n if (premiseModel === undefined) continue;\n const neighbours = adj.get(premise) ?? new Set<string>();\n if (neighbours.has(conclusion)) {\n stillConnected++;\n continue;\n }\n const candidates = [...models.keys()].filter((id) => id !== premise && !neighbours.has(id));\n queries.push({ held, premise, conclusion, premiseModel, adj, candidates });\n }\n }\n return { models, queries, stillConnected };\n}\n\n/** 1-based position of `id` in a ranking; Infinity when absent. */\nconst rankOf = (list: readonly string[], id: string): number => {\n const i = list.indexOf(id);\n return i < 0 ? Number.POSITIVE_INFINITY : i + 1;\n};\n\n/** Seeded percentile bootstrap of the mean of per-trial values (a 0/1 hit, or a reciprocal rank). */\nfunction bootstrapMean(values: readonly number[]): BootstrapInterval {\n const ci = bootstrapCI([...values], (sample) => meanOf(sample), {\n confidence: 0.95,\n resamples: RESAMPLES,\n seed: RESAMPLE_SEED,\n });\n return { estimate: ci.estimate, lower: ci.lower, upper: ci.upper, confidence: ci.confidence };\n}\n\n/** The mean of a trial statistic; NaN with no trials, as the recorded result always read it. */\nconst meanOrNaN = (xs: readonly number[]): number => (xs.length === 0 ? Number.NaN : meanOf(xs));\n\n/**\n * Run leave-one-bridge-out link prediction over the families' model graph. The recorded\n * comparison (structural against text), with its seeded intervals and paired statistics.\n *\n * @param families - the atlas families (normally `ATLAS_FAMILIES`).\n * @param k - the depth a hit must fall within (10, as pre-registered for recall).\n * @internal\n */\nexport function runLinkPrediction(families: readonly AtlasFamily[], k = 10): LinkPredictionResult {\n const { models, queries, stillConnected } = holdOuts(families);\n const trials: LinkPredictionTrial[] = queries.map((q) => {\n const neighbours = q.adj.get(q.premise) ?? new Set<string>();\n const common = (id: string): number => {\n let n = 0;\n for (const x of q.adj.get(id) ?? []) if (neighbours.has(x)) n++;\n return n;\n };\n const structural = rankBy(q.candidates, (id) => [common(id), models.get(id)!.family === q.premiseModel.family ? 1 : 0]);\n const pText = tokens(`${q.premiseModel.dynamics} ${q.premiseModel.stateSpace}`);\n const text = rankBy(q.candidates, (id) => {\n const m = models.get(id)!;\n return [jaccard(pText, tokens(`${m.dynamics} ${m.stateSpace}`))];\n });\n return {\n bridgeId: q.held.id,\n premise: q.premise,\n conclusion: q.conclusion,\n structuralRank: rankOf(structural, q.conclusion),\n textRank: rankOf(text, q.conclusion),\n candidates: q.candidates.length,\n };\n });\n\n const structuralHit: number[] = trials.map((t) => (t.structuralRank <= k ? 1 : 0));\n const textHit: number[] = trials.map((t) => (t.textRank <= k ? 1 : 0));\n const structuralRR = trials.map((t) => 1 / t.structuralRank);\n const textRR = trials.map((t) => 1 / t.textRank);\n\n // The paired hit table: both, structural only, text only, neither.\n let a = 0;\n let b = 0;\n let c = 0;\n let d = 0;\n trials.forEach((_, i) => {\n if (structuralHit[i] && textHit[i]) a++;\n else if (structuralHit[i]) b++;\n else if (textHit[i]) c++;\n else d++;\n });\n\n const permuted = permutationTest(structuralRR, textRR, (x, y) => meanOrNaN(x) - meanOrNaN(y), {\n resamples: RESAMPLES,\n seed: RESAMPLE_SEED,\n });\n\n return {\n k,\n trials,\n stillConnected,\n structuralHits: structuralHit.reduce((acc, x) => acc + x, 0),\n textHits: textHit.reduce((acc, x) => acc + x, 0),\n chanceRecall: meanOrNaN(trials.map((t) => Math.min(k, t.candidates) / t.candidates)),\n structuralMrr: meanOrNaN(structuralRR),\n textMrr: meanOrNaN(textRR),\n intervals: {\n seed: RESAMPLE_SEED,\n resamples: RESAMPLES,\n structuralRecall: bootstrapMean(structuralHit),\n textRecall: bootstrapMean(textHit),\n structuralMrr: bootstrapMean(structuralRR),\n textMrr: bootstrapMean(textRR),\n },\n permutation: {\n statistic: permuted.statistic,\n pValue: permuted.pValue,\n seed: RESAMPLE_SEED,\n resamples: RESAMPLES,\n kind: PERMUTATION_KIND,\n },\n mcnemarExactP: mcnemar({ a, b, c, d }).exactP,\n };\n}\n\n/** A square number matrix of order n, read back from MathTS `inv`, which types its result `unknown`. */\nfunction squareMatrix(value: unknown, n: number): number[][] {\n if (!Array.isArray(value) || value.length !== n) {\n throw new TypeError(`inv did not return a ${n}×${n} matrix`);\n }\n for (const row of value) {\n if (!Array.isArray(row) || row.length !== n || !row.every((x) => typeof x === 'number' && Number.isFinite(x))) {\n throw new TypeError(`inv did not return a ${n}×${n} matrix of finite numbers`);\n }\n }\n return value as number[][];\n}\n\n/**\n * The Katz index of the graph without the held-out bridge: K = (I − βA)⁻¹ − I through MathTS\n * `inv`, with β = 1/(2·max degree). The largest eigenvalue of a 0/1 adjacency is at most the\n * maximum degree, so β is below the spectral bound 1/λ_max and the series Σ βˡ Aˡ converges.\n * A graph with no edge has K = 0 everywhere, and β is stated as 0.5 (there is nothing to attenuate).\n */\nfunction katzIndex(adj: ReadonlyMap<string, ReadonlySet<string>>, ids: readonly string[]): { K: number[][]; beta: number } {\n const n = ids.length;\n const index = new Map(ids.map((id, i) => [id, i]));\n const A: number[][] = Array.from({ length: n }, () => new Array<number>(n).fill(0));\n let maxDegree = 0;\n for (const [u, neighbours] of adj) {\n const i = index.get(u);\n if (i === undefined) continue;\n maxDegree = Math.max(maxDegree, neighbours.size);\n for (const v of neighbours) {\n const j = index.get(v);\n if (j !== undefined) A[i][j] = 1;\n }\n }\n const beta = maxDegree === 0 ? 0.5 : 1 / (2 * maxDegree);\n const M = A.map((row, i) => row.map((x, j) => (i === j ? 1 : 0) - beta * x));\n const inverse = squareMatrix(inv(M), n);\n const K = inverse.map((row, i) => row.map((x, j) => (i === j ? x - 1 : x)));\n return { K, beta };\n}\n\n/**\n * The Katz-index predictor, SEPARATE from the recorded comparison and labelled post hoc: it was\n * added after the negative result was recorded, so its numbers are exploratory and are never\n * merged into that result. Ranks each candidate by K[premise][candidate] (paths of every length,\n * attenuated by β per step), ties by id. Not wired into discovery (`src/composition/`): Product A\n * candidates are in different components by construction, so every path score there is 0.\n *\n * @internal\n */\nexport function runKatzLinkPrediction(families: readonly AtlasFamily[], k = 10): KatzLinkPredictionResult {\n const { models, queries, stillConnected } = holdOuts(families);\n const ids = [...models.keys()];\n const index = new Map(ids.map((id, i) => [id, i]));\n const trials: KatzTrial[] = queries.map((q) => {\n const katz = katzIndex(q.adj, ids);\n const p = index.get(q.premise)!;\n const score = (id: string): number => katz.K[p][index.get(id)!];\n const ranked = rankBy(q.candidates, (id) => [score(id)]);\n return {\n bridgeId: q.held.id,\n premise: q.premise,\n conclusion: q.conclusion,\n katzRank: rankOf(ranked, q.conclusion),\n katzScore: q.candidates.includes(q.conclusion) ? score(q.conclusion) : 0,\n candidates: q.candidates.length,\n beta: katz.beta,\n postHoc: true,\n };\n });\n const betas = trials.map((t) => t.beta);\n const hit: number[] = trials.map((t) => (t.katzRank <= k ? 1 : 0));\n const rr = trials.map((t) => 1 / t.katzRank);\n return {\n postHoc: true,\n label: POST_HOC_LABEL,\n k,\n betaRange: betas.length === 0 ? [Number.NaN, Number.NaN] : [Math.min(...betas), Math.max(...betas)],\n trials,\n stillConnected,\n katzHits: hit.reduce((acc, x) => acc + x, 0),\n katzMrr: meanOrNaN(rr),\n chanceRecall: meanOrNaN(trials.map((t) => Math.min(k, t.candidates) / t.candidates)),\n intervals: { seed: RESAMPLE_SEED, resamples: RESAMPLES, recall: bootstrapMean(hit), mrr: bootstrapMean(rr) },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bridges-coarse.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-coarse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMjE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1F;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAA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las/oscillators/bridges-coarse
12
12
  */
13
13
  import { LENGTH, MASS, VELOCITY } from '../../dimensional/types.js';
14
- import { deriveRegimeGroups } from '../regime.js';
14
+ import { makeRegime } from '../regime.js';
15
15
  import { relationContractOf } from './bridges-exact.js';
16
16
  import { SPRING_CONSTANT } from './dimensions.js';
17
17
  const FAMILY = 'oscillators';
@@ -82,16 +82,12 @@ export const BRIDGE_CHAIN_WAVE = {
82
82
  'the discrete lattice spacing a as an independent scale',
83
83
  ],
84
84
  sideConditions: ['long-wavelength, qa ≪ 1'],
85
- regime: {
86
- family: FAMILY,
87
- inequalities: [{ group: 'qa', op: '<', bound: 1, alias: 'qa ≪ 1' }],
88
- groupDefinitions: deriveRegimeGroups(FAMILY, [
89
- { name: 'm', dim: MASS },
90
- { name: 'kappa', dim: SPRING_CONSTANT },
91
- { name: 'a', dim: LENGTH },
92
- { name: 'c', dim: VELOCITY },
93
- ], ['qa']),
94
- },
85
+ regime: makeRegime(FAMILY, [
86
+ { name: 'm', dim: MASS },
87
+ { name: 'kappa', dim: SPRING_CONSTANT },
88
+ { name: 'a', dim: LENGTH },
89
+ { name: 'c', dim: VELOCITY },
90
+ ], ['qa'], [{ group: 'qa', op: '<', bound: 1, alias: 'qa ≪ 1' }]),
95
91
  counterexamples: [
96
92
  {
97
93
  description: 'A mode at the band edge qa = π has ω = 2√(κ/m) on the lattice, while the ' +
@@ -1 +1 @@
1
- {"version":3,"file":"bridges-coarse.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-coarse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,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AAqB,kBAAkB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/**\n * Bridge 5 of the oscillator pilot: the COARSE-GRAINING bridge from the\n * discrete mass–spring chain to the 1-D wave equation.\n *\n * This is the only Phase 0 bridge whose relation is `coarse-graining`: the\n * reduction map `u_n(t) ↦ u(x = na, t)` is not invertible, and the\n * short-wavelength half of the lattice Brillouin zone (`q > π/a`) has no image\n * in the continuum model. The information loss is therefore recorded in\n * `doesNotPreserve` and witnessed numerically by `W9`.\n *\n * @module atlas/oscillators/bridges-coarse\n */\n\nimport { LENGTH, MASS, VELOCITY } from '../../dimensional/types.js';\nimport { deriveRegimeGroups } from '../regime.js';\nimport type { AtlasBridge, RelationContract } from '../types.js';\nimport { relationContractOf } from './bridges-exact.js';\nimport { SPRING_CONSTANT } from './dimensions.js';\n\nconst FAMILY = 'oscillators';\n\n/**\n * The lattice dispersion relation of `m u_n″ = κ(u_{n+1} − 2u_n + u_{n−1})`:\n * `ω(q) = 2 √(κ/m) |sin(qa/2)|`.\n *\n * @internal\n */\nexport function latticeDispersion(q: number, a: number, kappa: number, m: number): number {\n return 2 * Math.sqrt(kappa / m) * Math.abs(Math.sin((q * a) / 2));\n}\n\n/**\n * The continuum dispersion relation of `u_tt = c² u_xx` with `c² = κ a² / m`:\n * `ω = c q`.\n *\n * @internal\n */\nexport function continuumDispersion(q: number, a: number, kappa: number, m: number): number {\n return Math.sqrt((kappa * a * a) / m) * Math.abs(q);\n}\n\n/** The long-wavelength wave speed `c = a √(κ/m)`. @internal */\nexport function chainWaveSpeed(a: number, kappa: number, m: number): number {\n return a * Math.sqrt(kappa / m);\n}\n\n/**\n * The band edge of the lattice, at `qa = π`: `ω_max = 2 √(κ/m)`.\n * The continuum relation `ω = c q` is unbounded and has no counterpart —\n * that absence IS the information the coarse-graining discards.\n *\n * @internal\n */\nexport function latticeBandEdge(kappa: number, m: number): number {\n return 2 * Math.sqrt(kappa / m);\n}\n\n/**\n * Leading-order relative dispersion error `1 − ω_lattice/ω_continuum`,\n * approximated as `(qa)²/24`.\n *\n * Convention note (fixed for the whole sprint): with `x = qa/2`,\n * `1 − sin x / x = x²/6 − x⁴/120 + …`, so the true relative error is\n * `(qa)²/24 − (qa)⁴/1920`. The quartic term makes `(qa)²/24` an\n * OVERESTIMATE; the signed deviation `(true − approx)/approx` is therefore\n * NEGATIVE and equals `−(qa)²/80` to leading order. The W9 assertion is on\n * the MAGNITUDE, so the sign convention does not change the test — it is\n * stated here so the next reader does not rederive it.\n *\n * @internal\n */\nexport function dispersionErrorApproximation(qa: number): number {\n return (qa * qa) / 24;\n}\n\n/** Bridge 5: chain → wave equation by coarse-graining. @internal */\nexport const BRIDGE_CHAIN_WAVE: AtlasBridge = {\n id: 'ab-chain-wave',\n relation: 'coarse-graining',\n premises: ['model-chain'],\n conclusion: 'model-wave-1d',\n transformation: 'u_n(t) ↦ u(x = n a, t), with c² = κ a² / m',\n preserves: [\n 'long-wavelength dispersion ω ≈ c q',\n 'wave speed c = a √(κ/m)',\n 'linearity',\n ],\n doesNotPreserve: [\n 'modes with q > π/a',\n 'the band edge ω_max = 2 √(κ/m) at qa = π',\n 'the discrete lattice spacing a as an independent scale',\n ],\n sideConditions: ['long-wavelength, qa ≪ 1'],\n regime: {\n family: FAMILY,\n inequalities: [{ group: 'qa', op: '<', bound: 1, alias: 'qa ≪ 1' }],\n groupDefinitions: deriveRegimeGroups(\n FAMILY,\n [\n { name: 'm', dim: MASS },\n { name: 'kappa', dim: SPRING_CONSTANT },\n { name: 'a', dim: LENGTH },\n { name: 'c', dim: VELOCITY },\n ],\n ['qa'],\n ),\n },\n counterexamples: [\n {\n description:\n 'A mode at the band edge qa = π has ω = 2√(κ/m) on the lattice, while the ' +\n 'continuum relation ω = c q is unbounded: the coarse-grained model has no ' +\n 'band edge at all.',\n witness: 'W9',\n },\n ],\n witnesses: [\n {\n id: 'W9',\n kind: 'numeric',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance: 'relative dispersion error matches (qa)²/24 within 0.5% of itself',\n },\n {\n id: 'W9b',\n kind: 'numeric',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance:\n 'ring of 64 masses integrated: ω matches the lattice dispersion within 1e-9 and the coarse error ' +\n '(qa)²/24 within 1%; superposition within 1e-10 (linearity); a 10% wrong κ and a cubic on-site force each fail',\n },\n ],\n // The monatomic-chain dispersion omega(q) = 2 sqrt(kappa/m) |sin(qa/2)| and its\n // long-wavelength continuum limit are standard solid-state results. Work and topic are\n // cited rather than a precise section number, which would be fabrication in a more\n // confident costume. This array was EMPTY, which is honest but leaves a textbook result\n // looking unsourced.\n citations: [\n 'Kittel, Introduction to Solid State Physics - Phonons I: the monatomic linear chain, its dispersion relation and the qa << 1 continuum limit',\n 'Ashcroft & Mermin, Solid State Physics - the one-dimensional monatomic Bravais lattice and the first Brillouin zone band edge at qa = pi',\n ],\n reviewStatus: 'proposed',\n};\n\n/**\n * Bridge 5 re-registered through `RelationContract`.\n *\n * `coarse-graining` leaves `bound` OPTIONAL, and this record carries none: the\n * `qa²/24` dispersion residual is a per-mode series term, not a Lipschitz\n * constant with a uniform offset in a stated norm. The union permits the\n * absence rather than forcing an invented `K` and `delta`.\n *\n * No `deltaAt` either, for the same reason and by the same rule: `deltaAt` is\n * the machine form OF a `delta`, so a record with no `delta` has nothing for\n * it to be the machine form of. `admitApproximation` requires `deltaAt` only\n * of an `approximation`, so this record passes admission unchanged.\n *\n * @internal\n */\nexport const CONTRACT_CHAIN_WAVE: RelationContract = relationContractOf(BRIDGE_CHAIN_WAVE);\n"]}
1
+ {"version":3,"file":"bridges-coarse.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-coarse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,E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AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB,kBAAkB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/**\n * Bridge 5 of the oscillator pilot: the COARSE-GRAINING bridge from the\n * discrete mass–spring chain to the 1-D wave equation.\n *\n * This is the only Phase 0 bridge whose relation is `coarse-graining`: the\n * reduction map `u_n(t) ↦ u(x = na, t)` is not invertible, and the\n * short-wavelength half of the lattice Brillouin zone (`q > π/a`) has no image\n * in the continuum model. The information loss is therefore recorded in\n * `doesNotPreserve` and witnessed numerically by `W9`.\n *\n * @module atlas/oscillators/bridges-coarse\n */\n\nimport { LENGTH, MASS, VELOCITY } from '../../dimensional/types.js';\nimport { makeRegime } from '../regime.js';\nimport type { AtlasBridge, RelationContract } from '../types.js';\nimport { relationContractOf } from './bridges-exact.js';\nimport { SPRING_CONSTANT } from './dimensions.js';\n\nconst FAMILY = 'oscillators';\n\n/**\n * The lattice dispersion relation of `m u_n″ = κ(u_{n+1} − 2u_n + u_{n−1})`:\n * `ω(q) = 2 √(κ/m) |sin(qa/2)|`.\n *\n * @internal\n */\nexport function latticeDispersion(q: number, a: number, kappa: number, m: number): number {\n return 2 * Math.sqrt(kappa / m) * Math.abs(Math.sin((q * a) / 2));\n}\n\n/**\n * The continuum dispersion relation of `u_tt = c² u_xx` with `c² = κ a² / m`:\n * `ω = c q`.\n *\n * @internal\n */\nexport function continuumDispersion(q: number, a: number, kappa: number, m: number): number {\n return Math.sqrt((kappa * a * a) / m) * Math.abs(q);\n}\n\n/** The long-wavelength wave speed `c = a √(κ/m)`. @internal */\nexport function chainWaveSpeed(a: number, kappa: number, m: number): number {\n return a * Math.sqrt(kappa / m);\n}\n\n/**\n * The band edge of the lattice, at `qa = π`: `ω_max = 2 √(κ/m)`.\n * The continuum relation `ω = c q` is unbounded and has no counterpart —\n * that absence IS the information the coarse-graining discards.\n *\n * @internal\n */\nexport function latticeBandEdge(kappa: number, m: number): number {\n return 2 * Math.sqrt(kappa / m);\n}\n\n/**\n * Leading-order relative dispersion error `1 − ω_lattice/ω_continuum`,\n * approximated as `(qa)²/24`.\n *\n * Convention note (fixed for the whole sprint): with `x = qa/2`,\n * `1 − sin x / x = x²/6 − x⁴/120 + …`, so the true relative error is\n * `(qa)²/24 − (qa)⁴/1920`. The quartic term makes `(qa)²/24` an\n * OVERESTIMATE; the signed deviation `(true − approx)/approx` is therefore\n * NEGATIVE and equals `−(qa)²/80` to leading order. The W9 assertion is on\n * the MAGNITUDE, so the sign convention does not change the test — it is\n * stated here so the next reader does not rederive it.\n *\n * @internal\n */\nexport function dispersionErrorApproximation(qa: number): number {\n return (qa * qa) / 24;\n}\n\n/** Bridge 5: chain → wave equation by coarse-graining. @internal */\nexport const BRIDGE_CHAIN_WAVE: AtlasBridge = {\n id: 'ab-chain-wave',\n relation: 'coarse-graining',\n premises: ['model-chain'],\n conclusion: 'model-wave-1d',\n transformation: 'u_n(t) ↦ u(x = n a, t), with c² = κ a² / m',\n preserves: [\n 'long-wavelength dispersion ω ≈ c q',\n 'wave speed c = a √(κ/m)',\n 'linearity',\n ],\n doesNotPreserve: [\n 'modes with q > π/a',\n 'the band edge ω_max = 2 √(κ/m) at qa = π',\n 'the discrete lattice spacing a as an independent scale',\n ],\n sideConditions: ['long-wavelength, qa ≪ 1'],\n regime: makeRegime(\n FAMILY,\n [\n { name: 'm', dim: MASS },\n { name: 'kappa', dim: SPRING_CONSTANT },\n { name: 'a', dim: LENGTH },\n { name: 'c', dim: VELOCITY },\n ],\n ['qa'],\n [{ group: 'qa', op: '<', bound: 1, alias: 'qa ≪ 1' }],\n ),\n counterexamples: [\n {\n description:\n 'A mode at the band edge qa = π has ω = 2√(κ/m) on the lattice, while the ' +\n 'continuum relation ω = c q is unbounded: the coarse-grained model has no ' +\n 'band edge at all.',\n witness: 'W9',\n },\n ],\n witnesses: [\n {\n id: 'W9',\n kind: 'numeric',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance: 'relative dispersion error matches (qa)²/24 within 0.5% of itself',\n },\n {\n id: 'W9b',\n kind: 'numeric',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance:\n 'ring of 64 masses integrated: ω matches the lattice dispersion within 1e-9 and the coarse error ' +\n '(qa)²/24 within 1%; superposition within 1e-10 (linearity); a 10% wrong κ and a cubic on-site force each fail',\n },\n ],\n // The monatomic-chain dispersion omega(q) = 2 sqrt(kappa/m) |sin(qa/2)| and its\n // long-wavelength continuum limit are standard solid-state results. Work and topic are\n // cited rather than a precise section number, which would be fabrication in a more\n // confident costume. This array was EMPTY, which is honest but leaves a textbook result\n // looking unsourced.\n citations: [\n 'Kittel, Introduction to Solid State Physics - Phonons I: the monatomic linear chain, its dispersion relation and the qa << 1 continuum limit',\n 'Ashcroft & Mermin, Solid State Physics - the one-dimensional monatomic Bravais lattice and the first Brillouin zone band edge at qa = pi',\n ],\n reviewStatus: 'proposed',\n};\n\n/**\n * Bridge 5 re-registered through `RelationContract`.\n *\n * `coarse-graining` leaves `bound` OPTIONAL, and this record carries none: the\n * `qa²/24` dispersion residual is a per-mode series term, not a Lipschitz\n * constant with a uniform offset in a stated norm. The union permits the\n * absence rather than forcing an invented `K` and `delta`.\n *\n * No `deltaAt` either, for the same reason and by the same rule: `deltaAt` is\n * the machine form OF a `delta`, so a record with no `delta` has nothing for\n * it to be the machine form of. `admitApproximation` requires `deltaAt` only\n * of an `approximation`, so this record passes admission unchanged.\n *\n * @internal\n */\nexport const CONTRACT_CHAIN_WAVE: RelationContract = relationContractOf(BRIDGE_CHAIN_WAVE);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bridges-exact.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-exact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAU,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA8CzE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,EAAE,WA6D9B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAoC/B,CAAC;AAMF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,CAwBxE;AAED,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,gBAAuD,CAAC;AAEzF,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,EAAE,gBAAwD,CAAC"}
1
+ {"version":3,"file":"bridges-exact.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-exact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAU,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA6CzE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,EAAE,WA6D9B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAoC/B,CAAC;AAMF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,CAwBxE;AAED,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,gBAAuD,CAAC;AAEzF,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,EAAE,gBAAwD,CAAC"}
@@ -21,7 +21,7 @@
21
21
  * @module atlas/oscillators/bridges-exact
22
22
  */
23
23
  import { physjsFormalRef } from '../physjs-ref.js';
24
- import { deriveRegimeGroups } from '../regime.js';
24
+ import { makeRegime } from '../regime.js';
25
25
  import { getAtlasModel } from './models.js';
26
26
  import { SPRING_LC_RELATIVE_PERIOD_TRANSPORT } from './norm-transport.js';
27
27
  const FAMILY = 'oscillators';
@@ -40,7 +40,10 @@ const WITNESS_RESULTS_TEST = 'tests/atlas/witness-results.test.ts';
40
40
  *
41
41
  * Work and topic are cited rather than precise section numbers, because a section number
42
42
  * stated without checking the edition in hand is the same fabrication in a more confident
43
- * costume. `reviewStatus` stays 'proposed' until the independent physicist review lands.
43
+ * costume. `reviewStatus` is the record's declared review state and derives no evidence
44
+ * tag (`deriveEvidence` never reads it). It is 'proposed' here because no independent
45
+ * physicist review of these records exists; the atlas no longer gates on one (the ruling
46
+ * is recorded in `ACTIVE.md` and `NOTES.md`).
44
47
  */
45
48
  const CITATIONS = [
46
49
  'Olson, Dynamical Analogies - the force-voltage (impedance) analogy between a mass-spring–damper and a series RLC circuit',
@@ -57,11 +60,7 @@ function bridgeRegime(premiseId, conclusionId) {
57
60
  ...getAtlasModel(premiseId).parameters,
58
61
  ...getAtlasModel(conclusionId).parameters,
59
62
  ];
60
- return {
61
- family: FAMILY,
62
- inequalities: [],
63
- groupDefinitions: deriveRegimeGroups(FAMILY, parameters, []),
64
- };
63
+ return makeRegime(FAMILY, parameters, [], []);
65
64
  }
66
65
  /**
67
66
  * Bridge 1 — the lossless spring ↔ LC dictionary.
@@ -1 +1 @@
1
- {"version":3,"file":"bridges-exact.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-exact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAC;AAE1E,MAAM,MAAM,GAAG,aAAa,CAAC;AAE7B,yDAAyD;AACzD,MAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,iFAAiF;AACjF,MAAM,oBAAoB,GAAG,qCAAqC,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,SAAS,GAAsB;IACnC,0HAA0H;IAC1H,+GAA+G;CAChH,CAAC;AAEF;;;;;GAKG;AACH,SAAS,YAAY,CAAC,SAAiB,EAAE,YAAo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C;AACH,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAqB,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;AAEzF,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAqB,kBAAkB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/**\n * The two Phase 0 `exact-equivalence` bridges of design note §3.\n *\n * - `ab-spring-lc` — the lossless mechanical/electrical dictionary, exact with\n * no side condition beyond positivity and losslessness.\n * - `ab-damped-rlc` — exact only ON a side condition: the two damping ratios\n * must agree, `b/(2√(mk)) = (R/2)√(C/L)`.\n *\n * **Regimes carry no inequalities.** `RegimeInequality` expresses `<`, `<=`,\n * `>`, `>=` only, so the bridge-2 side condition — an EQUALITY between two\n * derived ratios — cannot be written as one. It is carried in\n * `sideConditions` as prose instead, and the equality is what witness W2\n * executes. Writing an inequality that merely resembles it would be a\n * fabricated constraint, so none is written. `groupDefinitions` is derived\n * from the premise and conclusion parameters by `deriveRegimeGroups`, exactly\n * as the models do; nothing there is hand-authored.\n *\n * **Evidence tags are witness-gated.** A tag appears only because a witness in\n * `tests/atlas/oscillators-exact.test.ts` passes and shows it.\n *\n * @module atlas/oscillators/bridges-exact\n */\n\nimport { physjsFormalRef } from '../physjs-ref.js';\nimport { deriveRegimeGroups } from '../regime.js';\nimport { getAtlasModel } from './models.js';\nimport type { AtlasBridge, Regime, RelationContract } from '../types.js';\nimport { SPRING_LC_RELATIVE_PERIOD_TRANSPORT } from './norm-transport.js';\n\nconst FAMILY = 'oscillators';\n\n/** The witness test file every witness below runs in. */\nconst TEST = 'tests/atlas/oscillators-exact.test.ts';\n/** Where the CAS witnesses W1s and W2s are named; the artifact pin runs them. */\nconst WITNESS_RESULTS_TEST = 'tests/atlas/witness-results.test.ts';\n\n/**\n * Literature for the electromechanical analogy, NOT a pointer at our own plan.\n *\n * The previous value here was `docs/planning/Atlas-Phase-0-Design.md §3, §6` - a citation\n * naming the document that ASSERTED the claim. That is circular, and it is worse than an\n * empty array because it LOOKS sourced and would satisfy any check that only asks whether\n * `citations[]` is non-empty. Same failure class as the evidence-tag theatre that\n * `tests/atlas/evidence-rule.test.ts` exists to catch.\n *\n * Work and topic are cited rather than precise section numbers, because a section number\n * stated without checking the edition in hand is the same fabrication in a more confident\n * costume. `reviewStatus` stays 'proposed' until the independent physicist review lands.\n */\nconst CITATIONS: readonly string[] = [\n 'Olson, Dynamical Analogies - the force-voltage (impedance) analogy between a mass-spring–damper and a series RLC circuit',\n 'Feynman, Lectures on Physics Vol. II, chapter on resonance - the LC oscillator and its mechanical counterpart',\n];\n\n/**\n * Regime coordinates spanning a bridge's premise and conclusion parameters.\n *\n * The two models' parameter names are disjoint in both bridges, so the union\n * is a legal `deriveRegimeGroups` input.\n */\nfunction bridgeRegime(premiseId: string, conclusionId: string): Regime {\n const parameters = [\n ...getAtlasModel(premiseId).parameters,\n ...getAtlasModel(conclusionId).parameters,\n ];\n return {\n family: FAMILY,\n inequalities: [],\n groupDefinitions: deriveRegimeGroups(FAMILY, parameters, []),\n };\n}\n\n/**\n * Bridge 1 — the lossless spring ↔ LC dictionary.\n *\n * `m ↔ L`, `k ↔ 1/C`, `x ↔ q`. Under `u = x/x0` (or `q/q0`) and `τ = ω0 t`\n * both systems become `u'' + u = 0`, so the equivalence is exact and\n * invertible.\n *\n * Its counterexample is W2b, which lives on THIS bridge: it shows that adding\n * a resistor to the LC side breaks the equivalence, so bridge 1 is a statement\n * about the LOSSLESS pair only.\n *\n * @internal\n */\nexport const BRIDGE_SPRING_LC: AtlasBridge = {\n id: 'ab-spring-lc',\n relation: 'exact-equivalence',\n premises: ['model-spring'],\n conclusion: 'model-lc',\n // Two nondimensionalizations, each with its own ω0; composed, the spring→LC map is\n // q(t) = (q0/x0)·x(ω_LC t / ω_s). The dimensioned frequencies differ (W1a: ω_s = 2,\n // ω_LC = 2√2); what is preserved is the frequency in units of ω0.\n transformation:\n 'force–voltage analogy m ↔ L, k ↔ 1/C, x ↔ q (so ω0² = k/m ↔ 1/(LC)); ' +\n 'u = x/x0 or q/q0, τ = ω0 t; composed, q(t) = (q0/x0)·x(ω_LC t / ω_s)',\n inverse: 'x = x0 u, t = τ/ω0',\n preserves: ['the natural frequency in units of ω0 (ω = 1 in τ = ω0 t)', 'energy up to scale', 'phase portrait'],\n doesNotPreserve: ['physical interpretation', 'units'],\n sideConditions: ['m, k, L, C > 0', 'lossless', 'unforced', 'x0, q0 nonzero'],\n regime: bridgeRegime('model-spring', 'model-lc'),\n counterexamples: [\n {\n description:\n 'adding R to bridge 1 breaks it: the circuit L = 2, C = 0.125 of witness W2b with R = 4 has ' +\n 'ζ_RLC = (R/2)√(C/L) = 0.5, ' +\n 'which no lossless spring matches — the trajectories separate by more than 1e-2 at τ = π',\n witness: 'W2b',\n },\n ],\n // `symbolically-checked` is NOT stored here any more (Phase 4 S4.3): it is\n // DERIVED from `data/atlas/witness-results.json`, where W1s records the CAS\n // check of this bridge's dictionary. A stored copy would be a second source\n // of truth that no run could falsify.\n witnesses: [\n {\n id: 'W1',\n kind: 'symbolic',\n test: TEST,\n tolerance: 'exact — rational exponent arithmetic, no floating point',\n },\n {\n id: 'W1a',\n kind: 'numeric',\n test: TEST,\n tolerance: '|u_spring − u_lc| < 1e-8; each within 1e-8 of cos τ',\n },\n {\n id: 'W1b',\n kind: 'numeric',\n test: TEST,\n tolerance: 'inverse-mapped trajectory solves m x″ + k x = 0 within 1e-8; a 1% wrong ω0 fails',\n },\n { id: 'W2b', kind: 'numeric', test: TEST, tolerance: 'separation > 1e-2 at τ = π' },\n {\n id: 'W1s',\n kind: 'symbolic',\n test: WITNESS_RESULTS_TEST,\n tolerance: 'CAS: k/m under m ↔ L, k ↔ 1/C minus 1/(LC) simplifies to literal 0',\n },\n ],\n citations: CITATIONS,\n reviewStatus: 'proposed',\n // spring → LC in relative period error only; see ./norm-transport.ts for what is not declared.\n normTransports: [SPRING_LC_RELATIVE_PERIOD_TRANSPORT],\n formalRef: physjsFormalRef('ab-spring-lc'),\n};\n\n/**\n * Bridge 2 — damped spring ↔ RLC, exact ON a side condition.\n *\n * The undamped dictionary of bridge 1 does not extend for free: `b` and `R`\n * are independent parameters, and the nondimensional systems coincide only\n * when the damping ratios match. The side condition is that equality, and W2\n * DERIVES `R` from it rather than assuming a value.\n *\n * @internal\n */\nexport const BRIDGE_DAMPED_RLC: AtlasBridge = {\n id: 'ab-damped-rlc',\n relation: 'exact-equivalence',\n premises: ['model-damped-spring'],\n conclusion: 'model-rlc',\n transformation:\n 'force–voltage analogy m ↔ L, k ↔ 1/C, b ↔ R, x ↔ q; ' +\n 'u = x/x0 or q/q0, τ = ω0 t; composed, q(t) = (q0/x0)·x(ω_RLC t / ω_mech)',\n inverse: 'x = x0 u, t = τ/ω0',\n preserves: ['the natural frequency in units of ω0 (ω = 1 in τ = ω0 t)', 'damping ratio', 'phase portrait'],\n doesNotPreserve: ['physical interpretation', 'units'],\n sideConditions: [\n 'b/√(mk) = R√(C/L), equivalently ζ_mech = b/(2√(mk)) equals ζ_RLC = (R/2)√(C/L)',\n 'm, b, k, L, R, C > 0',\n 'unforced',\n 'x0, q0 nonzero',\n ],\n regime: bridgeRegime('model-damped-spring', 'model-rlc'),\n counterexamples: [],\n witnesses: [\n {\n id: 'W2',\n kind: 'numeric',\n test: TEST,\n tolerance: 'R derived exactly; |u_mech − u_rlc| < 1e-8 at four τ',\n },\n {\n id: 'W2s',\n kind: 'symbolic',\n test: WITNESS_RESULTS_TEST,\n tolerance: 'CAS: b²/(4mk) under m ↔ L, k ↔ 1/C, b ↔ R minus R²C/(4L) simplifies to literal 0',\n },\n ],\n citations: CITATIONS,\n reviewStatus: 'proposed',\n formalRef: physjsFormalRef('ab-damped-rlc'),\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Phase 1 re-registration: the Sprint 0 bridges through `RelationContract`\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Re-register an `AtlasBridge` through the Phase 1 `RelationContract` union.\n *\n * `AtlasBridge` states its two conditional requirements — `exact-equivalence`\n * needs `inverse`, `approximation` needs `bound` — only in doc comments, so a\n * record that breaks them type-checks. `RelationContract` states them in the\n * type system. This function is the one place the Sprint 0 records cross from\n * the weaker shape to the stronger one, and it THROWS on the two cases the\n * doc comments could only describe.\n *\n * It copies rather than restates: every field comes off the bridge, so a\n * contract cannot drift from the record it re-registers.\n *\n * @throws TypeError when the bridge omits the field its relation requires.\n * @internal\n */\nexport function relationContractOf(bridge: AtlasBridge): RelationContract {\n const { relation, transformation } = bridge;\n switch (relation) {\n case 'exact-equivalence': {\n if (bridge.inverse === undefined) {\n throw new TypeError(`${bridge.id}: exact-equivalence without an inverse`);\n }\n return { type: relation, transformation, inverse: bridge.inverse };\n }\n case 'approximation': {\n if (bridge.bound === undefined) {\n throw new TypeError(`${bridge.id}: approximation without a bound`);\n }\n return { type: relation, transformation, bound: bridge.bound };\n }\n case 'coarse-graining':\n // `bound` is OPTIONAL here: the chain/wave bridge carries none, and the\n // union allows that rather than forcing an invented one.\n return bridge.bound === undefined\n ? { type: relation, transformation }\n : { type: relation, transformation, bound: bridge.bound };\n default:\n return { type: relation, transformation };\n }\n}\n\n/** Bridge 1 re-registered through the Phase 1 contract. @internal */\nexport const CONTRACT_SPRING_LC: RelationContract = relationContractOf(BRIDGE_SPRING_LC);\n\n/** Bridge 2 re-registered through the Phase 1 contract. @internal */\nexport const CONTRACT_DAMPED_RLC: RelationContract = relationContractOf(BRIDGE_DAMPED_RLC);\n"]}
1
+ {"version":3,"file":"bridges-exact.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-exact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,mCAAmC,EAAE,MAAM,qBA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;gBAC/B,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE;gBACpC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;QAC9D;YACE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAqB,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;AAEzF,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAqB,kBAAkB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/**\n * The two Phase 0 `exact-equivalence` bridges of design note §3.\n *\n * - `ab-spring-lc` — the lossless mechanical/electrical dictionary, exact with\n * no side condition beyond positivity and losslessness.\n * - `ab-damped-rlc` — exact only ON a side condition: the two damping ratios\n * must agree, `b/(2√(mk)) = (R/2)√(C/L)`.\n *\n * **Regimes carry no inequalities.** `RegimeInequality` expresses `<`, `<=`,\n * `>`, `>=` only, so the bridge-2 side condition — an EQUALITY between two\n * derived ratios — cannot be written as one. It is carried in\n * `sideConditions` as prose instead, and the equality is what witness W2\n * executes. Writing an inequality that merely resembles it would be a\n * fabricated constraint, so none is written. `groupDefinitions` is derived\n * from the premise and conclusion parameters by `deriveRegimeGroups`, exactly\n * as the models do; nothing there is hand-authored.\n *\n * **Evidence tags are witness-gated.** A tag appears only because a witness in\n * `tests/atlas/oscillators-exact.test.ts` passes and shows it.\n *\n * @module atlas/oscillators/bridges-exact\n */\n\nimport { physjsFormalRef } from '../physjs-ref.js';\nimport { makeRegime } from '../regime.js';\nimport { getAtlasModel } from './models.js';\nimport type { AtlasBridge, Regime, RelationContract } from '../types.js';\nimport { SPRING_LC_RELATIVE_PERIOD_TRANSPORT } from './norm-transport.js';\n\nconst FAMILY = 'oscillators';\n\n/** The witness test file every witness below runs in. */\nconst TEST = 'tests/atlas/oscillators-exact.test.ts';\n/** Where the CAS witnesses W1s and W2s are named; the artifact pin runs them. */\nconst WITNESS_RESULTS_TEST = 'tests/atlas/witness-results.test.ts';\n\n/**\n * Literature for the electromechanical analogy, NOT a pointer at our own plan.\n *\n * The previous value here was `docs/planning/Atlas-Phase-0-Design.md §3, §6` - a citation\n * naming the document that ASSERTED the claim. That is circular, and it is worse than an\n * empty array because it LOOKS sourced and would satisfy any check that only asks whether\n * `citations[]` is non-empty. Same failure class as the evidence-tag theatre that\n * `tests/atlas/evidence-rule.test.ts` exists to catch.\n *\n * Work and topic are cited rather than precise section numbers, because a section number\n * stated without checking the edition in hand is the same fabrication in a more confident\n * costume. `reviewStatus` is the record's declared review state and derives no evidence\n * tag (`deriveEvidence` never reads it). It is 'proposed' here because no independent\n * physicist review of these records exists; the atlas no longer gates on one (the ruling\n * is recorded in `ACTIVE.md` and `NOTES.md`).\n */\nconst CITATIONS: readonly string[] = [\n 'Olson, Dynamical Analogies - the force-voltage (impedance) analogy between a mass-spring–damper and a series RLC circuit',\n 'Feynman, Lectures on Physics Vol. II, chapter on resonance - the LC oscillator and its mechanical counterpart',\n];\n\n/**\n * Regime coordinates spanning a bridge's premise and conclusion parameters.\n *\n * The two models' parameter names are disjoint in both bridges, so the union\n * is a legal `deriveRegimeGroups` input.\n */\nfunction bridgeRegime(premiseId: string, conclusionId: string): Regime {\n const parameters = [\n ...getAtlasModel(premiseId).parameters,\n ...getAtlasModel(conclusionId).parameters,\n ];\n return makeRegime(FAMILY, parameters, [], []);\n}\n\n/**\n * Bridge 1 — the lossless spring ↔ LC dictionary.\n *\n * `m ↔ L`, `k ↔ 1/C`, `x ↔ q`. Under `u = x/x0` (or `q/q0`) and `τ = ω0 t`\n * both systems become `u'' + u = 0`, so the equivalence is exact and\n * invertible.\n *\n * Its counterexample is W2b, which lives on THIS bridge: it shows that adding\n * a resistor to the LC side breaks the equivalence, so bridge 1 is a statement\n * about the LOSSLESS pair only.\n *\n * @internal\n */\nexport const BRIDGE_SPRING_LC: AtlasBridge = {\n id: 'ab-spring-lc',\n relation: 'exact-equivalence',\n premises: ['model-spring'],\n conclusion: 'model-lc',\n // Two nondimensionalizations, each with its own ω0; composed, the spring→LC map is\n // q(t) = (q0/x0)·x(ω_LC t / ω_s). The dimensioned frequencies differ (W1a: ω_s = 2,\n // ω_LC = 2√2); what is preserved is the frequency in units of ω0.\n transformation:\n 'force–voltage analogy m ↔ L, k ↔ 1/C, x ↔ q (so ω0² = k/m ↔ 1/(LC)); ' +\n 'u = x/x0 or q/q0, τ = ω0 t; composed, q(t) = (q0/x0)·x(ω_LC t / ω_s)',\n inverse: 'x = x0 u, t = τ/ω0',\n preserves: ['the natural frequency in units of ω0 (ω = 1 in τ = ω0 t)', 'energy up to scale', 'phase portrait'],\n doesNotPreserve: ['physical interpretation', 'units'],\n sideConditions: ['m, k, L, C > 0', 'lossless', 'unforced', 'x0, q0 nonzero'],\n regime: bridgeRegime('model-spring', 'model-lc'),\n counterexamples: [\n {\n description:\n 'adding R to bridge 1 breaks it: the circuit L = 2, C = 0.125 of witness W2b with R = 4 has ' +\n 'ζ_RLC = (R/2)√(C/L) = 0.5, ' +\n 'which no lossless spring matches — the trajectories separate by more than 1e-2 at τ = π',\n witness: 'W2b',\n },\n ],\n // `symbolically-checked` is NOT stored here any more (Phase 4 S4.3): it is\n // DERIVED from `data/atlas/witness-results.json`, where W1s records the CAS\n // check of this bridge's dictionary. A stored copy would be a second source\n // of truth that no run could falsify.\n witnesses: [\n {\n id: 'W1',\n kind: 'symbolic',\n test: TEST,\n tolerance: 'exact — rational exponent arithmetic, no floating point',\n },\n {\n id: 'W1a',\n kind: 'numeric',\n test: TEST,\n tolerance: '|u_spring − u_lc| < 1e-8; each within 1e-8 of cos τ',\n },\n {\n id: 'W1b',\n kind: 'numeric',\n test: TEST,\n tolerance: 'inverse-mapped trajectory solves m x″ + k x = 0 within 1e-8; a 1% wrong ω0 fails',\n },\n { id: 'W2b', kind: 'numeric', test: TEST, tolerance: 'separation > 1e-2 at τ = π' },\n {\n id: 'W1s',\n kind: 'symbolic',\n test: WITNESS_RESULTS_TEST,\n tolerance: 'CAS: k/m under m ↔ L, k ↔ 1/C minus 1/(LC) simplifies to literal 0',\n },\n ],\n citations: CITATIONS,\n reviewStatus: 'proposed',\n // spring → LC in relative period error only; see ./norm-transport.ts for what is not declared.\n normTransports: [SPRING_LC_RELATIVE_PERIOD_TRANSPORT],\n formalRef: physjsFormalRef('ab-spring-lc'),\n};\n\n/**\n * Bridge 2 — damped spring ↔ RLC, exact ON a side condition.\n *\n * The undamped dictionary of bridge 1 does not extend for free: `b` and `R`\n * are independent parameters, and the nondimensional systems coincide only\n * when the damping ratios match. The side condition is that equality, and W2\n * DERIVES `R` from it rather than assuming a value.\n *\n * @internal\n */\nexport const BRIDGE_DAMPED_RLC: AtlasBridge = {\n id: 'ab-damped-rlc',\n relation: 'exact-equivalence',\n premises: ['model-damped-spring'],\n conclusion: 'model-rlc',\n transformation:\n 'force–voltage analogy m ↔ L, k ↔ 1/C, b ↔ R, x ↔ q; ' +\n 'u = x/x0 or q/q0, τ = ω0 t; composed, q(t) = (q0/x0)·x(ω_RLC t / ω_mech)',\n inverse: 'x = x0 u, t = τ/ω0',\n preserves: ['the natural frequency in units of ω0 (ω = 1 in τ = ω0 t)', 'damping ratio', 'phase portrait'],\n doesNotPreserve: ['physical interpretation', 'units'],\n sideConditions: [\n 'b/√(mk) = R√(C/L), equivalently ζ_mech = b/(2√(mk)) equals ζ_RLC = (R/2)√(C/L)',\n 'm, b, k, L, R, C > 0',\n 'unforced',\n 'x0, q0 nonzero',\n ],\n regime: bridgeRegime('model-damped-spring', 'model-rlc'),\n counterexamples: [],\n witnesses: [\n {\n id: 'W2',\n kind: 'numeric',\n test: TEST,\n tolerance: 'R derived exactly; |u_mech − u_rlc| < 1e-8 at four τ',\n },\n {\n id: 'W2s',\n kind: 'symbolic',\n test: WITNESS_RESULTS_TEST,\n tolerance: 'CAS: b²/(4mk) under m ↔ L, k ↔ 1/C, b ↔ R minus R²C/(4L) simplifies to literal 0',\n },\n ],\n citations: CITATIONS,\n reviewStatus: 'proposed',\n formalRef: physjsFormalRef('ab-damped-rlc'),\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Phase 1 re-registration: the Sprint 0 bridges through `RelationContract`\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Re-register an `AtlasBridge` through the Phase 1 `RelationContract` union.\n *\n * `AtlasBridge` states its two conditional requirements — `exact-equivalence`\n * needs `inverse`, `approximation` needs `bound` — only in doc comments, so a\n * record that breaks them type-checks. `RelationContract` states them in the\n * type system. This function is the one place the Sprint 0 records cross from\n * the weaker shape to the stronger one, and it THROWS on the two cases the\n * doc comments could only describe.\n *\n * It copies rather than restates: every field comes off the bridge, so a\n * contract cannot drift from the record it re-registers.\n *\n * @throws TypeError when the bridge omits the field its relation requires.\n * @internal\n */\nexport function relationContractOf(bridge: AtlasBridge): RelationContract {\n const { relation, transformation } = bridge;\n switch (relation) {\n case 'exact-equivalence': {\n if (bridge.inverse === undefined) {\n throw new TypeError(`${bridge.id}: exact-equivalence without an inverse`);\n }\n return { type: relation, transformation, inverse: bridge.inverse };\n }\n case 'approximation': {\n if (bridge.bound === undefined) {\n throw new TypeError(`${bridge.id}: approximation without a bound`);\n }\n return { type: relation, transformation, bound: bridge.bound };\n }\n case 'coarse-graining':\n // `bound` is OPTIONAL here: the chain/wave bridge carries none, and the\n // union allows that rather than forcing an invented one.\n return bridge.bound === undefined\n ? { type: relation, transformation }\n : { type: relation, transformation, bound: bridge.bound };\n default:\n return { type: relation, transformation };\n }\n}\n\n/** Bridge 1 re-registered through the Phase 1 contract. @internal */\nexport const CONTRACT_SPRING_LC: RelationContract = relationContractOf(BRIDGE_SPRING_LC);\n\n/** Bridge 2 re-registered through the Phase 1 contract. @internal */\nexport const CONTRACT_DAMPED_RLC: RelationContract = relationContractOf(BRIDGE_DAMPED_RLC);\n"]}
@@ -35,11 +35,11 @@ import type { ApproximationBound, AtlasBridge, RelationContract } from '../types
35
35
  * @internal
36
36
  */
37
37
  export declare function makeApproximation(bound: ApproximationBound): ApproximationBound;
38
- /** Arithmetic–geometric mean, the standard evaluation route for `K`. @internal */
39
- export declare function agm(a0: number, b0: number): number;
40
38
  /**
41
39
  * The EXACT relative period error of the pendulum at amplitude `theta0`:
42
- * `(2/π) K(sin(θ0/2)) − 1 = 1/AGM(1, cos(θ0/2)) − 1`.
40
+ * `(2/π) K(sin(θ0/2)) − 1`, with `K` MathTS `ellipticK`, which takes the
41
+ * PARAMETER `m = k² = sin²(θ0/2)` and evaluates it by the AGM
42
+ * (`K = π / (2·AGM(1, √(1−m)))`, so this is `1/AGM(1, cos(θ0/2)) − 1`).
43
43
  *
44
44
  * This is the machine form of `ab-pendulum-linear`'s `delta`. It is SHARP —
45
45
  * the bound equals the error it bounds — and it is strictly increasing in
@@ -102,19 +102,6 @@ export declare const AB_PENDULUM_LINEAR: AtlasBridge;
102
102
  export declare const AB_DAMPED_MASSLESS: AtlasBridge;
103
103
  /** The two approximation bridges of this module, in design-note order. @internal */
104
104
  export declare const LIMIT_BRIDGES: readonly AtlasBridge[];
105
- /**
106
- * The two approximation bridges re-registered through `RelationContract`.
107
- *
108
- * The union REQUIRES `bound` on an `approximation`, and `ApproximationBound`
109
- * requires its own machine `horizonHolds`, so these two lines are what turn
110
- * Sprint 0's doc-comment requirement into a compile-and-throw one. Both bounds
111
- * are the records' own, measured ones — nothing is restated here.
112
- *
113
- * @internal
114
- */
115
- export declare const CONTRACT_PENDULUM_LINEAR: RelationContract;
116
- /** @internal */
117
- export declare const CONTRACT_DAMPED_MASSLESS: RelationContract;
118
105
  /** The two limit contracts, in design-note order. @internal */
119
106
  export declare const LIMIT_CONTRACTS: readonly RelationContract[];
120
107
  //# sourceMappingURL=bridges-limits.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bridges-limits.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-limits.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AM,aAAa,CAAC;AAS7F;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAO/E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAMtF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAKpF;AAiCD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAgFhC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAmFhC,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAA6C,CAAC;AAmB9F,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,SAAS,gBAAgB,EAGtD,CAAC"}
@@ -20,8 +20,10 @@
20
20
  *
21
21
  * @module atlas/oscillators/bridges-limits
22
22
  */
23
+ import { ellipticK } from '@danielsimonjr/mathts-functions';
24
+ import { numberFrom } from '../../core/mathts-read.js';
23
25
  import { physjsFormalRef } from '../physjs-ref.js';
24
- import { deriveRegimeGroups } from '../regime.js';
26
+ import { makeRegime } from '../regime.js';
25
27
  import { MissingHorizonError } from '../types.js';
26
28
  import { relationContractOf } from './bridges-exact.js';
27
29
  import { DAMPING, SPRING_CONSTANT } from './dimensions.js';
@@ -48,18 +50,11 @@ export function makeApproximation(bound) {
48
50
  }
49
51
  return bound;
50
52
  }
51
- /** Arithmetic–geometric mean, the standard evaluation route for `K`. @internal */
52
- export function agm(a0, b0) {
53
- let a = a0;
54
- let b = b0;
55
- for (let i = 0; i < 60 && a !== b; i++) {
56
- [a, b] = [(a + b) / 2, Math.sqrt(a * b)];
57
- }
58
- return a;
59
- }
60
53
  /**
61
54
  * The EXACT relative period error of the pendulum at amplitude `theta0`:
62
- * `(2/π) K(sin(θ0/2)) − 1 = 1/AGM(1, cos(θ0/2)) − 1`.
55
+ * `(2/π) K(sin(θ0/2)) − 1`, with `K` MathTS `ellipticK`, which takes the
56
+ * PARAMETER `m = k² = sin²(θ0/2)` and evaluates it by the AGM
57
+ * (`K = π / (2·AGM(1, √(1−m)))`, so this is `1/AGM(1, cos(θ0/2)) − 1`).
63
58
  *
64
59
  * This is the machine form of `ab-pendulum-linear`'s `delta`. It is SHARP —
65
60
  * the bound equals the error it bounds — and it is strictly increasing in
@@ -79,7 +74,9 @@ export function pendulumPeriodErrorAt(params) {
79
74
  const { theta0 } = params;
80
75
  if (!Number.isFinite(theta0) || Math.abs(theta0) >= Math.PI)
81
76
  return Infinity;
82
- return 1 / agm(1, Math.cos(theta0 / 2)) - 1;
77
+ const m = Math.sin(theta0 / 2) ** 2;
78
+ const k = numberFrom('ellipticK', ellipticK(m));
79
+ return (2 / Math.PI) * k - 1;
83
80
  }
84
81
  /**
85
82
  * The position-offset bound of `ab-damped-massless` at a point:
@@ -103,14 +100,10 @@ export function dampedOffsetBoundAt(params) {
103
100
  return (2 * (1 + Math.abs(v0)) * m) / b;
104
101
  }
105
102
  /** Pendulum regime: `θ0 ≤ 0.5 rad`, stated on the dimensionless input. @internal */
106
- const PENDULUM_REGIME = {
107
- family: FAMILY,
108
- inequalities: [{ group: 'theta0', op: '<=', bound: 0.5, alias: 'θ0 ≤ 0.5 rad' }],
109
- groupDefinitions: deriveRegimeGroups(FAMILY, [
110
- { name: 'g', dim: ACCELERATION },
111
- { name: 'ell', dim: LENGTH },
112
- ], ['theta0']),
113
- };
103
+ const PENDULUM_REGIME = makeRegime(FAMILY, [
104
+ { name: 'g', dim: ACCELERATION },
105
+ { name: 'ell', dim: LENGTH },
106
+ ], ['theta0'], [{ group: 'theta0', op: '<=', bound: 0.5, alias: 'θ0 ≤ 0.5 rad' }]);
114
107
  /**
115
108
  * Damped-spring regime: overdamped, `m k / b² < 1/4`.
116
109
  *
@@ -120,15 +113,11 @@ const PENDULUM_REGIME = {
120
113
  *
121
114
  * @internal
122
115
  */
123
- const DAMPED_REGIME = {
124
- family: FAMILY,
125
- inequalities: [{ group: 'm · b^-2 · k', op: '<', bound: 0.25, alias: 'ζ > 1' }],
126
- groupDefinitions: deriveRegimeGroups(FAMILY, [
127
- { name: 'm', dim: MASS },
128
- { name: 'b', dim: DAMPING },
129
- { name: 'k', dim: SPRING_CONSTANT },
130
- ], []),
131
- };
116
+ const DAMPED_REGIME = makeRegime(FAMILY, [
117
+ { name: 'm', dim: MASS },
118
+ { name: 'b', dim: DAMPING },
119
+ { name: 'k', dim: SPRING_CONSTANT },
120
+ ], [], [{ group: 'm · b^-2 · k', op: '<', bound: 0.25, alias: 'ζ > 1' }]);
132
121
  /**
133
122
  * `ab-pendulum-linear` — small-angle pendulum → harmonic spring.
134
123
  *
@@ -158,8 +147,8 @@ export const AB_PENDULUM_LINEAR = {
158
147
  bound: makeApproximation({
159
148
  K: 1,
160
149
  // Sup over `θ0 ≤ 0.5`: the error is strictly increasing in |θ0|, so the
161
- // edge value IS the supremum. 0.0158525311014... (AGM), independently
162
- // reproduced by quadrature of the complete elliptic integral.
150
+ // edge value IS the supremum. 0.0158525311014... (MathTS ellipticK, by the
151
+ // AGM), independently reproduced by quadrature of the complete elliptic integral.
163
152
  delta: pendulumPeriodErrorAt({ theta0: 0.5 }),
164
153
  deltaAt: pendulumPeriodErrorAt,
165
154
  deltaAtBasis: 'closed-form',
@@ -224,7 +213,7 @@ export const AB_PENDULUM_LINEAR = {
224
213
  // certifies the TRANSFORMATION (mass mℓ², spring constant mgℓ, ω0² = g/ℓ),
225
214
  // not `bound.delta`. Physlib's period results concern `periodFormula`, which
226
215
  // its own TODO has not yet tied to the motion. The sanity lemmas instantiate
227
- // that imported statement. Keyed by `formal/physjs/manifest.json`.
216
+ // that imported statement. Keyed by `formal/lean/manifest.json`.
228
217
  formalRef: physjsFormalRef('ab-pendulum-linear'),
229
218
  };
230
219
  /**
@@ -333,9 +322,9 @@ export const LIMIT_BRIDGES = [AB_PENDULUM_LINEAR, AB_DAMPED_MASSLESS];
333
322
  *
334
323
  * @internal
335
324
  */
336
- export const CONTRACT_PENDULUM_LINEAR = relationContractOf(AB_PENDULUM_LINEAR);
325
+ const CONTRACT_PENDULUM_LINEAR = relationContractOf(AB_PENDULUM_LINEAR);
337
326
  /** @internal */
338
- export const CONTRACT_DAMPED_MASSLESS = relationContractOf(AB_DAMPED_MASSLESS);
327
+ const CONTRACT_DAMPED_MASSLESS = relationContractOf(AB_DAMPED_MASSLESS);
339
328
  /** The two limit contracts, in design-note order. @internal */
340
329
  export const LIMIT_CONTRACTS = [
341
330
  CONTRACT_PENDULUM_LINEAR,
@@ -1 +1 @@
1
- {"version":3,"file":"bridges-limits.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,MAAM,GAAG,aAAa,CAAC;AAC7B,MAAM,SAAS,GAAG,wCAAwC,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IACzD,IAAI,KAAK,CAAC,OAAO,CAA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ACf,IAAI,EAAE,SAAS;YACf,SAAS,EACP,2FAA2F;SAC9F;KACF;IACD,SAAS,EAAE;QACT,4FAA4F;QAC5F,mFAAmF;KACpF;IACD,YAAY,EAAE,UAAU;CACzB,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAE9F;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACnC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEzC,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GACnC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEzC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAgC;IAC1D,wBAAwB;IACxB,wBAAwB;CACzB,CAAC","sourcesContent":["/**\n * The two Phase 0 APPROXIMATION bridges — design note §3, bridges 3 and 4.\n *\n * - `ab-pendulum-linear` — a REGULAR limit. `θ'' + ω0² sin θ = 0` reduces to\n * `θ'' + ω0² θ = 0` as `θ0 → 0`. The order of the system does not drop, the\n * error is `O(θ0²)` in the relative period, and the approximation is\n * NON-UNIFORM in time: a fixed relative period error accumulates phase\n * without bound, so the bound carries the horizon `t ≪ 16 T0/θ0²`.\n * - `ab-damped-massless` — a SINGULAR limit. `m x'' + b x' + k x = 0` reduces\n * to `b x' + k x = 0` as `m → 0`. The order DROPS from two to one, one\n * initial condition is lost, and the reduced model cannot satisfy `x'(0)`.\n * The bound therefore holds only OUTSIDE the boundary layer, `t ≥ 5 m/b`.\n *\n * On the position offset of the singular bridge: `x_full − x_red` is an\n * `O((1 + |v0|) m)` deviation that PERSISTS THROUGHOUT THE OUTER REGION and\n * decays only on the slow time scale `b/k`. It is the matched-asymptotics\n * correction, not a boundary-layer transient, and waiting out the fast mode\n * does not remove it. (Design note §9 YELLOW (5) — \"non-vanishing\" was the\n * imprecise wording this replaces: the offset does go to zero as `t → ∞`.)\n *\n * @module atlas/oscillators/bridges-limits\n */\n\nimport { physjsFormalRef } from '../physjs-ref.js';\nimport { deriveRegimeGroups } from '../regime.js';\nimport { MissingHorizonError } from '../types.js';\nimport type { ApproximationBound, AtlasBridge, RelationContract, Regime } from '../types.js';\nimport { relationContractOf } from './bridges-exact.js';\nimport { DAMPING, SPRING_CONSTANT } from './dimensions.js';\nimport { RELATIVE_PERIOD_NORM } from './norms.js';\nimport { ACCELERATION, LENGTH, MASS } from '../../dimensional/types.js';\n\nconst FAMILY = 'oscillators';\nconst TEST_FILE = 'tests/atlas/oscillators-limits.test.ts';\n\n/**\n * Build an `ApproximationBound`, rejecting one with no prose horizon.\n *\n * Every `approximation` bridge in this module is constructed through here, so\n * the mandatory-horizon rule of `ApproximationBound` has something that FAILS\n * rather than a comment asking for compliance. `horizonHolds` is mandatory by\n * the type; the prose `horizon` is the field a caller can satisfy with `''`,\n * so it is the one checked at run time. `uniformity: null` is accepted: not\n * yet analysed is a real state, and the refusal lives in `boundPath`.\n *\n * @throws MissingHorizonError if `horizon` is empty or whitespace.\n * @internal\n */\nexport function makeApproximation(bound: ApproximationBound): ApproximationBound {\n if (bound.horizon.trim() === '') {\n throw new MissingHorizonError(\n 'an approximation bound requires a non-empty prose horizon beside horizonHolds',\n );\n }\n return bound;\n}\n\n/** Arithmetic–geometric mean, the standard evaluation route for `K`. @internal */\nexport function agm(a0: number, b0: number): number {\n let a = a0;\n let b = b0;\n for (let i = 0; i < 60 && a !== b; i++) {\n [a, b] = [(a + b) / 2, Math.sqrt(a * b)];\n }\n return a;\n}\n\n/**\n * The EXACT relative period error of the pendulum at amplitude `theta0`:\n * `(2/π) K(sin(θ0/2)) − 1 = 1/AGM(1, cos(θ0/2)) − 1`.\n *\n * This is the machine form of `ab-pendulum-linear`'s `delta`. It is SHARP —\n * the bound equals the error it bounds — and it is strictly increasing in\n * `|θ0|`, so its value at the edge of a declared amplitude range is the\n * supremum over that range. That last property is what lets the record state\n * one scalar for the whole domain honestly.\n *\n * The series `θ0²/16` is the LEADING TERM of this quantity, not an upper bound\n * on it: at the domain edge `θ0 = 0.5` the series gives `0.0156250` while the\n * exact error is `0.0158525311`, so the series UNDERSTATES by 1.456%. A record\n * that declares the series value is violated at its own boundary.\n *\n * @returns `Infinity` outside `|θ0| < π`, where no finite period error exists.\n * @internal\n */\nexport function pendulumPeriodErrorAt(params: Readonly<Record<string, number>>): number {\n const { theta0 } = params;\n if (!Number.isFinite(theta0) || Math.abs(theta0) >= Math.PI) return Infinity;\n return 1 / agm(1, Math.cos(theta0 / 2)) - 1;\n}\n\n/**\n * The position-offset bound of `ab-damped-massless` at a point:\n * `2 (1 + |v0|) m / b`, the formula this record's docstring has always\n * carried. It is a bound ONLY at the witness normalisation `b = k = x0 = 1`:\n * the leading offset is `(m/b)(v0 + k x0/b)`, and the formula has no `k` or\n * `x0` in it. At `m = 1e-3, b = 1, k = 100` (inside `m k/b² < 1/4`) the true\n * error is more than 20 times the formula.\n *\n * @returns `Infinity` unless `m`, `b`, `k`, `x0` and `v0` are all finite and\n * `b = k = x0 = 1` — a missing parameter would otherwise silently return a\n * bound for a normalisation the caller did not ask about.\n * @internal\n */\nexport function dampedOffsetBoundAt(params: Readonly<Record<string, number>>): number {\n const { m, b, k, x0, v0 } = params;\n if (![m, b, k, x0, v0].every(Number.isFinite)) return Infinity;\n if (b !== 1 || k !== 1 || x0 !== 1) return Infinity;\n return (2 * (1 + Math.abs(v0)) * m) / b;\n}\n\n/** Pendulum regime: `θ0 ≤ 0.5 rad`, stated on the dimensionless input. @internal */\nconst PENDULUM_REGIME: Regime = {\n family: FAMILY,\n inequalities: [{ group: 'theta0', op: '<=', bound: 0.5, alias: 'θ0 ≤ 0.5 rad' }],\n groupDefinitions: deriveRegimeGroups(\n FAMILY,\n [\n { name: 'g', dim: ACCELERATION },\n { name: 'ell', dim: LENGTH },\n ],\n ['theta0'],\n ),\n};\n\n/**\n * Damped-spring regime: overdamped, `m k / b² < 1/4`.\n *\n * The inequality is written on the π-group, not on `ζ = ½ (m k / b²)^(−½)`,\n * which is a derived quantity and not a group (`RegimeInequality` doc).\n * `m k / b² < 1/4` is exactly `ζ > 1`, recorded as the display alias.\n *\n * @internal\n */\nconst DAMPED_REGIME: Regime = {\n family: FAMILY,\n inequalities: [{ group: 'm · b^-2 · k', op: '<', bound: 0.25, alias: 'ζ > 1' }],\n groupDefinitions: deriveRegimeGroups(\n FAMILY,\n [\n { name: 'm', dim: MASS },\n { name: 'b', dim: DAMPING },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n [],\n ),\n};\n\n/**\n * `ab-pendulum-linear` — small-angle pendulum → harmonic spring.\n *\n * `θ0²/16` is the leading term of the exact relative period error\n * `(2/π) K(sin(θ0/2)) − 1`. At `θ0 = 0.2` the residual is `5.744e-6`, which\n * the next series term `11 θ0⁴/3072 = 5.729e-6` accounts for to `1.5e-8`.\n *\n * `delta` is the EXACT error at the edge of the declared range, not that\n * series term. The record previously declared `0.5²/16 = 0.0156250`, which is\n * the series evaluated at `θ0 = 0.5` — and the exact error there is\n * `0.0158525311`, so the declared bound was VIOLATED AT ITS OWN BOUNDARY by\n * 1.456%. A truncated series is an approximation of the error, not a bound on\n * it, and the sign of its omitted tail decides which. Here the tail is\n * positive, so the series sits below what it was asked to cover.\n *\n * @internal\n */\nexport const AB_PENDULUM_LINEAR: AtlasBridge = {\n id: 'ab-pendulum-linear',\n relation: 'approximation',\n premises: ['model-pendulum'],\n conclusion: 'model-spring',\n transformation: 'sin θ → θ, with x ↔ ℓ θ and ω0² = g/ℓ',\n preserves: ['harmonic frequency ω0 to O(θ0²)', 'energy conservation', 'time-reversal symmetry'],\n doesNotPreserve: ['the amplitude dependence of the period', 'phase over times t ≳ 16 T0/θ0²'],\n sideConditions: ['θ0 ≤ 0.5 rad', 'the bound is a PERIOD error and is not uniform in time'],\n bound: makeApproximation({\n K: 1,\n // Sup over `θ0 ≤ 0.5`: the error is strictly increasing in |θ0|, so the\n // edge value IS the supremum. 0.0158525311014... (AGM), independently\n // reproduced by quadrature of the complete elliptic integral.\n delta: pendulumPeriodErrorAt({ theta0: 0.5 }),\n deltaAt: pendulumPeriodErrorAt,\n deltaAtBasis: 'closed-form',\n norm: RELATIVE_PERIOD_NORM,\n domain: 'θ0 ≤ 0.5 rad',\n horizon: 't ≪ 16 T0/θ0²; machine form t < 4 T0/θ0², the π/2-drift time',\n // ⚠ The machine form is a QUARTER of the prose scale, and it must be.\n // `16 T0/θ0²` is the time at which the accumulated phase drift reaches a\n // FULL 2π (measured: 400 T0 at θ0 = 0.2, drift 6.2976 rad) — by then the\n // approximation has lapped, so `t < 16 T0/θ0²` is not a horizon at all.\n // The `≪` is what carries the whole claim, and `<` does not render it.\n // `4 T0/θ0²` is the π/2-drift time, which is exactly what W7b measures\n // independently (99.77 cycles at θ0 = 0.2). It is also what makes\n // `horizonHolds(200 T0)` false and `horizonHolds(10 T0)` true.\n horizonHolds: (t, params) => {\n const { T0, theta0 } = params;\n if (!Number.isFinite(T0) || !Number.isFinite(theta0) || theta0 === 0) return false;\n return t < (4 * T0) / theta0 ** 2;\n },\n parameterRange: 'θ0 ≤ 0.5 rad',\n limitCharacter: 'regular',\n // A period error. The record says it is not uniform in time, so time is\n // not listed.\n uniformity: ['one period, for θ0 in the stated domain'],\n }),\n regime: PENDULUM_REGIME,\n counterexamples: [\n {\n description:\n 'the approximation is non-uniform in time: at θ0 = 0.2 the phase drift reaches π/2 ' +\n 'after ~100 cycles, however small the per-cycle error is',\n witness: 'W7b',\n },\n ],\n witnesses: [\n {\n id: 'W7',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: 'T/T0 − 1 ∈ [0.002505, 0.002507]; residual ∈ [5.70e-6, 5.76e-6] at θ0 = 0.2',\n },\n {\n id: 'W7b',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: 'cycles to π/2 drift ∈ [99, 101] at θ0 = 0.2',\n },\n {\n id: 'W7c',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: 'RK4 zero-crossing lag within 0.05° of the elliptic prediction 89.98°',\n },\n ],\n citations: [\n 'Landau & Lifshitz, Mechanics §11 (pendulum period as a complete elliptic integral)',\n 'Abramowitz & Stegun §17.6 (AGM evaluation of K)',\n ],\n reviewStatus: 'proposed',\n // Milestone 1. The reference is the PhysJS theorem, which imports Physlib's\n // `ClassicalMechanics.SimplePendulum.linearizedEquationOfMotion_iff`. It\n // certifies the TRANSFORMATION (mass mℓ², spring constant mgℓ, ω0² = g/ℓ),\n // not `bound.delta`. Physlib's period results concern `periodFormula`, which\n // its own TODO has not yet tied to the motion. The sanity lemmas instantiate\n // that imported statement. Keyed by `formal/physjs/manifest.json`.\n formalRef: physjsFormalRef('ab-pendulum-linear'),\n};\n\n/**\n * `ab-damped-massless` — the SINGULAR `m → 0` limit of the damped spring.\n *\n * `deltaAt = 2(1 + |v0|) m/b` bounds the position offset outside the boundary\n * layer, and `delta` is its supremum over the declared range rather than its\n * value at one fixture. The lost initial condition is visible in the VELOCITY: inside the\n * layer the reduced model's `x'` is wrong by O(1/m·…), and it is only after\n * `t ≈ 5 m/b` that the fast mode has decayed.\n *\n * @internal\n */\nexport const AB_DAMPED_MASSLESS: AtlasBridge = {\n id: 'ab-damped-massless',\n relation: 'approximation',\n premises: ['model-damped-spring'],\n conclusion: 'model-first-order',\n transformation: 'm → 0, dropping the m x″ term',\n preserves: ['the slow relaxation rate k/b to O(m)', 'the sign and monotonicity of the decay'],\n doesNotPreserve: [\n 'the order of the system (two → one)',\n \"the initial condition x'(0), which the reduced model cannot satisfy\",\n 'the fast mode r ≈ −b/m',\n ],\n sideConditions: [\n 'overdamped: m k / b² < 1/4',\n 'the bound holds only outside the boundary layer, t ≥ 5 m/b',\n ],\n bound: makeApproximation({\n K: 1,\n // Sup over the DECLARED range, not the fixture. `2(1+|v0|)m/b` increases\n // in both m and |v0|, and the declared range is `m k/b² < 1/4` with\n // `|v0| ≤ 5`; at the witness normalisation `b = k = 1` that is `m < 1/4`,\n // so the supremum is `2·(1+5)·(1/4) = 3`, approached at the open edge and\n // not attained. The record previously declared `2·(1+5)·1e-3 = 0.012`,\n // the same formula frozen at the ONE fixture mass `m = 1e-3` — true error\n // there is 5.96e-3, but at m = 0.24 it is 5.19e-1, forty times the\n // declared bound.\n // KNOWN LOOSENESS (0.47.0 persona re-test, L9 residual; documented, not\n // tightened): for x0 = 1 the measured sup of |x − x_reduced| over the whole\n // declared range (m < 1/4, |v0| ≤ 5, t ≥ 5m/b) is 0.524, at m ≈ 0.21 and\n // v0 = +5, and it does not grow toward critical damping (0.514 at\n // m = 0.249999). So δ = 3 holds but is 5.7× loose, and it exceeds the unit\n // signal it bounds. A tighter δ needs a bound with its own basis, not a grid\n // maximum; until then `upt path` withholds the point bound\n // (deltaAtBasis below). Independent check: the persona's\n // checks/recheck_047.py and a 115 × 2 grid over (m, ±5).\n delta: dampedOffsetBoundAt({ m: 0.25, b: 1, k: 1, x0: 1, v0: 5 }),\n deltaAt: dampedOffsetBoundAt,\n // Witness W8b supports it numerically for m ∈ {1e-1, 1e-2, 1e-3}; no proof covers it.\n deltaAtBasis: 'numerically-supported',\n norm: 'sup |x − x_reduced| for t ≥ 5 m/b',\n domain: 't ≥ 5 m/b, overdamped, at the witness normalisation b = k = 1',\n horizon: 't ≥ 5 m/b (outside the boundary layer)',\n horizonHolds: (t, params) => {\n const { m, b } = params;\n if (!Number.isFinite(m) || !Number.isFinite(b) || b === 0) return false;\n return t >= (5 * m) / b;\n },\n parameterRange: 'm k / b² < 1/4, |v0| ≤ 5; with b = k = 1 this is m < 1/4',\n limitCharacter: 'singular',\n uniformity: [\n 't ≥ 5 m/b, overdamped, at the witness normalisation b = k = 1',\n 'm k / b² < 1/4, |v0| ≤ 5',\n ],\n }),\n regime: DAMPED_REGIME,\n counterexamples: [\n {\n description:\n \"inside the boundary layer the reduced model's velocity is wrong by O(1): at \" +\n \"t = 0.5 m/b with v0 = 5 the velocity error is 3.6, against x'_red = −1\",\n witness: 'W8b',\n },\n ],\n witnesses: [\n {\n id: 'W8',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: '|r_slow + k/b| < 2m and |r_fast·m + b| < 2m for m ∈ {1e-1, 1e-2, 1e-3}',\n },\n {\n id: 'W8b',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance:\n \"|x_full − x_red| < 2(1+v0)·m for t ≥ 5 m/b; |x'| error > 1 at 0.5 m/b and < 0.05 at 5 m/b\",\n },\n ],\n citations: [\n \"Kevorkian & Cole, Multiple Scale and Singular Perturbation Methods §2 (Tikhonov's theorem)\",\n 'Verhulst, Methods and Applications of Singular Perturbations §8 (boundary layers)',\n ],\n reviewStatus: 'proposed',\n};\n\n/** The two approximation bridges of this module, in design-note order. @internal */\nexport const LIMIT_BRIDGES: readonly AtlasBridge[] = [AB_PENDULUM_LINEAR, AB_DAMPED_MASSLESS];\n\n/**\n * The two approximation bridges re-registered through `RelationContract`.\n *\n * The union REQUIRES `bound` on an `approximation`, and `ApproximationBound`\n * requires its own machine `horizonHolds`, so these two lines are what turn\n * Sprint 0's doc-comment requirement into a compile-and-throw one. Both bounds\n * are the records' own, measured ones — nothing is restated here.\n *\n * @internal\n */\nexport const CONTRACT_PENDULUM_LINEAR: RelationContract =\n relationContractOf(AB_PENDULUM_LINEAR);\n\n/** @internal */\nexport const CONTRACT_DAMPED_MASSLESS: RelationContract =\n relationContractOf(AB_DAMPED_MASSLESS);\n\n/** The two limit contracts, in design-note order. @internal */\nexport const LIMIT_CONTRACTS: readonly RelationContract[] = [\n CONTRACT_PENDULUM_LINEAR,\n CONTRACT_DAMPED_MASSLESS,\n];\n"]}
1
+ {"version":3,"file":"bridges-limits.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/bridges-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kB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E,SAAS;YACf,SAAS,EAAE,wEAAwE;SACpF;QACD;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,SAAS,EACP,2FAA2F;SAC9F;KACF;IACD,SAAS,EAAE;QACT,4FAA4F;QAC5F,mFAAmF;KACpF;IACD,YAAY,EAAE,UAAU;CACzB,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAE9F;;;;;;;;;GASG;AACH,MAAM,wBAAwB,GAC5B,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEzC,gBAAgB;AAChB,MAAM,wBAAwB,GAC5B,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEzC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAgC;IAC1D,wBAAwB;IACxB,wBAAwB;CACzB,CAAC","sourcesContent":["/**\n * The two Phase 0 APPROXIMATION bridges — design note §3, bridges 3 and 4.\n *\n * - `ab-pendulum-linear` — a REGULAR limit. `θ'' + ω0² sin θ = 0` reduces to\n * `θ'' + ω0² θ = 0` as `θ0 → 0`. The order of the system does not drop, the\n * error is `O(θ0²)` in the relative period, and the approximation is\n * NON-UNIFORM in time: a fixed relative period error accumulates phase\n * without bound, so the bound carries the horizon `t ≪ 16 T0/θ0²`.\n * - `ab-damped-massless` — a SINGULAR limit. `m x'' + b x' + k x = 0` reduces\n * to `b x' + k x = 0` as `m → 0`. The order DROPS from two to one, one\n * initial condition is lost, and the reduced model cannot satisfy `x'(0)`.\n * The bound therefore holds only OUTSIDE the boundary layer, `t ≥ 5 m/b`.\n *\n * On the position offset of the singular bridge: `x_full − x_red` is an\n * `O((1 + |v0|) m)` deviation that PERSISTS THROUGHOUT THE OUTER REGION and\n * decays only on the slow time scale `b/k`. It is the matched-asymptotics\n * correction, not a boundary-layer transient, and waiting out the fast mode\n * does not remove it. (Design note §9 YELLOW (5) — \"non-vanishing\" was the\n * imprecise wording this replaces: the offset does go to zero as `t → ∞`.)\n *\n * @module atlas/oscillators/bridges-limits\n */\n\nimport { ellipticK } from '@danielsimonjr/mathts-functions';\nimport { numberFrom } from '../../core/mathts-read.js';\nimport { physjsFormalRef } from '../physjs-ref.js';\nimport { makeRegime } from '../regime.js';\nimport { MissingHorizonError } from '../types.js';\nimport type { ApproximationBound, AtlasBridge, RelationContract, Regime } from '../types.js';\nimport { relationContractOf } from './bridges-exact.js';\nimport { DAMPING, SPRING_CONSTANT } from './dimensions.js';\nimport { RELATIVE_PERIOD_NORM } from './norms.js';\nimport { ACCELERATION, LENGTH, MASS } from '../../dimensional/types.js';\n\nconst FAMILY = 'oscillators';\nconst TEST_FILE = 'tests/atlas/oscillators-limits.test.ts';\n\n/**\n * Build an `ApproximationBound`, rejecting one with no prose horizon.\n *\n * Every `approximation` bridge in this module is constructed through here, so\n * the mandatory-horizon rule of `ApproximationBound` has something that FAILS\n * rather than a comment asking for compliance. `horizonHolds` is mandatory by\n * the type; the prose `horizon` is the field a caller can satisfy with `''`,\n * so it is the one checked at run time. `uniformity: null` is accepted: not\n * yet analysed is a real state, and the refusal lives in `boundPath`.\n *\n * @throws MissingHorizonError if `horizon` is empty or whitespace.\n * @internal\n */\nexport function makeApproximation(bound: ApproximationBound): ApproximationBound {\n if (bound.horizon.trim() === '') {\n throw new MissingHorizonError(\n 'an approximation bound requires a non-empty prose horizon beside horizonHolds',\n );\n }\n return bound;\n}\n\n/**\n * The EXACT relative period error of the pendulum at amplitude `theta0`:\n * `(2/π) K(sin(θ0/2)) − 1`, with `K` MathTS `ellipticK`, which takes the\n * PARAMETER `m = k² = sin²(θ0/2)` and evaluates it by the AGM\n * (`K = π / (2·AGM(1, √(1−m)))`, so this is `1/AGM(1, cos(θ0/2)) − 1`).\n *\n * This is the machine form of `ab-pendulum-linear`'s `delta`. It is SHARP —\n * the bound equals the error it bounds — and it is strictly increasing in\n * `|θ0|`, so its value at the edge of a declared amplitude range is the\n * supremum over that range. That last property is what lets the record state\n * one scalar for the whole domain honestly.\n *\n * The series `θ0²/16` is the LEADING TERM of this quantity, not an upper bound\n * on it: at the domain edge `θ0 = 0.5` the series gives `0.0156250` while the\n * exact error is `0.0158525311`, so the series UNDERSTATES by 1.456%. A record\n * that declares the series value is violated at its own boundary.\n *\n * @returns `Infinity` outside `|θ0| < π`, where no finite period error exists.\n * @internal\n */\nexport function pendulumPeriodErrorAt(params: Readonly<Record<string, number>>): number {\n const { theta0 } = params;\n if (!Number.isFinite(theta0) || Math.abs(theta0) >= Math.PI) return Infinity;\n const m = Math.sin(theta0 / 2) ** 2;\n const k = numberFrom('ellipticK', ellipticK(m));\n return (2 / Math.PI) * k - 1;\n}\n\n/**\n * The position-offset bound of `ab-damped-massless` at a point:\n * `2 (1 + |v0|) m / b`, the formula this record's docstring has always\n * carried. It is a bound ONLY at the witness normalisation `b = k = x0 = 1`:\n * the leading offset is `(m/b)(v0 + k x0/b)`, and the formula has no `k` or\n * `x0` in it. At `m = 1e-3, b = 1, k = 100` (inside `m k/b² < 1/4`) the true\n * error is more than 20 times the formula.\n *\n * @returns `Infinity` unless `m`, `b`, `k`, `x0` and `v0` are all finite and\n * `b = k = x0 = 1` — a missing parameter would otherwise silently return a\n * bound for a normalisation the caller did not ask about.\n * @internal\n */\nexport function dampedOffsetBoundAt(params: Readonly<Record<string, number>>): number {\n const { m, b, k, x0, v0 } = params;\n if (![m, b, k, x0, v0].every(Number.isFinite)) return Infinity;\n if (b !== 1 || k !== 1 || x0 !== 1) return Infinity;\n return (2 * (1 + Math.abs(v0)) * m) / b;\n}\n\n/** Pendulum regime: `θ0 ≤ 0.5 rad`, stated on the dimensionless input. @internal */\nconst PENDULUM_REGIME: Regime = makeRegime(\n FAMILY,\n [\n { name: 'g', dim: ACCELERATION },\n { name: 'ell', dim: LENGTH },\n ],\n ['theta0'],\n [{ group: 'theta0', op: '<=', bound: 0.5, alias: 'θ0 ≤ 0.5 rad' }],\n);\n\n/**\n * Damped-spring regime: overdamped, `m k / b² < 1/4`.\n *\n * The inequality is written on the π-group, not on `ζ = ½ (m k / b²)^(−½)`,\n * which is a derived quantity and not a group (`RegimeInequality` doc).\n * `m k / b² < 1/4` is exactly `ζ > 1`, recorded as the display alias.\n *\n * @internal\n */\nconst DAMPED_REGIME: Regime = makeRegime(\n FAMILY,\n [\n { name: 'm', dim: MASS },\n { name: 'b', dim: DAMPING },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n [],\n [{ group: 'm · b^-2 · k', op: '<', bound: 0.25, alias: 'ζ > 1' }],\n);\n\n/**\n * `ab-pendulum-linear` — small-angle pendulum → harmonic spring.\n *\n * `θ0²/16` is the leading term of the exact relative period error\n * `(2/π) K(sin(θ0/2)) − 1`. At `θ0 = 0.2` the residual is `5.744e-6`, which\n * the next series term `11 θ0⁴/3072 = 5.729e-6` accounts for to `1.5e-8`.\n *\n * `delta` is the EXACT error at the edge of the declared range, not that\n * series term. The record previously declared `0.5²/16 = 0.0156250`, which is\n * the series evaluated at `θ0 = 0.5` — and the exact error there is\n * `0.0158525311`, so the declared bound was VIOLATED AT ITS OWN BOUNDARY by\n * 1.456%. A truncated series is an approximation of the error, not a bound on\n * it, and the sign of its omitted tail decides which. Here the tail is\n * positive, so the series sits below what it was asked to cover.\n *\n * @internal\n */\nexport const AB_PENDULUM_LINEAR: AtlasBridge = {\n id: 'ab-pendulum-linear',\n relation: 'approximation',\n premises: ['model-pendulum'],\n conclusion: 'model-spring',\n transformation: 'sin θ → θ, with x ↔ ℓ θ and ω0² = g/ℓ',\n preserves: ['harmonic frequency ω0 to O(θ0²)', 'energy conservation', 'time-reversal symmetry'],\n doesNotPreserve: ['the amplitude dependence of the period', 'phase over times t ≳ 16 T0/θ0²'],\n sideConditions: ['θ0 ≤ 0.5 rad', 'the bound is a PERIOD error and is not uniform in time'],\n bound: makeApproximation({\n K: 1,\n // Sup over `θ0 ≤ 0.5`: the error is strictly increasing in |θ0|, so the\n // edge value IS the supremum. 0.0158525311014... (MathTS ellipticK, by the\n // AGM), independently reproduced by quadrature of the complete elliptic integral.\n delta: pendulumPeriodErrorAt({ theta0: 0.5 }),\n deltaAt: pendulumPeriodErrorAt,\n deltaAtBasis: 'closed-form',\n norm: RELATIVE_PERIOD_NORM,\n domain: 'θ0 ≤ 0.5 rad',\n horizon: 't ≪ 16 T0/θ0²; machine form t < 4 T0/θ0², the π/2-drift time',\n // ⚠ The machine form is a QUARTER of the prose scale, and it must be.\n // `16 T0/θ0²` is the time at which the accumulated phase drift reaches a\n // FULL 2π (measured: 400 T0 at θ0 = 0.2, drift 6.2976 rad) — by then the\n // approximation has lapped, so `t < 16 T0/θ0²` is not a horizon at all.\n // The `≪` is what carries the whole claim, and `<` does not render it.\n // `4 T0/θ0²` is the π/2-drift time, which is exactly what W7b measures\n // independently (99.77 cycles at θ0 = 0.2). It is also what makes\n // `horizonHolds(200 T0)` false and `horizonHolds(10 T0)` true.\n horizonHolds: (t, params) => {\n const { T0, theta0 } = params;\n if (!Number.isFinite(T0) || !Number.isFinite(theta0) || theta0 === 0) return false;\n return t < (4 * T0) / theta0 ** 2;\n },\n parameterRange: 'θ0 ≤ 0.5 rad',\n limitCharacter: 'regular',\n // A period error. The record says it is not uniform in time, so time is\n // not listed.\n uniformity: ['one period, for θ0 in the stated domain'],\n }),\n regime: PENDULUM_REGIME,\n counterexamples: [\n {\n description:\n 'the approximation is non-uniform in time: at θ0 = 0.2 the phase drift reaches π/2 ' +\n 'after ~100 cycles, however small the per-cycle error is',\n witness: 'W7b',\n },\n ],\n witnesses: [\n {\n id: 'W7',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: 'T/T0 − 1 ∈ [0.002505, 0.002507]; residual ∈ [5.70e-6, 5.76e-6] at θ0 = 0.2',\n },\n {\n id: 'W7b',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: 'cycles to π/2 drift ∈ [99, 101] at θ0 = 0.2',\n },\n {\n id: 'W7c',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: 'RK4 zero-crossing lag within 0.05° of the elliptic prediction 89.98°',\n },\n ],\n citations: [\n 'Landau & Lifshitz, Mechanics §11 (pendulum period as a complete elliptic integral)',\n 'Abramowitz & Stegun §17.6 (AGM evaluation of K)',\n ],\n reviewStatus: 'proposed',\n // Milestone 1. The reference is the PhysJS theorem, which imports Physlib's\n // `ClassicalMechanics.SimplePendulum.linearizedEquationOfMotion_iff`. It\n // certifies the TRANSFORMATION (mass mℓ², spring constant mgℓ, ω0² = g/ℓ),\n // not `bound.delta`. Physlib's period results concern `periodFormula`, which\n // its own TODO has not yet tied to the motion. The sanity lemmas instantiate\n // that imported statement. Keyed by `formal/lean/manifest.json`.\n formalRef: physjsFormalRef('ab-pendulum-linear'),\n};\n\n/**\n * `ab-damped-massless` — the SINGULAR `m → 0` limit of the damped spring.\n *\n * `deltaAt = 2(1 + |v0|) m/b` bounds the position offset outside the boundary\n * layer, and `delta` is its supremum over the declared range rather than its\n * value at one fixture. The lost initial condition is visible in the VELOCITY: inside the\n * layer the reduced model's `x'` is wrong by O(1/m·…), and it is only after\n * `t ≈ 5 m/b` that the fast mode has decayed.\n *\n * @internal\n */\nexport const AB_DAMPED_MASSLESS: AtlasBridge = {\n id: 'ab-damped-massless',\n relation: 'approximation',\n premises: ['model-damped-spring'],\n conclusion: 'model-first-order',\n transformation: 'm → 0, dropping the m x″ term',\n preserves: ['the slow relaxation rate k/b to O(m)', 'the sign and monotonicity of the decay'],\n doesNotPreserve: [\n 'the order of the system (two → one)',\n \"the initial condition x'(0), which the reduced model cannot satisfy\",\n 'the fast mode r ≈ −b/m',\n ],\n sideConditions: [\n 'overdamped: m k / b² < 1/4',\n 'the bound holds only outside the boundary layer, t ≥ 5 m/b',\n ],\n bound: makeApproximation({\n K: 1,\n // Sup over the DECLARED range, not the fixture. `2(1+|v0|)m/b` increases\n // in both m and |v0|, and the declared range is `m k/b² < 1/4` with\n // `|v0| ≤ 5`; at the witness normalisation `b = k = 1` that is `m < 1/4`,\n // so the supremum is `2·(1+5)·(1/4) = 3`, approached at the open edge and\n // not attained. The record previously declared `2·(1+5)·1e-3 = 0.012`,\n // the same formula frozen at the ONE fixture mass `m = 1e-3` — true error\n // there is 5.96e-3, but at m = 0.24 it is 5.19e-1, forty times the\n // declared bound.\n // KNOWN LOOSENESS (0.47.0 persona re-test, L9 residual; documented, not\n // tightened): for x0 = 1 the measured sup of |x − x_reduced| over the whole\n // declared range (m < 1/4, |v0| ≤ 5, t ≥ 5m/b) is 0.524, at m ≈ 0.21 and\n // v0 = +5, and it does not grow toward critical damping (0.514 at\n // m = 0.249999). So δ = 3 holds but is 5.7× loose, and it exceeds the unit\n // signal it bounds. A tighter δ needs a bound with its own basis, not a grid\n // maximum; until then `upt path` withholds the point bound\n // (deltaAtBasis below). Independent check: the persona's\n // checks/recheck_047.py and a 115 × 2 grid over (m, ±5).\n delta: dampedOffsetBoundAt({ m: 0.25, b: 1, k: 1, x0: 1, v0: 5 }),\n deltaAt: dampedOffsetBoundAt,\n // Witness W8b supports it numerically for m ∈ {1e-1, 1e-2, 1e-3}; no proof covers it.\n deltaAtBasis: 'numerically-supported',\n norm: 'sup |x − x_reduced| for t ≥ 5 m/b',\n domain: 't ≥ 5 m/b, overdamped, at the witness normalisation b = k = 1',\n horizon: 't ≥ 5 m/b (outside the boundary layer)',\n horizonHolds: (t, params) => {\n const { m, b } = params;\n if (!Number.isFinite(m) || !Number.isFinite(b) || b === 0) return false;\n return t >= (5 * m) / b;\n },\n parameterRange: 'm k / b² < 1/4, |v0| ≤ 5; with b = k = 1 this is m < 1/4',\n limitCharacter: 'singular',\n uniformity: [\n 't ≥ 5 m/b, overdamped, at the witness normalisation b = k = 1',\n 'm k / b² < 1/4, |v0| ≤ 5',\n ],\n }),\n regime: DAMPED_REGIME,\n counterexamples: [\n {\n description:\n \"inside the boundary layer the reduced model's velocity is wrong by O(1): at \" +\n \"t = 0.5 m/b with v0 = 5 the velocity error is 3.6, against x'_red = −1\",\n witness: 'W8b',\n },\n ],\n witnesses: [\n {\n id: 'W8',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance: '|r_slow + k/b| < 2m and |r_fast·m + b| < 2m for m ∈ {1e-1, 1e-2, 1e-3}',\n },\n {\n id: 'W8b',\n kind: 'numeric',\n test: TEST_FILE,\n tolerance:\n \"|x_full − x_red| < 2(1+v0)·m for t ≥ 5 m/b; |x'| error > 1 at 0.5 m/b and < 0.05 at 5 m/b\",\n },\n ],\n citations: [\n \"Kevorkian & Cole, Multiple Scale and Singular Perturbation Methods §2 (Tikhonov's theorem)\",\n 'Verhulst, Methods and Applications of Singular Perturbations §8 (boundary layers)',\n ],\n reviewStatus: 'proposed',\n};\n\n/** The two approximation bridges of this module, in design-note order. @internal */\nexport const LIMIT_BRIDGES: readonly AtlasBridge[] = [AB_PENDULUM_LINEAR, AB_DAMPED_MASSLESS];\n\n/**\n * The two approximation bridges re-registered through `RelationContract`.\n *\n * The union REQUIRES `bound` on an `approximation`, and `ApproximationBound`\n * requires its own machine `horizonHolds`, so these two lines are what turn\n * Sprint 0's doc-comment requirement into a compile-and-throw one. Both bounds\n * are the records' own, measured ones — nothing is restated here.\n *\n * @internal\n */\nconst CONTRACT_PENDULUM_LINEAR: RelationContract =\n relationContractOf(AB_PENDULUM_LINEAR);\n\n/** @internal */\nconst CONTRACT_DAMPED_MASSLESS: RelationContract =\n relationContractOf(AB_DAMPED_MASSLESS);\n\n/** The two limit contracts, in design-note order. @internal */\nexport const LIMIT_CONTRACTS: readonly RelationContract[] = [\n CONTRACT_PENDULUM_LINEAR,\n CONTRACT_DAMPED_MASSLESS,\n];\n"]}