Module docstring
{"# Basic properties of sets
Sets in Lean are homogeneous; all their elements have the same type. Sets whose elements
have type X are thus defined as Set X := X → Prop. Note that this function need not
be decidable. The definition is in the module Mathlib.Data.Set.Defs.
This file provides some basic definitions related to sets and functions not present in the
definitions file, as well as extra lemmas for functions defined in the definitions file and
Mathlib.Data.Set.Operations (empty set, univ, union, intersection, insert, singleton,
set-theoretic difference, complement, and powerset).
Note that a set is a term, not a type. There is a coercion from Set α to Type* sending
s to the corresponding subtype ↥s.
See also the file SetTheory/ZFC.lean, which contains an encoding of ZFC set theory in Lean.
Main definitions
Notation used here:
f : α → βis a function,s : Set αands₁ s₂ : Set αare subsets ofαt : Set βis a subset ofβ.
Definitions in the file:
Nonempty s : Prop: the predicates ≠ ∅. Note that this is the preferred way to express the fact thatshas an element (see the Implementation Notes).inclusion s₁ s₂ : ↥s₁ → ↥s₂: the map↥s₁ → ↥s₂induced by an inclusions₁ ⊆ s₂.
Notation
sᶜfor the complement ofs
Implementation notes
s.Nonemptyis to be preferred tos ≠ ∅or∃ x, x ∈ s. It has the advantage that thes.Nonemptydot notation can be used.For
s : Set α, do not useSubtype s. Instead use↥sor(s : Type*)ors.
Tags
set, sets, subset, subsets, union, intersection, insert, singleton, complement, powerset
","### Set coercion to a type ","### Lemmas about mem and setOf ","### Subset and strict subset relations ","### Definition of strict subsets s ⊂ t and basic properties. ","### Non-empty sets ","### Lemmas about the empty set ","### Universal set.
In Lean @univ α (or univ : Set α) is the set that contains all elements of type α.
Mathematically it is the same as α but it has a different type.
","### Lemmas about union ","### Lemmas about intersection ","### Distributivity laws ","### Lemmas about sets defined as {x ∈ s | p x}. ","### Lemmas about complement ","### Lemmas about set difference ","### Powerset ","### Sets defined as an if-then-else ","### If-then-else for sets ","### Decidability instances for sets "}