Definition 0.3.10: For sets A and B, the Cartesian product is the set of ordered
pairs (x, y) with x ∈ A and y ∈ B, written A × B.
Equations
- cartesianProductElementCollection A B = A ×ˢ B
Instances For
The book's Cartesian product coincides with mathlib's set product.
Definition 0.3.11: A function f : A → B is a subset of A × B sending each
element of A to a unique y ∈ B; this subset is called the graph of the function. The
set A is the domain, R(f) = { y ∈ B | ∃ x ∈ A, (x, y) ∈ f } is the range, and B is
the codomain.
Instances For
Helper: from a functional graph, choose the output in B for each x ∈ A.
Equations
- functionGraphToSubtypeFun f A B hf x = ⟨Classical.choose ⋯, ⋯⟩
Instances For
Helper: the graph of a subtype-valued function is functional with domain A.
The book's notion of a functional subset of A × B is equivalent to an ordinary
mathlib function with domain the subtype of A and codomain B.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Example 0.3.12: Functions between spaces of functions include the derivative sending a
differentiable real function to another real function, the Laplace transform viewed as a
function taking functions to functions, and the definite integral assigning a number to a
continuous function on [0,1].
Definition 0.3.13: For a function f : A → B, the image (direct image) of
C ⊆ A is f(C) = { f x ∈ B | x ∈ C }, and the inverse image of D ⊆ B is
f ⁻¹(D) = { x ∈ A | f x ∈ D }.
Equations
- directImageElementCollection f C = f '' C
Instances For
The book's image of a subset is mathlib's Set.image.
The inverse image of a subset under f.
Equations
- inverseImageElementCollection f D = f ⁻¹' D
Instances For
The book's inverse image coincides with mathlib's preimage.
Example 0.3.14: For f(x) = sin (π x), one has
f([0, 1/2]) = [0, 1] and f ⁻¹({0}) = ℤ, etc.
Equations
- sinPiFunction x = Real.sin (Real.pi * x)
Instances For
Helper: values of sin (π x) on [0, 1/2] lie in [0, 1].
Helper: every y ∈ [0,1] is of the form sin (π x) for some x ∈ [0,1/2].
Example 0.3.14: The image of [0, 1/2] under x ↦ sin (π x) is [0, 1].
Helper: sin (π x) = 0 iff x is an integer.
Example 0.3.14: The preimage of {0} under x ↦ sin (π x) is the set of integers.
Proposition 0.3.15: For a function f : A → B and subsets C, D of B,
f ⁻¹'(C ∪ D) = f ⁻¹' C ∪ f ⁻¹' D, f ⁻¹'(C ∩ D) = f ⁻¹' C ∩ f ⁻¹' D, and
f ⁻¹'(Cᶜ) = (f ⁻¹' C)ᶜ.
Definition 0.3.17: A function f : A → B is injective (one-to-one) if f x₁ = f x₂
implies x₁ = x₂, equivalently each fiber f ⁻¹' {y} is empty or a singleton; it is
surjective (onto) if f(A) = B, i.e., its range equals its codomain; it is bijective if
both.
Equations
Instances For
The book's injectivity is mathlib's Function.Injective.
The book's notion of surjective function.
Equations
Instances For
The book's surjectivity coincides with mathlib's Function.Surjective.
The book's bijection is a function that is both injective and surjective.
Equations
Instances For
The book's bijectivity is mathlib's Function.Bijective.
Definition 0.3.18: For functions f : A → B and g : B → C, the composition
g ∘ f : A → C is given by (g ∘ f) x = g (f x).
Equations
- functionComposition g f = g ∘ f
Instances For
The book's composition of functions is mathlib's function composition.