Metamath Proof Explorer


Theorem invfun

Description: The inverse relation is a function, which is to say that every morphism has at most one inverse. (Contributed by Mario Carneiro, 2-Jan-2017)

Ref Expression
Hypotheses invfval.b 𝐵 = ( Base ‘ 𝐶 )
invfval.n 𝑁 = ( Inv ‘ 𝐶 )
invfval.c ( 𝜑𝐶 ∈ Cat )
invfval.x ( 𝜑𝑋𝐵 )
invfval.y ( 𝜑𝑌𝐵 )
Assertion invfun ( 𝜑 → Fun ( 𝑋 𝑁 𝑌 ) )

Proof

Step Hyp Ref Expression
1 invfval.b 𝐵 = ( Base ‘ 𝐶 )
2 invfval.n 𝑁 = ( Inv ‘ 𝐶 )
3 invfval.c ( 𝜑𝐶 ∈ Cat )
4 invfval.x ( 𝜑𝑋𝐵 )
5 invfval.y ( 𝜑𝑌𝐵 )
6 eqid ( Hom ‘ 𝐶 ) = ( Hom ‘ 𝐶 )
7 1 2 3 4 5 6 invss ( 𝜑 → ( 𝑋 𝑁 𝑌 ) ⊆ ( ( 𝑋 ( Hom ‘ 𝐶 ) 𝑌 ) × ( 𝑌 ( Hom ‘ 𝐶 ) 𝑋 ) ) )
8 relxp Rel ( ( 𝑋 ( Hom ‘ 𝐶 ) 𝑌 ) × ( 𝑌 ( Hom ‘ 𝐶 ) 𝑋 ) )
9 relss ( ( 𝑋 𝑁 𝑌 ) ⊆ ( ( 𝑋 ( Hom ‘ 𝐶 ) 𝑌 ) × ( 𝑌 ( Hom ‘ 𝐶 ) 𝑋 ) ) → ( Rel ( ( 𝑋 ( Hom ‘ 𝐶 ) 𝑌 ) × ( 𝑌 ( Hom ‘ 𝐶 ) 𝑋 ) ) → Rel ( 𝑋 𝑁 𝑌 ) ) )
10 7 8 9 mpisyl ( 𝜑 → Rel ( 𝑋 𝑁 𝑌 ) )
11 eqid ( Sect ‘ 𝐶 ) = ( Sect ‘ 𝐶 )
12 3 adantr ( ( 𝜑 ∧ ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) ) → 𝐶 ∈ Cat )
13 5 adantr ( ( 𝜑 ∧ ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) ) → 𝑌𝐵 )
14 4 adantr ( ( 𝜑 ∧ ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) ) → 𝑋𝐵 )
15 1 2 3 4 5 11 isinv ( 𝜑 → ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔 ↔ ( 𝑓 ( 𝑋 ( Sect ‘ 𝐶 ) 𝑌 ) 𝑔𝑔 ( 𝑌 ( Sect ‘ 𝐶 ) 𝑋 ) 𝑓 ) ) )
16 15 simplbda ( ( 𝜑𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔 ) → 𝑔 ( 𝑌 ( Sect ‘ 𝐶 ) 𝑋 ) 𝑓 )
17 16 adantrr ( ( 𝜑 ∧ ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) ) → 𝑔 ( 𝑌 ( Sect ‘ 𝐶 ) 𝑋 ) 𝑓 )
18 1 2 3 4 5 11 isinv ( 𝜑 → ( 𝑓 ( 𝑋 𝑁 𝑌 ) ↔ ( 𝑓 ( 𝑋 ( Sect ‘ 𝐶 ) 𝑌 ) ( 𝑌 ( Sect ‘ 𝐶 ) 𝑋 ) 𝑓 ) ) )
19 18 simprbda ( ( 𝜑𝑓 ( 𝑋 𝑁 𝑌 ) ) → 𝑓 ( 𝑋 ( Sect ‘ 𝐶 ) 𝑌 ) )
20 19 adantrl ( ( 𝜑 ∧ ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) ) → 𝑓 ( 𝑋 ( Sect ‘ 𝐶 ) 𝑌 ) )
21 1 11 12 13 14 17 20 sectcan ( ( 𝜑 ∧ ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) ) → 𝑔 = )
22 21 ex ( 𝜑 → ( ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) → 𝑔 = ) )
23 22 alrimiv ( 𝜑 → ∀ ( ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) → 𝑔 = ) )
24 23 alrimivv ( 𝜑 → ∀ 𝑓𝑔 ( ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) → 𝑔 = ) )
25 dffun2 ( Fun ( 𝑋 𝑁 𝑌 ) ↔ ( Rel ( 𝑋 𝑁 𝑌 ) ∧ ∀ 𝑓𝑔 ( ( 𝑓 ( 𝑋 𝑁 𝑌 ) 𝑔𝑓 ( 𝑋 𝑁 𝑌 ) ) → 𝑔 = ) ) )
26 10 24 25 sylanbrc ( 𝜑 → Fun ( 𝑋 𝑁 𝑌 ) )