2014-07-19 17:21:55 +00:00
|
|
|
|
-- 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
|
|
|
|
|
|
|
|
|
|
namespace equivalence
|
|
|
|
|
section
|
|
|
|
|
parameter {A : Type}
|
2014-07-22 16:43:18 +00:00
|
|
|
|
parameter p : A → A → Prop
|
2014-07-19 17:21:55 +00:00
|
|
|
|
infix `∼`:50 := p
|
|
|
|
|
definition reflexive := ∀a, a ∼ a
|
|
|
|
|
definition symmetric := ∀a b, a ∼ b → b ∼ a
|
|
|
|
|
definition transitive := ∀a b c, a ∼ b → b ∼ c → a ∼ c
|
|
|
|
|
end
|
|
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
|
inductive equivalence {A : Type} (p : A → A → Prop) : Prop :=
|
2014-07-19 17:21:55 +00:00
|
|
|
|
| equivalence_intro : reflexive p → symmetric p → transitive p → equivalence p
|
|
|
|
|
|
2014-07-29 02:58:57 +00:00
|
|
|
|
theorem equivalence_reflexive [instance] {A : Type} {p : A → A → Prop} (H : equivalence p) : reflexive p :=
|
|
|
|
|
equivalence_rec (λ r s t, r) H
|
2014-07-19 17:21:55 +00:00
|
|
|
|
|
2014-07-29 02:58:57 +00:00
|
|
|
|
theorem equivalence_symmetric [instance] {A : Type} {p : A → A → Prop} (H : equivalence p) : symmetric p :=
|
|
|
|
|
equivalence_rec (λ r s t, s) H
|
2014-07-19 17:21:55 +00:00
|
|
|
|
|
2014-07-29 02:58:57 +00:00
|
|
|
|
theorem equivalence_transitive [instance] {A : Type} {p : A → A → Prop} (H : equivalence p) : transitive p :=
|
|
|
|
|
equivalence_rec (λ r s t, t) H
|
2014-07-19 17:21:55 +00:00
|
|
|
|
end
|