2014-11-28 10:20:52 -05:00
|
|
|
|
/-
|
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
Module: logic.examples.instances_test
|
|
|
|
|
Author: Jeremy Avigad
|
|
|
|
|
|
|
|
|
|
Illustrates substitution and congruence with iff.
|
|
|
|
|
-/
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
import ..instances
|
2014-09-03 16:00:38 -07:00
|
|
|
|
open relation
|
2014-11-28 10:20:52 -05:00
|
|
|
|
open relation.general_subst
|
2014-09-03 16:00:38 -07:00
|
|
|
|
open relation.iff_ops
|
2014-10-01 17:51:17 -07:00
|
|
|
|
open eq.ops
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (a b : Prop) (H : a ↔ b) (H1 : a) : b := mp H H1
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (a b c d e : Prop) (H1 : a ↔ b) (H2 : a ∨ c → ¬(d → a)) : b ∨ c → ¬(d → b) :=
|
2014-08-19 19:32:44 -07:00
|
|
|
|
subst iff H1 H2
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (a b c d e : Prop) (H1 : a ↔ b) (H2 : a ∨ c → ¬(d → a)) : b ∨ c → ¬(d → b) :=
|
2014-08-11 17:35:25 -07:00
|
|
|
|
H1 ▸ H2
|
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (a b c d e : Prop) (H1 : a ↔ b) : (a ∨ c → ¬(d → a)) ↔ (b ∨ c → ¬(d → b)) :=
|
|
|
|
|
is_congruence.congr iff (λa, (a ∨ c → ¬(d → a))) H1
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (T : Type) (a b c d : T) (H1 : a = b) (H2 : c = b) (H3 : c = d) : a = d :=
|
2014-08-11 17:35:25 -07:00
|
|
|
|
H1 ⬝ H2⁻¹ ⬝ H3
|
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (a b c d : Prop) (H1 : a ↔ b) (H2 : c ↔ b) (H3 : c ↔ d) : a ↔ d :=
|
2014-08-11 17:35:25 -07:00
|
|
|
|
H1 ⬝ (H2⁻¹ ⬝ H3)
|
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (T : Type) (a b c d : T) (H1 : a = b) (H2 : c = b) (H3 : c = d) : a = d :=
|
2014-09-04 18:41:06 -07:00
|
|
|
|
H1 ⬝ H2⁻¹ ⬝ H3
|
2014-08-19 19:32:44 -07:00
|
|
|
|
|
2014-11-28 10:20:52 -05:00
|
|
|
|
example (a b c d : Prop) (H1 : a ↔ b) (H2 : c ↔ b) (H3 : c ↔ d) : a ↔ d :=
|
2014-09-04 18:41:06 -07:00
|
|
|
|
H1 ⬝ H2⁻¹ ⬝ H3
|