함수 및 사상

함수 표기법, 사상, 합성 및 정의역/공역.

Function composition and isomorphism in LaTeX

Function composition in LaTeX is \circ, as in g \circ f, and the isomorphism symbol in LaTeX is \cong (≅), with \simeq for a weaker equivalence; all three are built in. A function is declared with f \colon A \to B, where \colon gets the spacing right, and its rule with \mapsto, as in x \mapsto x^2. The identity map is \operatorname{id} from amsmath. The table lists the function and mapping commands people use most, with the package each one needs; the full list of symbols follows below.

SymbolCommandUsePackageCopy
f ⁣:A→Bf \colon A \to B
f \colon A \to BFunction from A to Bbuilt in
x↦x2x \mapsto x^2
x \mapsto x^2Maps to (function rule)built in
g∘fg \circ f
g \circ fComposition, g after fbuilt in
f−1f^{-1}
f^{-1}Inverse functionbuilt in
≅\cong
\congIsomorphic tobuilt in
≃\simeq
\simeqHomotopy equivalent, weak isomorphismbuilt in
→∼\xrightarrow{\sim}
\xrightarrow{\sim}Isomorphism arrowamsmath
id⁡A\operatorname{id}_A
\operatorname{id}_AIdentity mapamsmath
↪\hookrightarrow
\hookrightarrowInjection, inclusionbuilt in
↠\twoheadrightarrow
\twoheadrightarrowSurjectionamssymb
f∣Af|_A
f|_ARestriction to Abuilt in

Injections, surjections and named functions

The inverse is f^{-1} and restriction to a subset is f|_A. Injections and surjections get their own arrows, \hookrightarrow and \twoheadrightarrow (the latter from amssymb), and an isomorphism arrow is \xrightarrow{\sim}. Standard functions such as \sin, \log, \exp, \lim and \ker are built in and typeset upright with correct spacing. Anything else (image, domain, support, sign) should be wrapped in amsmath’s \operatorname{Im} or declared once with \DeclareMathOperator{\dom}{dom}; plain Im(f) would be set as the product of two italic variables. Piecewise definitions use the amsmath cases environment.

Load \usepackage{amsmath, amssymb} for \operatorname, \xrightarrow, cases and \twoheadrightarrow. Our guide to math functions in LaTeX covers operators, limits and function spacing in more depth, and the arrow symbols page lists every mapping arrow.

Frequently asked questions

How do I write function composition in LaTeX?
Use \circ, which is built in: $g \circ f$ prints g ∘ f, read “g after f”. Write (g \circ f)(x) = g(f(x)) for the rule. Do not use a lowercase o or \cdot, which have the wrong size and spacing.
How do I write the isomorphism symbol in LaTeX?
The standard isomorphism symbol ≅ is \cong, built in: $G \cong H$. For a homotopy equivalence or weaker notion use \simeq (≃), and for an arrow that is an isomorphism use \xrightarrow{\sim} from amsmath, or \cong placed over an arrow with \xrightarrow{\cong}.
How do I write f: A → B in LaTeX?
Write f \colon A \to B. The \colon command gives the spacing of punctuation; a plain colon is spaced like a relation and leaves too much room before A. Use \mapsto for the rule, as in x \mapsto x^2.
f(x)f(x)
f:A→Bf: A \to B
↦\mapsto

Maps To

\mapsto
→\to
⟶\longrightarrow

Long Right Arrow

\longrightarrow
f∘gf \circ g

Composition

f \circ g
f−1f^{-1}
Im(f)\text{Im}(f)

Image

\text{Im}(f)
ker⁡(f)\ker(f)

Kernel

\ker(f)
dom(f)\text{dom}(f)

Domain

\text{dom}(f)
cod(f)\text{cod}(f)

Codomain

\text{cod}(f)
range(f)\text{range}(f)

Range

\text{range}(f)
↪\hookrightarrow

Injective

\hookrightarrow
↠\twoheadrightarrow

Surjective

\twoheadrightarrow
↔\leftrightarrow

Bijective

\leftrightarrow
f∣Af|_A
f(x)=yf(x) = y
f(x)={ax>0bx≤0f(x) = \begin{cases} a & x > 0 \\ b & x \leq 0 \end{cases}

Piecewise Function

f(x) = \begin{cases} a & x > 0 \\ b & x \leq 0 \end{cases}