Metamath Proof Explorer


Theorem pjpyth

Description: Pythagorean theorem for projectors. (Contributed by NM, 11-Apr-2006) (New usage is discouraged.)

Ref Expression
Assertion pjpyth
|- ( ( H e. CH /\ A e. ~H ) -> ( ( normh ` A ) ^ 2 ) = ( ( ( normh ` ( ( projh ` H ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` H ) ) ` A ) ) ^ 2 ) ) )

Proof

Step Hyp Ref Expression
1 fveq2
 |-  ( H = if ( H e. CH , H , ~H ) -> ( projh ` H ) = ( projh ` if ( H e. CH , H , ~H ) ) )
2 1 fveq1d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( ( projh ` H ) ` A ) = ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) )
3 2 fveq2d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( normh ` ( ( projh ` H ) ` A ) ) = ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) )
4 3 oveq1d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( ( normh ` ( ( projh ` H ) ` A ) ) ^ 2 ) = ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) ^ 2 ) )
5 2fveq3
 |-  ( H = if ( H e. CH , H , ~H ) -> ( projh ` ( _|_ ` H ) ) = ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) )
6 5 fveq1d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( ( projh ` ( _|_ ` H ) ) ` A ) = ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) )
7 6 fveq2d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( normh ` ( ( projh ` ( _|_ ` H ) ) ` A ) ) = ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) )
8 7 oveq1d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( ( normh ` ( ( projh ` ( _|_ ` H ) ) ` A ) ) ^ 2 ) = ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) ^ 2 ) )
9 4 8 oveq12d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( ( ( normh ` ( ( projh ` H ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` H ) ) ` A ) ) ^ 2 ) ) = ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) ^ 2 ) ) )
10 9 eqeq2d
 |-  ( H = if ( H e. CH , H , ~H ) -> ( ( ( normh ` A ) ^ 2 ) = ( ( ( normh ` ( ( projh ` H ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` H ) ) ` A ) ) ^ 2 ) ) <-> ( ( normh ` A ) ^ 2 ) = ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) ^ 2 ) ) ) )
11 fveq2
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( normh ` A ) = ( normh ` if ( A e. ~H , A , 0h ) ) )
12 11 oveq1d
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( ( normh ` A ) ^ 2 ) = ( ( normh ` if ( A e. ~H , A , 0h ) ) ^ 2 ) )
13 2fveq3
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) = ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` if ( A e. ~H , A , 0h ) ) ) )
14 13 oveq1d
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) ^ 2 ) = ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) )
15 2fveq3
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) = ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` if ( A e. ~H , A , 0h ) ) ) )
16 15 oveq1d
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) ^ 2 ) = ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) )
17 14 16 oveq12d
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) ^ 2 ) ) = ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) ) )
18 12 17 eqeq12d
 |-  ( A = if ( A e. ~H , A , 0h ) -> ( ( ( normh ` A ) ^ 2 ) = ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` A ) ) ^ 2 ) ) <-> ( ( normh ` if ( A e. ~H , A , 0h ) ) ^ 2 ) = ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) ) ) )
19 ifchhv
 |-  if ( H e. CH , H , ~H ) e. CH
20 ifhvhv0
 |-  if ( A e. ~H , A , 0h ) e. ~H
21 19 20 pjpythi
 |-  ( ( normh ` if ( A e. ~H , A , 0h ) ) ^ 2 ) = ( ( ( normh ` ( ( projh ` if ( H e. CH , H , ~H ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` if ( H e. CH , H , ~H ) ) ) ` if ( A e. ~H , A , 0h ) ) ) ^ 2 ) )
22 10 18 21 dedth2h
 |-  ( ( H e. CH /\ A e. ~H ) -> ( ( normh ` A ) ^ 2 ) = ( ( ( normh ` ( ( projh ` H ) ` A ) ) ^ 2 ) + ( ( normh ` ( ( projh ` ( _|_ ` H ) ) ` A ) ) ^ 2 ) ) )