Metamath Proof Explorer


Theorem normpyth

Description: Analogy to Pythagorean theorem for orthogonal vectors. Remark 3.4(C) of Beran p. 98. (Contributed by NM, 17-Oct-1999) (New usage is discouraged.)

Ref Expression
Assertion normpyth ( ( 𝐴 ∈ ℋ ∧ 𝐵 ∈ ℋ ) → ( ( 𝐴 ·ih 𝐵 ) = 0 → ( ( norm ‘ ( 𝐴 + 𝐵 ) ) ↑ 2 ) = ( ( ( norm𝐴 ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ) )

Proof

Step Hyp Ref Expression
1 oveq1 ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( 𝐴 ·ih 𝐵 ) = ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih 𝐵 ) )
2 1 eqeq1d ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( ( 𝐴 ·ih 𝐵 ) = 0 ↔ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih 𝐵 ) = 0 ) )
3 fvoveq1 ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( norm ‘ ( 𝐴 + 𝐵 ) ) = ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) )
4 3 oveq1d ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( ( norm ‘ ( 𝐴 + 𝐵 ) ) ↑ 2 ) = ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) ↑ 2 ) )
5 fveq2 ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( norm𝐴 ) = ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) )
6 5 oveq1d ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( ( norm𝐴 ) ↑ 2 ) = ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) )
7 6 oveq1d ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( ( ( norm𝐴 ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) )
8 4 7 eqeq12d ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( ( ( norm ‘ ( 𝐴 + 𝐵 ) ) ↑ 2 ) = ( ( ( norm𝐴 ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ↔ ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ) )
9 2 8 imbi12d ( 𝐴 = if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) → ( ( ( 𝐴 ·ih 𝐵 ) = 0 → ( ( norm ‘ ( 𝐴 + 𝐵 ) ) ↑ 2 ) = ( ( ( norm𝐴 ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ) ↔ ( ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih 𝐵 ) = 0 → ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ) ) )
10 oveq2 ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih 𝐵 ) = ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) )
11 10 eqeq1d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih 𝐵 ) = 0 ↔ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) = 0 ) )
12 oveq2 ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) = ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) )
13 12 fveq2d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) = ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ) )
14 13 oveq1d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) ↑ 2 ) = ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ) ↑ 2 ) )
15 fveq2 ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( norm𝐵 ) = ( norm ‘ if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) )
16 15 oveq1d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( ( norm𝐵 ) ↑ 2 ) = ( ( norm ‘ if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ↑ 2 ) )
17 16 oveq2d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm ‘ if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ↑ 2 ) ) )
18 14 17 eqeq12d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ↔ ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm ‘ if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ↑ 2 ) ) ) )
19 11 18 imbi12d ( 𝐵 = if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) → ( ( ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih 𝐵 ) = 0 → ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + 𝐵 ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ) ↔ ( ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) = 0 → ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm ‘ if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ↑ 2 ) ) ) ) )
20 ifhvhv0 if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ∈ ℋ
21 ifhvhv0 if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ∈ ℋ
22 20 21 normpythi ( ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ·ih if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) = 0 → ( ( norm ‘ ( if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) + if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ) ↑ 2 ) = ( ( ( norm ‘ if ( 𝐴 ∈ ℋ , 𝐴 , 0 ) ) ↑ 2 ) + ( ( norm ‘ if ( 𝐵 ∈ ℋ , 𝐵 , 0 ) ) ↑ 2 ) ) )
23 9 19 22 dedth2h ( ( 𝐴 ∈ ℋ ∧ 𝐵 ∈ ℋ ) → ( ( 𝐴 ·ih 𝐵 ) = 0 → ( ( norm ‘ ( 𝐴 + 𝐵 ) ) ↑ 2 ) = ( ( ( norm𝐴 ) ↑ 2 ) + ( ( norm𝐵 ) ↑ 2 ) ) ) )