{"id":20565775,"url":"https://github.com/phenax/ts-theorem-provinator","last_synced_at":"2025-04-14T15:35:33.990Z","repository":{"id":211750361,"uuid":"729801206","full_name":"phenax/ts-theorem-provinator","owner":"phenax","description":"Experiment to use typescript's type system for theorem proving","archived":false,"fork":false,"pushed_at":"2023-12-22T14:55:15.000Z","size":31,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T04:30:40.166Z","etag":null,"topics":["theorem-prover","typescript","typescript-types"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phenax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-10T12:03:40.000Z","updated_at":"2024-11-29T07:06:15.000Z","dependencies_parsed_at":"2023-12-22T16:07:30.955Z","dependency_job_id":"b29192e6-947a-499b-aaca-c028159d96c9","html_url":"https://github.com/phenax/ts-theorem-provinator","commit_stats":null,"previous_names":["phenax/ts-theorem-provinator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fts-theorem-provinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fts-theorem-provinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fts-theorem-provinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fts-theorem-provinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phenax","download_url":"https://codeload.github.com/phenax/ts-theorem-provinator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248906964,"owners_count":21181251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["theorem-prover","typescript","typescript-types"],"created_at":"2024-11-16T04:39:06.638Z","updated_at":"2025-04-14T15:35:33.956Z","avatar_url":"https://github.com/phenax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Theorem prover in ts types\nExperiment to use typescript's type system to make a shitty theorem prover.\n\n\n### Commutativity of addition in ts types or something?\n\n```typescript\nexport type Commutativity\u003cA extends Op, B extends Op\u003e = Rewrite\u003cAdd\u003cA, B\u003e, Add\u003cB, A\u003e\u003e;\n\nexport interface Comm_Base_Proof\u003cB extends Op\u003e {\n  type: 'rewrite',\n  left: Equation\u003cAdd\u003c_0, B\u003e, Add\u003cB, _0\u003e\u003e; // 0 + b = b + 0\n  right: ChainRewrites\u003c[\n    IdentityR\u003cB\u003e,         // b = b + 0\n    Sym\u003cIdentity\u003cB\u003e\u003e,     // b + 0 = b + 0\n    Refl\u003cAdd\u003cB, _0\u003e\u003e,     // true\n  ], this['left']\u003e;\n};\n\nexport interface Comm_Inductive_Proof\u003cA extends Op, B extends Op\u003e {\n  type: 'rewrite',\n  left: Equation\u003cAdd\u003cSucc\u003cA\u003e, B\u003e, Add\u003cB, Succ\u003cA\u003e\u003e\u003e;  // succ(a) + b = b + succ(a)\n  right: ChainRewrites\u003c[\n    SumSucc\u003cA, B\u003e,          // succ(a + b) = b + succ(a)\n    Commutativity\u003cA, B\u003e,    // succ(b + a) = b + succ(a)\n    SumSuccR\u003cB, A\u003e,         // succ(b + a) = succ(b + a)\n    Refl\u003cSucc\u003cAdd\u003cB, A\u003e\u003e\u003e,  // true\n  ], this['left']\u003e;\n};\n\nexport namespace spec {\n  export type commutativity = [\n    assert\u003cVerifyEquation\u003cComm_Base_Proof\u003c'B'\u003e\u003e\u003e,\n    assert\u003cVerifyEquation\u003cComm_Inductive_Proof\u003c'A', 'B'\u003e\u003e\u003e,\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenax%2Fts-theorem-provinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphenax%2Fts-theorem-provinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenax%2Fts-theorem-provinator/lists"}