fix(tests/lean): adjust tests to modifications to standard library

This commit is contained in:
Leonardo de Moura 2014-11-30 21:16:01 -08:00
parent 697d4359e3
commit eefe03cf56
101 changed files with 158 additions and 76 deletions

View file

@ -1,6 +1,6 @@
import logic.prop namespace play
inductive acc (A : Type) (R : A → A → Prop) : A → Prop := inductive acc (A : Type) (R : A → A → Prop) : A → Prop :=
intro : ∀ (x : A), (∀ (y : A), R y x → acc A R y) → acc A R x intro : ∀ (x : A), (∀ (y : A), R y x → acc A R y) → acc A R x
check @acc.rec check @acc.rec
end play

View file

@ -1,5 +1,4 @@
import logic.prop namespace play
inductive acc {A : Type} (R : A → A → Prop) : A → Prop := inductive acc {A : Type} (R : A → A → Prop) : A → Prop :=
intro : ∀x, (∀ y, R y x → acc R y) → acc R x intro : ∀x, (∀ y, R y x → acc R y) → acc R x
@ -20,3 +19,4 @@ check F x₁
(λ (y : A) (a : R y x₁), (λ (y : A) (a : R y x₁),
acc.rec (λ (x₂ : A) (ac : ∀ (y : A), R y x₂ → acc R y) (iH : Π (y : A), R y x₂ → C y), F x₂ iH) acc.rec (λ (x₂ : A) (ac : ∀ (y : A), R y x₂ → acc R y) (iH : Π (y : A), R y x₂ → C y), F x₂ iH)
(ac y a)) (ac y a))
end play

View file

@ -1,4 +1,4 @@
structure prod.{l} (A : Type.{l}) (B : Type.{l}) := prelude namespace foo structure prod.{l} (A : Type.{l}) (B : Type.{l}) :=
(pr1 : A) (pr2 : B) (pr1 : A) (pr2 : B)
structure prod.{l} (A : Type.{l}) (B : Type.{l}) : Type := structure prod.{l} (A : Type.{l}) (B : Type.{l}) : Type :=
@ -9,3 +9,4 @@ structure prod.{l} (A : Type.{l}) (B : Type.{l}) : Type.{l} :=
structure prod.{l} (A : Type.{l}) (B : Type.{l}) : Type.{max 1 l} := structure prod.{l} (A : Type.{l}) (B : Type.{l}) : Type.{max 1 l} :=
(pr1 : A) (pr2 : B) (pr1 : A) (pr2 : B)
end foo

View file

@ -1,3 +1,3 @@
bad_structures.lean:1:49: error: invalid 'structure', the resultant universe must be provided when explicit universe levels are being used bad_structures.lean:1:71: error: invalid 'structure', the resultant universe must be provided when explicit universe levels are being used
bad_structures.lean:4:49: error: invalid 'structure', the resultant universe must be provided when explicit universe levels are being used bad_structures.lean:4:49: error: invalid 'structure', the resultant universe must be provided when explicit universe levels are being used
bad_structures.lean:7:49: error: invalid 'structure', the resultant universe level should not be zero for any universe parameter assignment bad_structures.lean:7:49: error: invalid 'structure', the resultant universe level should not be zero for any universe parameter assignment

View file

@ -1,4 +1,4 @@
import tools.tactic logic import logic
open tactic open tactic
theorem foo (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c := theorem foo (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c :=

View file

@ -1,4 +1,4 @@
definition bool : Type.{1} := Type.{0} prelude definition bool : Type.{1} := Type.{0}
definition and (p q : bool) : bool := ∀ c : bool, (p → q → c) → c definition and (p q : bool) : bool := ∀ c : bool, (p → q → c) → c
infixl `∧`:25 := and infixl `∧`:25 := and

View file

@ -1,4 +1,4 @@
constant A : Type.{1} prelude constant A : Type.{1}
definition bool : Type.{1} := Type.{0} definition bool : Type.{1} := Type.{0}
constant eq : A → A → bool constant eq : A → A → bool
infixl `=`:50 := eq infixl `=`:50 := eq

View file

@ -1,3 +1,4 @@
-- set_option default configuration for tests -- set_option default configuration for tests
prelude
set_option pp.colors false set_option pp.colors false
set_option pp.unicode true set_option pp.unicode true

View file

@ -1,4 +1,4 @@
import logic tools.tactic import logic
open tactic open tactic
definition simple := apply trivial definition simple := apply trivial

View file

@ -1,4 +1,4 @@
import tools.tactic logic.eq prelude import logic.eq
open tactic open tactic
set_option pp.notation false set_option pp.notation false

View file

@ -1,4 +1,4 @@
import logic data.prod priority import logic data.prod
set_option pp.notation false set_option pp.notation false
inductive C [class] (A : Type) := inductive C [class] (A : Type) :=

View file

@ -4,11 +4,16 @@
false|Prop false|Prop
false.rec|Π (C : Type), false → C false.rec|Π (C : Type), false → C
false_elim|false → ?c false_elim|false → ?c
false.of_ne|?a ≠ ?a → false
false.rec_on|Π (C : Type), false → C false.rec_on|Π (C : Type), false → C
false.cases_on|Π (C : Type), false → C false.cases_on|Π (C : Type), false → C
false.decidable|decidable false
false.induction_on|∀ (C : Prop), false → C false.induction_on|∀ (C : Prop), false → C
not_false_trivial|¬ false
true_ne_false|¬ true = false true_ne_false|¬ true = false
eq.false_elim|?p = false → ¬ ?p
p_ne_false|?p → ?p ≠ false p_ne_false|?p → ?p ≠ false
eq_false_elim|?a = false → ¬ ?a decidable.rec_on_false|Π (H3 : ¬ ?p), ?H2 H3 → decidable.rec_on ?H ?H1 ?H2
not_false|¬ false
if_false|∀ (t e : ?A), (if false then t else e) = e
iff.false_elim|?a ↔ false → ¬ ?a
-- ENDFINDP -- ENDFINDP

View file

@ -1,10 +1,10 @@
-- BEGINEVAL -- BEGINEVAL
Type : Type Type : Type
-- ENDEVAL -- ENDEVAL
-- BEGINSET -- BEGINSET
-- ENDSET -- ENDSET
-- BEGINEVAL -- BEGINEVAL
Type.{1} : Type.{2} Type₁ : Type₂
-- ENDEVAL -- ENDEVAL
-- BEGINWAIT -- BEGINWAIT
-- ENDWAIT -- ENDWAIT

View file

@ -3,16 +3,26 @@
-- BEGINSET -- BEGINSET
-- ENDSET -- ENDSET
-- BEGINFINDP -- BEGINFINDP
pos_num.size|pos_num → pos_num
pos_num.bit0|pos_num → pos_num pos_num.bit0|pos_num → pos_num
pos_num.is_inhabited|inhabited pos_num pos_num.is_inhabited|inhabited pos_num
pos_num.is_one|pos_num → bool
pos_num.inc|pos_num → pos_num pos_num.inc|pos_num → pos_num
pos_num.ibelow|pos_num → Prop
pos_num.induction_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n pos_num.induction_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n
pos_num.succ|pos_num → pos_num
pos_num.bit1|pos_num → pos_num pos_num.bit1|pos_num → pos_num
pos_num.rec|?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → (Π (n : pos_num), ?C n) pos_num.rec|?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → (Π (n : pos_num), ?C n)
pos_num.one|pos_num pos_num.one|pos_num
pos_num.below|pos_num → Type
pos_num.cases_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C (pos_num.bit0 a)) → ?C n pos_num.cases_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C (pos_num.bit0 a)) → ?C n
pos_num.pred|pos_num → pos_num
pos_num.mul|pos_num → pos_num → pos_num
pos_num.no_confusion_type|Type → pos_num → pos_num → Type
pos_num.num_bits|pos_num → pos_num pos_num.num_bits|pos_num → pos_num
pos_num.no_confusion|eq ?v1 ?v2 → pos_num.no_confusion_type ?P ?v1 ?v2
pos_num.rec_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n pos_num.rec_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n
pos_num.add|pos_num → pos_num → pos_num
pos_num|Type pos_num|Type
-- ENDFINDP -- ENDFINDP
-- BEGINWAIT -- BEGINWAIT
@ -23,25 +33,43 @@ pos_num|Type
pos_num.size|pos_num → pos_num pos_num.size|pos_num → pos_num
pos_num.bit0|pos_num → pos_num pos_num.bit0|pos_num → pos_num
pos_num.is_inhabited|inhabited pos_num pos_num.is_inhabited|inhabited pos_num
pos_num.is_one|pos_num → bool
pos_num.inc|pos_num → pos_num pos_num.inc|pos_num → pos_num
pos_num.ibelow|pos_num → Prop
pos_num.induction_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n pos_num.induction_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n
pos_num.succ|pos_num → pos_num
pos_num.bit1|pos_num → pos_num pos_num.bit1|pos_num → pos_num
pos_num.rec|?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → (Π (n : pos_num), ?C n) pos_num.rec|?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → (Π (n : pos_num), ?C n)
pos_num.one|pos_num pos_num.one|pos_num
pos_num.below|pos_num → Type
pos_num.cases_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C (pos_num.bit0 a)) → ?C n pos_num.cases_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C (pos_num.bit0 a)) → ?C n
pos_num.pred|pos_num → pos_num
pos_num.mul|pos_num → pos_num → pos_num
pos_num.no_confusion_type|Type → pos_num → pos_num → Type
pos_num.no_confusion|eq ?v1 ?v2 → pos_num.no_confusion_type ?P ?v1 ?v2
pos_num.rec_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n pos_num.rec_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n
pos_num.add|pos_num → pos_num → pos_num
pos_num|Type pos_num|Type
-- ENDFINDP -- ENDFINDP
-- BEGINFINDP -- BEGINFINDP
pos_num.size|pos_num → pos_num pos_num.size|pos_num → pos_num
pos_num.bit0|pos_num → pos_num pos_num.bit0|pos_num → pos_num
pos_num.is_inhabited|inhabited pos_num pos_num.is_inhabited|inhabited pos_num
pos_num.is_one|pos_num → bool
pos_num.inc|pos_num → pos_num pos_num.inc|pos_num → pos_num
pos_num.ibelow|pos_num → Prop
pos_num.induction_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n pos_num.induction_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n
pos_num.succ|pos_num → pos_num
pos_num.bit1|pos_num → pos_num pos_num.bit1|pos_num → pos_num
pos_num.rec|?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → (Π (n : pos_num), ?C n) pos_num.rec|?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → (Π (n : pos_num), ?C n)
pos_num.one|pos_num pos_num.one|pos_num
pos_num.below|pos_num → Type
pos_num.cases_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C (pos_num.bit0 a)) → ?C n pos_num.cases_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C (pos_num.bit0 a)) → ?C n
pos_num.pred|pos_num → pos_num
pos_num.mul|pos_num → pos_num → pos_num
pos_num.no_confusion_type|Type → pos_num → pos_num → Type
pos_num.no_confusion|eq ?v1 ?v2 → pos_num.no_confusion_type ?P ?v1 ?v2
pos_num.rec_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n pos_num.rec_on|Π (n : pos_num), ?C pos_num.one → (Π (a : pos_num), ?C a → ?C (pos_num.bit1 a)) → (Π (a : pos_num), ?C a → ?C (pos_num.bit0 a)) → ?C n
pos_num.add|pos_num → pos_num → pos_num
pos_num|Type pos_num|Type
-- ENDFINDP -- ENDFINDP

View file

@ -1,4 +1,4 @@
-- Correct version prelude -- Correct version
check let bool := Type.{0}, check let bool := Type.{0},
and (p q : bool) := ∀ c : bool, (p → q → c) → c, and (p q : bool) := ∀ c : bool, (p → q → c) → c,
infixl `∧`:25 := and, infixl `∧`:25 := and,

View file

@ -1,4 +1,4 @@
set_option pp.notation false prelude set_option pp.notation false
definition Prop := Type.{0} definition Prop := Type.{0}
constant eq {A : Type} : A → A → Prop constant eq {A : Type} : A → A → Prop
infixl `=`:50 := eq infixl `=`:50 := eq

View file

@ -1,4 +1,4 @@
section prelude section
variable A : Type variable A : Type
variable a : A variable a : A
variable c : A variable c : A

View file

@ -1,4 +1,4 @@
check λ {A : Type.{1}} (B : Type.{1}) (a : A) (b : B), a prelude check λ {A : Type.{1}} (B : Type.{1}) (a : A) (b : B), a
check λ {A : Type.{1}} {B : Type.{1}} (a : A) (b : B), a check λ {A : Type.{1}} {B : Type.{1}} (a : A) (b : B), a
check λ (A : Type.{1}) {B : Type.{1}} (a : A) (b : B), a check λ (A : Type.{1}) {B : Type.{1}} (a : A) (b : B), a
check λ (A : Type.{1}) (B : Type.{1}) (a : A) (b : B), a check λ (A : Type.{1}) (B : Type.{1}) (a : A) (b : B), a

View file

@ -1,7 +1,7 @@
import type --
inductive prod (A B : Type₊) := inductive prod2 (A B : Type₊) :=
mk : A → B → prod A B mk : A → B → prod2 A B
set_option pp.universes true set_option pp.universes true
check @prod check @prod2

View file

@ -1 +1 @@
prod.{l_1 l_2} : Type.{l_1+1} → Type.{l_2+1} → Type.{max (l_1+1) (l_2+1)} prod2.{l_1 l_2} : Type.{l_1+1} → Type.{l_2+1} → Type.{max (l_1+1) (l_2+1)}

View file

@ -1,3 +1,4 @@
prelude
constant A.{l1 l2} : Type.{l1} → Type.{l2} constant A.{l1 l2} : Type.{l1} → Type.{l2}
check A check A
definition tst.{l} (A : Type) (B : Type) (C : Type.{l}) : Type := A → B → C definition tst.{l} (A : Type) (B : Type) (C : Type.{l}) : Type := A → B → C

View file

@ -1,4 +1,4 @@
import tools.tactic logic.eq import logic.eq
open tactic open tactic
theorem foo (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c := theorem foo (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c :=

View file

@ -1,4 +1,4 @@
import hott.path tools.tactic import hott.path
open path tactic open path tactic
open path (rec_on) open path (rec_on)

View file

@ -1,4 +1,4 @@
import tools.tactic logic import logic
open tactic open tactic
theorem foo (A : Type) (a b c : A) : a = b → b = c → a = c ∧ c = a := theorem foo (A : Type) (a b c : A) : a = b → b = c → a = c ∧ c = a :=

View file

@ -1,3 +1,4 @@
prelude
import logic import logic
namespace experiment namespace experiment
inductive nat : Type := inductive nat : Type :=
@ -22,10 +23,10 @@ definition is_zero (x : nat)
:= nat.rec true (λ n r, false) x := nat.rec true (λ n r, false) x
theorem is_zero_zero : is_zero zero theorem is_zero_zero : is_zero zero
:= eq_true_elim (refl _) := eq.true_elim (refl _)
theorem not_is_zero_succ (x : nat) : ¬ is_zero (succ x) theorem not_is_zero_succ (x : nat) : ¬ is_zero (succ x)
:= eq_false_elim (refl _) := eq.false_elim (refl _)
theorem dichotomy (m : nat) : m = zero (∃ n, m = succ n) theorem dichotomy (m : nat) : m = zero (∃ n, m = succ n)
:= nat.rec := nat.rec

View file

@ -1,6 +1,6 @@
import data.num import data.num
namespace play
constants int nat real : Type.{1} constants int nat real : Type.{1}
constant nat_add : nat → nat → nat constant nat_add : nat → nat → nat
constant int_add : int → int → int constant int_add : int → int → int
@ -53,3 +53,4 @@ definition id (A : Type) (a : A) := a
notation A `=` B `:` C := @eq C A B notation A `=` B `:` C := @eq C A B
check nat_to_int n + nat_to_int m = (n + m) : int check nat_to_int n + nat_to_int m = (n + m) : int
end foo end foo
end play

View file

@ -1,3 +1,5 @@
prelude
constant A : Type.{1} constant A : Type.{1}
constant B : Type.{1} constant B : Type.{1}
constant f : A → B constant f : A → B

View file

@ -1,6 +1,6 @@
import data.unit import data.unit
open unit open unit
namespace play
constant int : Type.{1} constant int : Type.{1}
constant nat : Type.{1} constant nat : Type.{1}
constant izero : int constant izero : int
@ -13,3 +13,4 @@ definition g [coercion] (a : unit) : nat := nzero
set_option pp.coercions true set_option pp.coercions true
check isucc star check isucc star
check nsucc star check nsucc star
end play

View file

@ -3,7 +3,7 @@
--- Released under Apache 2.0 license as described in the file LICENSE. --- Released under Apache 2.0 license as described in the file LICENSE.
--- Author: Jeremy Avigad --- Author: Jeremy Avigad
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
import logic.connectives algebra.function import algebra.function
open function open function
namespace congr namespace congr

View file

@ -1,4 +1,4 @@
import data.nat logic.inhabited import data.nat
open nat inhabited open nat inhabited
constant N : Type.{1} constant N : Type.{1}

View file

@ -1,4 +1,4 @@
import data.nat data.prod logic.wf_k import data.nat data.prod
open nat well_founded decidable prod eq.ops open nat well_founded decidable prod eq.ops
-- Auxiliary lemma used to justify recursive call -- Auxiliary lemma used to justify recursive call

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constant eq : forall {A : Type}, A → A → Prop constant eq : forall {A : Type}, A → A → Prop
constant N : Type.{1} constant N : Type.{1}

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,2 +1,3 @@
prelude
definition Prop := Type.{0} definition Prop := Type.{0}
check Prop check Prop

View file

@ -1,3 +1,4 @@
prelude
definition Prop := Type.{0} definition Prop := Type.{0}
definition false := ∀x : Prop, x definition false := ∀x : Prop, x

View file

@ -1,3 +1,4 @@
prelude
definition Prop := Type.{0} definition Prop := Type.{0}
definition false : Prop := ∀x : Prop, x definition false : Prop := ∀x : Prop, x

View file

@ -1,3 +1,4 @@
prelude
definition Prop := Type.{0} definition Prop := Type.{0}
definition false : Prop := ∀x : Prop, x definition false : Prop := ∀x : Prop, x

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,3 +1,4 @@
prelude
precedence `+`:65 precedence `+`:65
namespace nat namespace nat

View file

@ -1,5 +1,3 @@
import general_notation type
inductive fibrant [class] (T : Type) : Type := inductive fibrant [class] (T : Type) : Type :=
fibrant_mk : fibrant T fibrant_mk : fibrant T

View file

@ -1,5 +1,3 @@
import general_notation
inductive fibrant [class] (T : Type) : Type := inductive fibrant [class] (T : Type) : Type :=
fibrant_mk : fibrant T fibrant_mk : fibrant T

View file

@ -1,4 +1,4 @@
import data.nat.basic data.sum data.sigma logic.wf data.bool import data.nat.basic data.sum data.sigma data.bool
open nat sigma open nat sigma
inductive tree (A : Type) : Type := inductive tree (A : Type) : Type :=

View file

@ -1,4 +1,4 @@
import data.nat data.prod logic.wf_k import data.nat data.prod
open nat well_founded decidable prod eq.ops open nat well_founded decidable prod eq.ops
namespace playground namespace playground

View file

@ -1,4 +1,4 @@
import hott.path tools.tactic import hott.path
open path open path
definition concat_pV_p {A : Type} {x y z : A} (p : x ≈ z) (q : y ≈ z) : (p ⬝ q⁻¹) ⬝ q ≈ p := definition concat_pV_p {A : Type} {x y z : A} (p : x ≈ z) (q : y ≈ z) : (p ⬝ q⁻¹) ⬝ q ≈ p :=

View file

@ -7,7 +7,7 @@
-- Various structures with 1, *, inv, including groups. -- Various structures with 1, *, inv, including groups.
import logic.eq logic.connectives import logic.eq
import data.unit data.sigma data.prod import data.unit data.sigma data.prod
import algebra.function algebra.binary import algebra.function algebra.binary

View file

@ -7,7 +7,7 @@
-- Various structures with 1, *, inv, including groups. -- Various structures with 1, *, inv, including groups.
import logic.eq logic.connectives import logic.eq
import data.unit data.sigma data.prod import data.unit data.sigma data.prod
import algebra.function algebra.binary import algebra.function algebra.binary

View file

@ -7,7 +7,7 @@
-- Various structures with 1, *, inv, including groups. -- Various structures with 1, *, inv, including groups.
import logic.eq logic.connectives import logic.eq
import data.unit data.sigma data.prod import data.unit data.sigma data.prod
import algebra.function algebra.binary import algebra.function algebra.binary

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constants a b c : Prop constants a b c : Prop
axiom Ha : a axiom Ha : a

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constants a b c : Prop constants a b c : Prop
axiom Ha : a axiom Ha : a

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constants a b c : Prop constants a b c : Prop
axiom Ha : a axiom Ha : a

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constants a b c : Prop constants a b c : Prop
axiom Ha : a axiom Ha : a

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constant and : Prop → Prop → Prop constant and : Prop → Prop → Prop
infixl `∧`:25 := and infixl `∧`:25 := and

View file

@ -1,3 +1,4 @@
prelude
-- category -- category
definition Prop := Type.{0} definition Prop := Type.{0}

View file

@ -1,3 +1,4 @@
prelude
-- category -- category
definition Prop := Type.{0} definition Prop := Type.{0}

View file

@ -1,3 +1,4 @@
prelude
-- category -- category
definition Prop := Type.{0} definition Prop := Type.{0}

View file

@ -1,3 +1,4 @@
prelude
-- category -- category
definition Prop := Type.{0} definition Prop := Type.{0}

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,3 +1,4 @@
prelude
inductive nat : Type := inductive nat : Type :=
zero : nat, zero : nat,
succ : nat → nat succ : nat → nat

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
inductive or (A B : Prop) : Prop := inductive or (A B : Prop) : Prop :=

View file

@ -1,3 +1,4 @@
prelude
definition Prop := Type.{0} definition Prop := Type.{0}
inductive nat := inductive nat :=

View file

@ -1,3 +1,4 @@
prelude
inductive list (A : Type) : Type := inductive list (A : Type) : Type :=
nil {} : list A, nil {} : list A,
cons : A → list A → list A cons : A → list A → list A

View file

@ -1,4 +1,4 @@
import logic tools.tactic import logic
open tactic open tactic
theorem tst1 (a b : Prop) : a → b → b := theorem tst1 (a b : Prop) : a → b → b :=

View file

@ -11,7 +11,7 @@ definition is_nil {A : Type} (l : list A) : Prop
:= list.rec true (fun h t r, false) l := list.rec true (fun h t r, false) l
theorem is_nil_nil (A : Type) : is_nil (@nil A) theorem is_nil_nil (A : Type) : is_nil (@nil A)
:= eq_true_elim (refl true) := eq.true_elim (refl true)
theorem cons_ne_nil {A : Type} (a : A) (l : list A) : ¬ cons a l = nil theorem cons_ne_nil {A : Type} (a : A) (l : list A) : ¬ cons a l = nil
:= not_intro (assume H : cons a l = nil, := not_intro (assume H : cons a l = nil,

View file

@ -1,4 +1,4 @@
import tools.tactic logic.eq import logic.eq
variable {a : Type} variable {a : Type}
definition foo {A : Type} : A → A := definition foo {A : Type} : A → A :=

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
constant N : Type.{1} constant N : Type.{1}
constant and : Prop → Prop → Prop constant and : Prop → Prop → Prop

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
context context
variable N : Type.{1} variable N : Type.{1}

View file

@ -1,3 +1,4 @@
prelude
constant N : Type.{1} constant N : Type.{1}
constant f : N → N → N → N constant f : N → N → N → N
constant g : N → N → N constant g : N → N → N

View file

@ -1,3 +1,4 @@
prelude
constant nat : Type.{1} constant nat : Type.{1}
constant f : nat → nat constant f : nat → nat

View file

@ -1,18 +1,18 @@
import logic import logic.eq
inductive sigma {A : Type} (B : A → Type) := inductive sigma2 {A : Type} (B : A → Type) :=
mk : Π (a : A), B a → sigma B mk : Π (a : A), B a → sigma2 B
#projections sigma :: proj1 proj2 #projections sigma2 :: proj1 proj2
check sigma.proj1 check sigma2.proj1
check sigma.proj2 check sigma2.proj2
variables {A : Type} {B : A → Type} variables {A : Type} {B : A → Type}
variables (a : A) (b : B a) variables (a : A) (b : B a)
theorem tst1 : sigma.proj1 (sigma.mk a b) = a := theorem tst1 : sigma2.proj1 (sigma2.mk a b) = a :=
rfl rfl
theorem tst2 : sigma.proj2 (sigma.mk a b) = b := theorem tst2 : sigma2.proj2 (sigma2.mk a b) = b :=
rfl rfl

View file

@ -1,4 +1,4 @@
import tools.tactic logic import logic
open tactic open tactic
theorem foo1 (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c := theorem foo1 (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c :=

View file

@ -1,4 +1,4 @@
import data.sigma tools.tactic import data.sigma
namespace sigma namespace sigma
namespace manual namespace manual

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
context context
parameter A : Type parameter A : Type

View file

@ -1,9 +1,8 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved. -- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE. -- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura, Jeremy Avigad -- Author: Leonardo de Moura, Jeremy Avigad
import logic.prop logic.inhabited logic.decidable
open inhabited decidable open inhabited decidable
namespace play
-- TODO: take this outside the namespace when the inductive package handles it better -- TODO: take this outside the namespace when the inductive package handles it better
inductive sum (A B : Type) : Type := inductive sum (A B : Type) : Type :=
inl : A → sum A B, inl : A → sum A B,
@ -59,3 +58,4 @@ rec_on s1
(take b2, show decidable (inr A b1 = inr A b2), from H2 b1 b2)) (take b2, show decidable (inr A b1 = inr A b2), from H2 b1 b2))
end sum end sum
end play

View file

@ -1,3 +1,4 @@
prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
print raw ((Prop)) print raw ((Prop))
print raw Prop print raw Prop

View file

@ -1,3 +1,4 @@
prelude
constant int : Type.{1} constant int : Type.{1}
constant nat : Type.{1} constant nat : Type.{1}
namespace int namespace int

View file

@ -1,3 +1,4 @@
prelude
precedence `+` : 65 precedence `+` : 65
precedence `++` : 100 precedence `++` : 100
constant N : Type.{1} constant N : Type.{1}

View file

@ -1,3 +1,4 @@
prelude
definition bool : Type.{1} := Type.{0} definition bool : Type.{1} := Type.{0}
definition and (p q : bool) : bool definition and (p q : bool) : bool
:= ∀ c : bool, (p → q → c) → c := ∀ c : bool, (p → q → c) → c

View file

@ -1,4 +1,4 @@
import tools.tactic logic import logic
open tactic open tactic
definition mytac := apply @and.intro; apply @eq.refl definition mytac := apply @and.intro; apply @eq.refl

View file

@ -1,3 +1,4 @@
prelude
-- Porting Vladimir's file to Lean -- Porting Vladimir's file to Lean
notation `assume` binders `,` r:(scoped f, f) := r notation `assume` binders `,` r:(scoped f, f) := r
notation `take` binders `,` r:(scoped f, f) := r notation `take` binders `,` r:(scoped f, f) := r

View file

@ -2,11 +2,6 @@
-- Released under Apache 2.0 license as described in the file LICENSE. -- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Jeremy Avigad -- Author: Jeremy Avigad
-- Ported from Coq HoTT -- Ported from Coq HoTT
import general_notation
notation `assume` binders `,` r:(scoped f, f) := r
notation `take` binders `,` r:(scoped f, f) := r
definition id {A : Type} (a : A) := a definition id {A : Type} (a : A) := a
definition compose {A : Type} {B : Type} {C : Type} (g : B → C) (f : A → B) := λ x, g (f x) definition compose {A : Type} {B : Type} {C : Type} (g : B → C) (f : A → B) := λ x, g (f x)
infixr ∘ := compose infixr ∘ := compose

View file

@ -1,2 +1,10 @@
decidable : Prop → Type₁
inhabited : Type → Type
nonempty : Type → Prop
point : Type → Type → Type point : Type → Type → Type
well_founded : Π {A : Type}, (A → A → Prop) → Prop
decidable : Prop → Type₁
inhabited : Type → Type
nonempty : Type → Prop
point : Type → Type → Type point : Type → Type → Type
well_founded : Π {A : Type}, (A → A → Prop) → Prop

View file

@ -1,4 +1,4 @@
constant N : Type.{1} prelude constant N : Type.{1}
definition B : Type.{1} := Type.{0} definition B : Type.{1} := Type.{0}
constant ite : B → N → N → N constant ite : B → N → N → N
constant and : B → B → B constant and : B → B → B

View file

@ -1,4 +1,4 @@
constant A : Type.{1} prelude constant A : Type.{1}
definition bool : Type.{1} := Type.{0} definition bool : Type.{1} := Type.{0}
constant Exists (P : A → bool) : bool constant Exists (P : A → bool) : bool
notation `exists` binders `,` b:(scoped b, Exists b) := b notation `exists` binders `,` b:(scoped b, Exists b) := b

View file

@ -1,4 +1,4 @@
precedence `+` : 65 prelude precedence `+` : 65
precedence `*` : 75 precedence `*` : 75
constant N : Type.{1} constant N : Type.{1}
check λ (f : N -> N -> N) (g : N → N → N) (infix + := f) (infix * := g) (x y : N), x+x*y check λ (f : N -> N -> N) (g : N → N → N) (infix + := f) (infix * := g) (x y : N), x+x*y

View file

@ -1,4 +1,4 @@
constant A : Type.{1} prelude constant A : Type.{1}
constant f : A → A → A constant f : A → A → A
constant g : A → A → A constant g : A → A → A
precedence `+` : 65 precedence `+` : 65

View file

@ -1,4 +1,4 @@
namespace foo prelude namespace foo
constant A : Type.{1} constant A : Type.{1}
constant a : A constant a : A
constant x : A constant x : A

View file

@ -1,4 +1,4 @@
definition Prop : Type.{1} := Type.{0} prelude definition Prop : Type.{1} := Type.{0}
constant N : Type.{1} constant N : Type.{1}
check N check N
constant a : N constant a : N

View file

@ -1,4 +1,4 @@
definition Prop : Type.{1} := Type.{0} prelude definition Prop : Type.{1} := Type.{0}
section section
variable {A : Type} -- Mark A as implicit parameter variable {A : Type} -- Mark A as implicit parameter
variable R : A → A → Prop variable R : A → A → Prop

View file

@ -1,4 +1,4 @@
definition Prop : Type.{1} := Type.{0} prelude definition Prop : Type.{1} := Type.{0}
constant and : Prop → Prop → Prop constant and : Prop → Prop → Prop
context context
parameter {A : Type} -- Mark A as implicit parameter parameter {A : Type} -- Mark A as implicit parameter

View file

@ -1,4 +1,4 @@
precedence `+` : 65 prelude precedence `+` : 65
precedence `*` : 75 precedence `*` : 75
precedence `=` : 50 precedence `=` : 50
precedence `≃` : 50 precedence `≃` : 50

Some files were not shown because too many files have changed in this diff Show more