Metamath Proof Explorer


Theorem iccin

Description: Intersection of two closed intervals of extended reals. (Contributed by Zhi Wang, 9-Sep-2024)

Ref Expression
Assertion iccin ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ* ) ∧ ( 𝐶 ∈ ℝ*𝐷 ∈ ℝ* ) ) → ( ( 𝐴 [,] 𝐵 ) ∩ ( 𝐶 [,] 𝐷 ) ) = ( if ( 𝐴𝐶 , 𝐶 , 𝐴 ) [,] if ( 𝐵𝐷 , 𝐵 , 𝐷 ) ) )

Proof

Step Hyp Ref Expression
1 df-icc [,] = ( 𝑥 ∈ ℝ* , 𝑦 ∈ ℝ* ↦ { 𝑧 ∈ ℝ* ∣ ( 𝑥𝑧𝑧𝑦 ) } )
2 xrmaxle ( ( 𝐴 ∈ ℝ*𝐶 ∈ ℝ*𝑧 ∈ ℝ* ) → ( if ( 𝐴𝐶 , 𝐶 , 𝐴 ) ≤ 𝑧 ↔ ( 𝐴𝑧𝐶𝑧 ) ) )
3 xrlemin ( ( 𝑧 ∈ ℝ*𝐵 ∈ ℝ*𝐷 ∈ ℝ* ) → ( 𝑧 ≤ if ( 𝐵𝐷 , 𝐵 , 𝐷 ) ↔ ( 𝑧𝐵𝑧𝐷 ) ) )
4 1 2 3 ixxin ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ* ) ∧ ( 𝐶 ∈ ℝ*𝐷 ∈ ℝ* ) ) → ( ( 𝐴 [,] 𝐵 ) ∩ ( 𝐶 [,] 𝐷 ) ) = ( if ( 𝐴𝐶 , 𝐶 , 𝐴 ) [,] if ( 𝐵𝐷 , 𝐵 , 𝐷 ) ) )