5 ms·
This touches on the actual definition of a function, which is a mapping between sets where every element of the first set maps to exactly one element of the sec
by matteoraso 3y ago
This touches on the actual definition of a function, which is a mapping between sets where every element of the first set maps to exactly one element of the second set. The problem with using vectors is that vectors aren't as general as sets, so there's functions that can't be expressed using vectors. For example, vectors can't be used to handle undefined values or non-numeric elements.
- adammarples 3y agoThat's not the definition of a function, what you're describing would be called a bijective function. A simple function that is not bijective and maps to two distinct values would be sqrt(x)
- tlb 3y ago"In mathematics, a function from a set X to a set Y assigns to each element of X exactly one element of Y." [0] [0] https://en.wikipedia.org/wiki/Function_(mathematics) https://en.wikipedia.org/wiki/Function_(mathematics)
- eternityforest 3y agoWhich doesn't mean each element of Y has exactly one matching counterpart in X, two elements in X can share one in Y
- ElFitz 3y agoe.g. hash collisions.
- slavik81 3y agoYou may be confused because a bijective function must be one-to-one, while in general, a function may be many-to-one. However, the standard definition of a function excludes one-to-many mappings. > A function f from a set X to a set Y, denoted f: X -> Y, is a relation from X, the domain, to Y, the co-domain, that satisfies two properties: (1) every element in X is related to some element in Y, and (2) no element in X is related to more than one element in Y. Susanna S. Epp. 2010. Discrete Mathematics with Applications (4th. ed.). p.384
- deleted 3y ago[deleted]
- thaumasiotes 3y agoThat is the definition of a function, but it's purely a formalism. In reality, and in theoretical math, we are frequently interested in functions that generate multiple values, and it's very easy to represent those in terms of the formal definition: 1. When we want to consider both positive and negative square roots, we can just say that instead of the function sqrt(x): ℝ ⟶ ℝ which always gives a nonnegative real number, we are using a function full_sqrt(x): ℝ ⟶ ℝ² which gives an ordered pair of real numbers. 2. We mostly define arcsine as yielding a single value between -pi/2 and pi/2, but it's just as easy to define the equivalence relation "x ~ y when sin(x) = sin(y)" and then say that the unique value given by the arcsine function is one of the equivalence classes which that relation induces over the real numbers -- or that it is the subset of the reals included in such an equivalence class. 3. If we are concerned about graphing a multi-valued function, we can do that too; for your parabola, we can define the three-dimensional function "z(x,y): ℝ² ⟶ {0, 1} = 1 when x = y² and 0 otherwise" and the graph of this function is the parabola you want. So you're wrong about the definition of a function, except that you're right in spirit; the way we normally think about functions, as opposed to the way we define them, definitely allows them to yield multiple values for one input. You're catastrophically wrong about bijective functions; those are an important concept and your definition is not related to the actual one. A bijective function is one for which all values in the target set are reached by exactly one, no more and no less, value in the source set.
- Tainnor 3y agoI feel like you're being technically correct but in a kind of useless way. Yes, nothing stops you from defining the square root function such that it returns an element of R^2. It's perfectly legal mathematics, functions can map arbitrary domains to arbitrary codomains after all. But I've never seen it used anywhere. Maybe there is an area where such a definition makes sense... but regular real (or complex) analysis doesn't really normally do such a kind of thing. The problem is that you want your typical functions like square root (and logarithms, which in the complex case also aren't unique) to be functions R -> R (or C -> C). Otherwise you can't compose them and then everything is kinda weird. In particular, you don't get the vector space structure that the article is all about. When working in a structure, one often doesn't want to leave that structure and go to another one, but keep the same structure (or at least one that is related in an interesting way, such as a quotient structure). That just leads to more interesting mathematics.
- _kb 3y agoAs others comments have pointed out - you may want to brush up on those definitions. Correct semantics are crucial. They're a form of compression with no/low error correction. Any claims of injective or surjective properties (and by extension bijection) are moot without the domain and co-domain being specified. To map math ↦ dev semantics: functions need to be pure, deterministic and declared with strong types. The properties of square root in particular will vary wildly based on what those types are.
- tsimionescu 3y agoAre you defining sqrt(x²) to be +x and -x? If you are, then sqrt(x) is indeed not a function. You could make it a function by defining sqrt : N -> Z×Z, so sqrt(4) = (-2,2), and we're back to the property that any value in the domain (the natural numbers) is mapped to a single value in the co-domain (a unique pair of integers). Of course, this is not the traditional sqrt function that people normally use, since it doesn't obey the property (sqrt(x))² = x (since obviously taking the square of a pair of integers will not return an integer, for usual definitions of squaring). Note that a bijective function has both this property and the opposite, that for any value in the co-domain there is also a unique value in the domain that maps to it. Sqrt, both in the traditional definition where it only returns positive roots, and in this definition where it returns a pair of roots, is actually also bijective. Squaring is a non-bijective function, though.
- adammarples 3y agoThat's a very good point
- daynthelife 3y agoThe codomain should not be Z×Z — firstly, the square root is usually not an integer, but more importantly, there is not a canonical ordering of the pairs you get, especially if we allow negative/complex inputs. The map we really want is sqrt: C -> (C×C)/~, where C is the complex numbers and ~ is the equivalence relation generated by (a,b) ~ (b,a) for all a,b in C.
- tsimionescu 3y agoYou're right, I should have said sqrt : N -> R×R. I don't think the order is a problem, we can define the function such that sqrt(x)={a | a²=x}. Sets are inherently unordered, {-2,2} = {2,-2}. Of course, this is not a surjective function, but it is a function nevertheless.
- daynthelife 3y agoThe issue with sets is that they don’t capture the notion of multiplicity. One would like to say sqrt(0) = {0,0}, but {0,0} is just equal to {0} as a set. The CxC/~ formalism captures the possibility of multiplicity as well as the fact that the output always has size 2. As an aside, the notation R x R means ordered pairs of reals. So for your definition, you would instead want 2^R as the codomain (i.e. the set of subsets of R).
- cykotic 3y agoFunctions can’t be used to handle undefined values either. A function is a mapping, f, from one set to another such that each element of the originating set gets mapped to one and only one element of the target set. This, by definition, requires that all values in the originating set get mapped to something in the target set. So there are no undefined values as such. Function spaces can’t always be viewed as vector spaces because there may be no concept of addition of functions or a concept of scalar multiplication on the functions that behaves well with whatever notion of addition the functions satisfy.