Constant functions #
This file defines Function.IsConst, the predicate that a function takes the same value
at every pair of inputs, and its restricted variant Function.IsConstOn, the predicate that a
function takes the same value at every pair of points of a given set.
Note that a function with empty domain is considered constant.
If a constant function has non-empty codomain, then it can be represented by Function.const,
see isConst_iff_exists_eq_const.
A function is constant if it takes equal values at any two inputs.
Note that a function with empty domain is considered constant.
If a constant function has non-empty co domain, then it can be represented by Function.const,
see isConst_iff_exists_eq_const.
The intended use is for expressing that a function is constant when the exact constant value is
not known, not unique or not easy to express. To state the constant value explicitly,
use Function.const.
Equations
- Function.IsConst f = ∀ (x y : α), f x = f y
Instances For
All functions on a subsingleton domain are constant.
All functions to a subsingleton codomain are constant.
Alias of the forward direction of Function.isConst_iff_exists_eq_const.
A function α → β is constant on a non-empty codomain if and only if there is b : β so that
the function can be written as Function.const α b.
A function α → β is constant on a non-empty domain if and only if there is b : β so that
the function can be written as Function.const α b.
The identity function on a type is constant if and only if the type is a subsingleton.
A function is constant on a set s if it takes equal values at any two points of s.
The intended use is for expressing that a function is constant on s when the exact constant
value is not known, not unique or not easy to express. To state the constant value explicitly,
use Set.EqOn f (Function.const α b) s.
Equations
- Function.IsConstOn f s = ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → f x = f y
Instances For
Every function is constant on a subsingleton set.
A function f : α → β is constant on a non-empty set s if and only if there is b : β so
that f a = b for all a ∈ s.
A function α → β to a non-empty codomain is constant on s if and only if there is b : β
so that the function agrees with Function.const α b on s.
Alias of the forward direction of Function.isConstOn_iff_exists_eqOn_const.
A function α → β to a non-empty codomain is constant on s if and only if there is b : β
so that the function agrees with Function.const α b on s.
A function α → β is constant on a non-empty set s if and only if there is b : β so that
the function agrees with Function.const α b on s.
Precomposing a function constant on t with a function mapping s to t gives a function
constant on s.
The identity function is constant on a set if and only if the set is a subsingleton.