File: Mathlib/Init/Set.lean

full_name: Set
code: /-- A set is a collection of elements of some type `α`.

Although `Set` is defined as `α → Prop`, this is an implementation detail which should not be
relied on. Instead, `setOf` and membership of a set (`∈`) should be used to convert between sets
and predicates.
-/
def Set (α : Type u) 
goal: Type u

full_name: setOf
code: /-- Turn a predicate `p : α → Prop` into a set, also written as `{x | p x}` -/
def setOf {α : Type u} (p : α → Prop) : Set α 
goal: Set α

full_name: Set.Mem
code: /-- Membership in a set -/
protected def Mem (a : α) (s : Set α) : Prop 
goal: Prop

full_name: Set.instMembership
code: instance : Membership α (Set α) 
goal: Membership α (Set α)

full_name: Set.ext
code: theorem ext {a b : Set α} (h : ∀ (x : α), x ∈ a ↔ x ∈ b) : a = b 
goal: a = b

full_name: Set.Subset
code: /-- The subset relation on sets. `s ⊆ t` means that all elements of `s` are elements of `t`.

Note that you should **not** use this definition directly, but instead write `s ⊆ t`. -/
protected def Subset (s₁ s₂ : Set α) 
goal: Prop

full_name: Set.instLE
code: /-- Porting note: we introduce `≤` before `⊆` to help the unifier when applying lattice theorems
to subset hypotheses. -/
instance : LE (Set α) 
goal: LE (Set α)

full_name: Set.instHasSubset
code: instance : HasSubset (Set α) 
goal: HasSubset (Set α)

full_name: Set.instEmptyCollection
code: instance : EmptyCollection (Set α) 
goal: EmptyCollection (Set α)

full_name: Set.«term{_|_}»
code: syntax "{" extBinder " | " term "}" : term
goal: Lean.ParserDescr

full_name: Set.«_aux_Mathlib_Init_Set___macroRules_Set_term{_|_}_1»
code: macro_rules
  | `({ $x:ident | $p }) => `(setOf fun $x:ident ↦ $p)
  | `({ $x:ident : $t | $p }) => `(setOf fun $x:ident : $t ↦ $p)
  | `({ $x:ident $b:binderPred | $p }) =>
    `(setOf fun $x:ident ↦ satisfies_binder_pred% $x $b ∧ $p)
goal: Lean.Macro

full_name: Set.setOf.unexpander
code: @[app_unexpander setOf]
def setOf.unexpander : Lean.PrettyPrinter.Unexpander
  
goal: Lean.PrettyPrinter.Unexpander

full_name: Set.«_aux_Mathlib_Init_Set___macroRules_Set_term{_|_}_1_1»
code: macro (priority := low) "{" t:term " | " bs:extBinders "}" : term =>
  `({x | ∃ᵉ $bs:extBinders, $t = x})
goal: Lean.Macro

full_name: Set.«term{_|_}_1»
code: macro (priority := low) "{" t:term " | " bs:extBinders "}" : term =>
  `({x | ∃ᵉ $bs:extBinders, $t = x})
goal: Lean.ParserDescr

full_name: Set.macroPattSetBuilder
code: macro (name := macroPattSetBuilder) (priority := low-1)
  "{" pat:term " : " t:term " | " p:term "}" : term =>
  `({ x : $t | match x with | $pat => $p })
goal: Lean.ParserDescr

full_name: Set._aux_Mathlib_Init_Set___macroRules_Set_macroPattSetBuilder_1
code: macro (name := macroPattSetBuilder) (priority := low-1)
  "{" pat:term " : " t:term " | " p:term "}" : term =>
  `({ x : $t | match x with | $pat => $p })
goal: Lean.Macro

full_name: Set.«term{_|_}_2»
code: macro (priority := low-1) "{" pat:term " | " p:term "}" : term =>
  `({ x | match x with | $pat => $p })
goal: Lean.ParserDescr

full_name: Set.«_aux_Mathlib_Init_Set___macroRules_Set_term{_|_}_2_1»
code: macro (priority := low-1) "{" pat:term " | " p:term "}" : term =>
  `({ x | match x with | $pat => $p })
goal: Lean.Macro

full_name: Set.setOfPatternMatchUnexpander
code: /-- Pretty printing for set-builder notation with pattern matching. -/
@[app_unexpander setOf]
def setOfPatternMatchUnexpander : Lean.PrettyPrinter.Unexpander
  
goal: Lean.PrettyPrinter.Unexpander

full_name: Set.univ
code: /-- The universal set on a type `α` is the set containing all elements of `α`.

This is conceptually the "same as" `α` (in set theory, it is actually the same), but type theory
makes the distinction that `α` is a type while `Set.univ` is a term of type `Set α`. `Set.univ` can
itself be coerced to a type `↥Set.univ` which is in bijection with (but distinct from) `α`. -/
def univ : Set α 
goal: Set α

full_name: Set.insert
code: /-- `Set.insert a s` is the set `{a} ∪ s`.

Note that you should **not** use this definition directly, but instead write `insert a s` (which is
mediated by the `Insert` typeclass). -/
protected def insert (a : α) (s : Set α) : Set α 
goal: Set α

full_name: Set.instInsert
code: instance : Insert α (Set α) 
goal: Insert α (Set α)

full_name: Set.singleton
code: /-- The singleton of an element `a` is the set with `a` as a single element.

Note that you should **not** use this definition directly, but instead write `{a}`. -/
protected def singleton (a : α) : Set α 
goal: Set α

full_name: Set.instSingletonSet
code: instance instSingletonSet : Singleton α (Set α) 
goal: Singleton α (Set α)

full_name: Set.union
code: /-- The union of two sets `s` and `t` is the set of elements contained in either `s` or `t`.

Note that you should **not** use this definition directly, but instead write `s ∪ t`. -/
protected def union (s₁ s₂ : Set α) : Set α 
goal: Set α

full_name: Set.instUnion
code: instance : Union (Set α) 
goal: Union (Set α)

full_name: Set.inter
code: /-- The intersection of two sets `s` and `t` is the set of elements contained in both `s` and `t`.

Note that you should **not** use this definition directly, but instead write `s ∩ t`. -/
protected def inter (s₁ s₂ : Set α) : Set α 
goal: Set α

full_name: Set.instInter
code: instance : Inter (Set α) 
goal: Inter (Set α)

full_name: Set.compl
code: /-- The complement of a set `s` is the set of elements not contained in `s`.

Note that you should **not** use this definition directly, but instead write `sᶜ`. -/
protected def compl (s : Set α) : Set α 
goal: Set α

full_name: Set.diff
code: /-- The difference of two sets `s` and `t` is the set of elements contained in `s` but not in `t`.

Note that you should **not** use this definition directly, but instead write `s \ t`. -/
protected def diff (s t : Set α) : Set α 
goal: Set α

full_name: Set.instSDiff
code: instance : SDiff (Set α) 
goal: SDiff (Set α)

full_name: Set.powerset
code: /-- `𝒫 s` is the set of all subsets of `s`. -/
def powerset (s : Set α) : Set (Set α) 
goal: Set (Set α)

full_name: Set._aux_Mathlib_Init_Set___unexpand_Set_powerset_1
code: @[inherit_doc] prefix:100 "𝒫" => powerset
goal: Lean.PrettyPrinter.Unexpander

full_name: Set._aux_Mathlib_Init_Set___macroRules_Set_term𝒫__1
code: @[inherit_doc] prefix:100 "𝒫" => powerset
goal: Lean.Macro

full_name: Set.image
code: /-- The image of `s : Set α` by `f : α → β`, written `f '' s`, is the set of `b : β` such that
`f a = b` for some `a ∈ s`. -/
def image {β : Type v} (f : α → β) (s : Set α) : Set β 
goal: Set β

full_name: Set.instFunctor
code: instance : Functor Set 
goal: Functor Set

full_name: Set.instLawfulFunctor
code: instance : LawfulFunctor Set 
goal: LawfulFunctor Set

full_name: Set.Nonempty
code: /-- The property `s.Nonempty` expresses the fact that the set `s` is not empty. It should be used
in theorem assumptions instead of `∃ x, x ∈ s` or `s ≠ ∅` as it gives access to a nice API thanks
to the dot notation. -/
protected def Nonempty (s : Set α) : Prop 
goal: Prop