Metamath Proof Explorer


Theorem ffvresb

Description: A necessary and sufficient condition for a restricted function. (Contributed by Mario Carneiro, 14-Nov-2013)

Ref Expression
Assertion ffvresb ( Fun 𝐹 → ( ( 𝐹𝐴 ) : 𝐴𝐵 ↔ ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) ) )

Proof

Step Hyp Ref Expression
1 fdm ( ( 𝐹𝐴 ) : 𝐴𝐵 → dom ( 𝐹𝐴 ) = 𝐴 )
2 dmres dom ( 𝐹𝐴 ) = ( 𝐴 ∩ dom 𝐹 )
3 inss2 ( 𝐴 ∩ dom 𝐹 ) ⊆ dom 𝐹
4 2 3 eqsstri dom ( 𝐹𝐴 ) ⊆ dom 𝐹
5 1 4 eqsstrrdi ( ( 𝐹𝐴 ) : 𝐴𝐵𝐴 ⊆ dom 𝐹 )
6 5 sselda ( ( ( 𝐹𝐴 ) : 𝐴𝐵𝑥𝐴 ) → 𝑥 ∈ dom 𝐹 )
7 fvres ( 𝑥𝐴 → ( ( 𝐹𝐴 ) ‘ 𝑥 ) = ( 𝐹𝑥 ) )
8 7 adantl ( ( ( 𝐹𝐴 ) : 𝐴𝐵𝑥𝐴 ) → ( ( 𝐹𝐴 ) ‘ 𝑥 ) = ( 𝐹𝑥 ) )
9 ffvelrn ( ( ( 𝐹𝐴 ) : 𝐴𝐵𝑥𝐴 ) → ( ( 𝐹𝐴 ) ‘ 𝑥 ) ∈ 𝐵 )
10 8 9 eqeltrrd ( ( ( 𝐹𝐴 ) : 𝐴𝐵𝑥𝐴 ) → ( 𝐹𝑥 ) ∈ 𝐵 )
11 6 10 jca ( ( ( 𝐹𝐴 ) : 𝐴𝐵𝑥𝐴 ) → ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) )
12 11 ralrimiva ( ( 𝐹𝐴 ) : 𝐴𝐵 → ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) )
13 simpl ( ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → 𝑥 ∈ dom 𝐹 )
14 13 ralimi ( ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → ∀ 𝑥𝐴 𝑥 ∈ dom 𝐹 )
15 dfss3 ( 𝐴 ⊆ dom 𝐹 ↔ ∀ 𝑥𝐴 𝑥 ∈ dom 𝐹 )
16 14 15 sylibr ( ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → 𝐴 ⊆ dom 𝐹 )
17 funfn ( Fun 𝐹𝐹 Fn dom 𝐹 )
18 fnssres ( ( 𝐹 Fn dom 𝐹𝐴 ⊆ dom 𝐹 ) → ( 𝐹𝐴 ) Fn 𝐴 )
19 17 18 sylanb ( ( Fun 𝐹𝐴 ⊆ dom 𝐹 ) → ( 𝐹𝐴 ) Fn 𝐴 )
20 16 19 sylan2 ( ( Fun 𝐹 ∧ ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) ) → ( 𝐹𝐴 ) Fn 𝐴 )
21 simpr ( ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → ( 𝐹𝑥 ) ∈ 𝐵 )
22 7 eleq1d ( 𝑥𝐴 → ( ( ( 𝐹𝐴 ) ‘ 𝑥 ) ∈ 𝐵 ↔ ( 𝐹𝑥 ) ∈ 𝐵 ) )
23 21 22 syl5ibr ( 𝑥𝐴 → ( ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → ( ( 𝐹𝐴 ) ‘ 𝑥 ) ∈ 𝐵 ) )
24 23 ralimia ( ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → ∀ 𝑥𝐴 ( ( 𝐹𝐴 ) ‘ 𝑥 ) ∈ 𝐵 )
25 24 adantl ( ( Fun 𝐹 ∧ ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) ) → ∀ 𝑥𝐴 ( ( 𝐹𝐴 ) ‘ 𝑥 ) ∈ 𝐵 )
26 fnfvrnss ( ( ( 𝐹𝐴 ) Fn 𝐴 ∧ ∀ 𝑥𝐴 ( ( 𝐹𝐴 ) ‘ 𝑥 ) ∈ 𝐵 ) → ran ( 𝐹𝐴 ) ⊆ 𝐵 )
27 20 25 26 syl2anc ( ( Fun 𝐹 ∧ ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) ) → ran ( 𝐹𝐴 ) ⊆ 𝐵 )
28 df-f ( ( 𝐹𝐴 ) : 𝐴𝐵 ↔ ( ( 𝐹𝐴 ) Fn 𝐴 ∧ ran ( 𝐹𝐴 ) ⊆ 𝐵 ) )
29 20 27 28 sylanbrc ( ( Fun 𝐹 ∧ ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) ) → ( 𝐹𝐴 ) : 𝐴𝐵 )
30 29 ex ( Fun 𝐹 → ( ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) → ( 𝐹𝐴 ) : 𝐴𝐵 ) )
31 12 30 impbid2 ( Fun 𝐹 → ( ( 𝐹𝐴 ) : 𝐴𝐵 ↔ ∀ 𝑥𝐴 ( 𝑥 ∈ dom 𝐹 ∧ ( 𝐹𝑥 ) ∈ 𝐵 ) ) )