I realize this is a bit pedantic, but I am not sure if there is a term for a function which maps from an empty domain to a range of size one. I am a programmer, and not a mathematician, but was thinking of a general case for a single variable. So something like,
f(x) = x
int f(int x) { returns x; }
is a linear mapping of the integer domain to the integer codomain. If I had:
g(x) = 4
int g(int x) { returns 4; }
that is again a linear mapping of the integer domain to the integer codomain, with range of size 1. I am not sure if this is mathematically correct to say so but if I had:
h() = 5
int h() { return 5; }
that takes no input, thus there an empty domain, but the codomain is still integers and the range is of size 1. Is there a special term for this?
this is coming from the idea that:
int i = 5;
and
int h() { return 5; }
are the 'same'. Thus if there is a term to describe the function h, it can describe what 'i' is.
Some background, I became interested in this question when I realized (though the definition of tensors can vary) that singular numbers are tensors of rank 0 (scalars). I want to know if singular numbers can also be described as a special case of functions.
int k(int a, int b)it is two numbers, and forint j(String a)it's a string. With yourint h()the input is a list with no values in it, but this list certainly a thing. And the set that contains that thing is not the empty set. – hmakholm left over Monica Nov 21 '18 at 21:23voidtype in C-like languages is exactly the one-element type we're speaking of. Many languages restrict what it can be used for, but usually you can declare a function as returningvoid. Then when you writereturn;the compiler supplies the single, unnamed, element of that for you. The type is not the empty set, because by definition it would be impossible to return if you needed to pass an element of the empty set. (And in C your function would even be declared asint h(void), though that is more for profane syntactical reasons that due to theory). – hmakholm left over Monica Nov 21 '18 at 21:28noreturnthat could syntactically appear as the return type of a function. (As input it would becannotcall, which is less practically useful). – hmakholm left over Monica Nov 21 '18 at 21:32