lean4-htt/tests/lean/run/subset.lean

39 lines
879 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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