1 comments

  • voidmain1 day ago
    This typechecks:<p><pre><code> function prove_anything&lt;P&gt;(){ function prove_false() : False { return prove_false() } let f = prove_false() return contradiction&lt;P&gt;()(f) } </code></pre> I think a proof assistant will usually have a total notion of computation to avoid this kind of circular proof. And there are probably some subtler unsoundnesses in TS to worry about.<p>(I&#x27;m not any kind of expert in this area. It&#x27;s possible the original author intends that you execute the proof function as well as typechecking it, which I guess will prove termination, although I think for many proofs you might run out of resources trying to do that, and it&#x27;s probably still not sound.)
    • xxmarijnw7 hours ago
      TypeScript is a suitable alternative to real proof assistants like Rocq. Not only does non-termination break Curry-Howard like you mentioned, the type system of TypeScript is actually unsound on purpose: <a href="https:&#x2F;&#x2F;www.typescriptlang.org&#x2F;docs&#x2F;handbook&#x2F;type-compatibility.html#a-note-on-soundness" rel="nofollow">https:&#x2F;&#x2F;www.typescriptlang.org&#x2F;docs&#x2F;handbook&#x2F;type-compatibil...</a> :)<p>It&#x27;s still fun to see how far we can take an unsuitable type system like that of TypeScript for formal verification.