Call a function f from ℝᵖ into ℝ^qlinear provided that f(ax + by) = af(x) + bf(y) holds for every pair a, b of reals and every pair x, y of points of ℝᵖ.
這張圖在說定義要求的是什麼:從左上角出發有兩條路——先往右做 f 再往下組合,或先往下組合再往右做 f。線性的意思就是這兩條路的終點永遠相同。加底噪那種處理走不通,因為往下那一步會把底噪也複製一份。
定義寫成一條合併式很緊湊,可是驗算時把它拆開比較省力——而且拆開之後會掉出一個免費的否決工具。
LEMMA
A function f: ℝᵖ → ℝ^q is linear if and only if both of the following hold. (i) f(x + y) = f(x) + f(y) for all x, y ∈ ℝᵖ. (ii) f(ax) = af(x) for all a ∈ ℝ and all x ∈ ℝᵖ. Moreover, every linear function satisfies f(0) = 0.
證明計畫 · 由所求想起 正向:所求是兩條規則。合併式裡的 a 與 b 是我們可以隨意指定的,各挑一組數字把想要的那一條逼出來即可。 逆向:所求是合併式。左邊先按 (i) 切成兩塊,每一塊再各用一次 (ii)。 f(0) = 0 則是 (ii) 取 a = 0 的直接後果。
Proof. Suppose f is linear. Taking a = b = 1 in the defining equation gives f(x + y) = f(x) + f(y), which is (i). Taking b = 0 and y = x gives f(ax) = f(ax + 0x) = af(x) + 0f(x) = af(x), which is (ii).
Conversely, suppose (i) and (ii) hold. For any a, b ∈ ℝ and x, y ∈ ℝᵖ, rule (i) applied to the two points ax and by gives f(ax + by) = f(ax) + f(by), and rule (ii) applied to each term gives f(ax) + f(by) = af(x) + bf(y). Hence f is linear.
這一步的所求:把合併式重新組回來。次序是先切後縮:(i) 只認得「兩個點相加」這個形狀,所以要把 ax 與 by 各自看成一整個點,切完之後再用 (ii) 去處理各自身上的係數。反過來先用 (ii) 是不行的,因為 ax + by 整體並不是某個點的純量倍。
Finally, apply (ii) with a = 0 and any x ∈ ℝᵖ: f(0) = f(0x) = 0f(x) = 0.
最後這一句只有一行,用途卻很大。0 這個向量可以寫成任何點的 0 倍,於是 (ii) 直接把它的像壓成零向量。之後只要看到一個函數把原點送去別處,一秒就判它不是線性——不必再去湊 a 與 b。
Assume the assertion holds for some n ∈ ℕ. Given a₁, ⋯, a_{n+1} and x₁, ⋯, x_{n+1}, put s = a₁x₁ + ⋯ + aₙxₙ, a single element of ℝᵖ. By rule (i), f(s + a_{n+1}x_{n+1}) = f(s) + f(a_{n+1}x_{n+1}).
By the induction hypothesis f(s) = a₁f(x₁) + ⋯ + aₙf(xₙ), and by rule (ii) f(a_{n+1}x_{n+1}) = a_{n+1}f(x_{n+1}). Adding the two gives the assertion for n + 1, and the induction is complete.