I agree Our site saves small pieces of text information (cookies) on your device in order to deliver better content and for statistical purposes. You can disable the usage of cookies by changing the settings of your browser. By browsing our website without changing the browser settings you grant us permission to store that information on your device.
Could you believe it? Stefan was playing around with his favorite numbers, he wanted to practice taking the fifth power of them, when suddenly he realized, that the least significant digit of the result was the same as the original number's. Can you show him why?
That is, prove:n mod 10 = (n ^ 5) mod 10
theory Defs imports Main begin end
theory Submission imports Defs begin lemma modpower5: fixes n :: nat shows "n mod 10 = (n ^ 5) mod 10" sorry end
theory Check imports Submission begin lemma "(n::nat) mod 10 = (n ^ 5) mod 10" by (rule Submission.modpower5) end
Require Export Arith Lia.
Require Import Defs. (* Proving this might be useful (but is not mandatory). *) Lemma mod_power a b n : ((a mod b) ^ n) mod b = (a ^ n) mod b. Admitted. Theorem modpower5 : forall (n: nat), n mod 10 = (n ^ 5) mod 10. Proof. (* todo *) Admitted.
theory Defs imports Main begin end
theory Submission imports Defs begin lemma modpower5: fixes n :: nat shows "n mod 10 = (n ^ 5) mod 10" sorry end
theory Check imports Submission begin lemma "(n::nat) mod 10 = (n ^ 5) mod 10" by (rule Submission.modpower5) end
-- no definitions required -- Lean version: 3.4.2 -- Mathlib version: 2019-07-31
theorem mod_power_five : ∀ (n : ℕ), n % 10 = (n ^ 5) % 10 := sorry
import .submission theorem you_did_it : ∀ (n : ℕ), n % 10 = (n ^ 5) % 10 := mod_power_five
(in-package "ACL2")
(in-package "ACL2") (defthm modpower5 (implies (natp n) (equal (mod-expt n 5 10) (mod n 10))) )
; The four lines just below are boilerplate, that is, the same for every ; problem. (in-package "ACL2") (include-book "Submission") (set-enforce-redundancy t) (include-book "Defs") ; The events below represent the theorem to be proved, and are copied from ; template.lisp. (defthm modpower5 (implies (natp n) (equal (mod-expt n 5 10) (mod n 10))) )
-- no definitions required -- Lean version: 3.16.2 -- Mathlib version: eb5b7fb7f406385cd1f2efaa15d9c0923541b955
theorem mod_power_five : ∀ (n : ℕ), n % 10 = (n ^ 5) % 10 := sorry
import .submission theorem you_did_it : ∀ (n : ℕ), n % 10 = (n ^ 5) % 10 := mod_power_five
theory Defs imports Main begin end
theory Submission imports Defs begin lemma modpower5: fixes n :: nat shows "n mod 10 = (n ^ 5) mod 10" sorry end
theory Check imports Submission begin lemma "(n::nat) mod 10 = (n ^ 5) mod 10" by (rule Submission.modpower5) end