# Metamath Proof Explorer

## Theorem rabun2

Description: Abstraction restricted to a union. (Contributed by Stefan O'Rear, 5-Feb-2015)

Ref Expression
Assertion rabun2 { 𝑥 ∈ ( 𝐴𝐵 ) ∣ 𝜑 } = ( { 𝑥𝐴𝜑 } ∪ { 𝑥𝐵𝜑 } )

### Proof

Step Hyp Ref Expression
1 df-rab { 𝑥 ∈ ( 𝐴𝐵 ) ∣ 𝜑 } = { 𝑥 ∣ ( 𝑥 ∈ ( 𝐴𝐵 ) ∧ 𝜑 ) }
2 df-rab { 𝑥𝐴𝜑 } = { 𝑥 ∣ ( 𝑥𝐴𝜑 ) }
3 df-rab { 𝑥𝐵𝜑 } = { 𝑥 ∣ ( 𝑥𝐵𝜑 ) }
4 2 3 uneq12i ( { 𝑥𝐴𝜑 } ∪ { 𝑥𝐵𝜑 } ) = ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∪ { 𝑥 ∣ ( 𝑥𝐵𝜑 ) } )
5 elun ( 𝑥 ∈ ( 𝐴𝐵 ) ↔ ( 𝑥𝐴𝑥𝐵 ) )
6 5 anbi1i ( ( 𝑥 ∈ ( 𝐴𝐵 ) ∧ 𝜑 ) ↔ ( ( 𝑥𝐴𝑥𝐵 ) ∧ 𝜑 ) )
7 andir ( ( ( 𝑥𝐴𝑥𝐵 ) ∧ 𝜑 ) ↔ ( ( 𝑥𝐴𝜑 ) ∨ ( 𝑥𝐵𝜑 ) ) )
8 6 7 bitri ( ( 𝑥 ∈ ( 𝐴𝐵 ) ∧ 𝜑 ) ↔ ( ( 𝑥𝐴𝜑 ) ∨ ( 𝑥𝐵𝜑 ) ) )
9 8 abbii { 𝑥 ∣ ( 𝑥 ∈ ( 𝐴𝐵 ) ∧ 𝜑 ) } = { 𝑥 ∣ ( ( 𝑥𝐴𝜑 ) ∨ ( 𝑥𝐵𝜑 ) ) }
10 unab ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∪ { 𝑥 ∣ ( 𝑥𝐵𝜑 ) } ) = { 𝑥 ∣ ( ( 𝑥𝐴𝜑 ) ∨ ( 𝑥𝐵𝜑 ) ) }
11 9 10 eqtr4i { 𝑥 ∣ ( 𝑥 ∈ ( 𝐴𝐵 ) ∧ 𝜑 ) } = ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∪ { 𝑥 ∣ ( 𝑥𝐵𝜑 ) } )
12 4 11 eqtr4i ( { 𝑥𝐴𝜑 } ∪ { 𝑥𝐵𝜑 } ) = { 𝑥 ∣ ( 𝑥 ∈ ( 𝐴𝐵 ) ∧ 𝜑 ) }
13 1 12 eqtr4i { 𝑥 ∈ ( 𝐴𝐵 ) ∣ 𝜑 } = ( { 𝑥𝐴𝜑 } ∪ { 𝑥𝐵𝜑 } )