Basic definitions about sets #
In this file we define various operations on sets.
We also provide basic lemmas needed to unfold the definitions.
More advanced theorems about these definitions are located in other files in Mathlib/Data/Set
.
Main definitions #
- complement of a set and set difference;
Set.Elem
: coercion of a set to a type; it is reducibly equal to{x // x ∈ s}
;Set.preimage f s
, a.k.a.f ⁻¹' s
: preimage of a set;Set.range f
: the range of a function; it is more general thanf '' univ
because it allows functions fromSort*
;s ×ˢ t
: product ofs : Set α
andt : Set β
as a set inα × β
;Set.diagonal
: the diagonal inα × α
;Set.offDiag s
: the part ofs ×ˢ s
that is off the diagonal;Set.pi
: indexed product of a family of sets∀ i, Set (α i)
, as a set in∀ i, α i
;Set.EqOn f g s
: the predicate saying that two functions are equal on a set;Set.MapsTo f s t
: the predicate syaing thatf
sends all points ofs
to `t;Set.MapsTo.restrict
: restrictf : α → β
tof' : s → t
provided thatSet.MapsTo f s t
;Set.restrictPreimage
: restrictf : α → β
tof' : (f ⁻¹' t) → t
;Set.InjOn
: the predicate saying thatf
is injective on a set;Set.SurjOn f s t
: the prediate saying thatt ⊆ f '' s
;Set.BijOn f s t
: the predicate saying thatf
is injective ons
andf '' s = t
;Set.graphOn
: the graph of a function on a set;Set.LeftInvOn
,Set.RightInvOn
,Set.InvOn
: the predicates saying thatf'
is a left, right or two-sided inverse off
ons
,t
, or both;Set.image2
: the image of a pair of sets under a binary operation, mostly useful to define pointwise algebraic operations on sets;Set.seq
: monadicseq
operation on sets; we don't use monadic notation to ensure support for maps between different universes;
Notations #
f '' s
: image of a set;f ⁻¹' s
: preimage of a set;s ×ˢ t
: the product of sets;s ∪ t
: the union of two sets;s ∩ t
: the intersection of two sets;sᶜ
: the complement of a set;s \ t
: the difference of two sets.
Keywords #
set, image, preimage
f ⁻¹' t
denotes the preimage of t : Set β
under the function f : α → β
.
Equations
- Set.«term_⁻¹'_» = Lean.ParserDescr.trailingNode `Set.term_⁻¹'_ 80 80 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⁻¹' ") (Lean.ParserDescr.cat `term 81))
Instances For
f '' s
denotes the image of s : Set α
under the function f : α → β
.
Equations
- Set.term_''_ = Lean.ParserDescr.trailingNode `Set.term_''_ 80 80 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " '' ") (Lean.ParserDescr.cat `term 81))
Instances For
Restriction of f
to s
factors through s.imageFactorization f : s → f '' s
.
Equations
- Set.imageFactorization f s p = { val := f ↑p, property := ⋯ }
Instances For
Any map f : ι → α
factors through a map rangeFactorization f : ι → range f
.
Equations
- Set.rangeFactorization f i = { val := f i, property := ⋯ }
Instances For
We can use the axiom of choice to pick a preimage for every element of range f
.
Equations
- Set.rangeSplitting f x = Exists.choose ⋯
Instances For
diagonal α
is the set of α × α
consisting of all pairs of the form (a, a)
.
Equations
- Set.diagonal α = {p : α × α | p.fst = p.snd}
Instances For
Given a map f
sending s : Set α
into t : Set β
, restrict domain of f
to s
and the codomain to t
. Same as Subtype.map
.
Equations
- Set.MapsTo.restrict f s t h = Subtype.map f h
Instances For
The restriction of a function onto the preimage of a set.
Equations
- Set.restrictPreimage t f = Set.MapsTo.restrict f (f ⁻¹' t) t ⋯
Instances For
The graph of a function f : α → β
on a set s
.
Equations
- Set.graphOn f s = (fun (x : α) => (x, f x)) '' s
Instances For
g
is a left inverse to f
on a
means that g (f x) = x
for all x ∈ a
.
Equations
- Set.LeftInvOn f' f s = ∀ ⦃x : α⦄, x ∈ s → f' (f x) = x
Instances For
g
is a right inverse to f
on b
if f (g x) = x
for all x ∈ b
.
Equations
- Set.RightInvOn f' f t = Set.LeftInvOn f f' t