Metamath Proof Explorer


Theorem funeldmdif

Description: Two ways of expressing membership in the difference of domains of two nested functions. (Contributed by AV, 27-Oct-2023)

Ref Expression
Assertion funeldmdif ( ( Fun 𝐴𝐵𝐴 ) → ( 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ↔ ∃ 𝑥 ∈ ( 𝐴𝐵 ) ( 1st𝑥 ) = 𝐶 ) )

Proof

Step Hyp Ref Expression
1 funrel ( Fun 𝐴 → Rel 𝐴 )
2 releldmdifi ( ( Rel 𝐴𝐵𝐴 ) → ( 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) → ∃ 𝑥 ∈ ( 𝐴𝐵 ) ( 1st𝑥 ) = 𝐶 ) )
3 1 2 sylan ( ( Fun 𝐴𝐵𝐴 ) → ( 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) → ∃ 𝑥 ∈ ( 𝐴𝐵 ) ( 1st𝑥 ) = 𝐶 ) )
4 eldif ( 𝑥 ∈ ( 𝐴𝐵 ) ↔ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) )
5 1stdm ( ( Rel 𝐴𝑥𝐴 ) → ( 1st𝑥 ) ∈ dom 𝐴 )
6 5 ex ( Rel 𝐴 → ( 𝑥𝐴 → ( 1st𝑥 ) ∈ dom 𝐴 ) )
7 1 6 syl ( Fun 𝐴 → ( 𝑥𝐴 → ( 1st𝑥 ) ∈ dom 𝐴 ) )
8 7 adantr ( ( Fun 𝐴𝐵𝐴 ) → ( 𝑥𝐴 → ( 1st𝑥 ) ∈ dom 𝐴 ) )
9 8 com12 ( 𝑥𝐴 → ( ( Fun 𝐴𝐵𝐴 ) → ( 1st𝑥 ) ∈ dom 𝐴 ) )
10 9 adantr ( ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) → ( ( Fun 𝐴𝐵𝐴 ) → ( 1st𝑥 ) ∈ dom 𝐴 ) )
11 10 impcom ( ( ( Fun 𝐴𝐵𝐴 ) ∧ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) ) → ( 1st𝑥 ) ∈ dom 𝐴 )
12 funelss ( ( Fun 𝐴𝐵𝐴𝑥𝐴 ) → ( ( 1st𝑥 ) ∈ dom 𝐵𝑥𝐵 ) )
13 12 3expa ( ( ( Fun 𝐴𝐵𝐴 ) ∧ 𝑥𝐴 ) → ( ( 1st𝑥 ) ∈ dom 𝐵𝑥𝐵 ) )
14 13 con3d ( ( ( Fun 𝐴𝐵𝐴 ) ∧ 𝑥𝐴 ) → ( ¬ 𝑥𝐵 → ¬ ( 1st𝑥 ) ∈ dom 𝐵 ) )
15 14 impr ( ( ( Fun 𝐴𝐵𝐴 ) ∧ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) ) → ¬ ( 1st𝑥 ) ∈ dom 𝐵 )
16 11 15 eldifd ( ( ( Fun 𝐴𝐵𝐴 ) ∧ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) ) → ( 1st𝑥 ) ∈ ( dom 𝐴 ∖ dom 𝐵 ) )
17 16 3adant3 ( ( ( Fun 𝐴𝐵𝐴 ) ∧ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) ∧ ( 1st𝑥 ) = 𝐶 ) → ( 1st𝑥 ) ∈ ( dom 𝐴 ∖ dom 𝐵 ) )
18 eleq1 ( ( 1st𝑥 ) = 𝐶 → ( ( 1st𝑥 ) ∈ ( dom 𝐴 ∖ dom 𝐵 ) ↔ 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ) )
19 18 3ad2ant3 ( ( ( Fun 𝐴𝐵𝐴 ) ∧ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) ∧ ( 1st𝑥 ) = 𝐶 ) → ( ( 1st𝑥 ) ∈ ( dom 𝐴 ∖ dom 𝐵 ) ↔ 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ) )
20 17 19 mpbid ( ( ( Fun 𝐴𝐵𝐴 ) ∧ ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) ∧ ( 1st𝑥 ) = 𝐶 ) → 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) )
21 20 3exp ( ( Fun 𝐴𝐵𝐴 ) → ( ( 𝑥𝐴 ∧ ¬ 𝑥𝐵 ) → ( ( 1st𝑥 ) = 𝐶𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ) ) )
22 4 21 syl5bi ( ( Fun 𝐴𝐵𝐴 ) → ( 𝑥 ∈ ( 𝐴𝐵 ) → ( ( 1st𝑥 ) = 𝐶𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ) ) )
23 22 rexlimdv ( ( Fun 𝐴𝐵𝐴 ) → ( ∃ 𝑥 ∈ ( 𝐴𝐵 ) ( 1st𝑥 ) = 𝐶𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ) )
24 3 23 impbid ( ( Fun 𝐴𝐵𝐴 ) → ( 𝐶 ∈ ( dom 𝐴 ∖ dom 𝐵 ) ↔ ∃ 𝑥 ∈ ( 𝐴𝐵 ) ( 1st𝑥 ) = 𝐶 ) )