Metamath Proof Explorer


Theorem ehl2eudis

Description: The Euclidean distance function in a real Euclidean space of dimension 2. (Contributed by AV, 16-Jan-2023)

Ref Expression
Hypotheses ehl2eudis.e E = 𝔼 hil 2
ehl2eudis.x X = 1 2
ehl2eudis.d D = dist E
Assertion ehl2eudis D = f X , g X f 1 g 1 2 + f 2 g 2 2

Proof

Step Hyp Ref Expression
1 ehl2eudis.e E = 𝔼 hil 2
2 ehl2eudis.x X = 1 2
3 ehl2eudis.d D = dist E
4 2nn0 2 0
5 fz12pr 1 2 = 1 2
6 5 eqcomi 1 2 = 1 2
7 6 1 2 3 ehleudis 2 0 D = f X , g X k 1 2 f k g k 2
8 4 7 ax-mp D = f X , g X k 1 2 f k g k 2
9 fveq2 k = 1 f k = f 1
10 fveq2 k = 1 g k = g 1
11 9 10 oveq12d k = 1 f k g k = f 1 g 1
12 11 oveq1d k = 1 f k g k 2 = f 1 g 1 2
13 fveq2 k = 2 f k = f 2
14 fveq2 k = 2 g k = g 2
15 13 14 oveq12d k = 2 f k g k = f 2 g 2
16 15 oveq1d k = 2 f k g k 2 = f 2 g 2 2
17 2 eleq2i f X f 1 2
18 reex V
19 prex 1 2 V
20 18 19 elmap f 1 2 f : 1 2
21 17 20 bitri f X f : 1 2
22 id f : 1 2 f : 1 2
23 1ex 1 V
24 23 prid1 1 1 2
25 24 a1i f : 1 2 1 1 2
26 22 25 ffvelrnd f : 1 2 f 1
27 21 26 sylbi f X f 1
28 27 adantr f X g X f 1
29 2 eleq2i g X g 1 2
30 18 19 elmap g 1 2 g : 1 2
31 29 30 bitri g X g : 1 2
32 id g : 1 2 g : 1 2
33 24 a1i g : 1 2 1 1 2
34 32 33 ffvelrnd g : 1 2 g 1
35 31 34 sylbi g X g 1
36 35 adantl f X g X g 1
37 28 36 resubcld f X g X f 1 g 1
38 37 resqcld f X g X f 1 g 1 2
39 38 recnd f X g X f 1 g 1 2
40 2ex 2 V
41 40 prid2 2 1 2
42 41 a1i f : 1 2 2 1 2
43 22 42 ffvelrnd f : 1 2 f 2
44 21 43 sylbi f X f 2
45 44 adantr f X g X f 2
46 41 a1i g : 1 2 2 1 2
47 32 46 ffvelrnd g : 1 2 g 2
48 31 47 sylbi g X g 2
49 48 adantl f X g X g 2
50 45 49 resubcld f X g X f 2 g 2
51 50 resqcld f X g X f 2 g 2 2
52 51 recnd f X g X f 2 g 2 2
53 39 52 jca f X g X f 1 g 1 2 f 2 g 2 2
54 23 40 pm3.2i 1 V 2 V
55 54 a1i f X g X 1 V 2 V
56 1ne2 1 2
57 56 a1i f X g X 1 2
58 12 16 53 55 57 sumpr f X g X k 1 2 f k g k 2 = f 1 g 1 2 + f 2 g 2 2
59 58 fveq2d f X g X k 1 2 f k g k 2 = f 1 g 1 2 + f 2 g 2 2
60 59 mpoeq3ia f X , g X k 1 2 f k g k 2 = f X , g X f 1 g 1 2 + f 2 g 2 2
61 8 60 eqtri D = f X , g X f 1 g 1 2 + f 2 g 2 2