Metamath Proof Explorer


Theorem itcoval2

Description: A function iterated twice. (Contributed by AV, 2-May-2024)

Ref Expression
Assertion itcoval2 ( ( Rel 𝐹𝐹𝑉 ) → ( ( IterComp ‘ 𝐹 ) ‘ 2 ) = ( 𝐹𝐹 ) )

Proof

Step Hyp Ref Expression
1 itcoval ( 𝐹𝑉 → ( IterComp ‘ 𝐹 ) = seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) )
2 1 fveq1d ( 𝐹𝑉 → ( ( IterComp ‘ 𝐹 ) ‘ 2 ) = ( seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) ‘ 2 ) )
3 2 adantl ( ( Rel 𝐹𝐹𝑉 ) → ( ( IterComp ‘ 𝐹 ) ‘ 2 ) = ( seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) ‘ 2 ) )
4 nn0uz 0 = ( ℤ ‘ 0 )
5 1nn0 1 ∈ ℕ0
6 5 a1i ( ( Rel 𝐹𝐹𝑉 ) → 1 ∈ ℕ0 )
7 df-2 2 = ( 1 + 1 )
8 1 eqcomd ( 𝐹𝑉 → seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) = ( IterComp ‘ 𝐹 ) )
9 8 fveq1d ( 𝐹𝑉 → ( seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) ‘ 1 ) = ( ( IterComp ‘ 𝐹 ) ‘ 1 ) )
10 9 adantl ( ( Rel 𝐹𝐹𝑉 ) → ( seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) ‘ 1 ) = ( ( IterComp ‘ 𝐹 ) ‘ 1 ) )
11 itcoval1 ( ( Rel 𝐹𝐹𝑉 ) → ( ( IterComp ‘ 𝐹 ) ‘ 1 ) = 𝐹 )
12 10 11 eqtrd ( ( Rel 𝐹𝐹𝑉 ) → ( seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) ‘ 1 ) = 𝐹 )
13 eqidd ( ( Rel 𝐹𝐹𝑉 ) → ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) = ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) )
14 2ne0 2 ≠ 0
15 neeq1 ( 𝑖 = 2 → ( 𝑖 ≠ 0 ↔ 2 ≠ 0 ) )
16 14 15 mpbiri ( 𝑖 = 2 → 𝑖 ≠ 0 )
17 16 neneqd ( 𝑖 = 2 → ¬ 𝑖 = 0 )
18 17 iffalsed ( 𝑖 = 2 → if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) = 𝐹 )
19 18 adantl ( ( ( Rel 𝐹𝐹𝑉 ) ∧ 𝑖 = 2 ) → if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) = 𝐹 )
20 2nn0 2 ∈ ℕ0
21 20 a1i ( ( Rel 𝐹𝐹𝑉 ) → 2 ∈ ℕ0 )
22 simpr ( ( Rel 𝐹𝐹𝑉 ) → 𝐹𝑉 )
23 13 19 21 22 fvmptd ( ( Rel 𝐹𝐹𝑉 ) → ( ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ‘ 2 ) = 𝐹 )
24 4 6 7 12 23 seqp1d ( ( Rel 𝐹𝐹𝑉 ) → ( seq 0 ( ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) , ( 𝑖 ∈ ℕ0 ↦ if ( 𝑖 = 0 , ( I ↾ dom 𝐹 ) , 𝐹 ) ) ) ‘ 2 ) = ( 𝐹 ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) 𝐹 ) )
25 eqidd ( 𝐹𝑉 → ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) = ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) )
26 coeq2 ( 𝑔 = 𝐹 → ( 𝐹𝑔 ) = ( 𝐹𝐹 ) )
27 26 ad2antrl ( ( 𝐹𝑉 ∧ ( 𝑔 = 𝐹𝑗 = 𝐹 ) ) → ( 𝐹𝑔 ) = ( 𝐹𝐹 ) )
28 elex ( 𝐹𝑉𝐹 ∈ V )
29 coexg ( ( 𝐹𝑉𝐹𝑉 ) → ( 𝐹𝐹 ) ∈ V )
30 29 anidms ( 𝐹𝑉 → ( 𝐹𝐹 ) ∈ V )
31 25 27 28 28 30 ovmpod ( 𝐹𝑉 → ( 𝐹 ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) 𝐹 ) = ( 𝐹𝐹 ) )
32 31 adantl ( ( Rel 𝐹𝐹𝑉 ) → ( 𝐹 ( 𝑔 ∈ V , 𝑗 ∈ V ↦ ( 𝐹𝑔 ) ) 𝐹 ) = ( 𝐹𝐹 ) )
33 3 24 32 3eqtrd ( ( Rel 𝐹𝐹𝑉 ) → ( ( IterComp ‘ 𝐹 ) ‘ 2 ) = ( 𝐹𝐹 ) )