# 绝对值

**绝对值**（也称模）是实数、复数或向量的量值，不计其符号，用竖线写作 |x|、|z| 或 |v|，且始终非负<sup>[1](https://www.britannica.com/science/absolute-value)</sup>。对实数 x 而言，它是数轴上 x 到零的距离：当 x ≥ 0 时 |x| = x，当 x < 0 时 |x| = −x<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup><sup> • </sup><sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup>。同样的记号与同样的核心性质可推广到复数和域上<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup>。

| 关键事实 | 细节 |
|---|---|
| 实数定义 | 若 x ≥ 0 则 \( |x| = x \)，若 x < 0 则 \( |x| = -x \)；等价地 \( |x| = \sqrt{x^2} \)<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup><sup> • </sup><sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup> |
| 复模 | 对 z = x + iy，\( |z| = \sqrt{x^2 + y^2} \)，即复平面上到原点的距离<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup><sup> • </sup><sup>[1](https://www.britannica.com/science/absolute-value)</sup> |
| 中心不等式 | \( |a| - |b| \le |a+b| \le |a| + |b| \)，即双边三角不等式<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup> |
| 代数法则 | \( |a| = |-a| \)、\( |ab| = |a|\,|b| \)，以及当 b ≠ 0 时 \( |a/b| = |a|/|b| \)<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup> |
| p进绝对值 | \( |x|_p = p^{-v_p(x)} \)，故 \( |p|_p = 1/p \)；对每个非零有理数 x 成立乘积公式 \( |x|_\infty \cdot \prod_p |x|_p = 1 \)<sup>[4](https://kskedlaya.org/18.787/absolute-values.pdf)</sup><sup> • </sup><sup>[5](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)</sup> |
| 奥斯特罗夫斯基定理 | 在等价意义下，Q 上的非平凡绝对值恰好是通常的阿基米德绝对值与 p进绝对值，每个素数对应一个 p进绝对值<sup>[6](https://kconrad.math.uconn.edu/blurbs/gradnumthy/ostrowskinumbfield.pdf)</sup> |
| 记号 | 卡尔·魏尔斯特拉斯（Karl Weierstrass，1815–1897）在1841年的论文《论幂级数理论》（"Zur Theorie der Potenzreihen"）中引入了竖线记号<sup>[7](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/functions/)</sup> |

## 定义与基本性质

分段定义之所以可行，是因为每个实数要么非负要么为负，而两种情形下公式都返回去掉符号后的数：正数原样保留，负数 x 则替换为 −x，即正数。两支在 0 处相接，此处 |0| = 0<sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup>。

同一函数可不作分情形讨论而写成 \( |x| = \sqrt{x^2} \)<sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup>。这一恒等式也是一个常见代数错误的根源：把 \( \sqrt{x^2} \) 简化为 x 仅在 x ≥ 0 时成立。对一切实数 x，正确的化简是 \( \sqrt{x^2} = |x| \)；例如 \( \sqrt{(-5)^2} = \sqrt{25} = 5 = |-5| \)，而非 −5<sup>[8](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/19%3A_Absolute_Value_Functions/19.01%3A_The_Absolute_Value_Function)</sup>。

在抽象代数层面，域 k 上的绝对值是一个映射 \( |\cdot| : k \to \mathbb{R}_{\ge 0} \)，满足三个条件：\( |x| = 0 \) 当且仅当 x = 0；乘法性，\( |xy| = |x|\,|y| \)；以及三角不等式，\( |x+y| \le |x| + |y| \)<sup>[9](https://math.mit.edu/classes/18.785/2025/LectureNotes1.pdf)</sup>。由此可推出 \( |a| = |-a| \)、当 b ≠ 0 时的商法则 \( |a/b| = |a|/|b| \)，以及双边形式 \( |a| - |b| \le |a+b| \le |a| + |b| \)<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup>。

## 几何解释

从几何上看，实数的绝对值是它到原点的位移，这正是它始终非负的原因<sup>[1](https://www.britannica.com/science/absolute-value)</sup>。f(x) = |x| 的图像定义域为全体实数，值域为 \( [0, \infty) \)，由两条射线 y = x（x ≥ 0 时）与 y = −x（x < 0 时）在称为顶点的尖角处相接而成<sup>[8](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/19%3A_Absolute_Value_Functions/19.01%3A_The_Absolute_Value_Function)</sup>。

对复数 z = x + iy，其模为 \( |z| = \sqrt{x^2 + y^2} \)<sup>[2](https://encyclopediaofmath.org/wiki/Absolute_value)</sup>。把 z 视为复平面上的有序对 (a, b) 时，由勾股定理，这恰是 z 到原点的距离<sup>[1](https://www.britannica.com/science/absolute-value)</sup>。同样的构造给出四元数 H 上的范数：\( |x| = \sqrt{x \cdot \bar{x}} \)<sup>[10](https://encyclopediaofmath.org/wiki/Norm_on_a_field)</sup>。

## 三角不等式与度量

三角不等式 \( |x+y| \le |x| + |y| \) 是使绝对值可用作大小度量的性质：它说和的大小不超过大小之和，即“直路不长于绕路”的数值表述。它是域上绝对值三条定义公理之一<sup>[9](https://math.mit.edu/classes/18.785/2025/LectureNotes1.pdf)</sup>，大英百科全书也将其列为该记号所遵循的基本性质之一<sup>[1](https://www.britannica.com/science/absolute-value)</sup>。

任何绝对值都通过 \( d(x, y) = |x - y| \) 在其域上诱导一个度量，从而诱导度量拓扑<sup>[11](https://users.math.msu.edu/users/ruiterj2/math/Documents/Notes%20and%20talks/Ostrowski%27s%20Theorem.pdf)</sup>。这就是代数定义与几何之间的联系：实数轴、复平面以及更抽象环境中的距离，都是差的绝对值。

有时成立更强的条件：\( |x+y| \le \max(|x|, |y|) \)，即超度量不等式。满足它的绝对值称为非阿基米德的；否则称为阿基米德的<sup>[9](https://math.mit.edu/classes/18.785/2025/LectureNotes1.pdf)</sup>。通常的绝对值是阿基米德的；下文描述的 p进绝对值是非阿基米德的。

## 推广：范数与 p进绝对值

在一般域上，范数（也称绝对值或乘法赋值）是满足上述公理、且 φ(x) ≥ 0、仅当 x = 0 时 φ(x) = 0 的函数 φ<sup>[10](https://encyclopediaofmath.org/wiki/Norm_on_a_field)</sup>。在向量空间上，这一概念更为宽泛：赋值域 F 上的向量空间 V 上的范数是一个函数 \( |\cdot|_V : V \to [0, +\infty) \)，满足正定性、次可加性与齐次性 \( |fx|_V = |f|\,|x|_V \)<sup>[4](https://kskedlaya.org/18.787/absolute-values.pdf)</sup>。当 F 完备时，有限维 F向量空间上任何两个与 |·| 相容的范数都等价<sup>[4](https://kskedlaya.org/18.787/absolute-values.pdf)</sup>。

**p进绝对值。** 每个有理数 x 都有 p进赋值 \( v_p(x) \)，即素数 p 整除 x 的幂次。取指数得 \( |x|_p = p^{-v_p(x)} \)；任何底数 0 < b < 1 都会给出等价的绝对值，但标准选择取 b = p<sup>−1</sup>，以使乘积公式成立<sup>[5](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)</sup><sup> • </sup><sup>[4](https://kskedlaya.org/18.787/absolute-values.pdf)</sup>。对既约分数 x = a/b，若 a、b 均不被 p 整除则 \( |x|_p = 1 \)；若 a 被 p 整除一次则 \( |x|_p = p^{-1} \)；若 b 被 p 整除一次则 \( |x|_p = p \)；特别地 \( |p|_p = p^{-1} \)<sup>[5](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)</sup>。

**奥斯特罗夫斯基分类。** 奥斯特罗夫斯基（Ostrowski）于1916年证明，在等价意义下，Q 上的非平凡绝对值分为两类：标准的阿基米德绝对值，以及每个素数 p 对应一个 p进绝对值，且任意两者互不等价<sup>[6](https://kconrad.math.uconn.edu/blurbs/gradnumthy/ostrowskinumbfield.pdf)</sup>。这给出 Q 的无穷多个位，每个素数对应一个 p进位，外加一个阿基米德位，后者有时称为“无穷远素数”<sup>[5](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)</sup>。阿基米德情形说的是 Q 上任何非平凡阿基米德绝对值都等价于 \( |\cdot|_\infty \)<sup>[11](https://users.math.msu.edu/users/ruiterj2/math/Documents/Notes%20and%20talks/Ostrowski%27s%20Theorem.pdf)</sup>，而域上的阿基米德范数在嵌入稠密子域的意义下，等价于由 R、C 或 H 诱导的范数<sup>[10](https://encyclopediaofmath.org/wiki/Norm_on_a_field)</sup>。关于分类的年份，文献说法不一：康拉德（Conrad）的讲义定为1916年<sup>[6](https://kconrad.math.uconn.edu/blurbs/gradnumthy/ostrowskinumbfield.pdf)</sup>，而一篇 arXiv 论文在其定理版本中写作“奥斯特罗夫斯基，1918”<sup>[12](https://arxiv.org/pdf/0903.2615)</sup>。乘积公式把各个位联系起来：对任何非零有理数 x，\( |x|_\infty \cdot \prod_p |x|_p = 1 \)<sup>[5](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)</sup>。

## 相关概念及其区别

竖线记号承载了多重含义。它常用于复模、p进范数、一般赋值和向量范数<sup>[13](https://mathworld.wolfram.com/AbsoluteValue.html)</sup>。这些区别在实践中很重要：

- **符号**是绝对值丢弃的那部分信息；|x| 只恢复量值。
- **量值**是绝对值所度量的东西的日常说法，适用于实数、复数或向量<sup>[1](https://www.britannica.com/science/absolute-value)</sup>。
- **范数**把绝对值推广到向量和域；双竖线 \( \|v\| \) 约定用于向量范数，单竖线用于数。
- **距离**是作用于差的绝对值，d(x, y) = |x − y|<sup>[11](https://users.math.msu.edu/users/ruiterj2/math/Documents/Notes%20and%20talks/Ostrowski%27s%20Theorem.pdf)</sup>。

在统计学与机器学习中，同样的区分表现为 L1 与 L2：MSE 与 MAE 分别是均方误差与平均绝对误差，对应平方 L2（欧几里得）范数与 L1（曼哈顿）范数<sup>[14](https://gmd.copernicus.org/articles/15/5481/2022/gmd-15-5481-2022.html)</sup>。

## 用数字说话

两种标准误差度量定义为

\[ \mathrm{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i|, \qquad \mathrm{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2}. \]

MAE 是预测值与观测值之差的绝对值的平均<sup>[14](https://gmd.copernicus.org/articles/15/5481/2022/gmd-15-5481-2022.html)</sup>。两者由一个界联系起来：RMSE 的下限等于 MAE，在所有误差量值相同时达到；上限为 \( \sqrt{n} \times \mathrm{MAE} \)，在所有误差集中于单个数据值时达到<sup>[15](https://eos.org/opinions/climate-and-other-models-may-be-more-accurate-than-reported)</sup>。由于 RMSE 相对 MAE 的上界随误差个数的平方根（\( n^{1/2} \)）增长，威尔莫特（Willmott）与松浦（Matsuura）认为 MAE 是更自然、更无歧义的平均误差度量<sup>[16](https://www.int-res.com/journals/cr/articles/cr030079)</sup>。

损失函数的选择编码了误差模型。MAE 可解释为误差服从拉普拉斯分布时的负对数似然，而 MSE 对应高斯误差<sup>[17](https://arxiv.org/html/2008.07281)</sup>。这是1920年一场交流的现代形式：费希尔（Fisher）证明对正态误差而言最小化平方误差在理论上最优，而爱丁顿（Eddington）得以加注一条脚注，指出最小化绝对误差在实践中往往更好，因为真实观测包含偏离正态分布的离群值<sup>[14](https://gmd.copernicus.org/articles/15/5481/2022/gmd-15-5481-2022.html)</sup>。

p进归一化本身就是一个定量陈述：选择 \( |p|_p = 1/p \) 是为了使对每个非零有理数 x 都有 \( |x|_\infty \cdot \prod_p |x|_p = 1 \)<sup>[4](https://kskedlaya.org/18.787/absolute-values.pdf)</sup><sup> • </sup><sup>[5](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)</sup>。

## 应用

**模型评估与稳健统计。** 根据上述费希尔–爱丁顿交流，MAE 因能容忍离群值而被视为一种稳健的估计形式<sup>[14](https://gmd.copernicus.org/articles/15/5481/2022/gmd-15-5481-2022.html)</sup>。对常数预测 θ，平均绝对误差为 \( L(\theta, \mathbf{y}) = \frac{1}{n} \sum_{i=1}^{n} |y_i - \theta| \)<sup>[18](https://learningds.org/ch/04/modeling_loss_functions.html)</sup>，使其最小的常数是中位数，而均值最小化均方误差<sup>[19](https://notes.eecs245.org/introduction-to-supervised-learning/comparing-loss-functions/)</sup>。在深度学习中，作为向量到向量回归损失的 MAE 是利普希茨连续的，这保证了加性噪声下损失的广义上界；MSE 不具备这一性质，因为它不是利普希茨连续的<sup>[17](https://arxiv.org/html/2008.07281)</sup>。

**可微性与优化。** 绝对值函数在零点不可微，因为其最小值处有尖角，这给基于梯度的优化带来困难，并促成了 L1 正则化模型中的次梯度方法<sup>[8](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/19%3A_Absolute_Value_Functions/19.01%3A_The_Absolute_Value_Function)</sup><sup> • </sup><sup>[20](https://ai-terms-glossary.com/item/absolute-value-function/)</sup>。在 L1 正则化（Lasso）中，模型系数的绝对值被加入损失，使部分系数收缩为零，从而实现自动特征选择<sup>[20](https://ai-terms-glossary.com/item/absolute-value-function/)</sup>。在复数上情况更为严峻：绝对值的导数依赖于求导方向，因此柯西–黎曼方程不可能成立，该函数处处不是复可微的，尽管沿实轴的实导数在非零点存在<sup>[13](https://mathworld.wolfram.com/AbsoluteValue.html)</sup>。

**计算。** MATLAB 的 abs 返回输入各元素的绝对值，对复数输入返回复模；abs(-0) 返回 0<sup>[21](https://www.mathworks.com/help/matlab/ref/double.abs.html)</sup>。在 C++ 中，标准库通过 std::abs 与 std::fabs 重载计算浮点绝对值，自 C++23 起为所有 cv 非限定浮点类型增加了重载<sup>[22](https://cppreference.com/cpp/numeric/math/fabs)</sup>。std::fabs 返回的值是精确的，不依赖任何舍入模式，且该函数不受 math_errhandling 中规定的错误条件影响<sup>[22](https://cppreference.com/cpp/numeric/math/fabs)</sup>。

## 解方程与不等式

解绝对值方程的基础是：若 \( |p| = b \) 且 b > 0，则 p = −b 或 p = b<sup>[23](https://tutorial.math.lamar.edu/classes/alg/SolveAbsValueEqns.aspx)</sup>：量值为 b 的量位于数轴上的两个点之一。不等式则按方向拆分。形如 \( |x - 3| \le 9 \) 的界表示 x 到 3 的距离至多为 9，故可改写为复合不等式 \( -9 \le x - 3 \le 9 \)，得 \( -6 \le x \le 12 \)<sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup>。

两个陷阱造成了大多数错误。第一，写在竖线外的负号不会被去掉：\( -|-6| = -6 \)，因为先求绝对值，再取负<sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup>。第二，\( |a+b| \) 一般不等于 \( |a| + |b| \)；三角不等式以右边界定左边，但等号仅在特殊情形下成立<sup>[3](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)</sup>。绝对值竖线也不是括号，在许多情形下行为并不像括号<sup>[23](https://tutorial.math.lamar.edu/classes/alg/SolveAbsValueEqns.aspx)</sup>。

## 历史

在专用符号出现之前，作者们用文字表达这一概念，如“取……的绝对值”之类的说法<sup>[24](https://link.springer.com/content/pdf/10.1007/s00407-020-00266-9.pdf)</sup>。J. R. 阿尔冈（J. R. Argand）于1806年（1814年又有进一步发表）为复数的绝对值引入“模”（module）一词，卡尔·魏尔斯特拉斯于1841年引入竖线记号 |z|<sup>[25](https://functions.wolfram.com/ComplexComponents/Abs/introductions/ComplexComplements/01/ShowAll.html)</sup>。魏尔斯特拉斯（1815–1897）在其1841年论文《论幂级数理论》中使用了竖线<sup>[7](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/functions/)</sup>，该文从第一页起就一贯地用这个符号表示绝对值，即在代数表达式前后各加一条竖线<sup>[24](https://link.springer.com/content/pdf/10.1007/s00407-020-00266-9.pdf)</sup>。此后该符号被标准化：ISO 80000-2:2019 将竖线收入其数学符号与记号目录，用以表示实数的绝对值<sup>[26](https://cdn.standards.iteh.ai/samples/23602/89e2d877cbab4426bd935f12ac4d8bf9/ISO-80000-2-2019.pdf)</sup>。

## References

1. [Absolute value, Encyclopaedia Britannica](https://www.britannica.com/science/absolute-value)
2. [Absolute value, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Absolute_value)
3. [2.10: The Absolute Value of a Number, Mathematics LibreTexts](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/02%3A_Arithmetic/2.10%3A_The_Absolute_Value_of_a_Number)
4. [Kiran Kedlaya, 18.787 notes: Absolute values on fields and norms on vector spaces](https://kskedlaya.org/18.787/absolute-values.pdf)
5. [Berkeley number fields notes: Absolute values and Ostrowski's theorem](https://math.berkeley.edu/~avizeff/Fermat/number-fields.pdf)
6. [Keith Conrad, Ostrowski for number fields](https://kconrad.math.uconn.edu/blurbs/gradnumthy/ostrowskinumbfield.pdf)
7. [Earliest Uses of Function Symbols, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/functions/)
8. [19.1: The Absolute Value Function, Mathematics LibreTexts](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/19%3A_Absolute_Value_Functions/19.01%3A_The_Absolute_Value_Function)
9. [MIT 18.785 Lecture Notes 1: Absolute values on fields](https://math.mit.edu/classes/18.785/2025/LectureNotes1.pdf)
10. [Norm on a field, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Norm_on_a_field)
11. [Ostrowski's Theorem and Completions of Fields, MSU notes](https://users.math.msu.edu/users/ruiterj2/math/Documents/Notes%20and%20talks/Ostrowski%27s%20Theorem.pdf)
12. [arXiv paper on moduli and Ostrowski's theorem](https://arxiv.org/pdf/0903.2615)
13. [Absolute Value, Wolfram MathWorld](https://mathworld.wolfram.com/AbsoluteValue.html)
14. [Root-mean-square error (RMSE) or mean absolute error (MAE): when to use them or not, Geoscientific Model Development (2022)](https://gmd.copernicus.org/articles/15/5481/2022/gmd-15-5481-2022.html)
15. [Climate and Other Models May Be More Accurate Than Reported, Eos](https://eos.org/opinions/climate-and-other-models-may-be-more-accurate-than-reported)
16. [Advantages of the mean absolute error (MAE) over the root mean square error (RMSE), Climate Research](https://www.int-res.com/journals/cr/articles/cr030079)
17. [On Mean Absolute Error for Deep Neural Network Based Vector-to-Vector Regression, arXiv](https://arxiv.org/html/2008.07281)
18. [4.2. Minimizing Loss, Learning Data Science](https://learningds.org/ch/04/modeling_loss_functions.html)
19. [1.4. Comparing Loss Functions, EECS 245 Course Notes](https://notes.eecs245.org/introduction-to-supervised-learning/comparing-loss-functions/)
20. [What is an Absolute Value Function, AI Terms Glossary](https://ai-terms-glossary.com/item/absolute-value-function/)
21. [abs - Absolute value and complex magnitude, MATLAB documentation](https://www.mathworks.com/help/matlab/ref/double.abs.html)
22. [std::abs, std::fabs, cppreference.com](https://cppreference.com/cpp/numeric/math/fabs)
23. [Algebra - Absolute Value Equations, Paul's Online Notes](https://tutorial.math.lamar.edu/classes/alg/SolveAbsValueEqns.aspx)
24. [The development of the concept of uniform convergence in Karl Weierstrass's lectures and publications, Archive for History of Exact Sciences](https://link.springer.com/content/pdf/10.1007/s00407-020-00266-9.pdf)
25. [Absolute value function: Introduction to the complex components, Wolfram Functions](https://functions.wolfram.com/ComplexComponents/Abs/introductions/ComplexComplements/01/ShowAll.html)
26. [ISO 80000-2:2019, Quantities and units, Part 2: Mathematical signs and symbols (sample)](https://cdn.standards.iteh.ai/samples/23602/89e2d877cbab4426bd935f12ac4d8bf9/ISO-80000-2-2019.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/absolute-value

English original: https://www.edgepedia.org/absolute-value
