Metamath Proof Explorer


Theorem iocinif

Description: Relate intersection of two open-below, closed-above intervals with the same upper bound with a conditional construct. (Contributed by Thierry Arnoux, 7-Aug-2017)

Ref Expression
Assertion iocinif ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = if ( 𝐴 < 𝐵 , ( 𝐵 (,] 𝐶 ) , ( 𝐴 (,] 𝐶 ) ) )

Proof

Step Hyp Ref Expression
1 exmid ( 𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵 )
2 xrltle ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ* ) → ( 𝐴 < 𝐵𝐴𝐵 ) )
3 2 imp ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ* ) ∧ 𝐴 < 𝐵 ) → 𝐴𝐵 )
4 3 3adantl3 ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ 𝐴 < 𝐵 ) → 𝐴𝐵 )
5 iocinioc2 ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ 𝐴𝐵 ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) )
6 4 5 syldan ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ 𝐴 < 𝐵 ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) )
7 6 ex ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( 𝐴 < 𝐵 → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) ) )
8 7 ancld ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( 𝐴 < 𝐵 → ( 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) ) ) )
9 simpl2 ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ ¬ 𝐴 < 𝐵 ) → 𝐵 ∈ ℝ* )
10 simpl1 ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ ¬ 𝐴 < 𝐵 ) → 𝐴 ∈ ℝ* )
11 simpr ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ ¬ 𝐴 < 𝐵 ) → ¬ 𝐴 < 𝐵 )
12 xrlenlt ( ( 𝐵 ∈ ℝ*𝐴 ∈ ℝ* ) → ( 𝐵𝐴 ↔ ¬ 𝐴 < 𝐵 ) )
13 12 biimpar ( ( ( 𝐵 ∈ ℝ*𝐴 ∈ ℝ* ) ∧ ¬ 𝐴 < 𝐵 ) → 𝐵𝐴 )
14 9 10 11 13 syl21anc ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ ¬ 𝐴 < 𝐵 ) → 𝐵𝐴 )
15 3ancoma ( ( 𝐵 ∈ ℝ*𝐴 ∈ ℝ*𝐶 ∈ ℝ* ) ↔ ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) )
16 incom ( ( 𝐵 (,] 𝐶 ) ∩ ( 𝐴 (,] 𝐶 ) ) = ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) )
17 iocinioc2 ( ( ( 𝐵 ∈ ℝ*𝐴 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ 𝐵𝐴 ) → ( ( 𝐵 (,] 𝐶 ) ∩ ( 𝐴 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) )
18 16 17 eqtr3id ( ( ( 𝐵 ∈ ℝ*𝐴 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ 𝐵𝐴 ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) )
19 15 18 sylanbr ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ 𝐵𝐴 ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) )
20 14 19 syldan ( ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) ∧ ¬ 𝐴 < 𝐵 ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) )
21 20 ex ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( ¬ 𝐴 < 𝐵 → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) ) )
22 21 ancld ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( ¬ 𝐴 < 𝐵 → ( ¬ 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) ) ) )
23 8 22 orim12d ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( ( 𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵 ) → ( ( 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) ) ∨ ( ¬ 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) ) ) ) )
24 1 23 mpi ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( ( 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) ) ∨ ( ¬ 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) ) ) )
25 eqif ( ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = if ( 𝐴 < 𝐵 , ( 𝐵 (,] 𝐶 ) , ( 𝐴 (,] 𝐶 ) ) ↔ ( ( 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐵 (,] 𝐶 ) ) ∨ ( ¬ 𝐴 < 𝐵 ∧ ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = ( 𝐴 (,] 𝐶 ) ) ) )
26 24 25 sylibr ( ( 𝐴 ∈ ℝ*𝐵 ∈ ℝ*𝐶 ∈ ℝ* ) → ( ( 𝐴 (,] 𝐶 ) ∩ ( 𝐵 (,] 𝐶 ) ) = if ( 𝐴 < 𝐵 , ( 𝐵 (,] 𝐶 ) , ( 𝐴 (,] 𝐶 ) ) )