Metamath Proof Explorer


Theorem hsphoival

Description: H is a function (that returns the representation of the right side of a half-open interval intersected with a half-space). Step (b) in Lemma 115B of Fremlin1 p. 29. (Contributed by Glauco Siliprandi, 21-Nov-2020)

Ref Expression
Hypotheses hsphoival.h 𝐻 = ( 𝑥 ∈ ℝ ↦ ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝑥 , ( 𝑎𝑗 ) , 𝑥 ) ) ) ) )
hsphoival.a ( 𝜑𝐴 ∈ ℝ )
hsphoival.x ( 𝜑𝑋𝑉 )
hsphoival.b ( 𝜑𝐵 : 𝑋 ⟶ ℝ )
hsphoival.k ( 𝜑𝐾𝑋 )
Assertion hsphoival ( 𝜑 → ( ( ( 𝐻𝐴 ) ‘ 𝐵 ) ‘ 𝐾 ) = if ( 𝐾𝑌 , ( 𝐵𝐾 ) , if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) ) )

Proof

Step Hyp Ref Expression
1 hsphoival.h 𝐻 = ( 𝑥 ∈ ℝ ↦ ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝑥 , ( 𝑎𝑗 ) , 𝑥 ) ) ) ) )
2 hsphoival.a ( 𝜑𝐴 ∈ ℝ )
3 hsphoival.x ( 𝜑𝑋𝑉 )
4 hsphoival.b ( 𝜑𝐵 : 𝑋 ⟶ ℝ )
5 hsphoival.k ( 𝜑𝐾𝑋 )
6 breq2 ( 𝑥 = 𝐴 → ( ( 𝑎𝑗 ) ≤ 𝑥 ↔ ( 𝑎𝑗 ) ≤ 𝐴 ) )
7 id ( 𝑥 = 𝐴𝑥 = 𝐴 )
8 6 7 ifbieq2d ( 𝑥 = 𝐴 → if ( ( 𝑎𝑗 ) ≤ 𝑥 , ( 𝑎𝑗 ) , 𝑥 ) = if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) )
9 8 ifeq2d ( 𝑥 = 𝐴 → if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝑥 , ( 𝑎𝑗 ) , 𝑥 ) ) = if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) )
10 9 mpteq2dv ( 𝑥 = 𝐴 → ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝑥 , ( 𝑎𝑗 ) , 𝑥 ) ) ) = ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) )
11 10 mpteq2dv ( 𝑥 = 𝐴 → ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝑥 , ( 𝑎𝑗 ) , 𝑥 ) ) ) ) = ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) ) )
12 ovex ( ℝ ↑m 𝑋 ) ∈ V
13 12 mptex ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) ) ∈ V
14 13 a1i ( 𝜑 → ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) ) ∈ V )
15 1 11 2 14 fvmptd3 ( 𝜑 → ( 𝐻𝐴 ) = ( 𝑎 ∈ ( ℝ ↑m 𝑋 ) ↦ ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) ) )
16 fveq1 ( 𝑎 = 𝐵 → ( 𝑎𝑗 ) = ( 𝐵𝑗 ) )
17 16 breq1d ( 𝑎 = 𝐵 → ( ( 𝑎𝑗 ) ≤ 𝐴 ↔ ( 𝐵𝑗 ) ≤ 𝐴 ) )
18 17 16 ifbieq1d ( 𝑎 = 𝐵 → if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) = if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) )
19 16 18 ifeq12d ( 𝑎 = 𝐵 → if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) = if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) )
20 19 mpteq2dv ( 𝑎 = 𝐵 → ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) = ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) ) )
21 20 adantl ( ( 𝜑𝑎 = 𝐵 ) → ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝑎𝑗 ) , if ( ( 𝑎𝑗 ) ≤ 𝐴 , ( 𝑎𝑗 ) , 𝐴 ) ) ) = ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) ) )
22 reex ℝ ∈ V
23 22 a1i ( 𝜑 → ℝ ∈ V )
24 23 3 jca ( 𝜑 → ( ℝ ∈ V ∧ 𝑋𝑉 ) )
25 elmapg ( ( ℝ ∈ V ∧ 𝑋𝑉 ) → ( 𝐵 ∈ ( ℝ ↑m 𝑋 ) ↔ 𝐵 : 𝑋 ⟶ ℝ ) )
26 24 25 syl ( 𝜑 → ( 𝐵 ∈ ( ℝ ↑m 𝑋 ) ↔ 𝐵 : 𝑋 ⟶ ℝ ) )
27 4 26 mpbird ( 𝜑𝐵 ∈ ( ℝ ↑m 𝑋 ) )
28 mptexg ( 𝑋𝑉 → ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) ) ∈ V )
29 3 28 syl ( 𝜑 → ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) ) ∈ V )
30 15 21 27 29 fvmptd ( 𝜑 → ( ( 𝐻𝐴 ) ‘ 𝐵 ) = ( 𝑗𝑋 ↦ if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) ) )
31 eleq1 ( 𝑗 = 𝐾 → ( 𝑗𝑌𝐾𝑌 ) )
32 fveq2 ( 𝑗 = 𝐾 → ( 𝐵𝑗 ) = ( 𝐵𝐾 ) )
33 32 breq1d ( 𝑗 = 𝐾 → ( ( 𝐵𝑗 ) ≤ 𝐴 ↔ ( 𝐵𝐾 ) ≤ 𝐴 ) )
34 33 32 ifbieq1d ( 𝑗 = 𝐾 → if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) = if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) )
35 31 32 34 ifbieq12d ( 𝑗 = 𝐾 → if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) = if ( 𝐾𝑌 , ( 𝐵𝐾 ) , if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) ) )
36 35 adantl ( ( 𝜑𝑗 = 𝐾 ) → if ( 𝑗𝑌 , ( 𝐵𝑗 ) , if ( ( 𝐵𝑗 ) ≤ 𝐴 , ( 𝐵𝑗 ) , 𝐴 ) ) = if ( 𝐾𝑌 , ( 𝐵𝐾 ) , if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) ) )
37 4 5 ffvelrnd ( 𝜑 → ( 𝐵𝐾 ) ∈ ℝ )
38 37 2 ifcld ( 𝜑 → if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) ∈ ℝ )
39 37 38 ifexd ( 𝜑 → if ( 𝐾𝑌 , ( 𝐵𝐾 ) , if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) ) ∈ V )
40 30 36 5 39 fvmptd ( 𝜑 → ( ( ( 𝐻𝐴 ) ‘ 𝐵 ) ‘ 𝐾 ) = if ( 𝐾𝑌 , ( 𝐵𝐾 ) , if ( ( 𝐵𝐾 ) ≤ 𝐴 , ( 𝐵𝐾 ) , 𝐴 ) ) )