# Theorem prover in ts types Experiment to use typescript's type system to make a shitty theorem prover. ### Commutativity of addition in ts types or something? ```typescript export type Commutativity = Rewrite, Add>; export interface Comm_Base_Proof { type: 'rewrite', left: Equation, Add>; // 0 + b = b + 0 right: ChainRewrites<[ IdentityR, // b = b + 0 Sym>, // b + 0 = b + 0 Refl>, // true ], this['left']>; }; export interface Comm_Inductive_Proof { type: 'rewrite', left: Equation, B>, Add>>; // succ(a) + b = b + succ(a) right: ChainRewrites<[ SumSucc, // succ(a + b) = b + succ(a) Commutativity, // succ(b + a) = b + succ(a) SumSuccR, // succ(b + a) = succ(b + a) Refl>>, // true ], this['left']>; }; export namespace spec { export type commutativity = [ assert>>, assert>>, ] } ```