Proof-producing evaluation of a ^ b % n #
Note that Mathlib.Tactic.NormNum.PowMod contains a similar tactic, but that runs significantly
slower and less efficiently than the one here.
Computable version of powModTR using partial_fixpoint. Used at elaboration time
(e.g. in mkPowModEq') where we need actual computation, not kernel reduction.
Equations
- powModTR' a b n = powModTR'.aux n (a % n) b 1
Instances For
Given a, b, n, m : ℕ, if powMod a b n = m then return a proof of that fact.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a, b, n, m : ℕ, if powMod a b n ≠ m then return a proof of that fact.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tactic to close goals about modular exponentiation. Handles two goal shapes:
powMod a b n = m— proves the equality by computinga ^ b % nat elaboration timepowMod a b n ≠ m— proves the disequality similarly
All of a, b, n, m must be numeric literals. The computation uses powModTR'
(the partial_fixpoint version) at elaboration time, then produces a kernel proof via
powModTR and eagerReduce.
example : powMod 11 100002 100003 = 1 := by prove_pow_mod
example : powMod 2 100002 100003 ≠ 1 := by prove_pow_mod
Equations
- Tactic.powMod.tacticProve_pow_mod = Lean.ParserDescr.node `Tactic.powMod.tacticProve_pow_mod 1024 (Lean.ParserDescr.nonReservedSymbol "prove_pow_mod" false)