Live data from Hacker News

Functions are vectors

thenumb.at

51–60 of 124 posts

Re: Functions are vectors

#51
post #36

Earlier quoted context omitted.

Assuming this is in good faith, the units are: - c: speed of light in meters per second - m: mass in kilograms - energy: joules

yes it was in total good faith. soooo... the metric system just happens to perfectly conform to meters per second squared times kilograms equaling joules? That seems... mind-blowing since it was invented before kilograms and joules would have been interchangeable.. ??.

Kilograms and joules have been interchangable (well, they've had a defined relationship) for a long time though, you can calculate work in a completely Newtonian context and see that the energy requires is linearly related to the mass and quadratically to velocity (like with a spring).

That the direct conversion from mass to energy follows the same shape isn't really surprising, it sort of has to.

That said, the joule was only explicitly defined as kgm/s^2 in 1946 (or 1935), after Einstein and nuclear physics.

Re: Functions are vectors

#52
What makes the author say that functions are infinite dimensional? Seems like the space of functions might be infinite dimensional but one function is usually not.

“AND” is 0001 for 00 01 10 11. 2^4=16 binary Boolean functions, in ternary it blows up, but it’s not infinite.

Re: Functions are vectors

#53
post #44

Earlier quoted context omitted.

> So take a function that returns a random shuffled deck of cards with 52! possible real number vector outputs. that is not a function in the (mathematical) sense that the article is talking about. a function is a mapping from a set of inputs to a set of outputs, and the same input will always map to the same output. (in programming terms it's what you would call a "pure function")

then remapping them by some arithmetic is tautological, isn't it?

not quite; in the most general sense the arguments to and result of a function (the 'domain' and 'range' in mathematical jargon) need not be numbers but any set of mathematical objects. the heavy work went into proving properties of these generalised functions that were universally true, and showing that they were isomorphic to structures built up in other branches of mathematics.

as a side note, one very important technique/idea in mathematics (in general, not just in the area of functional analysis) is describing something in terms of a set of properties that is both as general as possible and as minimal as possible. for instance numbers can be added, subtracted, multiplied and divided, with "obvious" real-world interpretations. mathematicians then asked themselves what properties exactly the numbers had to possess in order for those operations to be defined, and then they proceeded to find other classes of mathematical objects that also had those properties, and suddenly we were able to "add" and "multiply" things that had no obvious physical interpretation for those operations. but since their structure was mapped to the structure of the numbers, those operations could be mechanically defined over them, and you had all sorts of mathematical tools at your disposal.

here a similar thing was done with functions. there had been a lot of work put into studying the operations you could do on "vector spaces", a mathematical structure that generalised the notion of a vector as a collection of numbers. then mathematicians noticed that if you took the minimal collection of properties something needed to have in order to be a vector space, functions satisfied all those properties. and voila - everything that you could prove about vector spaces (and again, it was a whole lot) was suddenly applicable to functions as well.

(why some of this seems a bit tautological is that it also follows the properties of the real numbers, and even non-mathematicians have had a lot of intuition built up about how numbers behave. but it is by no means guaranteed that every mathematical construct will have these same properties.)

Re: Functions are vectors

#54

I’d probably have titled this something including either the term “linear” or “functional analysis”. Because submitted here, we will first interpret “functions” in the context of a function in computer programming, where the statement is more provocative and thus clickbaity. The problem is many real world functions and problems are nonlinear. But they may have linear components. For example, a dog can be recognized b…

Nothing in this article assumed that the functions in question were linear and/or being approximated.

Re: Functions are vectors

#55

What makes the author say that functions are infinite dimensional? Seems like the space of functions might be infinite dimensional but one function is usually not. “AND” is 0001 for 00 01 10 11. 2^4=16 binary Boolean functions, in ternary it blows up, but it’s not infinite.

I think I understand it, let's see if I can explain it. Hopefully I'll say something useful.

Take a vector for normal space, [x, y, z]. We say each component of this vector is one dimension, so this one is 3D, and each of its three components can vary. Two such vectors are different if one or more components differ between them. Treating a function as a vector means treating each distinct possible input to the function as a distinct component.

For example, consider the integer function f(x) = x^2. This can be represented as the vector [..., 16, 9, 4, 0, 4, 9, 16, ...] Where the complete vector has as many components as integers. Since there's infinitely many integers, there's infinite components, so instead of 3D like the three component vector above, this vector is ∞D.

Any single function is representable in this way, so each distinct function has its own unique infinitely long vector.

So each different function is a different "point" in an infinite dimensional vector space.

Re: Functions are vectors

#56
post #25

Earlier quoted context omitted.

That 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 num…

We don’t allow multiple values for a given input of a function. Ever. This is never done. f(x) = x^2 is not invertible as a real valued function of a real variable. On the restricted domain of [0, infinity) it is invertible and that inverse is sqrt(x). If you want to talk about negative roots you use the function -1*sqrt(x). You can construct a new function as you did to encapsulate this fact but one never has a func…

Don't be ridiculous. It's a common need, it's easily satisfied, and so it is commonly done. Compare the concept of the "inverse element" of a value given by an invertible function with the "inverse image" of a value given by a non-invertible function. Of course the function that gives you inverse images is nothing more than an inverse function that is allowed to give multiple values. Why do we do that? Because our need to invert functions has nothing to do with whether those functions are one-to-one, and because in most contexts it isn't actually important that functions yield a single value. It's a formalism.

There is no high principle that says "collecting multiple values and giving them a collective name that implies they are a single value is metaphysically superior to collecting multiple values and admitting that they are multiple values".

Re: Functions are vectors

#57

Earlier quoted context omitted.

That 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 num…

> That is the definition of a function, but it's purely a formalism... Isn’t the function definition meant to be interpreted as “maps consistently to exactly one element of the codomain”? So an ordered pair of R^2 is still one element of R^2 It seems the parent has just mixed up the domain and codomain, because under that assumption he would be right about both the definition and bijectivity

I can't tell what you mean by your emphasis on the word "consistently". Functions are not stochastic; f(y) is f(y) regardless of how many times you ask what f(y) is.

The formal definition guarantees that whenever a = b, f(a) = f(b). You use it when you need that guarantee.

An ordered pair drawn from ℝ² is in some sense a single value. In another sense, it is two values. Which way you want to think about it depends on what you're going to do with it; if you're thinking about square roots of real numbers, it will be more useful to think of it as two values.

> It seems the parent has just mixed up the domain and codomain, because under that assumption he would be right about both the definition and bijectivity

He still wouldn't be right about bijectivity; you also need the assumption that a function is defined over its entire domain.

Re: Functions are vectors

#58

What makes the author say that functions are infinite dimensional? Seems like the space of functions might be infinite dimensional but one function is usually not. “AND” is 0001 for 00 01 10 11. 2^4=16 binary Boolean functions, in ternary it blows up, but it’s not infinite.

A function on the reals maps any real to another [or maybe the same] real. Given some systematic way to order the inputs, you could describe the function as a vector lookup table with an infinite number of elements -- one output for each possible input.

That vector describes a single point in an infinite-dimensional space. Thus every function from R to R is a single point in an infinite-dimensional space.

Now you can use linear algebra to move these points around in the infinite-dimensional space, measure how far two points [functions] are from each other, etc. That's functional analysis.

The linear operators that do this moving around and measuring are called functionals to indicate that they take functions as arguments. (Like higher-order functions in a programming language.) "Functional Analysis" is thus "The analysis of the objects known as functionals".

Differentiation is an example of a functional.

Re: Functions are vectors

#59

I’d probably have titled this something including either the term “linear” or “functional analysis”. Because submitted here, we will first interpret “functions” in the context of a function in computer programming, where the statement is more provocative and thus clickbaity. The problem is many real world functions and problems are nonlinear. But they may have linear components. For example, a dog can be recognized b…

The title is actually perfect, but requires some context, after which you might appreciate its tongue-in-cheek beauty:

The author studied at CMU, where the proudly-paraded slogan for an introductory functional programming classes is "Functions are values", which has an almost cult-like status - appearing on their TA hoodies, laptop stickers, and so on.

Other classes soon caught on, first with the imperative programming class declaring that "Functions are pointers", then the introductory discrete math class's "Functions are tuples", and even "Functions are relations" from the databases class.

So viewed in this lens, passing up the opportunity to title it what it was would have been unthinkable.

Re: Functions are vectors

#60
post #10

Earlier quoted context omitted.

That'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)

"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)

Which doesn't mean each element of Y has exactly one matching counterpart in X, two elements in X can share one in Y
Post reply on HN