Live data from Hacker News

Functions are vectors

thenumb.at

61–70 of 124 posts

Re: Functions are vectors

#61
post #50

Earlier quoted context omitted.

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.. ??.

If you express it in a different unit system all E, m, and c will take different numerical values, but the relationship will still be true. So there’s nothing special about the metric system. When we want to discuss this kind of relationship without reference to human convention we talk about a quantity’s dimension (not geometric like 3D). A Meter and a foot both have dimensions of length. c has units of length/time.…

Yep. This was going to be the next phase: there isn't anything special about the SI system, but it is consistent. The poster didn't seem prepared for "or any other velocity units you want".

For the original poster, you could equally use c in miles per hour, mass in "pounds", and get whatever that produces for energy (I'm sure there's a name for it).

This is also why Imperial units produce such amusing things as Foot-Pounds (for torque). The math all works out in the end, but you get some amusing numbers along the way.

Re: Functions are vectors

#62
doesn't is suffice to say that functions meet all the prerequisites of a vector space?

f + g = g + f

f + (g + h) = (f + g) + h

f + -f = 0

(a * b) * f = a * bf

a (f + g) = af + ag

(a + b) * f = af + bf

Re: Functions are vectors

#63
post #25

Earlier quoted context omitted.

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 ne…

Seems like a useful formalism though, at least coming from a programming background.

Maybe some kind of "it's all of them at once" mental model is useful in math, but object oriented programming gives you a hierarchal mindset, everything is in a container of some sort, so multiple return values having a container like a set makes perfect sense and just a bunch of loose values isn't a very familiar concept.

But perhaps if you're actually doing math, things are different?

Re: Functions are vectors

#64

Earlier quoted context omitted.

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 ne…

Seems like a useful formalism though, at least coming from a programming background. Maybe some kind of "it's all of them at once" mental model is useful in math, but object oriented programming gives you a hierarchal mindset, everything is in a container of some sort, so multiple return values having a container like a set makes perfect sense and just a bunch of loose values isn't a very familiar concept. But perhap…

It's useful in many places and less useful in others.

Over in the programming world, Common Lisp allows you to return multiple values without wrapping them in a container. If you want the primary value, you just treat the function as if it returned one value. If you want additional return values, you use multiple-value-bind.

(I believe the general idea is along these lines: your function does a certain amount of computation, producing a set of related values. Most of the time, the caller will be interested in just one of those, which you return as the primary value. But some of the time, the caller will be interested in more than just that one value, and you have to compute the secondary values whether the caller wants them or not, so you return those too.)

For a different example of formalism in math, it is conventional to say that there are two boolean logical operators, negation and implication. You can still write about conjunction and disjunction, but everyone understands that when you write "p and q are both true", what you really meant to write was "it isn't the case that the truth of p implies the falsity of q". The point of the formalism is that you can do your proofs by considering negation and implication and then ignoring everything else. (It isn't conventional to say that there's just one logical operator NAND. You might think that would be even better, but the effort saved by only considering how one operation works ends up being less than the extra effort involved in doing proofs about NAND.)

The situation with functions is more or less the same thing; at many points we want to rely on the assumption that when a = b, f(a) = f(b). So we define functions that way, and functions that give multiple values have to be treated as giving a single composite value instead. But in a context where you have some value a and what you want to know is "what is f(a)?", the fact that the answer may consist of multiple values won't bother you.

Now, I have never seen someone take the position that boolean conjunction and disjunction don't exist as concepts just because that is how logic is normally defined, but the analogous position seems to be more popular for multiple-valued functions.

Re: Functions are vectors

#65

> Now, a vector really is just an arbitrary function Not really grokking this. Seems to come out of nowhere.

In mathematics, a function is a mapping from input values to output values. A vector is a mapping from a set of integers to a value at the specified index, therefore it is a function.

e.g.

float vector[4]{1.0, 5.0, 3.0, 2.5};

vector[0] == 1.0;

vector[1] == 5.0;

vector[2] == 3.0;

vector[3] == 2.5;

Re: Functions are vectors

#66
post #10

Earlier quoted context omitted.

"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

e.g. hash collisions.

Re: Functions are vectors

#67
post #41

I wish I could upvote this twice. This is the best basic introduction to concepts in functional analysis that I've seen. Another great overview that goes deeper into the math is [1]. Another fantastic application that the website doesn't mention is the composition / Koopman operator. In control theory (e.g. autonomous drones, cars, robot arms, etc.), most real-world systems are described by nonlinear dynamics which a…

I upvoted this post and your comment, that is equivalent to upvoting the post twice.

Re: Functions are vectors

#68

This is only true if the codomain has the relevant structure for vector operations. Functions are more general than vectors.

Right. Specifically, the codomain needs to be an abelian group. And even that is not sufficient as one needs also an action of the field of scalars on that codomain with the right properties.

Re: Functions are vectors

#69
post #30

I have never seen these index functions used as a transfinite basis for a vector space. And it seems like the function is not a limit point of finite sequences of basis functions, but some weird transfinite sum with mostly zero entries? Clearly there is no Fourier transformation possible on all functions? I think diagonalization methods would be easy to disprove any useful result. Even Hilbert spaces are usually just…

This is my major gripe with the article. While useful for intuition, that "..." after the sum is mathematically meaningless. This is also a common issue with quantum mechanics as taught at an introductory level. But it seems the article, similarly to intro QM courses, is more about motivating functional analysis concepts, which is useful as exposition even if not rigorous.

Re: Functions are vectors

#70
post #23

Earlier quoted context omitted.

You may be thinking of a vector as a concrete collection of values, like a vector in R^3: [x y z]. This piece is about abstract vector spaces, their properties (vector addition, scalar multiplication, etc.) and specifically how functions meet the definition, giving you vector spaces of functions (function spaces). So the idea is that if you two functions, f and g, and a scalar b, then you can do stuff like: f + g = g…

Isn't this just describing a tautology? I was reading here earlier today about the naming of the constant for light as c , and I had a question which I was too embarrassed to ask. It is this: In e=mc^2 , what are the units, and if the units aren't defined and it's just a relationship, then why specify c^2? What's the point of squaring a constant, since it's just another constant? Not that I understand a damn thing ab…

It's not tautological — to pick one of the properties, you can conceive of spaces of functions where there is no -f to a function f. For example, consider the space of all positive-valued real functions.

Consider otherwise functions which take colours and output letters or the alphabet. Letters of the alphabet can't be added or subtracted, so there's no vector space structure on that.

On the flip side, vector spaces can be defined not just on real numbers, but complex numbers as well, or even other sets — specifically, any "field", that is, any set with addition, subtraction, multiplication, and division defined on it in a self-consistent way. There are even finite fields; vector spaces over three are relevant in cryptography.

If these rules seem silly and abstract to you (shouldn't a function just be a function?!), well, that's mathematics! By elucidating the very specific conditions under which results hold, and abstracting away all the irrelevant details, you end up with results of incredible generality.

Post reply on HN