Metamath Proof Explorer


Theorem partfun

Description: Rewrite a function defined by parts, using a mapping and an if construct, into a union of functions on disjoint domains. (Contributed by Thierry Arnoux, 30-Mar-2017)

Ref Expression
Assertion partfun x A if x B C D = x A B C x A B D

Proof

Step Hyp Ref Expression
1 mptun x A B A B if x B C D = x A B if x B C D x A B if x B C D
2 inundif A B A B = A
3 eqid if x B C D = if x B C D
4 2 3 mpteq12i x A B A B if x B C D = x A if x B C D
5 elinel2 x A B x B
6 5 iftrued x A B if x B C D = C
7 6 mpteq2ia x A B if x B C D = x A B C
8 eldifn x A B ¬ x B
9 8 iffalsed x A B if x B C D = D
10 9 mpteq2ia x A B if x B C D = x A B D
11 7 10 uneq12i x A B if x B C D x A B if x B C D = x A B C x A B D
12 1 4 11 3eqtr3i x A if x B C D = x A B C x A B D