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.preimage f s, a.k.a.- f ⁻¹' s: preimage of a set;
- Set.range f: the range of a function; it is more general than- f '' univbecause it allows functions from- Sort*;
- s ×ˢ t: product of- s : Set αand- t : Set βas a set in- α × β;
- Set.diagonal: the diagonal in- α × α;
- Set.offDiag s: the part of- s ×ˢ sthat 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 saying that- fsends all points of- sto- t;
- Set.MapsTo.restrict: restrict- f : α → βto- f' : s → tprovided that- Set.MapsTo f s t;
- Set.restrictPreimage: restrict- f : α → βto- f' : (f ⁻¹' t) → t;
- Set.InjOn: the predicate saying that- fis injective on a set;
- Set.SurjOn f s t: the prediate saying that- t ⊆ f '' s;
- Set.BijOn f s t: the predicate saying that- fis injective on- sand- f '' s = t;
- Set.graphOn: the graph of a function on a set;
- Set.LeftInvOn,- Set.RightInvOn,- Set.InvOn: the predicates saying that- f'is a left, right or two-sided inverse of- fon- s,- 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: monadic- seqoperation on sets; we don't use monadic notation to ensure support for maps between different universes.
Notation #
- 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
This lemma is intended for use with rw where a membership predicate is needed,
hence the explicit argument and the equality in the reverse direction from normal.
See also Set.mem_setOf_eq for the reverse direction applied to an argument.
Operations #
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 = ⟨f ↑p, ⋯⟩
Instances For
Any map f : ι → α factors through a map rangeFactorization f : ι → range f.
Equations
- Set.rangeFactorization f i = ⟨f i, ⋯⟩
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
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
- t.restrictPreimage f = Set.MapsTo.restrict f (f ⁻¹' t) t ⋯
Instances For
g is a left inverse to f on s means that g (f x) = x for all x ∈ s.
Equations
- Set.LeftInvOn g f s = ∀ ⦃x : α⦄, x ∈ s → g (f x) = x
Instances For
g is a right inverse to f on t if f (g x) = x for all x ∈ t.
Equations
- Set.RightInvOn g f t = Set.LeftInvOn f g t