Expression (mathematics)

Last updated

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

Contents

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, is an expression, while is a formula.

Expressions can be evaluated or partially evaluated by replacing operations that appear in them with their result. For example, the expression evaluates partially to and totally to

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, and define the function that associates to each number its square plus one. An expression with no variables would define a constant function. Usually, two expressions are considered equal or equivalent if they define the same function. Such an equality is called a "semantic equality", that is, both expressions "mean the same thing."

A formal expression is a kind of string of symols, created by the same production rules as standard expressions, however, they are used without regard to the meaning of the expression. In this way, two formal expressions are considered equal only if they are syntactically equal, that is, if they are the exact same expression. [3] [4] For instance, the formal expressions "2" and "1+1" are not equal.

Examples

The use of expressions ranges from the simple:

  (linear polynomial)
  (quadratic polynomial)
  (rational fraction)

to the complex:

Variables and evaluation

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. [5]

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

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. [6] [7] The equivalence between two expressions is called an identity and is often denoted with

For example, in the expression the variable n is bound, and the variable x is free. This expression is equivalent to the simpler expression 12 x; that is The value for x = 3 is 36, which can be denoted

Syntax versus semantics

Syntax

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. [8]

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

.

is not.

Semantics

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 to designate an internal direct sum.

Formal definition

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

The alphabet consists of:

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

Then is also a WFE.
For instance, if the domain of discorse is the real numbers, can denote the binary operation +, then is a WFE. Or can be the unary operation , then 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. [10] The leaf nodes are always atomic expressions. Operations and have exactly two child nodes, while operations , and have exactly one. There are countably infinitely many WFE's, however, each WFE has a finite number of nodes.

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. [11] [lower-alpha 1] 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

Algebraic expression

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). [12] 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:

See also: Algebraic equation and Algebraic closure

Polynomial expression

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

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

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

In computer science, an expression is a syntactic entity in a programming language that may be evaluated to determine its value [13] or fail to terminate, in which case the expression is undefined. [14] 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 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) x (3 + 1) as a Lisp tree, from a 1985 Master's Thesis Cassidy.1985.015.gif
Representation of the expression (8 − 6) × (3 + 1) as a Lisp tree, from a 1985 Master's Thesis

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

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, is a term built from the constant 1, the variable x, and the binary function symbols and ; it is part of the atomic formula which evaluates to true for each real-numbered value of x.

See also

Notes

  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. McCoy, Neal H. (1960). Introduction To Modern Algebra. Boston: Allyn & Bacon. p. 127. LCCN   68015225.
  4. Fraleigh, John B. (2003). A first course in abstract algebra. Boston : Addison-Wesley. ISBN   978-0-201-76390-4.
  5. 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
  6. Equation. Encyclopedia of Mathematics. URL: http://encyclopediaofmath.org/index.php?title=Equation&oldid=32613
  7. 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
  8. Stoll, Robert R. Set Theory and Logic. San Francisco, CA: Dover Publications. ISBN   978-0-486-63829-4.
  9. 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
  10. Hermes, Hans (1973). Introduction to Mathematical Logic. Springer London. ISBN   3540058192. ISSN   1431-4657.; here: Sect.II.1.3
  11. 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.
  12. Morris, Christopher G. (1992). Academic Press dictionary of science and technology . Gulf Professional Publishing. p.  74. algebraic expression over a field.
  13. Mitchell, J. (2002). Concepts in Programming Languages. Cambridge: Cambridge University Press, 3.4.1 Statements and Expressions, p. 26
  14. Maurizio Gabbrielli, Simone Martini (2010). Programming Languages - Principles and Paradigms. Springer London, 6.1 Expressions, p. 120
  15. 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).

Related Research Articles

<span class="mw-page-title-main">Complex number</span> Number with a real and an imaginary part

In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted i, called the imaginary unit and satisfying the equation ; every complex number can be expressed in the form , where a and b are real numbers. Because no real number satisfies the above equation, i was called an imaginary number by René Descartes. For the complex number ,a is called the real part, and b is called the imaginary part. The set of complex numbers is denoted by either of the symbols or C. Despite the historical nomenclature, "imaginary" complex numbers have a mathematical existence as firm as that of the real numbers, and they are fundamental tools in the scientific description of the natural world.

In mathematics, an equation is a mathematical formula that expresses the equality of two expressions, by connecting them with the equals sign =. The word equation and its cognates in other languages may have subtly different meanings; for example, in French an équation is defined as containing one or more variables, while in English, any well-formed formula consisting of two expressions related with an equals sign is an equation.

First-order logic—also called predicate logic, predicate calculus, quantificational logic—is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantified variables over non-logical objects, and allows the use of sentences that contain variables. Rather than propositions such as "all men are mortal", in first-order logic one can have expressions in the form "for all x, if x is a man, then x is mortal"; where "for all x" is a quantifier, x is a variable, and "... is a man" and "... is mortal" are predicates. This distinguishes it from propositional logic, which does not use quantifiers or relations; in this sense, propositional logic is the foundation of first-order logic.

The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. It deals with propositions and relations between propositions, including the construction of arguments based on them. Compound propositions are formed by connecting propositions by logical connectives representing the truth functions of conjunction, disjunction, implication, biconditional, and negation. Some sources include other connectives, as in the table below.

In mathematics, a polynomial is a mathematical expression consisting of indeterminates and coefficients, that involves only the operations of addition, subtraction, multiplication and exponentiation to nonnegative integer powers, and has a finite number of terms. An example of a polynomial of a single indeterminate x is x2 − 4x + 7. An example with three indeterminates is x3 + 2xyz2yz + 1.

A mathematical symbol is a figure or a combination of figures that is used to represent a mathematical object, an action on mathematical objects, a relation between mathematical objects, or for structuring the other symbols that occur in a formula. As formulas are entirely constituted with symbols of various types, many symbols are needed for expressing all mathematics.

<span class="mw-page-title-main">Equality (mathematics)</span> Relationship asserting that two quantities are the same

In mathematics, equality is a relationship between two quantities or, more generally, two mathematical expressions, asserting that the quantities have the same value, or that the expressions represent the same mathematical object. Equality between A and B is written A = B, and pronounced "A equals B". In this equality, A and B are the members of the equality and are distinguished by calling them left-hand side or left member, and right-hand side or right member. Two objects that are not equal are said to be distinct.

In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a variable may be said to be either free or bound. Some older books use the terms real variable and apparent variable for free variable and bound variable, respectively. A free variable is a notation (symbol) that specifies places in an expression where substitution may take place and is not a parameter of this or any container expression. The idea is related to a placeholder, or a wildcard character that stands for an unspecified symbol.

<span class="mw-page-title-main">Phi</span> Twenty-first letter in the Greek alphabet

Phi is the twenty-first letter of the Greek alphabet.

In set theory and its applications to logic, mathematics, and computer science, set-builder notation is a mathematical notation for describing a set by enumerating its elements, or stating the properties that its members must satisfy.

In mathematical logic, propositional logic and predicate logic, a well-formed formula, abbreviated WFF or wff, often simply formula, is a finite sequence of symbols from a given alphabet that is part of a formal language.

In mathematics, an indeterminate is a variable that is used formally, without reference to any value. In other words, this is just a symbol used in a formal way. Indeterminates occur in polynomials, formal power series, and, more generally, in expressions that are viewed as independent mathematical objects.

In universal algebra and mathematical logic, a term algebra is a freely generated algebraic structure over a given signature. For example, in a signature consisting of a single binary operation, the term algebra over a set X of variables is exactly the free magma generated by X. Other synonyms for the notion include absolutely free algebra and anarchic algebra.

In mathematical logic, a Boolean-valued model is a generalization of the ordinary Tarskian notion of structure from model theory. In a Boolean-valued model, the truth values of propositions are not limited to "true" and "false", but instead take values in some fixed complete Boolean algebra.

In mathematics, a variable is a symbol, typically a letter, that holds a place for constants, often numbers. One say colloqually that the variable represents or denotes the object, and that the object is the value of the variable.

A substitution is a syntactic transformation on formal expressions. To apply a substitution to an expression means to consistently replace its variable, or placeholder, symbols with other expressions.

An interpretation is an assignment of meaning to the symbols of a formal language. Many formal languages used in mathematics, logic, and theoretical computer science are defined in solely syntactic terms, and as such do not have any meaning until they are given some interpretation. The general study of interpretations of formal languages is called formal semantics.

In mathematics, the word constant conveys multiple meanings. As an adjective, it refers to non-variance ; as a noun, it has two different meanings:

In mathematical logic, a term denotes a mathematical object while a formula denotes a mathematical fact. In particular, terms appear as components of a formula. This is analogous to natural language, where a noun phrase refers to an object and a whole sentence refers to a fact.

In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variables are the truth values true and false, usually denoted 1 and 0, whereas in elementary algebra the values of the variables are numbers. Second, Boolean algebra uses logical operators such as conjunction (and) denoted as , disjunction (or) denoted as , and negation (not) denoted as ¬. Elementary algebra, on the other hand, uses arithmetic operators such as addition, multiplication, subtraction, and division. Boolean algebra is therefore a formal way of describing logical operations in the same way that elementary algebra describes numerical operations.

References