Function은 흔히 mapping(사상), transformation(변환)이라는 용어로 불리기도 함.
set으로 정의한다면,
- domain(정의역: 일종의 set)의 각 element에 대해
- co-domain(공역: 역시 일종의 set)의 elements 중 오직 하나 로 대응시키는
- Relation(or mapping)의 일종 ▶ 함수를 두 set(집합) 사이의 일종의 relation 으로 정의.
특정한 입력이 주어지면 거기에 따른 출력이 나오는 (maps to) 입출력 장치라고 볼 수 있음.
Programming Language에서의 Function의 정의는 다음을 참고.
https://dsaint31.tistory.com/506
[Python] Function Definition, Call and Arguments
이 문서는 function에 대한 간단한 소개를 하고 있다. 일부 자세한 내용들은 관련 URL을 추가하는 형태로 확장될 수 있음. Function이란 재사용성과 가독성을 위해 논리적으로 코드를 나누는(or 그룹짓
dsaint31.tistory.com
1. 수학적 정의
두 set $X$와 $Y$의 원소 간에 관계 $f$가 다음을 만족할 경우, function이라 한다.
- $\forall x \in X$에 대해 $y=f(x)$인 $y \in Y$가 반드시 존재함.
- $x_1, x_2 \in X$일 경우, $x_1=x_2$이며 $f(x_1) = f(x_2)$ 가 반드시 성립함.
위 두 조건을 만족하는 function $f$는 다음과 같이 표기된다.
$$
f: X \mapsto Y
$$
2. 관련 용어.
- domain (정의역) : $X$
- codomain (공역) : $Y$
- image (상) : $Y$의 원소 중 $X$의 원소와 mapping이 된 원소
- 또는 해당 원소로 구성된 set(이 경우 range와 동일).
- 항상 codomain의 subset임.
- preimage (원상, 역상) : image에 대응하는 $X$의 원소. inverse-image(역상)라고도 불림.
- codomain의 subset $B \subseteq Y$에서 function $f$에 대한 preimage는 $X$의 subset임.
- $f^{-1}(B)=\{x\in X: f(x)\in B\} \subseteq X$
- coimage (코이미지): 정의역 $X$에서 kernel(커널)에 동일시하여 만든 quotient space(몫공간)
- $X/ \text{ker}(f)$로 표기: quotient space가 이 나누기 기호로 표기!
- 선형 변환이 보존하는 정보를 반영하는 space
- image와 canonical isomorphism(표준 동형사상) 관계가 성립함: $|\text{image}|=|\text{coimage}|$
- coimage에서 한 entry는 equivalence class(동치류) 임: 한 equivalence class는 domain의 일부 elements로 구성된 set임.
- coimage의 entry와 kernel은 domain의 partition을 이룸: 분할함.
- range (치역) : 모든 image들의 set.
- indepedent variable (독립변수) : domain의 임의의 원소.
- dependent variable (종속변수) : range의 임의의 원소.
주의: Preimage vs. Coimage
- Preimage는 image의 한 원소에 대응하는 domain의 subset(부분집합)
- Coimage는 domain의 분할(partition)을 나타내는 equivalent class(동치류)들의 집합.
- Preimage는 개별 함숫값에 대한 역상 이라면, coimage는 전체 domain의 partition(분할) 임.
2025.02.07 - [.../Math] - [Math] 예제: Domain, Codomain, Image, Range, Preimage, Coimage
[Math] 예제: Domain, Codomain, Image, Range, Preimage, Coimage
예제함수 $f(x) = x^2$, domain $X = [-2, 2]$ 를 예제로 하여 domain, codomain, image, range, preimage, coimage 를 구해봄.Domain (정의역): $X = [-2, 2]$입력값의 범위: $-2 \le x \le 2$Codomain (공역): $Y = \mathbb{R}$ (실수 전체)
dsaint31.tistory.com
https://ko.wikipedia.org/wiki/%EC%83%81_(%EC%88%98%ED%95%99)
상 (수학) - 위키백과, 우리 모두의 백과사전
위키백과, 우리 모두의 백과사전. 수학에서 상(像, 영어: image)은 어떤 함수에 대한 정의역의 원소(들)에 대응하는 공역의 원소(들)이다. 반대로, 원상(原像, 영어: preimage) 또는 역상(逆像, 영어: inv
ko.wikipedia.org
참고: isomorphism
2025.02.07 - [.../Linear Algebra] - [LA] Isomorphism (동형사상)
[LA] Isomorphism (동형사상)
수학에서 isomorphism(동형)은 두 개의 수학적 구조가 본질적으로 동일하며, 서로 1:1 대응되는 관계를 의미한다. 즉, 한 구조에서 수행하는 연산과 관계를 다른 구조에서도 동일하게 수행할 수 있
dsaint31.tistory.com
참고: domina, codomain, and range (좀 더 엄밀한 정의)
$f:X\rightarrow Y$에서
- $X$를 $f$의 정의역(domain),
- $Y$를 $f$의 공역(codomain)
이라고 한다.
- $f(x)=y$라면 $y$는 $x$의 상(image)라고 하고, $x$는 $y$의 원상(preimage)이라 부름.
- $X$의 모든 원소에 대응되는 모든 상들의 집합을 $f$의 치역(range) 또는 상(image)이라 한다.
- 치역(range)는 $f(X)$로 표기.
- domain과 codomain이 같고 domain의 모든 원소 $x$에 대하여 $f(x)=g(x)$인 두 함수는 $f,g$는 서로 같다.($f=g$)
- $f:X\rightarrow Y$에서 $S\subset X$일 때, $S$의 image는 $f(S)=\{f(s)|s\in S\}$로 적는데 이 set은 $Y$의 subset임.
3. Types of function (0)
mapping에 따른 분류.
3.1. one-to-one (단사) function
$f:X \mapsto Y$에서 $\forall x_1, x_2 \in X$ 라 하자.
이때 $f(x_1) = f(x_2) \Rightarrow x_1 = x_2$가 성립하는 경우,
$f$를 one-to-one (or injection, injective) function이라고 함.
3.2. onto (전사) function
$f:X \mapsto Y$에서 $\forall y \in Y$가 적어도 하나의 $x \in X$의 image인 경우,
$f$를 onto (surjection, surjective) function이라고 함.
- functon $f$의 range(치역)는 codomain(공역)가 일치함.
3.3. one-to-one correspondence (전단사) function
- onto 이면서 one-to-one.
- bijection (or bijective)이라고 함.
4. Types of function (1)
domain과 codomain의 dimension에 따른 분류.
Vector Function ($\textbf{f}:\mathbb{R}\to\mathbb{R}^n$)
- 정의역(domain)이 $\mathbb{R}$이면서 공역(codomain)이 $\mathbb{R}^n$인 경우
- single-variable vector-valued function 또는 single variate vector-valued function 이라고 불림.
- vector 가 output인 것을 나타내기 위해 $\textbf{f}$ (bold)를 사용하거나 upper case $F$를 사용.
- output vector 의 각 element를 component function $f_i$이라고 부름.
Vector Field ($\textbf{f}:\mathbb{R}^n\to\mathbb{R}^m$)
- 정의역(domain)이 $\mathbb{R}^n$이면서 공역(codomain)이 $\mathbb{R}^n$인 경우
- multivariable vector-valued function 또는 multivariate vector-valued function 이라고 불림.
- vector 가 output인 것을 나타내기 위해 $\textbf{f}$ (bold)를 사용하거나 upper case $F$를 사용.
- output vector 의 각 element를 component function $f_i$이라고 부름.
Scalar Function ($f:\mathbb{R}\to\mathbb{R}$)
- 정의역(domain)이 $\mathbb{R}$이면서 공역(codomain)이 $\mathbb{R}$인 경우
Scalar Field ($f:\mathbb{R}^n\to\mathbb{R}$)
- 정의역(domain)이 $\mathbb{R}^n$ 이면서 공역(codomain)이 $\mathbb{R}$인 경우
- multi-variable function 또는 multi-variate function 이라고 불림.
- level set이라는 개념이 scalar field에서 매우 빈번하게 나옴. 기억할 것: https://dsaint31.tistory.com/entry/Math-Level-Set
[Math] Level Set
real multi-variate function $f:\mathbb{R}^n \to \mathbb{R}$ 에서 Level Set은 real value $c$에 대해 다음을 만족하는 set을 의미함. $$\left\{ (x_1, \dots, x_n) \in \mathbb{R}^n | f(x_1, \dots, x_n)=c \right\}$$ 위의 정의를 따르면서 $
dsaint31.tistory.com
5. Composite Function (합성함수)
어떤 domain에서 co-domain으로 mapping 될 때, 2개 이상의 함수를 거치는 경우를 가르킴.
$$ y=f(g(x))=(f\circ g)(x)$$
일반적으로 composite function에서는
- commutative law가 성립하지 않음.
- 하지만, associative law는 성립함.
참고로 distribute law는 $\circ$ (composite function)에 직접 적용되지 않음을 주의할 것.
6. Inverse Function (역함수)
2024.02.26 - [.../Math] - [Math] Inverse Function
[Math] Inverse Function
수학 용어에서 "reciprocal"과 "inverse"는 다른 뜻을 가지므로 주의해서 사용해야 함. Inverse vs. Reciprocal: 쉽게 살펴본 역함수 "reciprocal"은 "역수"로 특정 수나 expression에 대해 역수를 취하는 것을 의미
dsaint31.tistory.com
7. Increasing Function and Decreasing Function
$f:X\rightarrow Y$에서 $\forall x_1, x_2 \in X$, $x_1<x_2 \rightarrow f(x_1)\le f(x_2)$이면
increasing function(증가함수) 혹은 monotonic increasing function (단조증가함수)라고 하며,
$f(x_1)<f(x_2)$이면 strictly increasing function 이라고 한다.
마찬가지로 $f:X\rightarrow Y$에서 $\forall x_1, x_2 \in X$, $x_1<x_2 \rightarrow f(x_1)\ge f(x_2)$이면
decreasing function(감소함수) 혹은 monotonic decreasing function (단조감함수)라고 하며,
$f(x_1)<f(x_2)$이면 strictly decreasing function 이라고 한다.
8. 기타
8.1. 디리클레(Dirichlet)의 정의: Function
variable $x$, $y$에 대해 $x$의 값이 정해지면, 이에 따라 $y=f(x)$의 값이 정해질 때, $f(x)$는 $x$의 function이라 한다.
8.2. Function: 특별한 Relation
set $A$에서 set $B$로의 relation $f$가 다음의 두 조건을 모두 만족할 경우,
해당 relation을 $A$에서 $B$로의 function이라고 부름.
- $\forall x \in A, \exists y \in B: (x,y) \in f$
- $[ (x,y) \in f \wedge (x,z) \in f ] \Rightarrow y=z$
위의 정의에서 $(x,y) \in f$인 경우, $y=f(x)$라고 표기함.
2024.02.25 - [.../Math] - [Math] Relation
[Math] Relation
다음은 Relation에 대한 간단한 정의임. A relation (or, more precisely, a binary relation) on a set $A$ is a collection of ordered pairs of elements from $A$. 이를 Cartesian Product를 통해 설명하면, $A$로부터 $B$의 (binary) relation
dsaint31.tistory.com
8.3. 다양한 representation
function을 보다 쉽게 다루기 위한 다른 표현법도 존재함. 아래와 같이
- diargram 으로 표시하거나,
- Input/output을 가지는 box로 나타내는 경우와
- Graph로 표시하기 위한 tuple (or ordered pair, 순서쌍)의 set으로 나타내기도 함.
Graph로 나타내기 위한 순서쌍을 elements로 가지는 set $G$는 다음과 같음.
$$G=\{(x,f(x))|x\in D\}$$
- $D$: domain
같이 읽어보면 좋은 자료들
https://dsaint31.tistory.com/entry/Math-Multi-variable-vs-Multi-variate-and-Multiple-Regression
[Math] Multi-variable vs. Multi-variate and Multiple Regression
1. Multi-variable vs Multi-variate (in Regression) 위의 용어에서 variable은 독립변수에 해당하며, variate는 종속변수에 해당함. variable (변수) : 독립변수에 해당. univariable : independent variable이 scalar. multi-variable
dsaint31.tistory.com
https://dsaint31.github.io/math/math-week01/#function-simple
[Math] Week 01
Basic
dsaint31.github.io
'... > Math' 카테고리의 다른 글
[Statistics] Central Limit Theorem (0) | 2022.03.31 |
---|---|
[Statistics] Moment (Probability Moment) (0) | 2022.03.31 |
[Math] Vector (2) : Vector Function (0) | 2022.03.28 |
[Math] Vector (1) (0) | 2022.03.28 |
Softplus (0) | 2022.03.14 |