Metamath Proof Explorer


Theorem wfrlem5

Description: Lemma for well-ordered recursion. The values of two acceptable functions agree within their domains. (Contributed by Scott Fenton, 21-Apr-2011) (Revised by Mario Carneiro, 26-Jun-2015)

Ref Expression
Hypotheses wfrlem5.1 𝑅 We 𝐴
wfrlem5.2 𝑅 Se 𝐴
wfrlem5.3 𝐵 = { 𝑓 ∣ ∃ 𝑥 ( 𝑓 Fn 𝑥 ∧ ( 𝑥𝐴 ∧ ∀ 𝑦𝑥 Pred ( 𝑅 , 𝐴 , 𝑦 ) ⊆ 𝑥 ) ∧ ∀ 𝑦𝑥 ( 𝑓𝑦 ) = ( 𝐹 ‘ ( 𝑓 ↾ Pred ( 𝑅 , 𝐴 , 𝑦 ) ) ) ) }
Assertion wfrlem5 ( ( 𝑔𝐵𝐵 ) → ( ( 𝑥 𝑔 𝑢𝑥 𝑣 ) → 𝑢 = 𝑣 ) )

Proof

Step Hyp Ref Expression
1 wfrlem5.1 𝑅 We 𝐴
2 wfrlem5.2 𝑅 Se 𝐴
3 wfrlem5.3 𝐵 = { 𝑓 ∣ ∃ 𝑥 ( 𝑓 Fn 𝑥 ∧ ( 𝑥𝐴 ∧ ∀ 𝑦𝑥 Pred ( 𝑅 , 𝐴 , 𝑦 ) ⊆ 𝑥 ) ∧ ∀ 𝑦𝑥 ( 𝑓𝑦 ) = ( 𝐹 ‘ ( 𝑓 ↾ Pred ( 𝑅 , 𝐴 , 𝑦 ) ) ) ) }
4 vex 𝑥 ∈ V
5 vex 𝑢 ∈ V
6 4 5 breldm ( 𝑥 𝑔 𝑢𝑥 ∈ dom 𝑔 )
7 vex 𝑣 ∈ V
8 4 7 breldm ( 𝑥 𝑣𝑥 ∈ dom )
9 6 8 anim12i ( ( 𝑥 𝑔 𝑢𝑥 𝑣 ) → ( 𝑥 ∈ dom 𝑔𝑥 ∈ dom ) )
10 elin ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ↔ ( 𝑥 ∈ dom 𝑔𝑥 ∈ dom ) )
11 9 10 sylibr ( ( 𝑥 𝑔 𝑢𝑥 𝑣 ) → 𝑥 ∈ ( dom 𝑔 ∩ dom ) )
12 anandi ( ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ ( 𝑥 𝑔 𝑢𝑥 𝑣 ) ) ↔ ( ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ 𝑥 𝑔 𝑢 ) ∧ ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ 𝑥 𝑣 ) ) )
13 5 brresi ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢 ↔ ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ 𝑥 𝑔 𝑢 ) )
14 7 brresi ( 𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ↔ ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ 𝑥 𝑣 ) )
15 13 14 anbi12i ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) ↔ ( ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ 𝑥 𝑔 𝑢 ) ∧ ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ 𝑥 𝑣 ) ) )
16 12 15 sylbb2 ( ( 𝑥 ∈ ( dom 𝑔 ∩ dom ) ∧ ( 𝑥 𝑔 𝑢𝑥 𝑣 ) ) → ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) )
17 11 16 mpancom ( ( 𝑥 𝑔 𝑢𝑥 𝑣 ) → ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) )
18 3 wfrlem3 ( 𝑔𝐵 → dom 𝑔𝐴 )
19 ssinss1 ( dom 𝑔𝐴 → ( dom 𝑔 ∩ dom ) ⊆ 𝐴 )
20 wess ( ( dom 𝑔 ∩ dom ) ⊆ 𝐴 → ( 𝑅 We 𝐴𝑅 We ( dom 𝑔 ∩ dom ) ) )
21 1 20 mpi ( ( dom 𝑔 ∩ dom ) ⊆ 𝐴𝑅 We ( dom 𝑔 ∩ dom ) )
22 sess2 ( ( dom 𝑔 ∩ dom ) ⊆ 𝐴 → ( 𝑅 Se 𝐴𝑅 Se ( dom 𝑔 ∩ dom ) ) )
23 2 22 mpi ( ( dom 𝑔 ∩ dom ) ⊆ 𝐴𝑅 Se ( dom 𝑔 ∩ dom ) )
24 21 23 jca ( ( dom 𝑔 ∩ dom ) ⊆ 𝐴 → ( 𝑅 We ( dom 𝑔 ∩ dom ) ∧ 𝑅 Se ( dom 𝑔 ∩ dom ) ) )
25 18 19 24 3syl ( 𝑔𝐵 → ( 𝑅 We ( dom 𝑔 ∩ dom ) ∧ 𝑅 Se ( dom 𝑔 ∩ dom ) ) )
26 25 adantr ( ( 𝑔𝐵𝐵 ) → ( 𝑅 We ( dom 𝑔 ∩ dom ) ∧ 𝑅 Se ( dom 𝑔 ∩ dom ) ) )
27 3 wfrlem4 ( ( 𝑔𝐵𝐵 ) → ( ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ∧ ∀ 𝑎 ∈ ( dom 𝑔 ∩ dom ) ( ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ) )
28 3 wfrlem4 ( ( 𝐵𝑔𝐵 ) → ( ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom ∩ dom 𝑔 ) ∧ ∀ 𝑎 ∈ ( dom ∩ dom 𝑔 ) ( ( ↾ ( dom ∩ dom 𝑔 ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) ) ) ) )
29 28 ancoms ( ( 𝑔𝐵𝐵 ) → ( ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom ∩ dom 𝑔 ) ∧ ∀ 𝑎 ∈ ( dom ∩ dom 𝑔 ) ( ( ↾ ( dom ∩ dom 𝑔 ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) ) ) ) )
30 incom ( dom 𝑔 ∩ dom ) = ( dom ∩ dom 𝑔 )
31 30 reseq2i ( ↾ ( dom 𝑔 ∩ dom ) ) = ( ↾ ( dom ∩ dom 𝑔 ) )
32 31 fneq1i ( ( ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ↔ ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom 𝑔 ∩ dom ) )
33 30 fneq2i ( ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom 𝑔 ∩ dom ) ↔ ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom ∩ dom 𝑔 ) )
34 32 33 bitri ( ( ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ↔ ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom ∩ dom 𝑔 ) )
35 31 fveq1i ( ( ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( ( ↾ ( dom ∩ dom 𝑔 ) ) ‘ 𝑎 )
36 predeq2 ( ( dom 𝑔 ∩ dom ) = ( dom ∩ dom 𝑔 ) → Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) = Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) )
37 30 36 ax-mp Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) = Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 )
38 31 37 reseq12i ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) = ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) )
39 38 fveq2i ( 𝐹 ‘ ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) = ( 𝐹 ‘ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) ) )
40 35 39 eqeq12i ( ( ( ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ↔ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) ) ) )
41 30 40 raleqbii ( ∀ 𝑎 ∈ ( dom 𝑔 ∩ dom ) ( ( ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ↔ ∀ 𝑎 ∈ ( dom ∩ dom 𝑔 ) ( ( ↾ ( dom ∩ dom 𝑔 ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) ) ) )
42 34 41 anbi12i ( ( ( ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ∧ ∀ 𝑎 ∈ ( dom 𝑔 ∩ dom ) ( ( ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ) ↔ ( ( ↾ ( dom ∩ dom 𝑔 ) ) Fn ( dom ∩ dom 𝑔 ) ∧ ∀ 𝑎 ∈ ( dom ∩ dom 𝑔 ) ( ( ↾ ( dom ∩ dom 𝑔 ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom ∩ dom 𝑔 ) ) ↾ Pred ( 𝑅 , ( dom ∩ dom 𝑔 ) , 𝑎 ) ) ) ) )
43 29 42 sylibr ( ( 𝑔𝐵𝐵 ) → ( ( ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ∧ ∀ 𝑎 ∈ ( dom 𝑔 ∩ dom ) ( ( ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ) )
44 wfr3g ( ( ( 𝑅 We ( dom 𝑔 ∩ dom ) ∧ 𝑅 Se ( dom 𝑔 ∩ dom ) ) ∧ ( ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ∧ ∀ 𝑎 ∈ ( dom 𝑔 ∩ dom ) ( ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ) ∧ ( ( ↾ ( dom 𝑔 ∩ dom ) ) Fn ( dom 𝑔 ∩ dom ) ∧ ∀ 𝑎 ∈ ( dom 𝑔 ∩ dom ) ( ( ↾ ( dom 𝑔 ∩ dom ) ) ‘ 𝑎 ) = ( 𝐹 ‘ ( ( ↾ ( dom 𝑔 ∩ dom ) ) ↾ Pred ( 𝑅 , ( dom 𝑔 ∩ dom ) , 𝑎 ) ) ) ) ) → ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) = ( ↾ ( dom 𝑔 ∩ dom ) ) )
45 26 27 43 44 syl3anc ( ( 𝑔𝐵𝐵 ) → ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) = ( ↾ ( dom 𝑔 ∩ dom ) ) )
46 45 breqd ( ( 𝑔𝐵𝐵 ) → ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) )
47 46 biimprd ( ( 𝑔𝐵𝐵 ) → ( 𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) )
48 3 wfrlem2 ( 𝑔𝐵 → Fun 𝑔 )
49 funres ( Fun 𝑔 → Fun ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) )
50 dffun2 ( Fun ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) ↔ ( Rel ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) ∧ ∀ 𝑥𝑢𝑣 ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) ) )
51 50 simprbi ( Fun ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) → ∀ 𝑥𝑢𝑣 ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) )
52 2sp ( ∀ 𝑢𝑣 ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) → ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) )
53 52 sps ( ∀ 𝑥𝑢𝑣 ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) → ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) )
54 48 49 51 53 4syl ( 𝑔𝐵 → ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) )
55 54 adantr ( ( 𝑔𝐵𝐵 ) → ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) )
56 47 55 sylan2d ( ( 𝑔𝐵𝐵 ) → ( ( 𝑥 ( 𝑔 ↾ ( dom 𝑔 ∩ dom ) ) 𝑢𝑥 ( ↾ ( dom 𝑔 ∩ dom ) ) 𝑣 ) → 𝑢 = 𝑣 ) )
57 17 56 syl5 ( ( 𝑔𝐵𝐵 ) → ( ( 𝑥 𝑔 𝑢𝑥 𝑣 ) → 𝑢 = 𝑣 ) )