2013-12-28 20:08:08 +00:00
|
|
|
Import macros
|
2013-12-27 00:00:42 +00:00
|
|
|
|
2013-12-19 05:24:04 +00:00
|
|
|
Definition Set (A : Type) : Type := A → Bool
|
2013-12-19 05:03:16 +00:00
|
|
|
|
2013-12-19 05:18:45 +00:00
|
|
|
Definition element {A : Type} (x : A) (s : Set A) := s x
|
2013-12-19 05:03:16 +00:00
|
|
|
Infix 60 ∈ : element
|
|
|
|
|
2013-12-19 05:18:45 +00:00
|
|
|
Definition subset {A : Type} (s1 : Set A) (s2 : Set A) := ∀ x, x ∈ s1 ⇒ x ∈ s2
|
2013-12-19 05:03:16 +00:00
|
|
|
Infix 50 ⊆ : subset
|
|
|
|
|
2013-12-27 00:00:42 +00:00
|
|
|
Theorem SubsetTrans (A : Type) : ∀ s1 s2 s3 : Set A, s1 ⊆ s2 ⇒ s2 ⊆ s3 ⇒ s1 ⊆ s3 :=
|
2014-01-04 02:11:01 +00:00
|
|
|
For s1 s2 s3, Assume (H1 : s1 ⊆ s2) (H2 : s2 ⊆ s3),
|
2013-12-27 00:00:42 +00:00
|
|
|
show s1 ⊆ s3,
|
2014-01-04 02:11:01 +00:00
|
|
|
For x, Assume Hin : x ∈ s1,
|
2013-12-27 00:00:42 +00:00
|
|
|
show x ∈ s3,
|
2014-01-04 02:11:01 +00:00
|
|
|
let L1 : x ∈ s2 := MP (Instantiate H1 x) Hin
|
|
|
|
in MP (Instantiate H2 x) L1
|
2013-12-27 06:37:44 +00:00
|
|
|
|
|
|
|
Theorem SubsetExt (A : Type) : ∀ s1 s2 : Set A, (∀ x, x ∈ s1 = x ∈ s2) ⇒ s1 = s2 :=
|
2014-01-04 02:11:01 +00:00
|
|
|
For s1 s2, Assume (H : ∀ x, x ∈ s1 = x ∈ s2),
|
|
|
|
Abst (fun x, Instantiate H x)
|
2013-12-27 06:37:44 +00:00
|
|
|
|
|
|
|
Theorem SubsetAntiSymm (A : Type) : ∀ s1 s2 : Set A, s1 ⊆ s2 ⇒ s2 ⊆ s1 ⇒ s1 = s2 :=
|
2014-01-04 02:11:01 +00:00
|
|
|
For s1 s2, Assume (H1 : s1 ⊆ s2) (H2 : s2 ⊆ s1),
|
2013-12-27 06:37:44 +00:00
|
|
|
show s1 = s2,
|
|
|
|
MP (show (∀ x, x ∈ s1 = x ∈ s2) ⇒ s1 = s2,
|
2014-01-04 02:11:01 +00:00
|
|
|
Instantiate (SubsetExt A) s1 s2)
|
2013-12-27 06:37:44 +00:00
|
|
|
(show (∀ x, x ∈ s1 = x ∈ s2),
|
2014-01-04 02:11:01 +00:00
|
|
|
For x, show x ∈ s1 = x ∈ s2,
|
|
|
|
let L1 : x ∈ s1 ⇒ x ∈ s2 := Instantiate H1 x,
|
|
|
|
L2 : x ∈ s2 ⇒ x ∈ s1 := Instantiate H2 x
|
2013-12-27 06:37:44 +00:00
|
|
|
in ImpAntisym L1 L2)
|
|
|
|
|
|
|
|
(* Compact (but less readable) version of the previous theorem *)
|
|
|
|
Theorem SubsetAntiSymm2 (A : Type) : ∀ s1 s2 : Set A, s1 ⊆ s2 ⇒ s2 ⊆ s1 ⇒ s1 = s2 :=
|
2014-01-04 02:11:01 +00:00
|
|
|
For s1 s2, Assume H1 H2,
|
|
|
|
MP (Instantiate (SubsetExt A) s1 s2)
|
|
|
|
(For x, ImpAntisym (Instantiate H1 x) (Instantiate H2 x))
|