(* ========================================================================= *) (* Formalization of Electromagnetic Optics *) (* *) (* (c) Copyright, Sanaz Khan Afshar & Vincent Aravantinos 2011-14 *) (* Hardware Verification Group, *) (* Concordia University *) (* *) (* Contact: <s_khanaf@encs.concordia.ca> *) (* <vincent@encs.concordia.ca> *) (* *) (* This file deals with the non-trivial theorems called "primitive rules". *) (* ========================================================================= *)let NON_NULL_LEMMA =prove (`!emf v. ~(v = vec 0) /\ non_null_wave emf ==> let v_ccross = (ccross) (vector_to_cvector v) in ~(v_ccross (e_of_wave emf) = cvector_zero) \/ ~(v_ccross (h_of_wave emf) = cvector_zero)`,let NON_NULL_LEMMA_PASTECART =prove (`!emf v. ~(v = vec 0) /\ non_null_wave emf ==> let v_ccross = (ccross) (vector_to_cvector v) in ~(pastecart (v_ccross (e_of_wave emf)) (v_ccross (h_of_wave emf)) = cvector_zero)`,(* We combine the E and H field as one complex^6 vector. * Convenient for some proofs. *)let BOUNDARY_CONDITIONS_FOR_PLANE_WAVES =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t ==> let p = plane_of_interface i in !n. is_normal_to_plane n p ==> let n_ccross = (ccross) (vector_to_cvector n) in !pt. pt IN p ==> !t. let plane_component = \f_of_wave emf. cexp (--ii * Cx((k_of_wave emf) dot pt - w_of_wave emf*t)) % n_ccross (f_of_wave emf) in plane_component e_of_wave emf_i + plane_component e_of_wave emf_r = plane_component e_of_wave emf_t /\ plane_component h_of_wave emf_i + plane_component h_of_wave emf_r = plane_component h_of_wave emf_t`,let PASTECART_BOUNDARY_CONDITIONS_FOR_PLANE_WAVES =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t ==> let p = plane_of_interface i in !n. is_normal_to_plane n p ==> let n_ccross = (ccross) (vector_to_cvector n) in !pt. pt IN p ==> !t. let plane_component = \emf. cexp (--ii * Cx((k_of_wave emf) dot pt - w_of_wave emf*t)) % pastecart (n_ccross (e_of_wave emf)) (n_ccross (h_of_wave emf)) in plane_component emf_i + plane_component emf_r = plane_component emf_t`,let EXISTS_NORMAL_OF_PLANE_INTERFACE =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t ==> ?n. is_normal_to_plane n (plane_of_interface i)`,let IS_PLANE_WAVE_AT_INTERFACE_THMS = [is_plane_wave_at_interface;LET_DEF;LET_END_DEF;map_triple;o_DEF; is_valid_interface];;let FREQUENCY_CONSERVATION =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t ==> (non_null_wave emf_r ==> w_of_wave emf_r = w_of_wave emf_i) /\ (non_null_wave emf_t ==> w_of_wave emf_t = w_of_wave emf_i)`,let K_PLANE_PROJECTION_CONSERVATION =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t ==> let n = unit (normal_of_interface i) in (non_null_wave emf_r ==> projection_on_hyperplane (k_of_wave emf_r) n = projection_on_hyperplane (k_of_wave emf_i) n) /\ (non_null_wave emf_t ==> projection_on_hyperplane (k_of_wave emf_t) n = projection_on_hyperplane (k_of_wave emf_i) n)`,let LAW_OF_REFLECTION =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t ==> let n = unit (normal_of_interface i) in non_null_wave emf_r ==> symetric_vectors_wrt (--(k_of_wave emf_r)) (k_of_wave emf_i) n`,let PLANE_OF_INCIDENCE_LAW =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ non_null_wave emf_r /\ non_null_wave emf_t ==> coplanar {vec 0, k_of_wave emf_i, k_of_wave emf_r, k_of_wave emf_t, normal_of_interface i}`,let SNELL_LAW =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ non_null_wave emf_t ==> let theta = \emf. vector_angle (k_of_wave emf) (normal_of_interface i) in n1_of_interface i * sin (theta emf_i) = n2_of_interface i * sin (theta emf_t)`,let phase_shift_at_plane = new_definition `phase_shift_at_plane p n emf = k_of_wave emf dot (@a. a % unit n IN p) % unit n`;;let PLANE_WAVE_WITH_PHASE_SHIFT_AT_PLANE =prove (`!emf. is_plane_wave emf ==> !p. plane p ==> !n. is_normal_to_plane n p ==> !r. r IN p ==> !t. emf r t = cexp (--ii * Cx(projection_on_hyperplane (k_of_wave emf) (unit n) dot r - w_of_wave emf * t + phase_shift_at_plane p n emf)) % eh_of_wave emf`,let PLANE_WAVE_WITH_PHASE_SHIFT_AT_INTERFACE =prove (`!emf. is_plane_wave emf ==> !i. is_valid_interface i ==> !r. r IN plane_of_interface i ==> !t. let n = normal_of_interface i in emf r t = cexp (--ii * Cx(projection_on_hyperplane (k_of_wave emf) (unit n) dot r - w_of_wave emf * t + phase_shift_at_plane (plane_of_interface i) n emf)) % eh_of_wave emf`,let magnitude_shifted_at_plane = new_definition `magnitude_shifted_at_plane p n emf = cexp (--ii * Cx(phase_shift_at_plane p n emf)) % eh_of_wave emf`;;let E_PRESERVED_IN_TE_MODE =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ non_null_wave emf_r /\ non_null_wave emf_t /\ TE_mode i emf_i emf_r emf_t ==> let magnitude = \emf. FST (magnitude_shifted_at_plane (plane_of_interface i) (normal_of_interface i) emf) cdot (vector_to_cvector (TE_mode_axis i emf_i emf_r emf_t)) in magnitude emf_r + magnitude emf_i = magnitude emf_t`,let H_CROSS_Z_WRT_E_IN_TE_MODE =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ TE_mode i emf_i emf_r emf_t ==> let p = plane_of_interface i in let n = normal_of_interface i in let h_cross_z_wrt_e = \emf. (h_of_wave emf) ccross (vector_to_cvector n) = Cx ((n dot k_of_wave emf) / (eta0 * k0)) % e_of_wave emf in h_cross_z_wrt_e emf_i /\ h_cross_z_wrt_e emf_r /\ h_cross_z_wrt_e emf_t`,let NON_PROJECTED_E_RELATION_IN_TE_MODE =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ non_null_wave emf_r /\ non_null_wave emf_t /\ TE_mode i emf_i emf_r emf_t ==> let magnitude = \emf. FST (magnitude_shifted_at_plane (plane_of_interface i) (normal_of_interface i) emf) cdot (vector_to_cvector (TE_mode_axis i emf_i emf_r emf_t)) in let n = unit (normal_of_interface i) in Cx (n dot k_of_wave emf_i) * (magnitude emf_i - magnitude emf_r) = Cx (n dot k_of_wave emf_t) * magnitude emf_t`,let COMPLEX_MUL_LINV2 =prove (`!x y. ~(x=Cx(&0)) ==> inv x * (x * y) = y`,let COMPLEX_BALANCE_MUL_DIV =prove (`!x y z. ~(x=Cx(&0)) ==> (x*y=z <=> y=z/x)`,let FRESNEL_REFLECTION_TE_MODE =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ non_null_wave emf_r /\ non_null_wave emf_t /\ TE_mode i emf_i emf_r emf_t ==> let magnitude = \emf. FST (magnitude_shifted_at_plane (plane_of_interface i) (normal_of_interface i) emf) cdot (vector_to_cvector (TE_mode_axis i emf_i emf_r emf_t)) in let theta = \emf. Cx(vector_angle (k_of_wave emf) (normal_of_interface i)) in let n1 = Cx(n1_of_interface i) in let n2 = Cx(n2_of_interface i) in magnitude emf_r = (n1 * ccos (theta emf_i) - n2 * ccos (theta emf_t)) / (n1 * ccos (theta emf_i) + n2 * ccos (theta emf_t)) * magnitude emf_i`,let FRESNEL_TRANSMISSION_TE_MODE =prove (`!i emf_i emf_r emf_t. is_plane_wave_at_interface i emf_i emf_r emf_t /\ non_null_wave emf_r /\ non_null_wave emf_t /\ TE_mode i emf_i emf_r emf_t ==> let magnitude = \emf. FST (magnitude_shifted_at_plane (plane_of_interface i) (normal_of_interface i) emf) cdot (vector_to_cvector (TE_mode_axis i emf_i emf_r emf_t)) in let theta = \emf. Cx(vector_angle (k_of_wave emf) (normal_of_interface i)) in let n1 = Cx(n1_of_interface i) in let n2 = Cx(n2_of_interface i) in magnitude emf_t = Cx(&2) * n1 * ccos (theta emf_i) / (n1 * ccos (theta emf_i) + n2 * ccos (theta emf_t)) * magnitude emf_i`,