See issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/intro.20with.20type.20specified/near/305150215
39 lines
879 B
Text
39 lines
879 B
Text
def Set (α : Type u) := α → Prop
|
||
|
||
def setOf {α : Type u} (p : α → Prop) : Set α :=
|
||
p
|
||
|
||
namespace Set
|
||
|
||
protected def mem (a : α) (s : Set α) :=
|
||
s a
|
||
|
||
instance : Membership α (Set α) :=
|
||
⟨Set.mem⟩
|
||
|
||
theorem ext {a b : Set α} (h : ∀ (x : α), x ∈ a ↔ x ∈ b) : a = b :=
|
||
funext (fun x => propext (h x))
|
||
|
||
protected def subset (s₁ s₂ : Set α) :=
|
||
∀ {a}, a ∈ s₁ → a ∈ s₂
|
||
|
||
class Subset (α : Type u) where
|
||
/-- Subset relation: `a ⊆ b` -/
|
||
subset : α → α → Prop
|
||
|
||
/-- Subset relation: `a ⊆ b` -/
|
||
infix:50 " ⊆ " => Subset.subset
|
||
|
||
instance : Subset (Set α) :=
|
||
⟨Set.subset⟩
|
||
|
||
instance : EmptyCollection (Set α) :=
|
||
⟨λ _ => False⟩
|
||
|
||
example (U : Type) (A B : Set U) : A ⊆ B → A = A :=
|
||
fun h =>
|
||
match @h with | (h : A ⊆ B) => sorry
|
||
|
||
example (U : Type) (A B : Set U) : A ⊆ B → A = A := by
|
||
intro (h : A ⊆ B)
|
||
sorry
|