PFR/Tactic/RPowSimp.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Polynomial Freiman-Ruzsa proof paper, arXiv v2
40 declarations, 0 contain sorry, 0 declared as axioms
Imports (1)
Imported by 2 files
- structure
Mathlib.Tactic.RPowRing.ContextThe read-only state of theRPowRingmonad line 15 sourceSource documentation
The read-only state of the
RPowRingmonad.standard axioms: Classical.choice, Quot.sound, propext what this means
structure Context where …
- structure
Mathlib.Tactic.RPowRing.ConfigConfiguration forring_nfline 24 sourceSource documentation
Configuration for
ring_nf.no axioms what this means
structure Config where …
- abbrev
Mathlib.Tactic.RPowRing.MDocumented declaration: M line 37 sourceSource documentation
The monad for
RingNFcontains, in addition to theAtomMstate, a simp context for the main traversal and a simp function (which has another simp context) to simplify normalized polynomials.standard axioms: Classical.choice, Quot.sound, propext what this means
Proof uses:
ReaderT, Mathlib.Tactic.RPowRing.Context,Mathlib.Tactic.AtomMabbrev M := ReaderT Context AtomM
Mentions: Mathlib.Tactic.RPowRing.Context
- inductive
Mathlib.Tactic.RPowRing.ExBaseA monomial, which is a product of powers ofExBaseexpressions, terminated by a (nonzero) constant coefficient line 43 sourceSource documentation
A monomial, which is a product of powers of
ExBaseexpressions, terminated by a (nonzero) constant coefficient.no axioms what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Levelinductive ExBase : (e : Q(ℝ)) → Type /-- A coefficient `value`, which must not be `0`. `e` is a raw rat cast. If `value` is not an integer, then `hyp` should be a proof of `(value.den : α) ≠ 0`. -/ | atom (id : ℕ) (x : Q(ℝ)) : ExBase x /-- A product `x ^ e * b` is a monomial if `b` is a monomial. Here `x` is an `ExBase` and `e` is an `ExBase` representing a monomial expression in `ℕ` (it is a monomial instead of a polynomial because we eagerly normalize `x ^ (a + b) = x ^ a * x ^ b`.) -/ | pow (id : ℕ) (x : Q(ℝ)) (h : Q(0 < $x)) (e : Q(ℝ)) : ExBase q($x ^ $e)
- def
Mathlib.Tactic.RPowRing.ExBase.idline 52 sourceno axioms what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Level, Mathlib.Tactic.RPowRing.ExBase,NatProof uses:
Lean.Expr.app,Lean.Name.mkStr2,List.cons,Lean.Level.zero,Lean.Expr.lit,Lean.Literal.natVal1 instances, coercions and auxiliary constants left out.
- inductive
Mathlib.Tactic.RPowRing.ExProdA monomial, which is a product of powers ofExBaseexpressions, terminated by a (nonzero) constant coefficient line 59 sourceSource documentation
A monomial, which is a product of powers of
ExBaseexpressions, terminated by a (nonzero) constant coefficient.no axioms what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Levelinductive ExProd : (e : Q(ℝ)) → Type /-- A coefficient `value`, which must not be `0`. `e` is a raw rat cast. If `value` is not an integer, then `hyp` should be a proof of `(value.den : α) ≠ 0`. -/ | one : ExProd q(1) /-- A product `x ^ e * b` is a monomial if `b` is a monomial. Here `x` is an `ExBase` and `e` is an `ExProd` representing a monomial expression in `ℕ` (it is a monomial instead of a polynomial because we eagerly normalize `x ^ (a + b) = x ^ a * x ^ b`.) -/ | mul {x b : Q(ℝ)} : ExBase x → ExProd b → ExProd q($x * $b)Mentions: Mathlib.Tactic.RPowRing.ExBase
- instance
Mathlib.Tactic.RPowRing.(instance at line 68)line 68 source - instance
Mathlib.Tactic.RPowRing.(instance at line 69)line 69 source - def
Mathlib.Tactic.RPowRing.ExBase.toProdEmbed an exponent (anExBase, ExProdpair) as anExProdby multiplying by 1 line 72 sourceSource documentation
Embed an exponent (an
ExBase, ExProdpair) as anExProdby multiplying by 1.no axioms what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Level, Mathlib.Tactic.RPowRing.ExBase, Mathlib.Tactic.RPowRing.ExProd,Qq.Quoted.unsafeMk,Lean.Expr.app,Lean.Name.mkStr2,List.cons,Lean.Level.zero,Lean.Expr.lit,Lean.Literal.natValProof uses:
Mathlib.Tactic.RPowRing.ExProd.mul,Mathlib.Tactic.RPowRing.ExProd.onedef ExBase.toProd {a : Q(ℝ)} (va : ExBase a) : ExProd q($a * 1) := .mul va .oneMentions: Mathlib.Tactic.RPowRing.ExBase, Mathlib.Tactic.RPowRing.ExProd
- abbrev
Mathlib.Tactic.RPowRing.Resultline 74 sourceno axioms what this means
Statement uses:
Qq.Quoted,Qq.Quoted.unsafeMk,Lean.Expr.sort,Lean.Level.succ,Lean.Level.zero,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.LevelProof uses:
Mathlib.Tactic.Ring.Common.Result - instance
Mathlib.Tactic.RPowRing.(instance at line 76)line 76 source - theorem
Mathlib.Tactic.RPowRing.atom_pfline 79 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HMul.hMul,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congrArg,mul_one,eq_self11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.atom_pf'line 80 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HMul.hMul,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congr,congrArg,congrFun',mul_one,eq_self11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.atom_pow_pfline 81 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HMul.hMul,HPow.hPow,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congrArg,congrFun',Real.rpow_one,mul_one,eq_self15 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.atom_pow_pf'line 82 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HMul.hMul,HPow.hPow,Nat,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congr,congrArg,congrFun',pow_one,mul_one,eq_self21 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- def
Mathlib.Tactic.RPowRing.evalAtomEvaluates an atom, an expression whereringcan find no additional structure line 89 sourceSource documentation
Evaluates an atom, an expression where
ringcan find no additional structure.a = a ^ 1 * 1 + 0
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Level,Mathlib.Tactic.AtomM, Mathlib.Tactic.RPowRing.Result, Mathlib.Tactic.RPowRing.ExProdProof uses:
Bind.bind,Mathlib.Tactic.AtomM.Context,StateRefT',IO.RealWorld,Mathlib.Tactic.AtomM.State,Lean.Meta.MetaM,MonadReader.read,Lean.Meta.Simp.Result,liftM,ReaderT,Lean.Meta.Context,Lean.Meta.State,Lean.Core.CoreM,Mathlib.Tactic.AtomM.Context.evalAtom,Lean.Meta.Simp.Result.expr,Prod,Nat,Lean.Expr,Mathlib.Tactic.AtomM.addAtom,Mathlib.Meta.Positivity.Strictnessand 20 more14 instances, coercions and auxiliary constants left out.
def evalAtom (e : Q(ℝ)) : AtomM (Result ExProd e) := do …
Mentions: Mathlib.Tactic.RPowRing.Result, Mathlib.Tactic.RPowRing.ExProd
- theorem
Mathlib.Tactic.RPowRing.mul_pf_leftline 102 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HMul.hMulProof uses:
Eq.mpr,id,congrArg,mul_assoc,Eq.refl7 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.mul_pf_rightline 105 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HMul.hMulProof uses:
Eq.mpr,id,congrArg,mul_left_comm,Eq.refl8 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.mul_pp_pf_overlapline 108 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LT.lt,OfNat.ofNat,Eq,HMul.hMul,HPow.hPow,HAdd.hAddProof uses:
Eq.mpr,id,congrArg,Real.rpow_add,mul_mul_mul_comm,Eq.refl22 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- def
Mathlib.Tactic.RPowRing.evalMulMultiplies two monomialsva, vbtogether to get a normalized result monomial line 122 sourceSource documentation
Multiplies two monomials
va, vbtogether to get a normalized result monomial.x * y = (x * y)(forx,ycoefficients)x * (b₁ * b₂) = b₁ * (b₂ * x)(forxcoefficient)(a₁ * a₂) * y = a₁ * (a₂ * y)(forycoefficient)(x ^ ea * a₂) * (x ^ eb * b₂) = x ^ (ea + eb) * (a₂ * b₂)(ifeaandebare identical except coefficient)(a₁ * a₂) * (b₁ * b₂) = a₁ * (a₂ * (b₁ * b₂))(ifa₁.lt b₁)(a₁ * a₂) * (b₁ * b₂) = b₁ * ((a₁ * a₂) * b₂)(if nota₁.lt b₁)
no axioms what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Level, Mathlib.Tactic.RPowRing.ExProd, Mathlib.Tactic.RPowRing.Result,Qq.Quoted.unsafeMk,Lean.Expr.sort,Lean.Level.succ,Lean.Level.zero,Lean.Expr.app,Lean.Name.mkStr2,List.consProof uses:
Inhabited.default1 instances, coercions and auxiliary constants left out.
partial def evalMul {a b : Q(ℝ)} (va : ExProd a) (vb : ExProd b) : Result ExProd q($a * $b) := …Mentions: Mathlib.Tactic.RPowRing.ExProd, Mathlib.Tactic.RPowRing.Result
- theorem
Mathlib.Tactic.RPowRing.pow_posline 146 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LT.lt,OfNat.ofNat,HMul.hMul,HPow.hPowProof uses:
mul_pos,Real.rpow_pos_of_pos18 instances, coercions and auxiliary constants left out.
- theorem
Mathlib.Tactic.RPowRing.pow_pfline 149 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LT.lt,OfNat.ofNat,Eq,HPow.hPow,HMul.hMulProof uses:
Eq.mpr,id,congrArg,Real.mul_rpow,LT.lt.le,Real.rpow_pos_of_pos,Real.rpow_mul,Eq.refl16 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- def
Mathlib.Tactic.RPowRing.evalPowline 153 sourceno axioms what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Level, Mathlib.Tactic.RPowRing.ExProd,Option,Prod,Lean.Expr.app,Lean.Name.mkStr2,List.cons,Lean.Level.zero,Lean.Expr.lit,Lean.Literal.natVal, Mathlib.Tactic.RPowRing.Result,Qq.Quoted.unsafeMk,Lean.Expr.sort,Lean.Level.succ2 instances, coercions and auxiliary constants left out.
- theorem
Mathlib.Tactic.RPowRing.pow_congrline 163 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HPow.hPowProof uses:
Eq.refl,Eq.symm5 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.inv_congrline 165 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HPow.hPow,Neg.neg,OfNat.ofNat,Inv.invProof uses:
of_eq_true,Eq.trans,True,congrArg,Real.rpow_neg_one,eq_self,Eq.symm13 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Mathlib.Tactic.RPowRing.npow_congrline 168 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,Eq,HPow.hPow,NPow.npowProof uses:
of_eq_true,Eq.trans,True,congrArg,Real.rpow_natCast,eq_self,Eq.symm14 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- def
Mathlib.Tactic.RPowRing.evalline 171 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Qq.Quoted,Lean.Expr.const,Lean.Name.mkStr1,List.nil,Lean.Level,Mathlib.Tactic.AtomM, Mathlib.Tactic.RPowRing.Result, Mathlib.Tactic.RPowRing.ExProdProof uses:
Inhabited.default,Mathlib.Tactic.AtomM.Context,StateRefT',IO.RealWorld,Mathlib.Tactic.AtomM.State,Lean.Meta.MetaM5 instances, coercions and auxiliary constants left out.
- def
Mathlib.Tactic.RPowRing.rewriteline 200 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Lean.Expr,optParam,Bool,Bool.true, Mathlib.Tactic.RPowRing.M,Lean.Meta.Simp.ResultProof uses: Mathlib.Tactic.RPowRing.Context,
Mathlib.Tactic.AtomM.Context,ST.Ref,IO.RealWorld,Mathlib.Tactic.AtomM.State,Lean.Meta.Simp.Simproc,Bind.bind,Lean.Meta.Simp.SimpM,Lean.Meta.Simp.MethodsRef,ReaderT,Lean.Meta.Simp.Context,StateRefT',Lean.Meta.Simp.State,Lean.Meta.MetaM,Except,Lean.Meta.Simp.Step,MonadExcept.tryCatch,Lean.Exception,Lean.Meta.Context,Lean.Meta.Stateand 71 more43 instances, coercions and auxiliary constants left out.
- def
Mathlib.Tactic.RPowRing.M.runRuns a tactic in theRingNF.Mmonad, given initial data: *s: a reference to the mutable state ofring, for persisting across calls line 224 sourceSource documentation
Runs a tactic in the
RingNF.Mmonad, given initial data:s: a reference to the mutable state ofring, for persisting across calls. This ensures that atom ordering is used consistently.cfg: the configuration optionsx: the tactic to run
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IO.Ref,Mathlib.Tactic.AtomM.State, Mathlib.Tactic.RPowRing.Config, Mathlib.Tactic.RPowRing.M,Lean.Meta.MetaMProof uses:
Bind.bind,Lean.Meta.SimpTheorems,List.foldlM,Lean.Name,Lean.Meta.SimpTheorems.addConst,Bool.true,Bool.false,OfNat.ofNat,Nat,Lean.Meta.SimpTheorems.mk,Lean.Meta.DiscrTree.empty,Lean.Meta.SimpTheorem,EmptyCollection.emptyCollection,Lean.PHashSet,Lean.Meta.Origin,Lean.PersistentHashMap.mk,Array,Lean.PersistentHashMap.Node.entries,Lean.PersistentHashMap.mkEmptyEntriesArray,Lean.Elab.Tactic.simpOnlyBuiltinsand 87 more18 instances, coercions and auxiliary constants left out.
def M.run {α : Type} (s : IO.Ref AtomM.State) (cfg : RPowRing.Config) (x : M α) : MetaM α := do …Mentions: Mathlib.Tactic.RPowRing.Config, Mathlib.Tactic.RPowRing.M
- def
Mathlib.Tactic.RPowRing.rpowRingTargetUserpow_ringto rewrite the main goal line 241 sourceSource documentation
Use
rpow_ringto rewrite the main goal.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IO.Ref,Mathlib.Tactic.AtomM.State, Mathlib.Tactic.RPowRing.Config,Lean.Elab.Tactic.TacticM,UnitProof uses:
Lean.Elab.Tactic.withMainContext,Bind.bind,Lean.MVarId,Lean.Elab.Tactic.getMainGoal,Lean.Expr,liftM,ReaderT,Lean.Meta.Context,StateRefT',IO.RealWorld,Lean.Meta.State,Lean.Core.CoreM,Lean.Elab.Tactic.Context,Lean.Elab.Tactic.State,Lean.Elab.Term.TermElabM,Lean.Elab.Term.State,Lean.Meta.MetaM,Lean.Elab.Term.Context,Lean.MVarId.getType,Lean.instantiateMVarsand 18 more9 instances, coercions and auxiliary constants left out.
def rpowRingTarget (s : IO.Ref AtomM.State) (cfg : Config) : TacticM Unit := withMainContext do …
Mentions: Mathlib.Tactic.RPowRing.Config
- def
Mathlib.Tactic.RPowRing.rpowRingLocalDeclUserpow_ringto rewrite hypothesishline 252 sourceSource documentation
Use
rpow_ringto rewrite hypothesish.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IO.Ref,Mathlib.Tactic.AtomM.State, Mathlib.Tactic.RPowRing.Config,Lean.FVarId,Lean.Elab.Tactic.TacticM,UnitProof uses:
Lean.Elab.Tactic.withMainContext,Bind.bind,Lean.Expr,liftM,ReaderT,Lean.Meta.Context,StateRefT',IO.RealWorld,Lean.Meta.State,Lean.Core.CoreM,Lean.Elab.Tactic.Context,Lean.Elab.Tactic.State,Lean.Elab.Term.TermElabM,Lean.Elab.Term.State,Lean.Meta.MetaM,Lean.Elab.Term.Context,Lean.FVarId.getType,Lean.instantiateMVars,Lean.MVarId,Lean.Elab.Tactic.getMainGoaland 11 more9 instances, coercions and auxiliary constants left out.
def rpowRingLocalDecl (s : IO.Ref AtomM.State) (cfg : Config) (fvarId : FVarId) : TacticM Unit := withMainContext do …Mentions: Mathlib.Tactic.RPowRing.Config
- def
Mathlib.Tactic.RPowRing.elabRPowRingConvElaborator for therpow_ringtactic line 285 sourceSource documentation
Elaborator for the
rpow_ringtactic.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Lean.Elab.Tactic.TacticProof uses:
Lean.Syntax,ite,Lean.Elab.Tactic.TacticM,Unit,Eq,Bool,Lean.Syntax.isOfKind,Lean.Name.mkStr4,Bool.true,Lean.Syntax.getArg,OfNat.ofNat,Nat,Option,Lean.TSyntax,List.cons,Lean.SyntaxNodeKind,List.nil,Option.map,Lean.TSyntax.mk,Lean.Syntax.getOptional?and 46 more16 instances, coercions and auxiliary constants left out.
@[tactic rpowRingConv] def elabRPowRingConv : Tactic := fun stx ↦ match stx with …
- theorem
Mathlib.Tactic.RPowRing._root_.Real.pow_negline 293 source - theorem
Mathlib.Tactic.RPowRing._root_.Real.inv_rpow'line 296 source - theorem
Mathlib.Tactic.RPowRing._root_.Real.rpow_invline 299 source - lemma
Mathlib.Tactic.RPowRing.fix_cast₁line 302 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Real,Int.ofNat,OfNat.ofNat,NatProof uses:
Iff.mpr,Int,Int.cast_eq_one,rfl20 instances, coercions and auxiliary constants left out.
- lemma
Mathlib.Tactic.RPowRing.fix_cast₂line 304 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Real,Int.ofNatProof uses:
rfl6 instances, coercions and auxiliary constants left out.
- lemma
Mathlib.Tactic.RPowRing.fix_cast₃line 306 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.AtLeastTwo,Eq,Real,OfNat.ofNatProof uses:
Eq.refl5 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- def
Mathlib.Tactic.RPowRing.delab_ofNatline 309 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Lean.PrettyPrinter.Delaborator.DelabProof uses:
Lean.PrettyPrinter.Delaborator.whenPPOption,Lean.getPPNotation,Lean.PrettyPrinter.Delaborator.SubExpr.withNaryArg,Lean.Syntax.Term,Lean.PrettyPrinter.Delaborator.DelabM,Lean.PrettyPrinter.Delaborator.Context,StateRefT',IO.RealWorld,Lean.PrettyPrinter.Delaborator.State,Lean.Meta.MetaM,OfNat.ofNat,Nat,Lean.PrettyPrinter.Delaborator.delab6 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- example
Mathlib.Tactic.RPowRing.(example at line 323)line 323 source