Metamath Proof Explorer


Theorem hashrabrex

Description: The number of elements in a class abstraction with a restricted existential quantification. (Contributed by Alexander van der Vekens, 29-Jul-2018)

Ref Expression
Hypotheses hashrabrex.1 ( 𝜑𝑌 ∈ Fin )
hashrabrex.2 ( ( 𝜑𝑦𝑌 ) → { 𝑥𝑋𝜓 } ∈ Fin )
hashrabrex.3 ( 𝜑Disj 𝑦𝑌 { 𝑥𝑋𝜓 } )
Assertion hashrabrex ( 𝜑 → ( ♯ ‘ { 𝑥𝑋 ∣ ∃ 𝑦𝑌 𝜓 } ) = Σ 𝑦𝑌 ( ♯ ‘ { 𝑥𝑋𝜓 } ) )

Proof

Step Hyp Ref Expression
1 hashrabrex.1 ( 𝜑𝑌 ∈ Fin )
2 hashrabrex.2 ( ( 𝜑𝑦𝑌 ) → { 𝑥𝑋𝜓 } ∈ Fin )
3 hashrabrex.3 ( 𝜑Disj 𝑦𝑌 { 𝑥𝑋𝜓 } )
4 iunrab 𝑦𝑌 { 𝑥𝑋𝜓 } = { 𝑥𝑋 ∣ ∃ 𝑦𝑌 𝜓 }
5 4 eqcomi { 𝑥𝑋 ∣ ∃ 𝑦𝑌 𝜓 } = 𝑦𝑌 { 𝑥𝑋𝜓 }
6 5 fveq2i ( ♯ ‘ { 𝑥𝑋 ∣ ∃ 𝑦𝑌 𝜓 } ) = ( ♯ ‘ 𝑦𝑌 { 𝑥𝑋𝜓 } )
7 1 2 3 hashiun ( 𝜑 → ( ♯ ‘ 𝑦𝑌 { 𝑥𝑋𝜓 } ) = Σ 𝑦𝑌 ( ♯ ‘ { 𝑥𝑋𝜓 } ) )
8 6 7 eqtrid ( 𝜑 → ( ♯ ‘ { 𝑥𝑋 ∣ ∃ 𝑦𝑌 𝜓 } ) = Σ 𝑦𝑌 ( ♯ ‘ { 𝑥𝑋𝜓 } ) )