Intuitionistic Logic Explorer < Previous   Next > Nearby theorems Mirrors  >  Home  >  ILE Home  >  Th. List  >  ialgcvg GIF version

Theorem ialgcvg 10810
 Description: One way to prove that an algorithm halts is to construct a countdown function 𝐶:𝑆⟶ℕ0 whose value is guaranteed to decrease for each iteration of 𝐹 until it reaches 0. That is, if 𝑋 ∈ 𝑆 is not a fixed point of 𝐹, then (𝐶‘(𝐹‘𝑋)) < (𝐶‘𝑋). If 𝐶 is a countdown function for algorithm 𝐹, the sequence (𝐶‘(𝑅‘𝑘)) reaches 0 after at most 𝑁 steps, where 𝑁 is the value of 𝐶 for the initial state 𝐴. (Contributed by Paul Chapman, 22-Jun-2011.)
Hypotheses
Ref Expression
algcvg.1 𝐹:𝑆𝑆
algcvg.2 𝑅 = seq0((𝐹 ∘ 1st ), (ℕ0 × {𝐴}), 𝑆)
algcvg.3 𝐶:𝑆⟶ℕ0
algcvg.4 (𝑧𝑆 → ((𝐶‘(𝐹𝑧)) ≠ 0 → (𝐶‘(𝐹𝑧)) < (𝐶𝑧)))
algcvg.5 𝑁 = (𝐶𝐴)
ialgcvg.s 𝑆𝑉
Assertion
Ref Expression
ialgcvg (𝐴𝑆 → (𝐶‘(𝑅𝑁)) = 0)
Distinct variable groups:   𝑧,𝐶   𝑧,𝐹   𝑧,𝑅   𝑧,𝑆
Allowed substitution hints:   𝐴(𝑧)   𝑁(𝑧)   𝑉(𝑧)

Proof of Theorem ialgcvg
Dummy variable 𝑘 is distinct from all other variables.
StepHypRef Expression
1 nn0uz 8948 . . . 4 0 = (ℤ‘0)
2 algcvg.2 . . . 4 𝑅 = seq0((𝐹 ∘ 1st ), (ℕ0 × {𝐴}), 𝑆)
3 0zd 8658 . . . 4 (𝐴𝑆 → 0 ∈ ℤ)
4 id 19 . . . 4 (𝐴𝑆𝐴𝑆)
5 algcvg.1 . . . . 5 𝐹:𝑆𝑆
65a1i 9 . . . 4 (𝐴𝑆𝐹:𝑆𝑆)
7 ialgcvg.s . . . . 5 𝑆𝑉
87a1i 9 . . . 4 (𝐴𝑆𝑆𝑉)
91, 2, 3, 4, 6, 8ialgrf 10807 . . 3 (𝐴𝑆𝑅:ℕ0𝑆)
10 algcvg.5 . . . 4 𝑁 = (𝐶𝐴)
11 algcvg.3 . . . . 5 𝐶:𝑆⟶ℕ0
1211ffvelrni 5378 . . . 4 (𝐴𝑆 → (𝐶𝐴) ∈ ℕ0)
1310, 12syl5eqel 2169 . . 3 (𝐴𝑆𝑁 ∈ ℕ0)
14 fvco3 5320 . . 3 ((𝑅:ℕ0𝑆𝑁 ∈ ℕ0) → ((𝐶𝑅)‘𝑁) = (𝐶‘(𝑅𝑁)))
159, 13, 14syl2anc 403 . 2 (𝐴𝑆 → ((𝐶𝑅)‘𝑁) = (𝐶‘(𝑅𝑁)))
16 fco 5125 . . . 4 ((𝐶:𝑆⟶ℕ0𝑅:ℕ0𝑆) → (𝐶𝑅):ℕ0⟶ℕ0)
1711, 9, 16sylancr 405 . . 3 (𝐴𝑆 → (𝐶𝑅):ℕ0⟶ℕ0)
18 0nn0 8580 . . . . . 6 0 ∈ ℕ0
19 fvco3 5320 . . . . . 6 ((𝑅:ℕ0𝑆 ∧ 0 ∈ ℕ0) → ((𝐶𝑅)‘0) = (𝐶‘(𝑅‘0)))
209, 18, 19sylancl 404 . . . . 5 (𝐴𝑆 → ((𝐶𝑅)‘0) = (𝐶‘(𝑅‘0)))
211, 2, 3, 4, 6, 8ialgr0 10806 . . . . . 6 (𝐴𝑆 → (𝑅‘0) = 𝐴)
2221fveq2d 5257 . . . . 5 (𝐴𝑆 → (𝐶‘(𝑅‘0)) = (𝐶𝐴))
2320, 22eqtrd 2115 . . . 4 (𝐴𝑆 → ((𝐶𝑅)‘0) = (𝐶𝐴))
2423, 10syl6reqr 2134 . . 3 (𝐴𝑆𝑁 = ((𝐶𝑅)‘0))
259ffvelrnda 5379 . . . . 5 ((𝐴𝑆𝑘 ∈ ℕ0) → (𝑅𝑘) ∈ 𝑆)
26 fveq2 5253 . . . . . . . . 9 (𝑧 = (𝑅𝑘) → (𝐹𝑧) = (𝐹‘(𝑅𝑘)))
2726fveq2d 5257 . . . . . . . 8 (𝑧 = (𝑅𝑘) → (𝐶‘(𝐹𝑧)) = (𝐶‘(𝐹‘(𝑅𝑘))))
2827neeq1d 2267 . . . . . . 7 (𝑧 = (𝑅𝑘) → ((𝐶‘(𝐹𝑧)) ≠ 0 ↔ (𝐶‘(𝐹‘(𝑅𝑘))) ≠ 0))
29 fveq2 5253 . . . . . . . 8 (𝑧 = (𝑅𝑘) → (𝐶𝑧) = (𝐶‘(𝑅𝑘)))
3027, 29breq12d 3824 . . . . . . 7 (𝑧 = (𝑅𝑘) → ((𝐶‘(𝐹𝑧)) < (𝐶𝑧) ↔ (𝐶‘(𝐹‘(𝑅𝑘))) < (𝐶‘(𝑅𝑘))))
3128, 30imbi12d 232 . . . . . 6 (𝑧 = (𝑅𝑘) → (((𝐶‘(𝐹𝑧)) ≠ 0 → (𝐶‘(𝐹𝑧)) < (𝐶𝑧)) ↔ ((𝐶‘(𝐹‘(𝑅𝑘))) ≠ 0 → (𝐶‘(𝐹‘(𝑅𝑘))) < (𝐶‘(𝑅𝑘)))))
32 algcvg.4 . . . . . 6 (𝑧𝑆 → ((𝐶‘(𝐹𝑧)) ≠ 0 → (𝐶‘(𝐹𝑧)) < (𝐶𝑧)))
3331, 32vtoclga 2675 . . . . 5 ((𝑅𝑘) ∈ 𝑆 → ((𝐶‘(𝐹‘(𝑅𝑘))) ≠ 0 → (𝐶‘(𝐹‘(𝑅𝑘))) < (𝐶‘(𝑅𝑘))))
3425, 33syl 14 . . . 4 ((𝐴𝑆𝑘 ∈ ℕ0) → ((𝐶‘(𝐹‘(𝑅𝑘))) ≠ 0 → (𝐶‘(𝐹‘(𝑅𝑘))) < (𝐶‘(𝑅𝑘))))
35 peano2nn0 8605 . . . . . . 7 (𝑘 ∈ ℕ0 → (𝑘 + 1) ∈ ℕ0)
36 fvco3 5320 . . . . . . 7 ((𝑅:ℕ0𝑆 ∧ (𝑘 + 1) ∈ ℕ0) → ((𝐶𝑅)‘(𝑘 + 1)) = (𝐶‘(𝑅‘(𝑘 + 1))))
379, 35, 36syl2an 283 . . . . . 6 ((𝐴𝑆𝑘 ∈ ℕ0) → ((𝐶𝑅)‘(𝑘 + 1)) = (𝐶‘(𝑅‘(𝑘 + 1))))
381, 2, 3, 4, 6, 8ialgrp1 10808 . . . . . . 7 ((𝐴𝑆𝑘 ∈ ℕ0) → (𝑅‘(𝑘 + 1)) = (𝐹‘(𝑅𝑘)))
3938fveq2d 5257 . . . . . 6 ((𝐴𝑆𝑘 ∈ ℕ0) → (𝐶‘(𝑅‘(𝑘 + 1))) = (𝐶‘(𝐹‘(𝑅𝑘))))
4037, 39eqtrd 2115 . . . . 5 ((𝐴𝑆𝑘 ∈ ℕ0) → ((𝐶𝑅)‘(𝑘 + 1)) = (𝐶‘(𝐹‘(𝑅𝑘))))
4140neeq1d 2267 . . . 4 ((𝐴𝑆𝑘 ∈ ℕ0) → (((𝐶𝑅)‘(𝑘 + 1)) ≠ 0 ↔ (𝐶‘(𝐹‘(𝑅𝑘))) ≠ 0))
42 fvco3 5320 . . . . . 6 ((𝑅:ℕ0𝑆𝑘 ∈ ℕ0) → ((𝐶𝑅)‘𝑘) = (𝐶‘(𝑅𝑘)))
439, 42sylan 277 . . . . 5 ((𝐴𝑆𝑘 ∈ ℕ0) → ((𝐶𝑅)‘𝑘) = (𝐶‘(𝑅𝑘)))
4440, 43breq12d 3824 . . . 4 ((𝐴𝑆𝑘 ∈ ℕ0) → (((𝐶𝑅)‘(𝑘 + 1)) < ((𝐶𝑅)‘𝑘) ↔ (𝐶‘(𝐹‘(𝑅𝑘))) < (𝐶‘(𝑅𝑘))))
4534, 41, 443imtr4d 201 . . 3 ((𝐴𝑆𝑘 ∈ ℕ0) → (((𝐶𝑅)‘(𝑘 + 1)) ≠ 0 → ((𝐶𝑅)‘(𝑘 + 1)) < ((𝐶𝑅)‘𝑘)))
4617, 24, 45nn0seqcvgd 10803 . 2 (𝐴𝑆 → ((𝐶𝑅)‘𝑁) = 0)
4715, 46eqtr3d 2117 1 (𝐴𝑆 → (𝐶‘(𝑅𝑁)) = 0)
 Colors of variables: wff set class Syntax hints:   → wi 4   ∧ wa 102   = wceq 1285   ∈ wcel 1434   ≠ wne 2249  {csn 3422   class class class wbr 3811   × cxp 4399   ∘ ccom 4405  ⟶wf 4965  ‘cfv 4969  (class class class)co 5591  1st c1st 5844  0cc0 7253  1c1 7254   + caddc 7256   < clt 7425  ℕ0cn0 8565  seqcseq 9740 This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1377  ax-7 1378  ax-gen 1379  ax-ie1 1423  ax-ie2 1424  ax-8 1436  ax-10 1437  ax-11 1438  ax-i12 1439  ax-bndl 1440  ax-4 1441  ax-13 1445  ax-14 1446  ax-17 1460  ax-i9 1464  ax-ial 1468  ax-i5r 1469  ax-ext 2065  ax-coll 3919  ax-sep 3922  ax-nul 3930  ax-pow 3974  ax-pr 4000  ax-un 4224  ax-setind 4316  ax-iinf 4366  ax-cnex 7339  ax-resscn 7340  ax-1cn 7341  ax-1re 7342  ax-icn 7343  ax-addcl 7344  ax-addrcl 7345  ax-mulcl 7346  ax-addcom 7348  ax-addass 7350  ax-distr 7352  ax-i2m1 7353  ax-0lt1 7354  ax-0id 7356  ax-rnegex 7357  ax-cnre 7359  ax-pre-ltirr 7360  ax-pre-ltwlin 7361  ax-pre-lttrn 7362  ax-pre-apti 7363  ax-pre-ltadd 7364 This theorem depends on definitions:  df-bi 115  df-dc 777  df-3or 921  df-3an 922  df-tru 1288  df-fal 1291  df-nf 1391  df-sb 1688  df-eu 1946  df-mo 1947  df-clab 2070  df-cleq 2076  df-clel 2079  df-nfc 2212  df-ne 2250  df-nel 2345  df-ral 2358  df-rex 2359  df-reu 2360  df-rab 2362  df-v 2614  df-sbc 2827  df-csb 2920  df-dif 2986  df-un 2988  df-in 2990  df-ss 2997  df-nul 3270  df-pw 3408  df-sn 3428  df-pr 3429  df-op 3431  df-uni 3628  df-int 3663  df-iun 3706  df-br 3812  df-opab 3866  df-mpt 3867  df-tr 3902  df-id 4084  df-iord 4157  df-on 4159  df-ilim 4160  df-suc 4162  df-iom 4369  df-xp 4407  df-rel 4408  df-cnv 4409  df-co 4410  df-dm 4411  df-rn 4412  df-res 4413  df-ima 4414  df-iota 4934  df-fun 4971  df-fn 4972  df-f 4973  df-f1 4974  df-fo 4975  df-f1o 4976  df-fv 4977  df-riota 5547  df-ov 5594  df-oprab 5595  df-mpt2 5596  df-1st 5846  df-2nd 5847  df-recs 6002  df-frec 6088  df-pnf 7427  df-mnf 7428  df-xr 7429  df-ltxr 7430  df-le 7431  df-sub 7558  df-neg 7559  df-inn 8317  df-n0 8566  df-z 8647  df-uz 8915  df-iseq 9741 This theorem is referenced by:  ialgcvga  10813
 Copyright terms: Public domain W3C validator