2014-01-05 20:05:08 +00:00
|
|
|
import macros
|
2013-12-27 00:00:42 +00:00
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
definition Set (A : Type) : Type := A → Bool
|
2013-12-19 05:03:16 +00:00
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
definition element {A : Type} (x : A) (s : Set A) := s x
|
|
|
|
infix 60 ∈ : element
|
2013-12-19 05:03:16 +00:00
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
definition subset {A : Type} (s1 : Set A) (s2 : Set A) := ∀ x, x ∈ s1 → x ∈ s2
|
2014-01-05 20:05:08 +00:00
|
|
|
infix 50 ⊆ : subset
|
2013-12-19 05:03:16 +00:00
|
|
|
|
2014-01-09 16:33:52 +00:00
|
|
|
theorem subset_trans {A : Type} {s1 s2 s3 : Set A} (H1 : s1 ⊆ s2) (H2 : s2 ⊆ s3) : s1 ⊆ s3
|
2014-01-12 02:36:37 +00:00
|
|
|
:= take x : A,
|
|
|
|
assume Hin : x ∈ s1,
|
2014-02-06 15:50:22 +00:00
|
|
|
show x ∈ s3, from
|
2014-01-12 02:36:37 +00:00
|
|
|
let L1 : x ∈ s2 := H1 x Hin
|
|
|
|
in H2 x L1
|
2013-12-27 06:37:44 +00:00
|
|
|
|
2014-01-09 16:33:52 +00:00
|
|
|
theorem subset_ext {A : Type} {s1 s2 : Set A} (H : ∀ x, x ∈ s1 = x ∈ s2) : s1 = s2
|
2014-01-09 01:25:14 +00:00
|
|
|
:= funext H
|
2013-12-27 06:37:44 +00:00
|
|
|
|
2014-01-09 16:33:52 +00:00
|
|
|
theorem subset_antisym {A : Type} {s1 s2 : Set A} (H1 : s1 ⊆ s2) (H2 : s2 ⊆ s1) : s1 = s2
|
2014-02-06 15:50:22 +00:00
|
|
|
:= subset_ext (show (∀ x, x ∈ s1 = x ∈ s2), from
|
|
|
|
take x, show x ∈ s1 = x ∈ s2, from
|
|
|
|
boolext (show x ∈ s1 → x ∈ s2, from H1 x)
|
|
|
|
(show x ∈ s2 → x ∈ s1, from H2 x))
|