2019년 9월 25일 수요일

8. 선형사상 변환규칙(Linear Map Transformation Rules)

8. 선형사상 변환규칙(Linear Map Transformation Rules)





In this video we're going to over transformation rules that linear map obey, when we go from one basis to another.

이번편 강의는 한 기저공간에서 다른 기저공간으로 변환될 때 '선형사상(=행렬로 표현된 선형변환 함수)'이 따라야 할 규칙에 대해 다룬다.


Ok. So, let's say I have linear map given by this matrix, here, and it is expressed in the e-basis. And, let's remind that this linear map turns e_1 into 1/2e and this turns e_2 into 2e_2. So, these just the outputs of the linear map but remember the basis isn't changing, still measuring outputs linear map using same basis.

먼저 간단한 예를 들어보자. 선형사상이 기저공간 e_i 에서 다음과 같은 행렬로 주어졌다. 이 선형사상은 기저벡터 e_1을 1/2e_1으로, e_2를 2e_2로 변환시킨다. 이런 변환의 결과는 선형사상[=함수 L()]을 기저 벡터 e_1과 e_2를 적용하여 얻은 것일 뿐이며 기저벡터가 변한 것이 아니라는 점을 꼭 기억해두자.



불변의 벡터 v 에 대하여 기저벡터 e_i인 공간과 변형된 기저벡터 e_i_tilde인 공간에서 위의 예와 같이 선형사상된 벡터 L(v)의 성분(components)을 구해보자.


예를 들어 기저가 e_1과 e_2인 공간에서 좌표성분이 1 과 1인 벡터 v 에 대하여 선형사상된 벡터 L(v)의 성분은 행렬 곱셈으로 쉽게 구할 수 있다. 변환된 벡터 L(v)는 여전히 기저벡터 e_i 의 공간에 있다.



이번에는 변형된 좌표계(changed coordinate), 즉 기저벡터가 e_i_tilde 인 공간에서 변환(transformation)된 벡터를 구해보자. 먼저 기저벡터 e_i 에서 벡터 v 를 변형된 좌표계 e_i_tilde 로 변환한다. 벡터의 성분은 반변하므로 역방향 변환행렬(Backward)을 곱하여 얻는다. [정역방향 변환행렬은 '1. 정역변환' 강의때부터 사용한 예제다.]



벡터 v의 변형된 좌표계에서 성분을 구했으므로 선형사상 함수 L()를 적용하면 변형된 기저벡터 공간에서 선형사상된 벡터 v의 성분을 구할 수 있다. 하지만 기저벡터 e_의 선형변환 함수 L()_e_는 변형된 기저벡터 e_i_tilde 에서 적용될 수 없다.



변형된 기저공간에서 적용할 수 있는 선형사상 함수(행렬)을 구해보자. 선형사상은 입력 벡터에 대한 행렬곱(matrix multiplication)이므로 다음과 같이 풀어쓸 수 있다. 풀어쓴 변형 기저벡터 연립 방정식의 계수 4개의 값을 정해주면 된다. 변형된 기저벡터 e_i_tilde에서 변환은 이탤릭체 L(), L로 기술한다.



먼저 우리가 알고 있는 몇가지 공식을 정리해보면, '벡터 변환규칙(Vector Transformation Rules)'과 선형사상(Linear Maps)이 있다.



다시 문제로 돌아가 보자. 지금 구하려는 것은 변형된 기저공간에서 선형사상계수들이다.  변형된 기저벡터의 선형사상은 기저벡터와 L의 선형 조합으로 나타낼 수 있다. [표준 행렬-벡터 곱의 형태가 아니다!]



원 기저벡터 e_i 와 변형 기저벡터 사이의 정역방향 변환행렬 F, B와 원 기저벡터 공간의 선형 사상 L()_e_i 이 주어 졌을 때, 임의벡터 v 에 대하여 변형된 기저공간에서 성분을 구하는 문제다. 임의 벡터 v의 원 기저벡터 공간에서 선형변환 된 성분은 L(v_e_i)_e_i 로 구할 수 있다. 하지만 L(v_e_i _tilde)_e_i _tilde 를 구하려면 L()_e_i _tilde 를 알아야 한다.



F, L, B는 모두 변환 행렬의 원소들로 숫자다. 따라서 곱셈의 순서를 바꿔도 성립한다. 이제 변형 좌표계에서 벡터의 선형사상 L(v)_i_tilde을 구했다. 변환 행렬 B와 F, 그리고 선형사상 행렬 L 을 벡터 성분에 순차적 곱하는 수식은 변형된 좌표 공간에서 벡터의 선형 사상된 성분을 구하는 과정을 보여주는 것이라 하겠다. 아래 그림에서 L_tilde로 바로 변환이 불가 하므로 F > L > B 의 경로를 취한 것이다.



예제의 값을 실제로 계산해 보자. 연속적인 행렬 곱셈 끝에 L_e_i_tilde 선형사상 행렬을 구했다.



마침내, 변형 기저벡터 공간에서 선형사상된 벡터 v의 성분을 구할 수 있게 되었다. 대략 그림으로 맞춰보면 맞다는 것을 알 수 있다.



이번에는 표기법에 대해 생각해보자. 총합 기호 ∑ 가 너무 많이 나온다. 그와중에 일정한 공통점이 발견된다. 행렬 원소의 윗 첨자와 기저벡터 아랫 첨자가 일치한 색인의 인수에 총합이 적용되는 공통점이 있다. 그렇다면 텐서를 선형 다항식(계수 곱과 합의 조합)으로 다룰 때 총합 기호를 생략하면 어떨까? 세상 간편하다. 필기공간도 줄이고 식을 전개할 때 손가락도 덜 아푸다. 다만 익숙해 지려면 머리 아푸다.



앞으로 자주 등장할 행렬곱셈을 총합기호를 사용해 선형 다항식으로 표현하게 된다. 총함기호를 가급적 작게 쓸 방안을 찾아보자. 먼저 행렬 M에 단위 행렬 I를 곱하면 다시 M이 된다는 사실을 알고 있다. 단위행렬 I을 선형대수 다항식으로 쓰면 크로네커 델타다. 크로네커 델타를 곱하면 결국 j=k항만 남게 되므로 총합 기호없이 행렬 곱셈을 표현 할 수 있다. 이 때문에 크로네커 델타(혹은 단위행렬)을 총합기호 제거용(summation index canceler)으로 사용한다. 이는 앞으로 지속적으로 등장하게될 행렬계산에서 수식의 간략화에 매우 요긴하게 사용될 것이다.



크로네커 델타(단위행렬)를 활용한 총합기호를 제거 기법을 적용하면 선형사상의 전방향 및 역방향 변환 규칙을 쉽게 유도해 낼 수 있다.




결국 총합기호가 제거 될 수 있다는 사실을 토대로 총합기호를 과감하게 버리고 색인의 소거로 단순화 시키도록 표기하자고 제안한 사람이 아인슈타인이다.

끝으로 요약....



------------------------------------------------------------
[이전] 7. 선형사상(Linear Maps)
[다음] 9. 측량텐서(Metric Tensor)

------------------------------------
[구구단만 알아도 '텐서']
-1. 동기(Motivation)
0. 텐서의 정의(Tensor Definition)
1. 정역방향 변환(Forward and Backward Transformation)
2 벡터의 정의(Vector Definition)
3. 벡터 변환 규칙(Vector Transformation Rules)
4. 여벡터 란?(What's a Covector?)
5. 여벡터 성분(Covector components)
6. 여벡터 변환 규칙(Covector Transformation Rules)
7. 선형 사상(Linear Maps)
8. 선형사상 변환규칙(Linear Map Transformation Rules)
9. 측량 텐서(Metric Tensor)
10. 쌍선형 형식(Bilinear Form)
11. 선형사상은 벡터-여벡터의 짝(Linear-Maps are Vector-Covector Pair)
12. 쌍선형 형식은 여벡터-여벡터 짝(Bilinear Forms are Covector-Covector Pairs)
13. 텐서 곱 vs. 크로네커 곱(Tensor Product vs. Kronecker Product)
14. 텐서는 벡터-여벡터 조합의 일반형(Tensors are a general vector-covector combinations)
15. 텐서 곱 공간(Tensor Product Spaces)
16. 색인 올림과 내림(Raising/Lowering Indexes)
-------------------------

2019년 9월 23일 월요일

7. 선형 사상(Linear Maps)

7. 선형 사상(Linear Maps)






여벡터 논의를 마무리하고 이어서 텐서의 세번째 예로서 '선형사상(Linear Maps)'을 다룬다. '선형사상'은 벡터를 입력받아 다시 벡터를 출력하는 변환(Transformation)[함수] 이다. 이번 강의에서 선형사상를 다음과 같이 세가지 측면에서 다뤄보겠다.

선형변환(Linear Transformation): 선형대수학에서, 선형 변환(線型變換, 영어: linear transformation) 또는 선형 사상(線型寫像, 영어: linear map) 또는 선형 연산자(線型演算子, 영어: linear operator) 또는 선형 작용소(線型作用素)는 선형 결합을 보존하는, 두 벡터 공간 사이의 함수이다.[위키백과]

먼저, 좌표상 정의(Coordinate Definition)로 선형사상을 좌표상의 숫자 배열(array of numbers)[좌표값]로 설명한다. 이어서 기하학적 정의(Geometric Definition)로서 말 그대로 사상(변환)을 그림으로 표현한다. 끝으로 추상적 정의(Abstract Definition)인데 대수수학(algebra)으로 선형사상(변환)을 표현한다. 이 방법이 선형사상을 설명하는 가장 좋은 방법이 될 수 있지만 직관적 이해를 위해 세가지를 서로 연관시켜 보기로 한다.

선형사상을 좌표(coordinate)로 나타낸 것이 '행렬(matrices)'이다. '행렬'은 2차원 숫자의 배열이다. 앞서 배운 '벡터(Vector)'는 숫자의 열(column array of numbers)로 좌표를 표현한 것이다.  '여벡터(Covector)' 또한 숫자의 배열로 좌표를 나타낸 것이긴 하지만 행배열(row array of numbers)이다.


Matrices are coordinate representation of liear maps. So, let's take a look at how matrices transform vectors.

행렬은 성형사상을 좌표로 표현한 것이므로, 행렬이 어떻게 벡터를 변환 시키는지 살펴보자. 아래와 같이 2x1 열벡터열벡터에 작용하는 2x2 행렬이 있다. 행렬 곱셈의 결과로 열벡터를 얻는다.



It might be confusing to understand what a matrix is doing just by looking at the numbers inside matrix. But, there's easy interpretation for what all these numbers mean.

일반적인 행렬과 벡터의 곱셈연산을 수행 했지만 행렬이 그 결과인 벡터에 어떤 작용을 일으켰는지 이해하기는 쉽지않다.

행렬에 기저벡터 e_1과 동일한 벡터 1,0을 곱하면 행렬의 첫번째 열이 된다. 그리고 기저벡터 e_2와 동일한 벡터 0,1 을 곱하면 행렬의 두번째 열이 된다.



이와 같이 행렬에 기저 벡터를 곱하면 복사한 것과 같은 결과가 된다는 사실은 중요하다. 즉, 선형사상 함수로서 행렬은 입력 벡터를 변환 시키지만 기저벡터에 대해서 변화를 주지 않는다. [행렬은 선형사상 또는 선형변환 함수다] 따라서 선형변환 함수인 행렬(=선형 사상)을 이용하여 벡터를 변환 시킬 수 있다. 이때, 이동하지 않는 한 기저는 변하지 않는다.


Linear Maps transform vectors. But, Linear Maps DO NOT transform the basis. So, when we transform vectors using Linear Maps, the basis isn't changing while we aren't moving the basis.

While the output vector might be different to an input vector we're still gong to be measuring the output vector using the same basis. Above that said with matrices the i-th column tells you what to map a copy of the i-th basis vector. Let's take a look at that visually.

'행렬'은 벡터를 변환시키는 함수다. 행렬의 i번째 열은 i번째 기저 벡터의 변환에 해당한다. 행렬의 역활을 보여주는 예를 그림으로 보자.

두개의 기저벡터 e_1과 e_2로 구성된 공간에 두 벡터 v와 w가 있다. 벡터 v는 첫번째 기저벡터 e_1의 복사본이며 w는 두번째 기저벡터 e_2의 복사본이다. 그리고 변환행렬(=선형사상)의 첫번째 열은 5,3 그리고 두번째 열은 -1과 4다.



벡터 v를 변환 행렬에 적용하여 얻은 벡터 L(v)는 노란 화살표가 된다. 벡터 w를 행렬에 적용하여 얻는 벡터 L(w)는 보라색 화살표가 된다. 이때 기저가 이동하지 않아야 하는데 선형사상이 기저를 변화시키지 않으므로  같은 기저공간에서 출력 벡터가 유효해진다.

Note that basis vectors have not moved because Linear Maps don't change the basis then still measuring the output vectors with the same basis.

행렬은 선형사상을 좌표로 나타낸 것이라는 점은 이해 했을 것이다. 기하학적인 의미를 좀더 알아보자.

So, Matrices are coordinate interpretation of Linear Maps. Let's try to get more Geometrical definition.

선형사상을 그림으로 표현하면 공간은 세가지 조건을 만족해야 한다.
1. 격자선은 서로 평행할 것
2. 격자선은 각각 등간격일 것
3. 원점은 이동하지 않을 것




원 격자공간은 수평으로 팽창될 수 있고, 회전 변형되며, 회전과 확장이 연이어 질 수도 있다. 변환된 격자는 각 축에 대해 서로 평행하며 등간격이고 원점의 이동은 없다. 한가지 주의할 것은 이동을 포한하는 변위(translation)는 선형변환에 해당하지 않는다.

끝으로 선형사상의 추상적 정의(abstract definition)를 해보자. 선형대수식으로 표현하는 것으로 매우 일반화되면서 적절한 방법이긴 하지만 처음 접하기엔 아주 난해할 수 있다. 선형사상은 벡터를 입력으로 취하여 벡터로 출력(사상, 대응)하는 함수로 선형성을 갖는다. 벡터를 입력으로 취하는 여벡터 또한 선형성을 갖는다는 점에서 유사하지만 여벡터가 스칼라 출력이지만 선형사상은 벡터 출력이라는 점이 다르다.



선형사상을 행렬로 표현된 함수로 보려면 생소하기도 하고 다른 선형성의 예와 비교해서 이해가 까다로울 수 있다. 그림으로 선형사상 함수의 선형성을 직관적으로 이해해 보자.





선형사상 함수의 선형성을 그림으로 표현한 경우와 좌표(행렬)로 표현한 경우를 서로 비교해 보자. 행렬의 곱셈을 알고 있다면 선형성을 규명해 보기는 어렵지 않을 것이다.



---------------------------------------------
선형사상의 표기를 추상화 해보자[대수식으로 일반화 해보기]. 앞으로 전개될 대수식들은 처음 보면 혼란 스럽겠지만 앞서 다뤘던 선형성을 토대로 하며, 단지 표기법이 생소할 수 있다는 점을 기억해 두자(윗첨자는 반변 Contravariant, 아랫첨자는 공변 Covariant).

벡터 w는 입력 벡터 v에 대한 선형사상이다. 입력 벡터 v 는 기저벡터 e_1 과 e_2에 각 성분값 v^1과 v^2를 곱한 합으로 표현된다. 벡터의 성분은 반변한다(Vector component=Contravariant).



선형사상 L()은 선형성에 따라 다음과 같이 각각의 합으로 표현된다.



기저벡터 e_1과 e_2에 대한 선형사상 L(e_1)과 L(e_2)는 결국 동일한 기저벡터를 사용하는 공간에서의 벡터 합이므로 다음과 같이 놓을 수 있다. 첨자가 붙은 L은 모두 숫자(스칼라)다. 윗첨자와 아랫 첨자로 구분되어 있음에 유의하자. 지금은 그냥 표기법이라 하고 넘기자. 첨자를 구분한 이유는 나중에 설명될 것이다.



기저벡터에 선형사상을 적용하여 확장한 후 공통 기저벡터로 정리하면 벡터 w 는 다음과 같다.



위의 식에서 각 기저벡터의 계수는 결국 숫자값이므로 다음과 같이 놓자. 결국 w^1과 w^2는 계수 L의 행렬과 벡터 성분 v의 곱과 같다.



최종적으로 벡터 w는 다음과 같이 표현된다. 결국 변환은 동일한 기저벡터에 계수값의 변화임을 알 수 있다.



--------------------
선형사상을 일반화하여 요약하면 다음과 같다.



-------------------
[이전] 6. 여벡터 변환규칙(Covector Transformation Rules)
[다음] 8. 선형사상 변환규칙(Linear Map Transformation Rules)

------------------------------------
[구구단만 알아도 '텐서']
-1. 동기(Motivation)
0. 텐서의 정의(Tensor Definition)
1. 정역방향 변환(Forward and Backward Transformation)
2 벡터의 정의(Vector Definition)
3. 벡터 변환 규칙(Vector Transformation Rules)
4. 여벡터 란?(What's a Covector?)
5. 여벡터 성분(Covector components)
6. 여벡터 변환 규칙(Covector Transformation Rules)
7. 선형 사상(Linear Maps)
8. 선형사상 변환규칙(Linear Map Transformation Rules)
9. 측량 텐서(Metric Tensor)
10. 쌍선형 형식(Bilinear Form)
11. 선형사상은 벡터-여벡터의 짝(Linear-Maps are Vector-Covector Pair)
12. 쌍선형 형식은 여벡터-여벡터 짝(Bilinear Forms are Covector-Covector Pairs)
13. 텐서 곱 vs. 크로네커 곱(Tensor Product vs. Kronecker Product)
14. 텐서는 벡터-여벡터 조합의 일반형(Tensors are a general vector-covector combinations)
15. 텐서 곱 공간(Tensor Product Spaces)
16. 색인 올림과 내림(Raising/Lowering Indexes)
-------------------------

2019년 9월 22일 일요일

6. 여벡터 변환 규칙(Covector Transformation Rules)

[구구단만 알아도 '텐서'] 6. 여벡터 변환 규칙(Covector Transformation Rules)
원본출처: Tensors for Beginners by eigenchris(YouTube)





In the last video we saw that all covectors can be written as linear combinations of the Dual Basis vectors. We saw how covector component can be obtained by counting how many covector lines that basis vector pierces. We also saw that covector components transform in opposite way that vector components do.

지난번 강의[5. 여벡터 성분]에서 여벡터(covector)는 이중 기저벡터(dual basis vector)의 선형결합(linear combination)으로 기술된다는 것을 알아봤다. 그리고 기저벡터가 관통하는 여벡터 선의 갯수가 곧 여벡터 성분이라는 것도 살펴봤다. 아울러 여벡터 성분의 변환은 벡터 성분 변환과 반대로 적용된다는 것도 알게됐다.

So now just gonna confirm a covector transformation rules should be mathematically. So the first thing we need to get out of the way is figuring out how covectors themselves transform. So not covector components, not the oppose, we're talking about covector themselves which are the epsilon.

이번 강의는 여벡터 변환 규칙을 수학적으로 규명해 본다. 먼저 여벡터 자신의 변환을 먼저 알아보고 이어서 여벡터의 성분 변환을 구하기로 하자.

So with the vectors in order to get, from old basis, the new basis vectors out of old basis vectors. Then, now these are forward [vector] transform. Now we wanna same things on covectors. So, how we can build new Dual-Basis out of the old Dual-Basis.

벡터의 변환을 다룰때 원기저벡터로부터 변형기저벡터를 구한다고 배웠다. 이를 순방향 변환(Forward transform)이라 한다. 여벡터의 경우에도 이와 마찬가지로 원이중기저로 부터 변형이중기저를 구한다.[이중기저(Dual Basis):여벡터(Covector)의 선형합]



What are the Q coefficients that let's do this. So to figure these[Q coefficients] out, we start by applying ε^1_tilde to e_1 and replacing ε^1_tilde with ε's as written here using linearity rules. We can get this.



So we know that this goes to 1, and this goes to 0, so ε^1_tilde of e_1 equals to Q_11.



And if we apply ε^1_tilde of e_2, we get that is equals to Q_12.



Ok. So an alternative way of writing is like this and these parts here are just numbers.



Let's bring out of backward transformation that we can write out old basis vectors in terms of new basis vectors. So we can get these.






Now using the linearity of covectors and these goes to 1 while these goes to 0. and we get this the new dual basis vectors in terms of the olds.




And if you turn to old that again, you can do same thing to ε^2_tilde.



So, you noticed that this coefficients and these coefficients are awfully similar. So, this means that to go from old Dual-Basis to new Dual-Basis we used backward transformation.



Ok, Let's try to improve that for any dimension. I have some stuffs here. I have Dual-Basis definitions.




I have forward and backward transformation,



And I have reminder that forward and backward transformation are inverse, because when we multiply them, get the Kronecker-delta.



Ok, Let's start by letting epsilon tilde as linear combination of epsilons.


Now apply covectors to the new basis vectors, e_k_tilde, left-hand side became to Kronecker delta, by the definition here, right-hand side can be replaced by new basis vectors, which is linear combination of old basis vector using the forward transformation,



We can take scaling constant outside, and it became also Kronecker delta by this definition here,



This term, here becomes 0 when j doesn't equal to l. So we can ignore all other terms that are j doesn't equal l. We only take care about j equals l. So that means I can replace this l here with j.



And so now we have that Q multiply by F gives us the Kronecker delta. So in another words, Q and F are inverses. But we remember that we only know that the inverses of F is B. So what that means is that Q is equal to B. Since only F have one inverse. So Q is backward transform. So we move from old Dual-Basis to new Dual-Basis with backward transform. Now you understand that why we write index at top, because that transform in opposite way that basis vectors do.



Here we summarize that the Basis-Vector and Covector transformation rules and again they are opposite.



So now we know that how basis-vector transform figuring out how the component transform was really easy.

We just write covector α as sum of the old basis covector.



We used the forward transformation that we rewrite the old basis in terms of new basis , we rearrange the sums and we see that this part of middle has to be equal to the new covector components, α_tilde.




And so we find out that the forward transform brings from the old covector components to the new. By likewise backward transform brings from the new covector components to the old. So the Covector Component transformation is the same way that the Basis-Vectors do.
--------------------
Let's do the sanity check to make it sense.

So here we have a covector sitting in the space basis e_1 and e_2. And it's looks like e_1 pierces 2-lines and e_2 pierces 2-lines. So the component in the spaces are [2 2]. Now wat if we make these space vector twice as big. So we get a new basis here e_1_tilde and e_2_tilde. What are the covector components now? Well e_1_tilde pierces 4-lines, e_2_tilde pierces 4-lines as well. So the components are [4 4].



This means that when we increase the size of basis, we also increase the size of the covector components. So covector component transform in the same way that the basis-vector do. So, hopefully that makes intuitive sense now.
--------------------
Here are summarize all the transformation rules we learn so far in the videos.

We started with the transformation rules of 'Basis-Vectors' and then we figure out that transformation rules for 'Vector Components' which are opposite compare to the Basis-Vector. So that are called 'Contravariant'.


Then earlier in this video, we found transformation rules for Basis-Covectors were also opposite compare to Basis-Vector. So, Basis-Covectors also transform by the 'Contravariant Rule'.

And finally just we find out 'Covector Components' transform in the same way that Basis-Vectors do. So this means that Covector component transform Covariantly and that's why we write as seen in the bottom just like Basis-Vectors, because they transform in the same way.
--------------------
So, that finishes all vectors. In the next video we'll talk about 3rd examples of tensors which is 'Linear-Map'.
----------------------
[이전] 5. 여벡터 성분(Covector Components)
[다음] 7. 선형 사상(Linear Maps)

------------------------------------
[구구단만 알아도 '텐서']
-1. 동기(Motivation)
0. 텐서의 정의(Tensor Definition)
1. 정역방향 변환(Forward and Backward Transformation)
2 벡터의 정의(Vector Definition)
3. 벡터 변환 규칙(Vector Transformation Rules)
4. 여벡터 란?(What's a Covector?)
5. 여벡터 성분(Covector components)
6. 여벡터 변환 규칙(Covector Transformation Rules)
7. 선형 사상(Linear Maps)
8. 선형사상 변환규칙(Linear Map Transformation Rules)
9. 측량 텐서(Metric Tensor)
10. 쌍선형 형식(Bilinear Form)
11. 선형사상은 벡터-여벡터의 짝(Linear-Maps are Vector-Covector Pair)
12. 쌍선형 형식은 여벡터-여벡터 짝(Bilinear Forms are Covector-Covector Pairs)
13. 텐서 곱 vs. 크로네커 곱(Tensor Product vs. Kronecker Product)
14. 텐서는 벡터-여벡터 조합의 일반형(Tensors are a general vector-covector combinations)
15. 텐서 곱 공간(Tensor Product Spaces)
16. 색인 올림과 내림(Raising/Lowering Indexes)
-------------------------