refactor(library/logic): move files in classes directory to core
This commit is contained in:
parent
dffe9a6f17
commit
9988914189
27 changed files with 46 additions and 46 deletions
|
@ -2,7 +2,7 @@
|
|||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||
-- Author: Leonardo de Moura
|
||||
|
||||
import logic.core.connectives logic.classes.decidable logic.classes.inhabited
|
||||
import logic.core.connectives logic.core.decidable logic.core.inhabited
|
||||
|
||||
open eq_ops eq decidable
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
-- Basic operations on the natural numbers.
|
||||
|
||||
import logic data.num tools.tactic struc.binary tools.helper_tactics
|
||||
import logic.classes.inhabited
|
||||
import logic.core.inhabited
|
||||
|
||||
open tactic binary eq_ops
|
||||
open decidable
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
--
|
||||
-- The ordering on the natural numbers
|
||||
|
||||
import .basic logic.classes.decidable
|
||||
import .basic logic.core.decidable
|
||||
import tools.fake_simplifier
|
||||
|
||||
open nat eq_ops tactic
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||
-- Author: Leonardo de Moura
|
||||
----------------------------------------------------------------------------------------------------
|
||||
import logic.classes.inhabited data.bool general_notation
|
||||
import logic.core.inhabited data.bool general_notation
|
||||
open bool
|
||||
|
||||
-- pos_num and num are two auxiliary datatypes used when parsing numerals such as 13, 0, 26.
|
||||
|
|
|
@ -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.classes.inhabited logic.classes.decidable
|
||||
import logic.core.eq logic.core.inhabited logic.core.decidable
|
||||
open eq_ops decidable
|
||||
|
||||
inductive option (A : Type) : Type :=
|
||||
|
|
|
@ -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.classes.inhabited logic.core.eq logic.classes.decidable
|
||||
import logic.core.inhabited logic.core.eq logic.core.decidable
|
||||
|
||||
-- data.prod
|
||||
-- =========
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||
-- Author: Floris van Doorn
|
||||
|
||||
import struc.relation logic.classes.nonempty data.subtype
|
||||
import struc.relation logic.core.nonempty data.subtype
|
||||
import .basic
|
||||
import logic.axioms.classical logic.axioms.hilbert logic.axioms.funext
|
||||
|
||||
|
|
|
@ -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.classes.inhabited logic.core.eq
|
||||
import logic.core.inhabited logic.core.eq
|
||||
open inhabited eq_ops
|
||||
|
||||
inductive sigma {A : Type} (B : A → Type) : Type :=
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||
-- Author: Leonardo de Moura, Jeremy Avigad
|
||||
|
||||
import logic.classes.inhabited logic.core.eq logic.classes.decidable
|
||||
import logic.core.inhabited logic.core.eq logic.core.decidable
|
||||
|
||||
open decidable
|
||||
|
||||
|
|
|
@ -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.classes.inhabited logic.classes.decidable
|
||||
import logic.core.prop logic.core.inhabited logic.core.decidable
|
||||
open inhabited decidable eq_ops
|
||||
-- data.sum
|
||||
-- ========
|
||||
|
|
|
@ -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.classes.decidable logic.classes.inhabited
|
||||
import logic.core.decidable logic.core.inhabited
|
||||
open decidable
|
||||
|
||||
inductive unit : Type :=
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
-- constructive one).
|
||||
|
||||
import logic.core.quantifiers
|
||||
import logic.classes.inhabited logic.classes.nonempty
|
||||
import logic.core.inhabited logic.core.nonempty
|
||||
import data.subtype data.sum
|
||||
|
||||
open subtype inhabited nonempty
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
----------------------------------------------------------------------------------------------------
|
||||
-- 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.classes.inhabited logic.core.cast
|
||||
import logic.core.inhabited logic.core.cast
|
||||
|
||||
open inhabited
|
||||
|
||||
-- Pi extensionality
|
||||
axiom piext {A : Type} {B B' : A → Type} {H : inhabited (Π x, B x)} :
|
||||
(Π x, B x) = (Π x, B' x) → B = B'
|
||||
(Π 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 :=
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
-- logic.axioms.prop_decidable
|
||||
-- ===========================
|
||||
|
||||
import logic.axioms.classical logic.axioms.hilbert logic.classes.decidable
|
||||
import logic.axioms.classical logic.axioms.hilbert logic.core.decidable
|
||||
open decidable inhabited nonempty
|
||||
|
||||
-- Excluded middle + Hilbert implies every proposition is decidable
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
logic.classes
|
||||
=============
|
||||
|
||||
Useful classes for general logical manipulations.
|
||||
|
||||
* [inhabited](inhabited.lean) : inhabited types
|
||||
* [nonempty](nonempty.lean) : nonempty type
|
||||
* [decidable](decidable.lean) : decidable types
|
||||
|
||||
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.
|
|
@ -1,8 +1,9 @@
|
|||
----------------------------------------------------------------------------------------------------
|
||||
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||
-- Author: Leonardo de Moura
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
-- cast.lean
|
||||
-- =========
|
||||
|
||||
import .eq .quantifiers
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
logic.connectives
|
||||
=================
|
||||
logic.core
|
||||
==========
|
||||
|
||||
Logical operations and connectives.
|
||||
|
||||
|
@ -9,6 +9,21 @@ Logical operations and connectives.
|
|||
* [cast](cast.lean) : casts and heterogeneous equality
|
||||
* [quantifiers](quantifiers.lean) : existential and universal quantifiers
|
||||
* [if](if.lean) : if-then-else
|
||||
* [instances](instances.lean) : type class instances
|
||||
* [identities](identities.lean) : some useful identities
|
||||
* [examples](examples/examples.md)
|
||||
* [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.
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
-- 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.classes.decidable logic.core.quantifiers logic.core.cast
|
||||
import logic.core.instances logic.core.decidable logic.core.quantifiers logic.core.cast
|
||||
|
||||
open relation decidable relation.iff_ops
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
-- Author: Leonardo de Moura
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
import logic.classes.decidable tools.tactic
|
||||
import logic.core.decidable tools.tactic
|
||||
open decidable tactic eq_ops
|
||||
|
||||
definition ite (c : Prop) {H : decidable c} {A : Type} (t e : A) : A :=
|
||||
|
|
|
@ -18,7 +18,8 @@ mk true
|
|||
definition fun_inhabited [instance] (A : Type) {B : Type} (H : inhabited B) : inhabited (A → B) :=
|
||||
destruct H (λb, mk (λa, b))
|
||||
|
||||
definition dfun_inhabited [instance] (A : Type) {B : A → Type} (H : Πx, inhabited (B x)) : inhabited (Πx, B x) :=
|
||||
definition dfun_inhabited [instance] (A : Type) {B : A → Type} (H : Πx, inhabited (B x)) :
|
||||
inhabited (Πx, B x) :=
|
||||
mk (λa, destruct (H a) (λb, b))
|
||||
|
||||
definition default (A : Type) {H : inhabited A} : A := destruct H (take a, a)
|
|
@ -2,7 +2,7 @@
|
|||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||
-- Authors: Leonardo de Moura, Jeremy Avigad
|
||||
|
||||
import .connectives ..classes.nonempty
|
||||
import .connectives ..core.nonempty
|
||||
|
||||
open inhabited nonempty
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
import logic.core.connectives logic.core.eq logic.core.cast
|
||||
import logic.core.quantifiers logic.core.if
|
||||
import logic.classes.decidable logic.classes.inhabited logic.classes.nonempty
|
||||
import logic.core.decidable logic.core.inhabited logic.core.nonempty
|
||||
import logic.core.instances
|
||||
import logic.core.identities
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- 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.classes.decidable
|
||||
import logic.axioms.classical logic.axioms.prop_decidable logic.core.decidable
|
||||
import logic.core.identities
|
||||
|
||||
open decidable
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import data.nat logic.classes.inhabited
|
||||
import data.nat logic.core.inhabited
|
||||
open nat inhabited
|
||||
|
||||
variable N : Type.{1}
|
||||
|
|
|
@ -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.prop logic.classes.inhabited logic.classes.decidable
|
||||
import logic.core.prop logic.core.inhabited logic.core.decidable
|
||||
|
||||
open inhabited decidable
|
||||
|
||||
|
|
Loading…
Reference in a new issue