refactor(library/standard): organize files into a hierarchy
This commit is contained in:
parent
fbaf8b7e77
commit
b2c2d1dd44
17 changed files with 87 additions and 31 deletions
7
library/standard/data/list/default.lean
Normal file
7
library/standard/data/list/default.lean
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||||
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||||
|
-- Author: Jeremy Avigad
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import data.list.basic
|
7
library/standard/data/nat/default.lean
Normal file
7
library/standard/data/nat/default.lean
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||||
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||||
|
-- Author: Jeremy Avigad
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import data.nat.nat1
|
|
@ -1,7 +1,9 @@
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.classes.inhabited
|
||||||
|
|
||||||
inductive option (A : Type) : Type :=
|
inductive option (A : Type) : Type :=
|
||||||
| none {} : option A
|
| none {} : option A
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.classes.inhabited
|
||||||
|
|
||||||
namespace pair
|
namespace pair
|
||||||
inductive pair (A : Type) (B : Type) : Type :=
|
inductive pair (A : Type) (B : Type) : Type :=
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
--- Copyright (c) 2014 Jeremy Avigad. All rights reserved.
|
------------------------------------------------------------------------------------------------------- Copyright (c) 2014 Jeremy Avigad. 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: Jeremy Avigad, Leonardo de Moura
|
--- Author: Jeremy Avigad, Leonardo de Moura
|
||||||
import logic funext bool
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.axioms.funext data.bool
|
||||||
using eq_proofs bool
|
using eq_proofs bool
|
||||||
|
|
||||||
namespace set
|
namespace set
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.connectives.prop
|
||||||
|
|
||||||
namespace sum
|
namespace sum
|
||||||
inductive sum (A : Type) (B : Type) : Type :=
|
inductive sum (A : Type) (B : Type) : Type :=
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic decidable
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.classes.decidable logic.classes.inhabited
|
||||||
using decidable
|
using decidable
|
||||||
|
|
||||||
namespace unit
|
namespace unit
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic cast
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.connectives.basic logic.connectives.quantifiers logic.connectives.cast
|
||||||
|
|
||||||
using eq_proofs
|
using eq_proofs
|
||||||
|
|
||||||
axiom prop_complete (a : Prop) : a = true ∨ a = false
|
axiom prop_complete (a : Prop) : a = true ∨ a = false
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
-- 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.
|
||||||
-- Authors: Leonardo de Moura, Jeremy Avigad
|
-- Author: Leonardo de Moura
|
||||||
import logic hilbert funext
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.axioms.hilbert logic.axioms.funext
|
||||||
using eq_proofs
|
using eq_proofs
|
||||||
|
|
||||||
-- Diaconescu’s theorem
|
-- Diaconescu’s theorem
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic function
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.connectives.eq logic.connectives.function
|
||||||
using function
|
using function
|
||||||
|
|
||||||
-- Function extensionality
|
-- Function extensionality
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.classes.inhabited
|
||||||
|
|
||||||
variable epsilon {A : Type} {H : inhabited A} (P : A → Prop) : A
|
variable epsilon {A : Type} {H : inhabited A} (P : A → Prop) : A
|
||||||
axiom epsilon_ax {A : Type} {P : A → Prop} (Hex : ∃ a, P a) : P (@epsilon A (inhabited_exists Hex) P)
|
axiom epsilon_ax {A : Type} {P : A → Prop} (Hex : ∃ a, P a) : P (@epsilon A (inhabited_exists Hex) P)
|
||||||
|
|
|
@ -1,25 +1,32 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic cast
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.classes.inhabited logic.connectives.cast
|
||||||
|
|
||||||
-- Pi extensionality
|
-- Pi extensionality
|
||||||
axiom piext {A : Type} {B B' : A → Type} {H : inhabited (Π x, B x)} : (Π x, B x) = (Π x, B' x) → B = B'
|
axiom piext {A : Type} {B B' : A → Type} {H : inhabited (Π x, B x)} :
|
||||||
|
(Π x, B x) = (Π x, B' x) → B = B'
|
||||||
|
|
||||||
theorem cast_app {A : Type} {B B' : A → Type} (H : (Π x, B x) = (Π x, B' x)) (f : Π x, B x) (a : A) : cast H f a == f a :=
|
theorem cast_app {A : Type} {B B' : A → Type} (H : (Π x, B x) = (Π x, B' x)) (f : Π x, B x)
|
||||||
|
(a : A) : cast H f a == f a :=
|
||||||
have Hi [fact] : inhabited (Π x, B x), from inhabited_intro f,
|
have Hi [fact] : inhabited (Π x, B x), from inhabited_intro f,
|
||||||
have Hb : B = B', from piext H,
|
have Hb : B = B', from piext H,
|
||||||
cast_app' Hb f a
|
cast_app' Hb f a
|
||||||
|
|
||||||
theorem hcongr1 {A : Type} {B B' : A → Type} {f : Π x, B x} {f' : Π x, B' x} (a : A) (H : f == f') : f a == f' a :=
|
theorem hcongr1 {A : Type} {B B' : A → Type} {f : Π x, B x} {f' : Π x, B' x} (a : A)
|
||||||
|
(H : f == f') : f a == f' a :=
|
||||||
have Hi [fact] : inhabited (Π x, B x), from inhabited_intro f,
|
have Hi [fact] : inhabited (Π x, B x), from inhabited_intro f,
|
||||||
have Hb : B = B', from piext (type_eq H),
|
have Hb : B = B', from piext (type_eq H),
|
||||||
hcongr1' a H Hb
|
hcongr1' a H Hb
|
||||||
|
|
||||||
theorem hcongr {A A' : Type} {B : A → Type} {B' : A' → Type} {f : Π x, B x} {f' : Π x, B' x} {a : A} {a' : A'}
|
theorem hcongr {A A' : Type} {B : A → Type} {B' : A' → Type}
|
||||||
(Hff' : f == f') (Haa' : a == a') : f a == f' a' :=
|
{f : Π x, B x} {f' : Π x, B' x} {a : A} {a' : A'}
|
||||||
|
(Hff' : f == f') (Haa' : a == a') : f a == f' a' :=
|
||||||
have H1 : ∀ (B B' : A → Type) (f : Π x, B x) (f' : Π x, B' x), f == f' → f a == f' a, from
|
have H1 : ∀ (B B' : A → Type) (f : Π x, B x) (f' : Π x, B' x), f == f' → f a == f' a, from
|
||||||
take B B' f f' e, hcongr1 a e,
|
take B B' f f' e, hcongr1 a e,
|
||||||
have H2 : ∀ (B : A → Type) (B' : A' → Type) (f : Π x, B x) (f' : Π x, B' x), f == f' → f a == f' a', from
|
have H2 : ∀ (B : A → Type) (B' : A' → Type) (f : Π x, B x) (f' : Π x, B' x),
|
||||||
hsubst Haa' H1,
|
f == f' → f a == f' a', from hsubst Haa' H1,
|
||||||
H2 B B' f f' Hff'
|
H2 B B' f f' Hff'
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import classical hilbert decidable
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.axioms.classical logic.axioms.hilbert logic.classes.decidable
|
||||||
using decidable
|
using decidable
|
||||||
|
|
||||||
-- Excluded middle + Hilbert implies every proposition is decidable
|
-- Excluded middle + Hilbert implies every proposition is decidable
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic tactic num string pair cast
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic tools.tactic data.num data.string data.pair logic.connectives.cast
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.connectives.eq
|
||||||
using eq_proofs
|
using eq_proofs
|
||||||
|
|
||||||
namespace binary
|
namespace binary
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.connectives.prop
|
||||||
|
|
||||||
namespace equivalence
|
namespace equivalence
|
||||||
section
|
section
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
-- 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
|
-- Author: Leonardo de Moura
|
||||||
import logic classical
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import logic.axioms.classical
|
||||||
|
|
||||||
-- Well-founded relation definition
|
-- Well-founded relation definition
|
||||||
-- We are essentially saying that a relation R is well-founded
|
-- We are essentially saying that a relation R is well-founded
|
||||||
|
@ -28,4 +31,3 @@ by_contradiction (assume N : ¬∀x, P x,
|
||||||
have s2 : P r, from iH r s1,
|
have s2 : P r, from iH r s1,
|
||||||
have s3 : ¬P r, from and_elim_left Hr,
|
have s3 : ¬P r, from and_elim_left Hr,
|
||||||
absurd s2 s3)
|
absurd s2 s3)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue