Can you explain the difference between a function and a relation and how a function is a subset of a relation, and when a relation is a function and when not?
Also, what is the domain, co-domain and range of a function?
All I’ve found on the internet and books has been a bunch of definitions which I can’t make sense out of. An intuitive explanation or any understandable illustration would be much appreciated.
A relation R is a function when for all x,y,z, (xRy and xRz implies y = z).
The domain of a function f is the 1st projection of f.
{ x : exists y with (x,y) in f }
The range of a function f is the 2nd projection of f.
{ y : exists x with (x,y) in f }
The codomain of a function is arbitray as long as the range is a subset of it.