section_path: Definition/Formal definition
section_name: Formal definition
paragraph_text: Formal definition
  
  The above definition of a function is essentially that of the founders of calculus, Leibniz, Newton and Euler. However, it cannot be formalized, since there is no mathematical definition of an "assignment". It is only at the end of the 19th century that the first formal definition of a function could be provided, in terms of set theory. This set-theoretic definition is based on the fact that a function establishes a relation between the elements of the domain and some (possibly all) elements of the codomain. Mathematically, a binary relation between two sets X and Y is a subset of the set of all ordered pairs (x, y) {\displaystyle (x,y)} such that x ∈ X {\displaystyle x\in X} and y ∈ Y. {\displaystyle y\in Y.} The set of all these pairs is called the Cartesian product of X and Y and denoted X × Y. {\displaystyle X\times Y.} Thus, the above definition may be formalized as follows.
  
  A function with domain X and codomain Y is a binary relation R between X and Y that satisfies the two following conditions:
  
  Still more formally, without referring explicitly to the concept of a relation, but using more notation (including set-builder notation):
  
  A function is formed by three sets, the domain X, {\displaystyle X,} the codomain Y, {\displaystyle Y,} and the graph R {\displaystyle R} that satisfy the three following conditions.