| 1 |
{x : nat | x = 0} + {True /\ False} + {forall x : nat, x = 0} |
| 2 |
: Set |
| 3 |
[<0, 2 >] |
| 4 |
: nat * nat * (nat * nat) |
| 5 |
[<0, 2 >] |
| 6 |
: nat * nat * (nat * nat) |
| 7 |
(0, 2, (2, 2)) |
| 8 |
: nat * nat * (nat * nat) |
| 9 |
pair (pair 0 2) (pair 2 0) |
| 10 |
: prod (prod nat nat) (prod nat nat) |
| 11 |
<< 0, 2, 4 >> |
| 12 |
: nat * nat * nat * (nat * (nat * nat)) |
| 13 |
<< 0, 2, 4 >> |
| 14 |
: nat * nat * nat * (nat * (nat * nat)) |
| 15 |
(0, 2, 4, (2, (2, 0))) |
| 16 |
: nat * nat * nat * (nat * (nat * nat)) |
| 17 |
(0, 2, 4, (0, (2, 4))) |
| 18 |
: nat * nat * nat * (nat * (nat * nat)) |
| 19 |
pair (pair (pair 0 2) 4) (pair 4 (pair 2 0)) |
| 20 |
: prod (prod (prod nat nat) nat) (prod nat (prod nat nat)) |
| 21 |
ETA x y : nat, Nat.add |
| 22 |
: nat -> nat -> nat |
| 23 |
ETA x y : nat, Nat.add |
| 24 |
: nat -> nat -> nat |
| 25 |
ETA x y : nat, Nat.add |
| 26 |
: nat -> nat -> nat |
| 27 |
fun x y : nat => Nat.add x y |
| 28 |
: forall (_ : nat) (_ : nat), nat |
| 29 |
ETA x y : nat, le_S |
| 30 |
: forall x y : nat, x <= y -> x <= S y |
| 31 |
fun f : forall x : nat * (bool * unit), ?T => CURRY (x : nat) (y : bool), f |
| 32 |
: (forall x : nat * (bool * unit), ?T) -> |
| 33 |
forall (x : nat) (y : bool), ?T@{x:=(x, (y, tt))} |
| 34 |
where |
| 35 |
?T : [x : nat * (bool * unit) |- Type] |
| 36 |
fun f : forall x : bool * (nat * unit), ?T => |
| 37 |
CURRYINV (x : nat) (y : bool), f |
| 38 |
: (forall x : bool * (nat * unit), ?T) -> |
| 39 |
forall (x : nat) (y : bool), ?T@{x:=(y, (x, tt))} |
| 40 |
where |
| 41 |
?T : [x : bool * (nat * unit) |- Type] |
| 42 |
fun f : forall x : unit * nat * bool, ?T => CURRYLEFT (x : nat) (y : bool), f |
| 43 |
: (forall x : unit * nat * bool, ?T) -> |
| 44 |
forall (x : nat) (y : bool), ?T@{x:=(tt, x, y)} |
| 45 |
where |
| 46 |
?T : [x : unit * nat * bool |- Type] |
| 47 |
fun f : forall x : unit * bool * nat, ?T => |
| 48 |
CURRYINVLEFT (x : nat) (y : bool), f |
| 49 |
: (forall x : unit * bool * nat, ?T) -> |
| 50 |
forall (x : nat) (y : bool), ?T@{x:=(tt, y, x)} |
| 51 |
where |
| 52 |
?T : [x : unit * bool * nat |- Type] |
| 53 |
forall n : nat, {#n | 1 > n} |
| 54 |
: Prop |
| 55 |
forall x : nat, {|x | x > 0|} |
| 56 |
: Prop |
| 57 |
exists2 x : nat, x = 1 & x = 2 |
| 58 |
: Prop |
| 59 |
fun n : nat => |
| 60 |
foo2 n (fun x y z : nat => (fun _ _ _ : nat => x + y + z = 0) z y x) |
| 61 |
: nat -> Prop |
| 62 |
fun n : nat => |
| 63 |
foo2 n (fun a b c : nat => (fun _ _ _ : nat => a + b + c = 0) c b a) |
| 64 |
: nat -> Prop |
| 65 |
fun n : nat => |
| 66 |
foo2 n (fun n0 y z : nat => (fun _ _ _ : nat => n0 + y + z = 0) z y n0) |
| 67 |
: nat -> Prop |
| 68 |
fun n : nat => |
| 69 |
foo2 n (fun x n0 z : nat => (fun _ _ _ : nat => x + n0 + z = 0) z n0 x) |
| 70 |
: nat -> Prop |
| 71 |
fun n : nat => |
| 72 |
foo2 n (fun x y n0 : nat => (fun _ _ _ : nat => x + y + n0 = 0) n0 y x) |
| 73 |
: nat -> Prop |
| 74 |
fun n : nat => {|n, y | fun _ _ _ : nat => n + y = 0 |}_2 |
| 75 |
: nat -> Prop |
| 76 |
fun n : nat => {|n, y | fun _ _ _ : nat => n + y = 0 |}_2 |
| 77 |
: nat -> Prop |
| 78 |
fun n : nat => {|n, n0 | fun _ _ _ : nat => n + n0 = 0 |}_2 |
| 79 |
: nat -> Prop |
| 80 |
fun n : nat => |
| 81 |
foo2 n (fun x y z : nat => (fun _ _ _ : nat => x + y + n = 0) z y x) |
| 82 |
: nat -> Prop |
| 83 |
fun n : nat => |
| 84 |
foo2 n (fun x y z : nat => (fun _ _ _ : nat => x + y + n = 0) z y x) |
| 85 |
: nat -> Prop |
| 86 |
fun n : nat => {|n, fun _ : nat => 0 = 0 |}_3 |
| 87 |
: nat -> Prop |
| 88 |
fun n : nat => {|n, fun _ : nat => n = 0 |}_3 |
| 89 |
: nat -> Prop |
| 90 |
fun n : nat => foo3 n (fun x _ : nat => ETA z : nat, (fun _ : nat => x = 0)) |
| 91 |
: nat -> Prop |
| 92 |
fun n : nat => {|n, fun _ : nat => 0 = 0 |}_4 |
| 93 |
: nat -> Prop |
| 94 |
fun n : nat => {|n, fun _ : nat => n = 0 |}_4 |
| 95 |
: nat -> Prop |
| 96 |
fun n : nat => foo4 n (fun _ _ : nat => ETA z : nat, (fun _ : nat => z = 0)) |
| 97 |
: nat -> Prop |
| 98 |
fun n : nat => foo4 n (fun _ y : nat => ETA z : nat, (fun _ : nat => y = 0)) |
| 99 |
: nat -> Prop |
| 100 |
tele (t : Type) '(y, z) (x : t) := tt |
| 101 |
: forall t : Type, nat * nat -> t -> fpack |
| 102 |
tele (t : Type) (y := nat) (x : t) (z : y) := (y, z) |
| 103 |
: forall t : Type, t -> nat -> fpack |
| 104 |
[fun x : nat => x + 0;; fun x : nat => x + 1;; fun x : nat => x + 2] |
| 105 |
: (nat -> nat) * |
| 106 |
((nat -> nat) * |
| 107 |
((nat -> nat) * |
| 108 |
((nat -> nat) * ((nat -> nat) * ((nat -> nat) * (nat -> nat)))))) |
| 109 |
foo5 x nat x |
| 110 |
: nat -> nat |
| 111 |
fun x : ?A => x === x |
| 112 |
: forall x : ?A, x = x |
| 113 |
where |
| 114 |
?A : [x : ?A |- Type] (x cannot be used) |
| 115 |
{{0, 1}} |
| 116 |
: nat * nat |
| 117 |
{{0, 1, 2}} |
| 118 |
: nat * (nat * nat) |
| 119 |
{{0, 1, 2, 3}} |
| 120 |
: nat * (nat * (nat * nat)) |
| 121 |
File "./output/Notations3.v", line 179, characters 0-174: |
| 122 |
Warning: Closed notations (i.e. starting and ending with a terminal symbol) |
| 123 |
should usually be at level 0 (default). |
| 124 |
[closed-notation-not-level-0,parsing,default] |
| 125 |
letpair x [1] = {0}; |
| 126 |
return (1, 2, 3, 4) |
| 127 |
: nat * nat * nat * nat |
| 128 |
((*1).2).3 |
| 129 |
: nat |
| 130 |
*(1.2) |
| 131 |
: nat |
| 132 |
{{ 1 | 1 // 1 }} |
| 133 |
: nat |
| 134 |
!!! _ _ : nat, True |
| 135 |
: (nat -> Prop) * ((nat -> Prop) * Prop) |
| 136 |
! '{{x, y}}, x.y = 0 |
| 137 |
: Prop |
| 138 |
exists_mixed (x y : nat) '{{u, t}}, x.y = 0 /\ u.t = 0 |
| 139 |
: Prop |
| 140 |
exists_mixed (x y : nat) '{{z, t}}, x.y = 0 /\ z.t = 0 |
| 141 |
: Prop |
| 142 |
exists_true '{{x, y}} (u := 0) '{{z, t}}, x.y = 0 /\ z.t = 0 |
| 143 |
: Prop |
| 144 |
exists_true (A : Type) (R : A -> A -> Prop) (_ : Reflexive R), |
| 145 |
(forall x : A, R x x) |
| 146 |
: Prop |
| 147 |
exists_true (x : nat) (A : Type) (R : A -> A -> Prop) |
| 148 |
(_ : Reflexive R) (y : nat), x.y = 0 -> forall z : A, R z z |
| 149 |
: Prop |
| 150 |
!! _ _ : nat # True # |
| 151 |
: Prop * Prop * Prop |
| 152 |
{{D 1, 2}} |
| 153 |
: nat * nat * (nat * nat * (nat * nat)) |
| 154 |
! a b : nat # True # |
| 155 |
: Prop * (Prop * Prop) |
| 156 |
{{forall x : nat, x = 0, nat}} |
| 157 |
: Prop * Set |
| 158 |
!!!! a b : nat # True # |
| 159 |
: Prop * Prop * (Prop * Prop * Prop) |
| 160 |
@@ a b : nat # a = b # b = a # |
| 161 |
: Prop * Prop |
| 162 |
exists_non_null x y z t : nat , x = y /\ z = t |
| 163 |
: Prop |
| 164 |
forall_non_null x y z t : nat , x = y /\ z = t |
| 165 |
: Prop |
| 166 |
{{RL 1, 2}} |
| 167 |
: nat * (nat * nat) |
| 168 |
{{RR 1, 2}} |
| 169 |
: nat * nat * nat |
| 170 |
@pair nat (prod nat nat) (S (S O)) (@pair nat nat (S O) O) |
| 171 |
: prod nat (prod nat nat) |
| 172 |
@pair (prod nat nat) nat (@pair nat nat O (S (S O))) (S O) |
| 173 |
: prod (prod nat nat) nat |
| 174 |
{{RLRR 1, 2}} |
| 175 |
: nat * (nat * nat) * (nat * nat * nat) * (nat * (nat * nat)) * |
| 176 |
(nat * nat * nat) |
| 177 |
pair |
| 178 |
(pair (pair (pair 2 (pair 1 0)) (pair (pair 0 2) 1)) (pair 1 (pair 2 0))) |
| 179 |
(pair (pair 0 1) 2) |
| 180 |
: prod |
| 181 |
(prod (prod (prod nat (prod nat nat)) (prod (prod nat nat) nat)) |
| 182 |
(prod nat (prod nat nat))) |
| 183 |
(prod (prod nat nat) nat) |
| 184 |
fun x : nat => if x is n .+ 1 then n else 1 |
| 185 |
: nat -> nat |
| 186 |
{'{{x, y}} : nat * nat | x.y = 0} |
| 187 |
: Set |
| 188 |
exists2' {{x, y}}, x = 0 & y = 0 |
| 189 |
: Prop |
| 190 |
myexists2 x : nat * nat, |
| 191 |
let '{{y, z}} := x in y > z & let '{{y, z}} := x in z > y |
| 192 |
: Prop |
| 193 |
fun '({{x, y}} as z) => x.y = 0 /\ z = z |
| 194 |
: nat * nat -> Prop |
| 195 |
myexists ({{x, y}} as z), x.y = 0 /\ z = z |
| 196 |
: Prop |
| 197 |
exists '({{x, y}} as z), x.y = 0 /\ z = z |
| 198 |
: Prop |
| 199 |
∀ '({{x, y}} as z), x.y = 0 /\ z = z |
| 200 |
: Prop |
| 201 |
fun '({{{{x, y}}, true}} | {{{{x, y}}, false}}) => x.y |
| 202 |
: nat * nat * bool -> nat |
| 203 |
myexists ({{{{x, y}}, true}} | {{{{x, y}}, false}}), x > y |
| 204 |
: Prop |
| 205 |
exists '({{{{x, y}}, true}} | {{{{x, y}}, false}}), x > y |
| 206 |
: Prop |
| 207 |
∀ '({{{{x, y}}, true}} | {{{{x, y}}, false}}), x > y |
| 208 |
: Prop |
| 209 |
fun p : nat => if p is S n then n else 0 |
| 210 |
: nat -> nat |
| 211 |
fun p : comparison => if p is Lt then 1 else 0 |
| 212 |
: comparison -> nat |
| 213 |
fun S : nat => [S | S.S] |
| 214 |
: nat -> nat * (nat -> nat) |
| 215 |
fun N : nat => [N | N.0] |
| 216 |
: nat -> nat * (nat -> nat) |
| 217 |
fun S : nat => [[S | S.S]] |
| 218 |
: nat -> nat * (nat -> nat) |
| 219 |
{I : nat | I = I} |
| 220 |
: Set |
| 221 |
{'I : True | I = I} |
| 222 |
: Prop |
| 223 |
{'{{x, y}} : nat * nat | x.y = 0} |
| 224 |
: Set |
| 225 |
exists2 '{{y, z}} : nat * nat, y > z & z > y |
| 226 |
: Prop |
| 227 |
foo = |
| 228 |
fun l : list nat => match l with |
| 229 |
| _ :: (_ :: _) as l1 => l1 |
| 230 |
| _ => l |
| 231 |
end |
| 232 |
: list nat -> list nat |
| 233 |
|
| 234 |
Arguments foo l%_list_scope |
| 235 |
Notation "'exists' x .. y , p" := (ex (fun x => .. (ex (fun y => p)) ..)) |
| 236 |
: type_scope (default interpretation) (from Corelib.Init.Logic) |
| 237 |
Notation "'exists' ! x .. y , p" := |
| 238 |
(ex (unique (fun x => .. (ex (unique (fun y => p))) ..))) : type_scope |
| 239 |
(default interpretation) (from Corelib.Init.Logic) |
| 240 |
Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope |
| 241 |
(default interpretation) (from Corelib.Init.Datatypes) |
| 242 |
1 goal |
| 243 |
|
| 244 |
============================ |
| 245 |
##@% |
| 246 |
^^^ |
| 247 |
myfoo01 tt |
| 248 |
: nat |
| 249 |
myfoo01 tt |
| 250 |
: nat |
| 251 |
myfoo01 tt |
| 252 |
: nat |
| 253 |
1 ⪯ 2 ⪯ 3 ⪯ 4 |
| 254 |
: Prop |
| 255 |
1 goal |
| 256 |
|
| 257 |
x : nat |
| 258 |
============================ |
| 259 |
|-_0 x |
| 260 |
1 goal |
| 261 |
|
| 262 |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : nat |
| 263 |
============================ |
| 264 |
|-_0 |
| 265 |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * |
| 266 |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 267 |
FORALL [[a, b]], a - b = 0 |
| 268 |
: Prop |
| 269 |
∀ (A : TypTerm) (B : ◻ A -> TypTerm), |
| 270 |
(∀ a : ◻ A, ◻ {B a}) -> ◻ (∀' {a : ◻ A}, {B a}) |
| 271 |
: Type |
| 272 |
FORALL [[a, b]], a - b = 0 |
| 273 |
: Prop |
| 274 |
∀ a b : nat, a - b = 0 |
| 275 |
: Prop |
| 276 |
fun x : option unit => match x with |
| 277 |
| # tt & => # tt & |
| 278 |
| None => None |
| 279 |
end |
| 280 |
: option unit -> option unit |