Expression (mathematics)

A finite combination of symbols that describes a mathematical object

In mathematics, an expression is a written arrangement of symbols following the context-dependent, syntactic conventions of mathematical notation. Symbols can denote numbers (constants), variables, operations, functions. Other symbols include punctuation signs and brackets (often used for grouping, that is for considering a part of the expression as a single symbol).

Many authors distinguish an expression from a formula, the former denoting a mathematical object, and the latter denoting a statement about mathematical objects.[1] This is analogous to natural language, where a noun phrase refers to an object, and a whole sentence refers to a fact. For example,  8 x − 5 {\displaystyle 8x-5} is an expression, while  8 x − 5 ≥ 3 {\displaystyle 8x-5\geq 3} is a formula.

Expressions can be evaluated or partially evaluated by replacing operations that appear in them with their result. For example, the expression  8 × 2 − 5 {\displaystyle 8\times 2-5} evaluates partially to  16 − 5 {\displaystyle 16-5} and totally to  11. {\displaystyle 11.}

An expression is often used to define a function, by taking the variables to be arguments, or inputs, of the function, and assigning the output to be the total evaluation of the resulting expression.[2] For example,  x ↦ x 2 + 1 {\displaystyle x\mapsto x^{2}+1} and  f ( x ) = x 2 + 1 {\displaystyle f(x)=x^{2}+1} define the function that associates to each number its square plus one. An expression with no variables would define a constant function.

## Examples

[edit]

The use of expressions ranges from the simple:

3 + 8 {\displaystyle 3+8}

8 x − 5 {\displaystyle 8x-5} (linear polynomial)

7 x 2 + 4 x − 10 {\displaystyle 7{{x}^{2}}+4x-10} (quadratic polynomial)

x − 1 x 2 + 12 {\displaystyle {\frac {x-1}{{{x}^{2}}+12}}} (rational fraction)

to the complex:

f ( a ) + ∑ k = 1 n 1 k ! d k d t k | t = 0 f ( u ( t ) ) {\displaystyle f(a)+\sum _{k=1}^{n}\left.{\frac {1}{k!}}{\frac {d^{k}}{dt^{k}}}\right|_{t=0}f(u(t))} + ∫ 0 1 ( 1 − t ) n n ! d n + 1 d t n + 1 f ( u ( t ) ) d t . {\displaystyle +\int _{0}^{1}{\frac {(1-t)^{n}}{n!}}{\frac {d^{n+1}}{dt^{n+1}}}f(u(t))\,dt.}

## Variables and evaluation

[edit]

Many expressions include variables. Any variable can be classified as being either a free variable or a bound variable.

For a given combination of values for the free variables, an expression may be evaluated, although for some combinations of values of the free variables, the value of the expression may be undefined. Thus an expression represents an operation over constants and free variables and whose output is the resulting value of the expression.[3]

For example, if the expression  x / y {\displaystyle x/y} is evaluated with x = 10, y = 5, it evaluates to 2; this is denoted

x / y | x = 10 , y = 5 = 2. {\displaystyle x/y{\text{ }}|_{x=10,\,y=5}=2.}
The evaluation is undefined for y = 0

Two expressions are said to be equivalent if, for each combination of values for the free variables, they have the same output, i.e., they represent the same function. [4][5] The equivalence between two expressions is called an identity and is often denoted with  ≡ . {\displaystyle \equiv .}

For example, in the expression  ∑ n = 1 3 ( 2 n x ) , {\textstyle \sum _{n=1}^{3}(2nx),} the variable n is bound, and the variable x is free. This expression is equivalent to the simpler expression 12 x; that is  ∑ n = 1 3 ( 2 n x ) ≡ 12 x . {\displaystyle \sum _{n=1}^{3}(2nx)\equiv 12x.} The value for x = 3 is 36, which can be denoted  ∑ n = 1 3 ( 2 n x ) | x = 3 = 36. {\displaystyle \sum _{n=1}^{3}(2nx){\Big |}_{x=3}=36.}

## Syntax versus semantics

[edit]

Main article: Formal grammar

### Syntax

[edit]

Main article: Syntax (logic)

An expression is a syntactic construct. It must be well-formed. It can be described somewhat informally as follows: the allowed operators must have the correct number of inputs in the correct places, the characters that make up these inputs must be valid, have a clear order of operations, etc. Strings of symbols that violate the rules of syntax are not well-formed and are not valid mathematical expressions.[6]

For example, in arithmetic, the expression 1 + 2 × 3 is well-formed, but

× 4 ) x + , / y {\displaystyle \times 4)x+,/y} .

is not.

### Semantics

[edit]

Main articles: Semantics and Formal semantics (logic)

Semantics is the study of meaning. Formal semantics is about attaching meaning to expressions.

In algebra, an expression may be used to designate a value, which might depend on values assigned to variables occurring in the expression.[citation needed] The determination of this value depends on the semantics attached to the symbols of the expression. The choice of semantics depends on the context of the expression. The same syntactic expression 1 + 2 × 3 can have different values (mathematically 7, but also 9), depending on the order of operations implied by the context (See also Operations § Calculators).

The semantic rules may declare that certain expressions do not designate any value (for instance when they involve division by 0); such expressions are said to have an undefined value, but they are well-formed expressions nonetheless. In general the meaning of expressions is not limited to designating values; for instance, an expression might designate a condition, or an equation that is to be solved, or it can be viewed as an object in its own right that can be manipulated according to certain rules.[citation needed] Certain expressions that designate a value simultaneously express a condition that is assumed to hold, for instance those involving the operator  ⊕ {\displaystyle \oplus } to designate an internal direct sum.

## Formal definition

[edit]

A well-formed expression in mathematics can be described as part of a formal language, and defined recursively as follows:[7]

The alphabet consists of:

* A set of Constants / Definites: Symbols representing fixed objects in the domain of discourse, such as numbers (1, 2.5, 1/7, ...), sets ( ∅ , { 1 , 2 , 3 } {\displaystyle \varnothing ,\\{1,2,3\\}} , ...), truth values (T or F), etc.

* A set of variable names: A countably infinite amount of variables used for representing mathematical objects in the domain. (Usually letters like x, or y)

* A set of operations: Symbols representing operations that can be performed on elements over the domain, like addition (+), multiplication (×), or set operations like union (∪), or intersection (∩). (Functions can be understood as unary operations)

* Brackets ( )

With this alphabet, the recursive rules for forming well-formed expression (WFE) are as follows:

* Any constant or variable as defined are the atomic expressions (the simplest WFE's). For instance, the expressions " 2 {\displaystyle 2} " or " x {\displaystyle x} " are syntactically correct expressions.

* Let  F {\displaystyle F} denote some n-ary operation over the domain, and let  ϕ 1 , ϕ 2 , . . . ϕ n {\displaystyle \phi _{1},\phi _{2},...\phi _{n}} be metavariables for any WFE's.

Then  F ( ϕ 1 , ϕ 2 , . . . ϕ n ) {\displaystyle F(\phi _{1},\phi _{2},...\phi _{n})} is also a WFE.
For instance, if the domain of discorse is the real numbers,  F {\displaystyle F} can denote the binary operation +, then  ϕ 1 + ϕ 2 {\displaystyle \phi _{1}+\phi _{2}} is a WFE. Or  F {\displaystyle F} can be the unary operation  √ {\displaystyle \surd } , then  ϕ 1 {\displaystyle {\sqrt {\phi _{1}}}} is as well.
Brackets are initially around each non-atomic expression, but they can be deleted in cases where there is a defined order of operations, or where order doesn't matter (i.e. where operations are associative)

A well-formed expression can be thought as a syntax tree.[8] The leaf nodes are always atomic expressions. Operations  + {\displaystyle +} and  ∪ {\displaystyle \cup } have exactly two child nodes, while operations  x {\textstyle {\sqrt {x}}} ,  ln ( x ) {\textstyle {\text{ln}}(x)} and  d d x {\textstyle {\frac {d}{dx}}} have exactly one. There are countably infinitely many WFE's, however, each WFE has a finite number of nodes.

### Lambda calculus

[edit]

Main article: Lambda calculus

Formal languages allow formalizing the concept of well-formed expressions.

In the 1930s, a new type of expressions, called lambda expressions, were introduced by Alonzo Church and Stephen Kleene for formalizing functions and their evaluation. [9][a] They form the basis for lambda calculus, a formal system used in mathematical logic and the theory of programming languages.

The equivalence of two lambda expressions is undecidable. This is also the case for the expressions representing real numbers, which are built from the integers by using the arithmetical operations, the logarithm and the exponential (Richardson's theorem)

## Types of expressions

[edit]

### Algebraic expression

[edit]

An algebraic expression is an expression built up from algebraic constants, variables, and the algebraic operations (addition, subtraction, multiplication, division and exponentiation by a rational number).[10] For example, 3x2 − 2xy \+ c is an algebraic expression. Since taking the square root is the same as raising to the power ⁠1/2⁠, the following is also an algebraic expression:

1 − x 2 1 + x 2 {\displaystyle {\sqrt {\frac {1-x^{2}}{1+x^{2}}}}}

See also: Algebraic equation and Algebraic closure

### Polynomial expression

[edit]

A polynomial expression is an expression built with scalars (numbers of elements of some field), indeterminates, and the operators of addition, multiplication, and exponentiation to nonnegative integer powers; for example  3 ( x + 1 ) 2 − x y . {\displaystyle 3(x+1)^{2}-xy.}

Using associativity, commutativity and distributivity, every polynomial expression is equivalent to a polynomial, that is an expression that is a linear combination of products of integer powers of the indeterminates. For example the above polynomial expression is equivalent (denote the same polynomial as  3 x 2 − x y + 6 x + 3. {\displaystyle 3x^{2}-xy+6x+3.}

Many author do not distinguish polynomials and polynomial expressions. In this case the expression of a polynomial expression as a linear combination is called the canonical form, normal form, or expanded form of the polynomial.

### Computational expression

[edit]

Main article: Expression (computer science)

In computer science, an expression is a syntactic entity in a programming language that may be evaluated to determine its value[11] or fail to terminate, in which case the expression is undefined.[12] It is a combination of one or more constants, variables, functions, and operators that the programming language interprets (according to its particular rules of precedence and of association) and computes to produce ("to return", in a stateful environment) another value. This process, for mathematical expressions, is called evaluation. In simple settings, the resulting value is usually one of various primitive types, such as string, boolean, or numerical (such as integer, floating-point, or complex).

In computer algebra, formulas are viewed as expressions that can be evaluated as a Boolean, depending on the values that are given to the variables occurring in the expressions. For example  8 x − 5 ≥ 3 {\displaystyle 8x-5\geq 3} takes the value false if x is given a value less than 1, and the value true otherwise.

Expressions are often contrasted with statements—syntactic entities that have no value (an instruction).

Representation of the expression (8 − 6) × (3 + 1) as a Lisp tree, from a 1985 Master's Thesis[13]

Except for numbers and variables, every mathematical expression may be viewed as the symbol of an operator followed by a sequence of operands. In computer algebra software, the expressions are usually represented in this way. This representation is very flexible, and many things that seem not to be mathematical expressions at first glance, may be represented and manipulated as such. For example, an equation is an expression with "=" as an operator, a matrix may be represented as an expression with "matrix" as an operator and its rows as operands.

See: Computer algebra expression

### Logical expression

[edit]

In mathematical logic, a "logical expression" can refer to either terms or formulas. A term denotes a mathematical object while a formula denotes a mathematical fact. In particular, terms appear as components of a formula.

A first-order term is recursively constructed from constant symbols, variables, and function symbols. An expression formed by applying a predicate symbol to an appropriate number of terms is called an atomic formula, which evaluates to true or false in bivalent logics, given an interpretation. For example, ⁠ ( x + 1 ) ∗ ( x + 1 ) {\displaystyle (x+1)*(x+1)} ⁠ is a term built from the constant 1, the variable x, and the binary function symbols ⁠ + {\displaystyle +} ⁠ and ⁠ ∗ {\displaystyle *} ⁠; it is part of the atomic formula ⁠ ( x + 1 ) ∗ ( x + 1 ) ≥ 0 {\displaystyle (x+1)*(x+1)\geq 0} ⁠ which evaluates to true for each real-numbered value of x.

## See also

[edit]

* Analytic expression
* Closed-form expression
* Combinator
* Defined and undefined
* Functional programming
* Number sentence
* Signature (logic)
* Well-defined expression

## Notes

[edit]

1. ^ Stoll, Robert R. Set Theory and Logic. San Francisco, CA: Dover Publications. ISBN 978-0-486-63829-4.
2. ^ Codd, Edgar Frank (June 1970). "A Relational Model of Data for Large Shared Data Banks" (PDF). Communications of the ACM. 13 (6): 377–387. doi:10.1145/362384.362685. S2CID 207549016. Archived (PDF) from the original on 2004-09-08. Retrieved 2020-04-29.
3. ^ C.C. Chang; H. Jerome Keisler (1977). Model Theory. Studies in Logic and the Foundation of Mathematics. Vol. 73\. North Holland.; here: Sect.1.3
4. ^ Equation. Encyclopedia of Mathematics. URL: http://encyclopediaofmath.org/index.php?title=Equation&oldid=32613
5. ^ Pratt, Vaughan, "Algebra", The Stanford Encyclopedia of Philosophy (Winter 2022 Edition), Edward N. Zalta & Uri Nodelman (eds.), URL: https://plato.stanford.edu/entries/algebra/#Laws
6. ^ Stoll, Robert R. Set Theory and Logic. San Francisco, CA: Dover Publications. ISBN 978-0-486-63829-4.
7. ^ C.C. Chang; H. Jerome Keisler (1977). Model Theory. Studies in Logic and the Foundation of Mathematics. Vol. 73\. North Holland.; here: Sect.1.3
8. ^ Hermes, Hans (1973). Introduction to Mathematical Logic. Springer London. ISBN 3540058192. ISSN 1431-4657.; here: Sect.II.1.3
9. ^ Church, Alonzo (1932). "A set of postulates for the foundation of logic". Annals of Mathematics. Series 2. 33 (2): 346–366. doi:10.2307/1968337. JSTOR 1968337.
10. ^ Morris, Christopher G. (1992). Academic Press dictionary of science and technology. Gulf Professional Publishing. p. 74. "algebraic expression over a field."
11. ^ Mitchell, J. (2002). Concepts in Programming Languages. Cambridge: Cambridge University Press, 3.4.1 Statements and Expressions, p. 26
12. ^ Maurizio Gabbrielli, Simone Martini (2010). Programming Languages - Principles and Paradigms. Springer London, 6.1 Expressions, p. 120
13. ^ Cassidy, Kevin G. (Dec 1985). The Feasibility of Automatic Storage Reclamation with Concurrent Program Execution in a LISP Environment (PDF) (Master's thesis). Naval Postgraduate School, Monterey/CA. p. 15\. ADA165184.

1. ^ For a full history, see Cardone and Hindley's "History of Lambda-calculus and Combinatory Logic" (2006).

## References

[edit]

* Redden, John (2011). "Elementary Algebra". Flat World Knowledge. Archived from the original on 2014-11-15. Retrieved 2012-03-18.

* v
* t
* e

Mathematical logic

General|

* Axiom
* list
* Cardinality
* First-order logic
* Formal proof
* Formal semantics
* Foundations of mathematics
* Information theory
* Lemma
* Logical consequence
* Model
* Theorem
* Theory
* Type theory

Theorems (list)
and paradoxes|

* Gödel's completeness and incompleteness theorems
* Tarski's undefinability
* Banach–Tarski paradox
* Cantor's theorem, paradox and diagonal argument
* Compactness
* Halting problem
* Lindström's
* Löwenheim–Skolem
* Russell's paradox

Logics|

| Traditional|

* Classical logic
* Logical truth
* Tautology
* Proposition
* Inference
* Logical equivalence
* Consistency
* Equiconsistency
* Argument
* Soundness
* Validity
* Syllogism
* Square of opposition
* Venn diagram

|

Propositional|

* Boolean algebra
* Boolean functions
* Logical connectives
* Propositional calculus
* Propositional formula
* Truth tables
* Many-valued logic
* 3
* finite
* ∞

Predicate|

* First-order
* list
* Second-order
* Monadic
* Higher-order
* Fixed-point
* Free
* Quantifiers
* Predicate
* Monadic predicate calculus

Set theory|

* Set
* hereditary
* Class
* (Ur-)Element
* Ordinal number
* Extensionality
* Forcing
* Relation
* equivalence
* partition
* Set operations:
* intersection
* union
* complement
* Cartesian product
* power set
* identities

Types of sets|

* Countable
* Uncountable
* Empty
* Inhabited
* Singleton
* Finite
* Infinite
* Transitive
* Ultrafilter
* Recursive
* Fuzzy
* Universal
* Universe
* constructible
* Grothendieck
* Von Neumann

Maps and cardinality|

* Function/Map
* domain
* codomain
* image
* In/Sur/Bi-jection
* Schröder–Bernstein theorem
* Isomorphism
* Gödel numbering
* Enumeration
* Large cardinal
* inaccessible
* Aleph number
* Operation
* binary

Set theories|

* Zermelo–Fraenkel
* axiom of choice
* continuum hypothesis
* General
* Kripke–Platek
* Morse–Kelley
* Naive
* New Foundations
* Tarski–Grothendieck
* Von Neumann–Bernays–Gödel
* Ackermann
* Constructive

Formal systems (list),
language and syntax|

* Alphabet
* Arity
* Automata
* Axiom schema
* Expression
* ground
* Extension
* by definition
* conservative
* Relation
* Formation rule
* Grammar
* Formula
* atomic
* closed
* ground
* open
* Free/bound variable
* Language
* Metalanguage
* Logical connective
* ¬
* ∨
* ∧
* →
* ↔
* =
* Predicate
* functional
* variable
* propositional variable
* Proof
* Quantifier
* ∃
* !
* ∀
* rank
* Sentence
* atomic
* spectrum
* Signature
* String
* Substitution
* Symbol
* function
* logical/constant
* non-logical
* variable
* Term
* Theory
* list

Example axiomatic
systems (list)|

* of arithmetic:
* Peano
* second-order
* elementary function
* primitive recursive
* Robinson
* Skolem
* of the real numbers
* Tarski's axiomatization
* of Boolean algebras
* canonical
* minimal axioms
* of geometry:
* Euclidean:
* Elements
* Hilbert's
* Tarski's
* non-Euclidean

* Principia Mathematica

Proof theory|

* Formal proof
* Natural deduction
* Logical consequence
* Rule of inference
* Sequent calculus
* Theorem
* Systems
* axiomatic
* deductive
* Hilbert
* list
* Complete theory
* Independence (from ZFC)
* Proof of impossibility
* Ordinal analysis
* Reverse mathematics
* Self-verifying theories

Model theory|

* Interpretation
* function
* of models
* Model
* equivalence
* finite
* saturated
* spectrum
* submodel
* Non-standard model
* of arithmetic
* Diagram
* elementary
* Categorical theory
* Model complete theory
* Satisfiability
* Semantics of logic
* Strength
* Theories of truth
* semantic
* Tarski's
* Kripke's
* T-schema
* Transfer principle
* Truth predicate
* Truth value
* Type
* Ultraproduct
* Validity

Computability theory|

* Church encoding
* Church–Turing thesis
* Computably enumerable
* Computable function
* Computable set
* Decision problem
* decidable
* undecidable
* P
* NP
* P versus NP problem
* Kolmogorov complexity
* Lambda calculus
* Primitive recursive function
* Recursion
* Recursive set
* Turing machine
* Type theory

Related|

* Abstract logic
* Algebraic logic
* Automated theorem proving
* Category theory
* Concrete/Abstract category
* Category of sets
* History of logic
* History of mathematical logic
* timeline
* Logicism
* Mathematical object
* Philosophy of mathematics
* Supertask

Mathematics portal
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template