Special Characters: Mathematical and Other Notation

Built into the Wolfram Language are a large number of special characters intended for use in mathematical and other notation. "Listing of Named Characters" gives a complete listing.

Each special character is assigned a full name such as (RefLink[\[Infinity], paclet:ref/character/Infinity]). More common special characters are also assigned aliases, such as Esc inf Esc. You can set up additional aliases using the (RefLink[InputAliases, paclet:ref/InputAliases]) notebook option discussed in "Options for Expression Input and Output".

For special characters that are supported in standard dialects of TeX, the Wolfram Language also allows you to use aliases based on TeX names. Thus, for example, you can enter (RefLink[\[Infinity], paclet:ref/character/Infinity]) using the alias Esc \infty Esc. The Wolfram Language also supports aliases such as Esc ∞ Esc based on names used in SGML and HTML.

Standard system software on many computer systems also supports special key combinations for entering certain special characters. On a Macintosh, for example, Option+5 will produce ∞ in most fonts. With the notebook front end the Wolfram System automatically allows you to use special key combinations when these are available, and with a text-based interface you can get the Wolfram System to accept such key combinations if you set an appropriate value for (RefLink[$CharacterEncoding, paclet:ref/$CharacterEncoding]).

Ways to enter special characters.

In a Wolfram System notebook, you can use special characters just like you use standard keyboard characters. You can include special characters both in ordinary text and in input that you intend to give to the Wolfram System.

Some special characters are set up to have an immediate meaning to the Wolfram System. Thus, for example, π is taken to be the symbol (RefLink[Pi, paclet:ref/Pi]). Similarly, ≥ is taken to be the operator >=, while ⋃ is equivalent to the function (RefLink[Union, paclet:ref/Union]).

π and ≥ have immediate meanings in the Wolfram System:

π ≥ 3

⋃ or ∖[Union] is immediately interpreted as the (RefLink[Union, paclet:ref/Union]) function:

{a,b,c} ⋃ {c,d,e}

⊔ or ∖[SquareUnion] has no immediate meaning to the Wolfram System:

{a,b,c} ⊔ {c,d,e}

Among ordinary characters such as (RefLink[E, paclet:ref/E]) and i, some have an immediate meaning to the Wolfram System, but most do not. And the same is true of special characters.

Thus, for example, while π and ∞ have an immediate meaning to the Wolfram System, λ and ℒ do not.

This allows you to set up your own definitions for λ and ℒ.

λ has no immediate meaning in the Wolfram System:

λ[2]+λ[3]

This defines a meaning for λ:

λ[x_]:=(Sqrt[(x^2)-1])

Now the Wolfram System evaluates λ just as it would any other function:

λ[2]+λ[3]

Characters such as λ and ℒ are treated by the Wolfram System as letters—just like ordinary keyboard letters like a or b.

But characters such as ⊕ and ⊔ are treated by the Wolfram System as operators. And although these particular characters are not assigned any built-in meaning by the Wolfram System, they are nevertheless required to follow a definite syntax.

⊔ is an infix operator:

{a,b,c} ⊔ {c,d,e}

The definition assigns a meaning to the ⊔ operator:

x_ ⊔ y_:=Join[x,y]

Now ⊔ can be evaluated by the Wolfram System:

{a,b,c} ⊔ {c,d,e}

The details of how input you give to the Wolfram System is interpreted depends on whether you are using (RefLink[StandardForm, paclet:ref/StandardForm]) or (RefLink[TraditionalForm, paclet:ref/TraditionalForm]), and on what additional information you supply in (RefLink[InterpretationBox, paclet:ref/InterpretationBox]) and similar constructs.

But unless you explicitly override its built-in rules by giving your own definitions for (RefLink[MakeExpression, paclet:ref/MakeExpression]), the Wolfram System will always assign the same basic syntactic properties to any particular special character.

These properties not only affect the interpretation of the special characters in Wolfram System input, but also determine the structure of expressions built with these special characters. They also affect various aspects of formatting; operators, for example, have extra space left around them, while letters do not.

Types of special characters.

In using special characters, it is important to make sure that you have the correct character for a particular purpose. There are quite a few examples of characters that look similar, yet are in fact quite different.

A common issue is operators whose forms are derived from letters. An example is ∑ or (RefLink[\[Sum], paclet:ref/character/Sum]), which looks very similar to Σ or (RefLink[\[CapitalSigma], paclet:ref/character/CapitalSigma]).

As is typical, however, the operator form ∑ is slightly less elaborate and more stylized than the letter form Σ. In addition, ∑ is an extensible character that grows depending on the summand, while Σ has a size determined only by the current font.

Different characters that look similar.

In cases such as (RefLink[\[CapitalAlpha], paclet:ref/character/CapitalAlpha]) versus A, both characters are letters. However, the Wolfram System treats these characters as different, and in some fonts, for example, they may look quite different.

The result contains four distinct characters:

Union[{Α,A,A,μ,μ,µ}]

Traditional mathematical notation occasionally uses ordinary letters as operators. An example is the d in a differential such as dx that appears in an integral.

To make the Wolfram System have a precise and consistent syntax, it is necessary at least in (RefLink[StandardForm, paclet:ref/StandardForm]) to distinguish between an ordinary d and the d used as a differential operator.

The way the Wolfram System does this is to use a special character d or (RefLink[\[DifferentialD], paclet:ref/character/DifferentialD]) as the differential operator. This special character can be entered using the alias Esc dd Esc.

The Wolfram System uses a special character for the differential operator, so there is no conflict with an ordinary d:

∫(x^d)\[DifferentialD]x

When letters and letter-like forms appear in Wolfram System input, they are typically treated as names of symbols. But when operators appear, functions must be constructed that correspond to these operators. In almost all cases, what the Wolfram System does is to create a function whose name is the full name of the special character that appears as the operator.

The Wolfram System constructs a (RefLink[CirclePlus, paclet:ref/CirclePlus]) function to correspond to the operator ⊕, whose full name is ∖[CirclePlus]:

a ⊕ b ⊕ c//FullForm

This constructs an (RefLink[And, paclet:ref/And]) function, which happens to have built-in evaluation rules in the Wolfram System:

a ∧ b ∧ c//FullForm

Following the correspondence between operator names and function names, special characters such as ⋃ that represent built-in Wolfram System functions have names that correspond to those functions. Thus, for example, ÷ is named (RefLink[\[Divide], paclet:ref/character/Divide]) to correspond to the built-in Wolfram System function (RefLink[Divide, paclet:ref/Divide]), and => is named (RefLink[\[Implies], paclet:ref/character/Implies]) to correspond to the built-in function (RefLink[Implies, paclet:ref/Implies]).

In general, however, special characters in the Wolfram Language are given names that are as generic as possible, so as not to prejudice different uses. Most often, characters are thus named mainly according to their appearance. The character ⊕ is therefore named (RefLink[\[CirclePlus], paclet:ref/character/CirclePlus]), rather than, say \[DirectSum], and ≈ is named (RefLink[\[TildeTilde], paclet:ref/character/TildeTilde]) rather than, say, \[ApproximatelyEqual].

Different operator characters that look similar.

There are sometimes characters that look similar but that are used to represent different operators. An example is (RefLink[\[Times], paclet:ref/character/Times]) and (RefLink[\[Cross], paclet:ref/character/Cross]). (RefLink[\[Times], paclet:ref/character/Times]) corresponds to the ordinary (RefLink[Times, paclet:ref/Times]) function for multiplication; (RefLink[\[Cross], paclet:ref/character/Cross]) corresponds to the (RefLink[Cross, paclet:ref/Cross]) function for vector cross products. The × for (RefLink[\[Cross], paclet:ref/character/Cross]) is drawn slightly smaller than × for (RefLink[\[Times], paclet:ref/character/Times]), corresponding to usual careful usage in mathematical typography.

The (RefLink[\[Times], paclet:ref/character/Times]) operator represents ordinary multiplication:

{5,6,7} × {2,3,1}

The (RefLink[\[Cross], paclet:ref/character/Cross]) operator represents vector cross products:

{5,6,7} \[Cross] {2,3,1}

The two operators display in a similar way—with (RefLink[\[Times], paclet:ref/character/Times]) slightly larger than (RefLink[\[Cross], paclet:ref/character/Cross]):

{a × b,a \[Cross] b}

In the example of (RefLink[\[And], paclet:ref/character/And]) and (RefLink[\[Wedge], paclet:ref/character/Wedge]), the (RefLink[\[And], paclet:ref/character/And]) operator—which happens to be drawn slightly larger—corresponds to the built-in Wolfram System function (RefLink[And, paclet:ref/And]), while the (RefLink[\[Wedge], paclet:ref/character/Wedge]) operator has a generic name based on the appearance of the character and has no built-in meaning.

You can mix ∖[Wedge] and ∖[And] operators. Each has a definite precedence:

a ⋀ b ∧ c ⋀ d//FullForm

Some of the special characters commonly used as operators in mathematical notation look similar to ordinary keyboard characters. Thus, for example, ⋀ or ∖[Wedge] looks similar to the ^ character on a standard keyboard.

The Wolfram System interprets a raw ^ as a power. But it interprets ⋀ as a generic (RefLink[Wedge, paclet:ref/Wedge]) function. In cases such as this where there is a special character that looks similar to an ordinary keyboard character, the convention is to use the ordinary keyboard character as the alias for the special character. Thus, for example, Esc ^ Esc is the alias for (RefLink[\[Wedge], paclet:ref/character/Wedge]).

The raw ^ is interpreted as a power, but the Esc ^ Esc is a generic wedge operator:

{x ^ y, x Esc ^ Esc y}

A related convention is that when a special character is used to represent an operator that can be typed using ordinary keyboard characters, those characters are used in the alias for the special character. Thus, for example, Esc -> Esc is the alias for -> or (RefLink[\[Rule], paclet:ref/character/Rule]), while Esc && Esc is the alias for ∧ or (RefLink[\[And], paclet:ref/character/And]).

Esc -> Esc is the alias for (RefLink[\[Rule], paclet:ref/character/Rule]), and Esc && Esc for (RefLink[\[And], paclet:ref/character/And]):

{x Esc -> Esc y, x Esc && Esc y} // FullForm

The most extreme case of characters that look alike but work differently occurs with vertical bars.

Different types of vertical bars.

Notice that the alias for (RefLink[\[VerticalBar], paclet:ref/character/VerticalBar]) is Esc ␣| Esc, while the alias for the somewhat more common (RefLink[\[VerticalSeparator], paclet:ref/character/VerticalSeparator]) is Esc | Esc. The Wolfram Language often gives similar-looking characters similar aliases; it is a general convention that the aliases for the less commonly used characters are distinguished by having spaces at the beginning.

Conventions for special character aliases.

The notebook front end for the Wolfram System often allows you to set up your own aliases for special characters. If you want to, you can overwrite the built-in aliases. But the convention is to use aliases that begin with a dot or comma.

Note that whatever aliases you may use to enter special characters, the full names of the characters will always be used when the characters are stored in files.