diff --git a/source/test.mmt b/source/test.mmt new file mode 100644 index 0000000000000000000000000000000000000000..d7649095affe3b76e7a15aad6ddcbebd65fb40ea --- /dev/null +++ b/source/test.mmt @@ -0,0 +1,152 @@ +namespace http://mathhub.info/MitM/NewFoundation âš + +// I left out all of the basic theories just to make sure that only +the notations in this file are around âš +theory Basics = + brackets # ( 1 ) prec -100000 â™ + f â™ + a â™ + b â™ + c â™ + p â™ + A â™ + B â™ + C â™ + t â™ + ls â™ + + T â™ + P â™ + R â™ +âš + +theory Pi : ?Basics = + pi # { V1T ,… } 2 prec -10000 â™ + arrow # 1⟶… prec -9999 â™ + apply1 # 1%w… prec -10 â™ + apply2 # 1(2,…) prec -100000 â™ + lambda # [ V1T ,… ] 2 prec -10000 â™ + + test1 : f a b â™ // works â™ + test2 : f(a,b) â™ // unbound token "," â™ +âš + +theory Sigma : ?Basics = + sigma # Σ { V1T,… } prec -10000 â™ + tuple # ( 1,… ) prec -100000 â™ + tuple_entry # 1 . 2 prec -1000 â™ + + test1 : Σ { a : A, b : B a} â™ // should work apart from ":" â™ + test2 : ( a,b ) â™ // "unparsed" â™ + test3 : t.5 â™ // works â™ +âš + +theory Sequences : ?Basics = + seq # 1 ^* â™ + nil # nil %I1 â™ + cons # 1 :: 2 â™ + list_entry # 1 . 2 prec -1000 â™ // ? â™ + match # 3 match case nil => 4 case V1 :: V2 => 5 prec -500 â™ // variables apparently need to be the + first arguments? â™ + + test1 : A^* â™ // works â™ + test2 : a :: ls â™ // works â™ + test3 : a.5 â™ // works â™ + test4 : ls match case nil => A case head::tail => (f head tail) â™ // works â™ +âš + +theory Options : ?Basics = + option # Option[ 1 ] â™ + some # Some( 1 ) â™ + none # None %I1 â™ + match # 2 match case None => 3 case Some( V1 ) => 4 prec -500 â™ + + test1 : Option[A] â™ // works (except for possibly LFLambda?) â™ + test2 : Some(a) â™ // works â™ + test3 : A ☠= a match case None => b case Some(x) => c â™ // this breaks somehow â™ +âš + +// ℬ, â„•, ℤ, â„š, â„, â„‚ âš + +theory Mod : ?Basics = + mod # Mod 1 â™ + cons # ⟨ L1,… ⟩ â™ + elim # 1 . L2 â™ + + test1 : Mod T â™ // works â™ + test2 : Mod T ☠= ⟨ a1 := a, b1 := b ⟩ â™ // works except for ":=" notations missing â™ + test3 : test2.a1 â™ // works (so far) â™ +âš + +theory Term : ?Basics = + // copy paste â™ + formation # {| 1 |} 2 prec -10000 + reflect # ⌜ 1 : 2 ⌠prec -10000 + eval # ⌞ 1 ⌟ 2 prec -10000 + elim # 1 ^ 2 prec -10000 +âš + +theory FiniteSet : ?Basics = + finset # ℘n 1 â™ + in # 1 â€âˆˆ 2 â™ + cons # { 1,… } â™ + + test1 : ℘n A ☠= { a, a, b, c, c, c } â™ // works â™ + test2 : a â€âˆˆ test1 â™ // works â™ +âš + +theory MultiSet : ?Basics = + multiset # ℘m 1 â™ + cons # { 1,… } â™ + mul # mul( 1 , 2 ) â™ + + test1 : ℘m A ☠= { a, a, b, c, c, c } â™ + test2 : ⊢ mul (test1,c) ≠3 â™ // brackets! â™ +âš + +// "A^n" - tuples? I dunno... âš + +theory InfiniteSequences : ?Basics = + // pretty much identical to finite sequences, notationwise. Probably additional introduction + form via â„• ⟶ A or induction? â™ + infseq # 1 ^≤ω â™ + nil # nil %I1 â™ + cons # 1 :: 2 â™ + seq_entry # 1 . 2 prec -1000 â™ // ? â™ + match # 3 match case nil => 4 case V1 :: V2 => 5 prec -500 â™ + + test1 : A^≤ω â™ // works â™ + test2 : a :: ls â™ // works â™ + test3 : a.5 â™ // works â™ + test4 : ls match case nil => A case head :: tail => (f head tail) â™ // works â™ +âš + +theory InfiniteSets : ?Basics = + set # ℘ 1 â™ + in # 1 â€âˆˆ 2 â™ + cons1 # { 1,… } â™ + cons2 # { V1 â€: 2 | 3 } prec -500â™ + + test1 : ℘ A ☠= { a, a, b, c, c, c } â™ // works â™ + test2 : ℘ A ☠= { x â€: A | P x } â™ // works (SO FAR! colon in notation might be problematic) â™ + test3 : a â€âˆˆ test1 â™ // works â™ +âš + +theory PredSubtype : ?Basics = + predsub # ⟨ V1 : 2 | 3 ⟩ â™ + prf # prf 1 â™ // idea: For x : ⟨ y : A | P y ⟩ we would have (prf x) : P x ? â™ + coerce # 1 ↪ 2 â™ // idea: For some p : P a we have (a ↪ p) : ⟨ x : A | P x ⟩ ? â™ + + test1 : ⟨ x : A | P x ⟩ â™ // works â™ + test2 : prf test1 â™ // works â™ + test3 : ⟨ x : A | P x ⟩ ☠= (a ↪ p) â™ // works â™ +âš + +theory Quotients : ?Basics = + Quot # 1 / 2 â™ // <type> / <relation> â™ + injection # [ 1 ]_ 2 â™ // [a]_R â™ + representative # rep( 1 ) â™ // requires axiom of choice â™ + + test1 : A / R ☠= [a]_ R â™ // works, but breaks without the space after _ ! â™ + test2 : A ☠= rep(test1) â™ // works â™ +âš \ No newline at end of file