refactor(library/logic): remove 'core' subdirectory

This commit is contained in:
Leonardo de Moura 2014-10-05 10:50:13 -07:00
parent 0f90d10a13
commit 73aa024c31
51 changed files with 74 additions and 87 deletions

View file

@ -1,7 +1,7 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import logic.core.eq
import logic.eq
open eq.ops
namespace binary

View file

@ -3,7 +3,7 @@
-- Author: Floris van Doorn
-- category
import logic.core.eq logic.core.connectives
import logic.eq logic.connectives
import data.unit data.sigma data.prod
import algebra.function
import logic.axioms.funext

View file

@ -5,7 +5,7 @@
-- algebra.relation
-- ==============
import logic.core.prop
import logic.prop
-- General properties of relations

View file

@ -1,9 +1,8 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import logic.axioms.classical logic.axioms.prop_decidable logic.core.decidable
import logic.core.identities
import logic.identities logic.decidable
import logic.axioms.classical logic.axioms.prop_decidable
open decidable

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import general_notation
import logic.core.connectives logic.core.decidable logic.core.inhabited
import logic.connectives logic.decidable logic.inhabited
open eq eq.ops decidable

View file

@ -5,7 +5,7 @@
-- Empty type
-- ----------
import logic.core.cast
import logic.cast
inductive empty : Type

View file

@ -12,7 +12,6 @@
import tools.tactic
import data.nat
import logic tools.helper_tactics
import logic.core.identities
open nat
open eq.ops

View file

@ -8,7 +8,7 @@
-- Basic operations on the natural numbers.
import logic data.num tools.tactic algebra.binary tools.helper_tactics
import logic.core.inhabited
import logic.inhabited
open tactic binary eq.ops
open decidable

View file

@ -7,7 +7,7 @@
--
-- The ordering on the natural numbers
import .basic logic.core.decidable
import .basic logic.decidable
import tools.fake_simplifier
open nat eq.ops tactic

View file

@ -3,7 +3,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
----------------------------------------------------------------------------------------------------
import logic.core.inhabited data.bool general_notation
import logic.inhabited data.bool general_notation
open bool
-- pos_num and num are two auxiliary datatypes used when parsing numerals such as 13, 0, 26.

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import logic.core.eq logic.core.inhabited logic.core.decidable
import logic.eq logic.inhabited logic.decidable
open eq.ops decidable
inductive option (A : Type) : Type :=

View file

@ -1,7 +1,7 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura, Jeremy Avigad
import logic.core.inhabited logic.core.eq logic.core.decidable
import logic.inhabited logic.eq logic.decidable
-- data.prod
-- =========

View file

@ -5,8 +5,8 @@
-- Theory data.quotient
-- ====================
import logic tools.tactic ..subtype logic.core.cast algebra.relation data.prod
import logic.core.instances
import logic tools.tactic data.subtype logic.cast algebra.relation data.prod
import logic.instances
import .util
open relation prod inhabited nonempty tactic eq.ops

View file

@ -2,9 +2,9 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Floris van Doorn
import algebra.relation logic.core.nonempty data.subtype
import .basic
import algebra.relation logic.nonempty data.subtype
import logic.axioms.classical logic.axioms.hilbert logic.axioms.funext
import .basic
namespace quotient

View file

@ -1,7 +1,7 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura, Jeremy Avigad, Floris van Doorn
import logic.core.inhabited logic.core.eq
import logic.inhabited logic.eq
open inhabited eq.ops
inductive sigma {A : Type} (B : A → Type) : Type :=

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura, Jeremy Avigad
import logic.core.inhabited logic.core.eq logic.core.decidable
import logic.inhabited logic.eq logic.decidable
open decidable

View file

@ -1,7 +1,7 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura, Jeremy Avigad
import logic.core.prop logic.core.inhabited logic.core.decidable
import logic.prop logic.inhabited logic.decidable
open inhabited decidable eq.ops
-- data.sum
-- ========

View file

@ -1,7 +1,7 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import logic.core.decidable logic.core.inhabited
import logic.decidable logic.inhabited
open decidable
inductive unit : Type :=

View file

@ -5,7 +5,7 @@
-- logic.axioms.classical
-- ======================
import logic.core.quantifiers logic.core.cast algebra.relation
import logic.quantifiers logic.cast algebra.relation
open eq.ops

View file

@ -5,7 +5,7 @@
-- logic.axioms.funext
-- ===================
import logic.core.eq algebra.function
import logic.eq algebra.function
open function
-- Function extensionality

View file

@ -8,8 +8,8 @@
-- Follows Coq.Logic.ClassicalEpsilon (but our definition of "inhabited" is the
-- constructive one).
import logic.core.quantifiers
import logic.core.inhabited logic.core.nonempty
import logic.quantifiers
import logic.inhabited logic.nonempty
import data.subtype data.sum
open subtype inhabited nonempty

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import logic.core.inhabited logic.core.cast
import logic.inhabited logic.cast
open inhabited

View file

@ -5,7 +5,7 @@
-- logic.axioms.prop_decidable
-- ===========================
import logic.axioms.classical logic.axioms.hilbert logic.core.decidable
import logic.axioms.classical logic.axioms.hilbert logic.decidable
open decidable inhabited nonempty
-- Excluded middle + Hilbert implies every proposition is decidable

View file

@ -1,29 +0,0 @@
logic.core
==========
Logical operations and connectives.
* [prop](prop.lean) : the type Prop
* [eq](eq.lean) : equality and disequality
* [connectives](connectives.lean) : propositional connectives
* [cast](cast.lean) : casts and heterogeneous equality
* [quantifiers](quantifiers.lean) : existential and universal quantifiers
* [if](if.lean) : if-then-else
* [identities](identities.lean) : some useful identities
* [examples](examples/examples.md)
Type classes for general logical manipulations:
* [inhabited](inhabited.lean) : inhabited types
* [nonempty](nonempty.lean) : nonempty type
* [decidable](decidable.lean) : decidable types
* [instances](instances.lean) : type class instances
Constructively, inhabited types have a witness, while nonempty types
are "proof irrelevant". Classically (assuming the axioms in
logic.axioms.hilbert) the two are equivalent. Type class inferences
are set up to use "inhabited" however, so users should use that to
declare that types have an element. Use "nonempty" in the hypothesis
of a theorem when the theorem does not depend on the witness chosen.

View file

@ -1,4 +0,0 @@
logic.connectives.examples
==========================
* [instances_test](instances_test.lean)

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import logic.core.connectives
import logic.connectives
inductive decidable (p : Prop) : Type :=
inl : p → decidable p,

View file

@ -2,8 +2,8 @@
--- Released under Apache 2.0 license as described in the file LICENSE.
--- Author: Jeremy Avigad
import logic.core.connectives logic.core.eq logic.core.cast
import logic.core.quantifiers logic.core.if
import logic.core.decidable logic.core.inhabited logic.core.nonempty
import logic.core.instances
import logic.core.identities
import logic.connectives logic.eq logic.cast
import logic.quantifiers logic.if
import logic.decidable logic.inhabited logic.nonempty
import logic.instances
import logic.identities

View file

@ -2,3 +2,4 @@ logic.examples
==============
* [nuprl_examples](nuprl_examples.lean) : examples from "Logical investigations with the Nuprl Proof Assistant"
* [instances_test](instances_test.lean)

View file

@ -2,13 +2,13 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Authors: Jeremy Avigad, Leonardo de Moura
-- logic.connectives.identities
-- logic.identities
-- ============================
-- Useful logical identities. In the absence of propositional extensionality, some of the
-- calculations use the type class support provided by logic.connectives.instances
import logic.core.instances logic.core.decidable logic.core.quantifiers logic.core.cast
import logic.instances logic.decidable logic.quantifiers logic.cast
open relation decidable relation.iff_ops

View file

@ -4,7 +4,7 @@
-- Author: Leonardo de Moura
----------------------------------------------------------------------------------------------------
import logic.core.decidable tools.tactic
import logic.decidable tools.tactic
open decidable tactic eq.ops
definition ite (c : Prop) {H : decidable c} {A : Type} (t e : A) : A :=

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Authors: Leonardo de Moura, Jeremy Avigad
import logic.core.connectives
import logic.connectives
inductive inhabited (A : Type) : Type :=
mk : A → inhabited A

View file

@ -5,7 +5,7 @@
-- logic.core.instances
-- ====================
import logic.core.connectives algebra.relation
import logic.connectives algebra.relation
namespace relation

View file

@ -4,6 +4,29 @@ logic
Logical constructions and axioms. By default, `import logic` does not
import any additional axioms.
* [core](core/core.md) : logical connectives and type classes
Logical operations and connectives.
* [prop](prop.lean) : the type Prop
* [eq](eq.lean) : equality and disequality
* [connectives](connectives.lean) : propositional connectives
* [cast](cast.lean) : casts and heterogeneous equality
* [quantifiers](quantifiers.lean) : existential and universal quantifiers
* [if](if.lean) : if-then-else
* [identities](identities.lean) : some useful identities
Type classes for general logical manipulations:
* [inhabited](inhabited.lean) : inhabited types
* [nonempty](nonempty.lean) : nonempty type
* [decidable](decidable.lean) : decidable types
* [instances](instances.lean) : type class instances
Constructively, inhabited types have a witness, while nonempty types
are "proof irrelevant". Classically (assuming the axioms in
logic.axioms.hilbert) the two are equivalent. Type class inferences
are set up to use "inhabited" however, so users should use that to
declare that types have an element. Use "nonempty" in the hypothesis
of a theorem when the theorem does not depend on the witness chosen.
* [axioms](axioms/axioms.md) : additional axioms
* [examples](examples/examples.md)

View file

@ -2,7 +2,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Authors: Leonardo de Moura, Jeremy Avigad
import .connectives ..core.nonempty
import logic.connectives logic.nonempty
open inhabited nonempty

View file

@ -7,7 +7,7 @@
-- Equality.
import logic.core.prop
import logic.prop
-- eq
-- --

View file

@ -1,4 +1,4 @@
import logic.core.eq algebra.relation
import logic.eq algebra.relation
check proof_irrel

View file

@ -3,7 +3,7 @@
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
----------------------------------------------------------------------------------------------------
import logic.core.inhabited
import logic.inhabited
-- pos_num and num are two auxiliary datatypes used when parsing numerals such as 13, 0, 26.
-- The parser will generate the terms (pos (bit1 (bit1 (bit0 one)))), zero, and (pos (bit0 (bit1 (bit1 one)))).

View file

@ -3,7 +3,7 @@
-- Author: Floris van Doorn
-- category
import logic.core.eq logic.core.connectives
import logic.eq logic.connectives
import data.unit data.sigma data.prod
import algebra.function

View file

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

View file

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

View file

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

View file

@ -1,9 +1,7 @@
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura, Jeremy Avigad
import logic.core.prop logic.core.inhabited logic.core.decidable
import logic.prop logic.inhabited logic.decidable
open inhabited decidable
-- TODO: take this outside the namespace when the inductive package handles it better

View file

@ -5,6 +5,6 @@ constant A : Type.{1}
constant f : A → A → A
theorem tst {a b c : A} (H1 : a = b) (H2 : b = c) : f a b = f b c
:= by apply (@congr A A (f a) (f b));
:= by apply (@congr A A _ _ (f a) (f b));
apply (congr_arg f);
!assumption

View file

@ -1,4 +1,4 @@
import data.prod data.num logic.core.quantifiers
import data.prod data.num logic.quantifiers
open prod
check (true, false, 10)

View file

@ -3,7 +3,7 @@
-- Author: Floris van Doorn
-- category
import logic.core.eq logic.core.connectives
import logic.eq logic.connectives
import data.unit data.sigma data.prod
import algebra.function
import logic.axioms.funext