fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
ppAC (ccs : CCState) : MessageData := sbracket (ccs.ppACDecls ++ ofFormat ("," ++ .line) ++ ccs.ppACR)
def
Tactic
[ "Batteries.Classes.Order", "Mathlib.Lean.Meta.Basic", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Data.Ordering.Basic" ]
Mathlib/Tactic/CC/Datatypes.lean
ppAC
null
CCNormalizer where normalize : Expr → MetaM Expr attribute [inherit_doc CCNormalizer] CCNormalizer.normalize
structure
Tactic
[ "Batteries.Classes.Order", "Mathlib.Lean.Meta.Basic", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Data.Ordering.Basic" ]
Mathlib/Tactic/CC/Datatypes.lean
CCNormalizer
The congruence closure module (optionally) uses a normalizer. The idea is to use it (if available) to normalize auxiliary expressions produced by internal propagation rules (e.g., subsingleton propagator).
CCPropagationHandler where propagated : Array Expr → MetaM Unit /-- Congruence closure module invokes the following method when a new auxiliary term is created during propagation. -/ newAuxCCTerm : Expr → MetaM Unit
structure
Tactic
[ "Batteries.Classes.Order", "Mathlib.Lean.Meta.Basic", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Data.Ordering.Basic" ]
Mathlib/Tactic/CC/Datatypes.lean
CCPropagationHandler
null
CCStructure extends CCState where /-- Equalities that have been discovered but not processed. -/ todo : Array TodoEntry := #[] /-- AC-equalities that have been discovered but not processed. -/ acTodo : Array ACTodoEntry := #[] normalizer : Option CCNormalizer := none phandler : Option CCPropagationHandler :...
structure
Tactic
[ "Batteries.Classes.Order", "Mathlib.Lean.Meta.Basic", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Data.Ordering.Basic" ]
Mathlib/Tactic/CC/Datatypes.lean
CCStructure
`CCStructure` extends `CCState` (which records a set of facts derived by congruence closure) by recording which steps still need to be taken to solve the goal.
iff_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ↔ b) = b := h.symm ▸ true_iff _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
iff_eq_of_eq_true_left
null
iff_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ↔ b) = a := h.symm ▸ iff_true _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
iff_eq_of_eq_true_right
null
iff_eq_true_of_eq {a b : Prop} (h : a = b) : (a ↔ b) = True := h ▸ iff_self _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
iff_eq_true_of_eq
null
and_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ∧ b) = b := h.symm ▸ true_and _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
and_eq_of_eq_true_left
null
and_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ∧ b) = a := h.symm ▸ and_true _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
and_eq_of_eq_true_right
null
and_eq_of_eq_false_left {a b : Prop} (h : a = False) : (a ∧ b) = False := h.symm ▸ false_and _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
and_eq_of_eq_false_left
null
and_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a ∧ b) = False := h.symm ▸ and_false _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
and_eq_of_eq_false_right
null
and_eq_of_eq {a b : Prop} (h : a = b) : (a ∧ b) = a := h ▸ propext and_self_iff
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
and_eq_of_eq
null
or_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ∨ b) = True := h.symm ▸ true_or _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
or_eq_of_eq_true_left
null
or_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ∨ b) = True := h.symm ▸ or_true _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
or_eq_of_eq_true_right
null
or_eq_of_eq_false_left {a b : Prop} (h : a = False) : (a ∨ b) = b := h.symm ▸ false_or _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
or_eq_of_eq_false_left
null
or_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a ∨ b) = a := h.symm ▸ or_false _
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
or_eq_of_eq_false_right
null
or_eq_of_eq {a b : Prop} (h : a = b) : (a ∨ b) = a := h ▸ propext or_self_iff
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
or_eq_of_eq
null
imp_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a → b) = b := h.symm ▸ propext ⟨fun h ↦ h trivial, fun h₁ _ ↦ h₁⟩
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
imp_eq_of_eq_true_left
null
imp_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a → b) = True := h.symm ▸ propext ⟨fun _ ↦ trivial, fun h₁ _ ↦ h₁⟩
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
imp_eq_of_eq_true_right
null
imp_eq_of_eq_false_left {a b : Prop} (h : a = False) : (a → b) = True := h.symm ▸ propext ⟨fun _ ↦ trivial, fun _ h₂ ↦ False.elim h₂⟩
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
imp_eq_of_eq_false_left
null
imp_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a → b) = Not a := h.symm ▸ propext ⟨fun h ↦ h, fun hna ha ↦ hna ha⟩ /- Remark: the congruence closure module will only use the following lemma is `CCConfig.em` is `true`. -/
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
imp_eq_of_eq_false_right
null
not_imp_eq_of_eq_false_right {a b : Prop} (h : b = False) : (Not a → b) = a := h.symm ▸ propext (Iff.intro ( fun h' ↦ Classical.byContradiction fun hna ↦ h' hna) fun ha hna ↦ hna ha)
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
not_imp_eq_of_eq_false_right
null
imp_eq_true_of_eq {a b : Prop} (h : a = b) : (a → b) = True := h ▸ propext ⟨fun _ ↦ trivial, fun _ ha ↦ ha⟩
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
imp_eq_true_of_eq
null
not_eq_of_eq_true {a : Prop} (h : a = True) : Not a = False := h.symm ▸ propext not_true
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
not_eq_of_eq_true
null
not_eq_of_eq_false {a : Prop} (h : a = False) : Not a = True := h.symm ▸ propext not_false_iff
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
not_eq_of_eq_false
null
false_of_a_eq_not_a {a : Prop} (h : a = Not a) : False := have : Not a := fun ha ↦ absurd ha (Eq.mp h ha) absurd (Eq.mpr h this) this universe u
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
false_of_a_eq_not_a
null
if_eq_of_eq_true {c : Prop} [d : Decidable c] {α : Sort u} (t e : α) (h : c = True) : @ite α c d t e = t := if_pos (of_eq_true h)
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
if_eq_of_eq_true
null
if_eq_of_eq_false {c : Prop} [d : Decidable c] {α : Sort u} (t e : α) (h : c = False) : @ite α c d t e = e := if_neg (of_eq_false h)
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
if_eq_of_eq_false
null
if_eq_of_eq (c : Prop) [d : Decidable c] {α : Sort u} {t e : α} (h : t = e) : @ite α c d t e = t := match d with | isTrue _ => rfl | isFalse _ => Eq.symm h
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
if_eq_of_eq
null
eq_true_of_and_eq_true_left {a b : Prop} (h : (a ∧ b) = True) : a = True := eq_true (And.left (of_eq_true h))
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
eq_true_of_and_eq_true_left
null
eq_true_of_and_eq_true_right {a b : Prop} (h : (a ∧ b) = True) : b = True := eq_true (And.right (of_eq_true h))
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
eq_true_of_and_eq_true_right
null
eq_false_of_or_eq_false_left {a b : Prop} (h : (a ∨ b) = False) : a = False := eq_false fun ha ↦ False.elim (Eq.mp h (Or.inl ha))
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
eq_false_of_or_eq_false_left
null
eq_false_of_or_eq_false_right {a b : Prop} (h : (a ∨ b) = False) : b = False := eq_false fun hb ↦ False.elim (Eq.mp h (Or.inr hb))
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
eq_false_of_or_eq_false_right
null
eq_false_of_not_eq_true {a : Prop} (h : Not a = True) : a = False := eq_false fun ha ↦ absurd ha (Eq.mpr h trivial) /- Remark: the congruence closure module will only use the following lemma is `CCConfig.em` is `true`. -/
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
eq_false_of_not_eq_true
null
eq_true_of_not_eq_false {a : Prop} (h : Not a = False) : a = True := eq_true (Classical.byContradiction fun hna ↦ Eq.mp h hna)
theorem
Tactic
[ "Mathlib.Init" ]
Mathlib/Tactic/CC/Lemmas.lean
eq_true_of_not_eq_false
null
CCM := StateRefT CCStructure MetaM
abbrev
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
CCM
The monad for the `cc` tactic stores the current state of the tactic.
@[inline] run {α : Type} (x : CCM α) (c : CCStructure) : MetaM (α × CCStructure) := StateRefT'.run x c
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
run
Run a computation in the `CCM` monad.
@[inline] modifyCache (f : CCCongrTheoremCache → CCCongrTheoremCache) : CCM Unit := modify fun cc => { cc with cache := f cc.cache }
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
modifyCache
Update the `cache` field of the state.
@[inline] getCache : CCM CCCongrTheoremCache := do return (← get).cache
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getCache
Read the `cache` field of the state.
getEntry (e : Expr) : CCM (Option Entry) := do return (← get).entries[e]?
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getEntry
Look up an entry associated with the given expression.
normalize (e : Expr) : CCM Expr := do if let some normalizer := (← get).normalizer then normalizer.normalize e else return e
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
normalize
Use the normalizer to normalize `e`. If no normalizer was configured, returns `e` itself.
getRoot (e : Expr) : CCM Expr := do return (← get).root e
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getRoot
Return the root expression of the expression's congruence class.
isCgRoot (e : Expr) : CCM Bool := do return (← get).isCgRoot e
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
isCgRoot
Is `e` the root of its congruence class?
partial isCongruent (e₁ e₂ : Expr) : CCM Bool := do let .app f a := e₁ | failure let .app g b := e₂ | failure if (← getEntry e₁).any Entry.fo then e₁.withApp fun f₁ args₁ => e₂.withApp fun f₂ args₂ => do if ha : args₁.size = args₂.size then for hi : i in [:args₁.size] do if (← getR...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
isCongruent
Return true iff the given function application are congruent `e₁` should have the form `f a` and `e₂` the form `g b`. See paper: Congruence Closure for Intensional Type Theory.
mkCCHCongrTheorem (fn : Expr) (nargs : Nat) : CCM (Option CCCongrTheorem) := do let cache ← getCache let key₁ : CCCongrTheoremKey := { fn, nargs } if let some it := cache[key₁]? then return it let lemm ← mkCCHCongrWithArity fn nargs if let some lemm := lemm then modifyCache fun ccc => ccc.insert key₁ ...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkCCHCongrTheorem
Try to find a congruence theorem for an application of `fn` with `nargs` arguments, with support for `HEq`.
mkCCCongrTheorem (e : Expr) : CCM (Option CCCongrTheorem) := do let fn := e.getAppFn let nargs := e.getAppNumArgs mkCCHCongrTheorem fn nargs
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkCCCongrTheorem
Try to find a congruence theorem for the expression `e` with support for `HEq`.
setFO (e : Expr) : CCM Unit := modify fun ccs => { ccs with entries := ccs.entries.modify e fun d => { d with fo := true } }
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
setFO
Treat the entry associated with `e` as a first-order function.
partial updateMT (e : Expr) : CCM Unit := do let r ← getRoot e let some ps := (← get).parents[r]? | return for p in ps do let some it ← getEntry p.expr | failure let gmt := (← get).gmt if it.mt < gmt then let newIt := { it with mt := gmt } modify fun ccs => { ccs with entries := cc...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
updateMT
Update the modification time of the congruence class of `e`.
hasHEqProofs (root : Expr) : CCM Bool := do let some n ← getEntry root | failure guard (n.root == root) return n.heqProofs
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
hasHEqProofs
Does the congruence class with root `root` have any `HEq` proofs?
flipProofCore (H : Expr) (flipped heqProofs : Bool) : CCM Expr := do let mut newH := H if ← liftM <| pure heqProofs <&&> Expr.isEq <$> (inferType H >>= whnf) then newH ← mkAppM ``heq_of_eq #[H] if !flipped then return newH else if heqProofs then mkHEqSymm newH else mkEqSymm newH
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
flipProofCore
Apply symmetry to `H`, which is an `Eq` or a `HEq`. * If `heqProofs` is true, ensure the result is a `HEq` (otherwise it is assumed to be `Eq`). * If `flipped` is true, apply `symm`, otherwise keep the same direction.
flipDelayedProofCore (H : DelayedExpr) (flipped heqProofs : Bool) : CCM DelayedExpr := do let mut newH := H if heqProofs then newH := .heqOfEq H if !flipped then return newH else if heqProofs then return .heqSymm newH else return .eqSymm newH
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
flipDelayedProofCore
In a delayed way, apply symmetry to `H`, which is an `Eq` or a `HEq`. * If `heqProofs` is true, ensure the result is a `HEq` (otherwise it is assumed to be `Eq`). * If `flipped` is true, apply `symm`, otherwise keep the same direction.
flipProof (H : EntryExpr) (flipped heqProofs : Bool) : CCM EntryExpr := match H with | .ofExpr H => EntryExpr.ofExpr <$> flipProofCore H flipped heqProofs | .ofDExpr H => EntryExpr.ofDExpr <$> flipDelayedProofCore H flipped heqProofs | _ => return H
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
flipProof
Apply symmetry to `H`, which is an `Eq` or a `HEq`. * If `heqProofs` is true, ensure the result is a `HEq` (otherwise it is assumed to be `Eq`). * If `flipped` is true, apply `symm`, otherwise keep the same direction.
isEqv (e₁ e₂ : Expr) : CCM Bool := do let some n₁ ← getEntry e₁ | return false let some n₂ ← getEntry e₂ | return false return n₁.root == n₂.root
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
isEqv
Are `e₁` and `e₂` known to be in the same equivalence class?
isNotEqv (e₁ e₂ : Expr) : CCM Bool := do let tmp ← mkEq e₁ e₂ if ← isEqv tmp (.const ``False []) then return true let tmp ← mkHEq e₁ e₂ isEqv tmp (.const ``False [])
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
isNotEqv
Is `e₁ ≠ e₂` known to be true? Note that this is stronger than `not (isEqv e₁ e₂)`: only if we can prove they are distinct this returns `true`.
@[inline] isEqTrue (e : Expr) : CCM Bool := isEqv e (.const ``True [])
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
isEqTrue
Is the proposition `e` known to be true?
@[inline] isEqFalse (e : Expr) : CCM Bool := isEqv e (.const ``False [])
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
isEqFalse
Is the proposition `e` known to be false?
mkTrans (H₁ H₂ : Expr) (heqProofs : Bool) : MetaM Expr := if heqProofs then mkHEqTrans H₁ H₂ else mkEqTrans H₁ H₂
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkTrans
Apply transitivity to `H₁` and `H₂`, which are both `Eq` or `HEq` depending on `heqProofs`.
mkTransOpt (H₁? : Option Expr) (H₂ : Expr) (heqProofs : Bool) : MetaM Expr := match H₁? with | some H₁ => mkTrans H₁ H₂ heqProofs | none => pure H₂ mutual
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkTransOpt
Apply transitivity to `H₁?` and `H₂`, which are both `Eq` or `HEq` depending on `heqProofs`. If `H₁?` is `none`, return `H₂` instead.
partial mkCongrProofCore (lhs rhs : Expr) (heqProofs : Bool) : CCM Expr := do let mut lhsArgsRev : Array Expr := #[] let mut rhsArgsRev : Array Expr := #[] let mut lhsIt := lhs let mut rhsIt := rhs if lhs != rhs then repeat let .app lhsItFn lhsItArg := lhsIt | failure let .app rhsItFn rhsItArg...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkCongrProofCore
Use congruence on arguments to prove `lhs = rhs`. That is, tries to prove that `lhsFn lhsArgs[0] ... lhsArgs[n-1] = lhsFn rhsArgs[0] ... rhsArgs[n-1]` by showing that `lhsArgs[i] = rhsArgs[i]` for all `i`. Fails if the head function of `lhs` is not that of `rhs`.
partial mkSymmCongrProof (e₁ e₂ : Expr) (heqProofs : Bool) : CCM (Option Expr) := do let some (R₁, lhs₁, rhs₁) ← e₁.relSidesIfSymm? | return none let some (R₂, lhs₂, rhs₂) ← e₂.relSidesIfSymm? | return none if R₁ != R₂ then return none if (← isEqv lhs₁ lhs₂) then return none guard (← isEqv lhs₁ rhs₂) /-...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkSymmCongrProof
If `e₁ : R lhs₁ rhs₁`, `e₂ : R lhs₂ rhs₂` and `lhs₁ = rhs₂`, where `R` is a symmetric relation, prove `R lhs₁ rhs₁` is equivalent to `R lhs₂ rhs₂`. * if `lhs₁` is known to equal `lhs₂`, return `none` * if `lhs₁` is not known to equal `rhs₂`, fail.
partial mkCongrProof (e₁ e₂ : Expr) (heqProofs : Bool) : CCM Expr := do if let some r ← mkSymmCongrProof e₁ e₂ heqProofs then return r else mkCongrProofCore e₁ e₂ heqProofs
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkCongrProof
Use congruence on arguments to prove `e₁ = e₂`. Special case: if `e₁` and `e₂` have the form `R lhs₁ rhs₁` and `R lhs₂ rhs₂` such that `R` is symmetric and `lhs₁ = rhs₂`, then use those facts instead.
partial mkDelayedProof (H : DelayedExpr) : CCM Expr := do match H with | .ofExpr H => return H | .eqProof lhs rhs => liftOption (← getEqProof lhs rhs) | .congrArg f h => mkCongrArg f (← mkDelayedProof h) | .congrFun h a => mkCongrFun (← mkDelayedProof h) (← liftOption a.toExpr) | .eqSymm h => mkEqSymm (← mk...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkDelayedProof
Turn a delayed proof into an actual proof term.
partial mkProof (lhs rhs : Expr) (H : EntryExpr) (heqProofs : Bool) : CCM Expr := do match H with | .congr => mkCongrProof lhs rhs heqProofs | .eqTrue => let (flip, some (R, a, b)) ← if lhs == .const ``True [] then ((true, ·)) <$> rhs.relSidesIfRefl? else ((false, ·)) <$> lhs.relSi...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkProof
Use the format of `H` to try and construct a proof or `lhs = rhs`: * If `H = .congr`, then use congruence. * If `H = .eqTrue`, try to prove `lhs = True` or `rhs = True`, if they have the format `R a b`, by proving `a = b`. * Otherwise, return the (delayed) proof encoded by `H` itself.
partial getEqProofCore (e₁ e₂ : Expr) (asHEq : Bool) : CCM (Option Expr) := do if e₁.hasExprMVar || e₂.hasExprMVar then return none if ← pureIsDefEq e₁ e₂ then if asHEq then return some (← mkHEqRefl e₁) else return some (← mkEqRefl e₁) let some n₁ ← getEntry e₁ | return none let some n₂ ← ge...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getEqProofCore
If `asHEq` is `true`, then build a proof for `e₁ ≍ e₂`. Otherwise, build a proof for `e₁ = e₂`. The result is `none` if `e₁` and `e₂` are not in the same equivalence class.
@[inline] partial getEqProof (e₁ e₂ : Expr) : CCM (Option Expr) := getEqProofCore e₁ e₂ false
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getEqProof
Build a proof for `e₁ = e₂`. The result is `none` if `e₁` and `e₂` are not in the same equivalence class.
@[inline] partial getHEqProof (e₁ e₂ : Expr) : CCM (Option Expr) := getEqProofCore e₁ e₂ true
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getHEqProof
Build a proof for `e₁ ≍ e₂`. The result is `none` if `e₁` and `e₂` are not in the same equivalence class.
getEqTrueProof (e : Expr) : CCM Expr := do guard (← isEqTrue e) let some p ← getEqProof e (.const ``True []) | failure return p
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getEqTrueProof
Build a proof for `e = True`. Fails if `e` is not known to be true.
getEqFalseProof (e : Expr) : CCM Expr := do guard (← isEqFalse e) let some p ← getEqProof e (.const ``False []) | failure return p
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getEqFalseProof
Build a proof for `e = False`. Fails if `e` is not known to be false.
getPropEqProof (a b : Expr) : CCM Expr := do guard (← isEqv a b) let some p ← getEqProof a b | failure return p
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getPropEqProof
Build a proof for `a = b`. Fails if `a` and `b` are not known to be equal.
getInconsistencyProof : CCM (Option Expr) := do guard !(← get).frozePartitions if let some p ← getEqProof (.const ``True []) (.const ``False []) then return some (← mkAppM ``false_of_true_eq_false #[p]) else return none
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
getInconsistencyProof
Build a proof of `False` if the context is inconsistent. Returns `none` if `False` is not known to be true.
mkNeOfEqOfNe (a a₁ a₁NeB : Expr) : CCM (Option Expr) := do guard (← isEqv a a₁) if a == a₁ then return some a₁NeB let aEqA₁ ← getEqProof a a₁ match aEqA₁ with | none => return none -- failed to build proof | some aEqA₁ => mkAppM ``ne_of_eq_of_ne #[aEqA₁, a₁NeB]
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkNeOfEqOfNe
Given `a`, `a₁` and `a₁NeB : a₁ ≠ b`, return a proof of `a ≠ b` if `a` and `a₁` are in the same equivalence class.
mkNeOfNeOfEq (aNeB₁ b₁ b : Expr) : CCM (Option Expr) := do guard (← isEqv b b₁) if b == b₁ then return some aNeB₁ let b₁EqB ← getEqProof b b₁ match b₁EqB with | none => return none -- failed to build proof | some b₁EqB => mkAppM ``ne_of_ne_of_eq #[aNeB₁, b₁EqB]
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkNeOfNeOfEq
Given `aNeB₁ : a ≠ b₁`, `b₁` and `b`, return a proof of `a ≠ b` if `b` and `b₁` are in the same equivalence class.
mkACProof (e₁ e₂ : Expr) : MetaM Expr := do let eq ← mkEq e₁ e₂ let .mvar m ← mkFreshExprSyntheticOpaqueMVar eq | failure AC.rewriteUnnormalizedRefl m let pr ← instantiateMVars (.mvar m) mkExpectedTypeHint pr eq
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkACProof
Return the proof of `e₁ = e₂` using `ac_rfl` tactic.
mkACSimpProof (tr t s r sr : ACApps) (tEqs : DelayedExpr) : MetaM DelayedExpr := do if tr == t then return tEqs else if tr == sr then let some tre := tr.toExpr | failure DelayedExpr.ofExpr <$> mkEqRefl tre else let .apps op _ := tr | failure let some re := r.toExpr | failure let some te :=...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
mkACSimpProof
Given `tr := t*r` `sr := s*r` `tEqs : t = s`, return a proof for `tr = sr` We use `a*b` to denote an AC application. That is, `(a*b)*(c*a)` is the term `a*a*b*c`.
simplifyACCore (e lhs rhs : ACApps) (H : DelayedExpr) : CCM (ACApps × DelayedExpr) := do guard (lhs.isSubset e) if e == lhs then return (rhs, H) else let .apps op _ := e | failure let newArgs := e.diff lhs let r : ACApps := if newArgs.isEmpty then default else .mkApps op newArgs let newArg...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
simplifyACCore
Given `e := lhs * r` and `H : lhs = rhs`, return `rhs * r` and the proof of `e = rhs * r`.
simplifyACStep (e : ACApps) : CCM (Option (ACApps × DelayedExpr)) := do if let .apps _ args := e then for h : i in [:args.size] do if i == 0 || args[i] != (args[i - 1]'(Nat.lt_of_le_of_lt (i.sub_le 1) h.2.1)) then let some ae := (← get).acEntries[args[i]]? | failure let occs := ae.RLHSOccs ...
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
simplifyACStep
The single step of `simplifyAC`. Simplifies an expression `e` by either simplifying one argument to the AC operator, or the whole expression.
simplifyAC (e : ACApps) : CCM (Option (ACApps × DelayedExpr)) := do let mut some (curr, pr) ← simplifyACStep e | return none repeat let some (newCurr, newPr) ← simplifyACStep curr | break pr := .eqTransOpt e curr newCurr pr newPr curr := newCurr return some (curr, pr)
def
Tactic
[ "Mathlib.Tactic.CC.Datatypes", "Mathlib.Tactic.CC.Lemmas", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Relation.Symm" ]
Mathlib/Tactic/CC/MkProof.lean
simplifyAC
If `e` can be simplified by the AC module, return the simplified term and the proof term of the equality.
Status where /-- `├` Start intro (top-level) -/ | sintro : Status /-- `Entry.depth` * `│` + `┌` Normal intro -/ | intro : Status /-- `Entry.depth` * `│` + `├` Continuation intro -/ | cintro : Status /-- `Entry.depth` * `│` -/ | lam : Status /-- `Entry.depth` * `│` -/ | reg : Status deriving...
inductive
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Status
How to display pipes (`│`) for this entry in the Fitch table .
Entry where /-- A type of this expression as a `MessageData`. Make sure to use `addMessageContext`. -/ type : MessageData /-- The row number, starting from `0`. This is set by `Entries.add`. -/ line : Option Nat := none /-- How many `if`s (aka lambda-abstractions) this row is nested under. -/ depth : Nat ...
structure
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entry
The row in the Fitch table.
Entry.line! (entry : Entry) : Nat := entry.line.get!
def
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entry.line
Get the `line` for an `Entry` that has been added to the `Entries` structure.
Entries : Type where /-- Allows us to compare `Expr`s fast. -/ s : ExprMap Entry /-- Simple list of `Expr`s. -/ l : List Entry deriving Inhabited
structure
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entries
Instead of simply keeping a list of entries (`List Entry`), we create a datatype `Entries` that allows us to compare expressions faster.
Entries.find? (es : Entries) (e : Expr) : Option Entry := es.s[e]?
def
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entries.find
Find a row where `Entry.expr` == `e`.
Entries.size (es : Entries) : Nat := es.s.size
def
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entries.size
Length of our entries.
Entries.add (entries : Entries) (expr : Expr) (entry : Entry) : Entry × Entries := if let some entry' := entries.find? expr then (entry', entries) else let entry := { entry with line := entries.size } (entry, ⟨entries.s.insert expr entry, entry :: entries.l⟩)
def
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entries.add
Add the entry unless it already exists. Sets the `line` field to the next available value.
Entries.addSynonym (entries : Entries) (expr : Expr) (entry : Entry) : Entries := ⟨entries.s.insert expr entry, entries.l⟩
def
Tactic
[ "Mathlib.Init", "Lean.Util.Trace" ]
Mathlib/Tactic/Explode/Datatypes.lean
Entries.addSynonym
Add a pre-existing entry to the `ExprMap` for an additional expression. This is used by `let` bindings where `expr` is an fvar.
padRight (mds : List MessageData) : MetaM (List MessageData) := do let mut maxLength := 0 for md in mds do maxLength := max maxLength (← md.toString).length let pad (md : MessageData) : MetaM MessageData := do let padWidth : Nat := maxLength - (← md.toString).length return md ++ "".pushn ' ' padWidth ...
def
Tactic
[ "Lean.Meta.Basic", "Mathlib.Tactic.Explode.Datatypes" ]
Mathlib/Tactic/Explode/Pretty.lean
padRight
Given a list of `MessageData`s, make them of equal length. We need this in order to form columns in our Fitch table. ```lean padRight ["hi", "hello"] = ["hi ", "hello"] ```
rowToMessageData : List MessageData → List MessageData → List MessageData → List Entry → MetaM MessageData | line :: lines, dep :: deps, thm :: thms, en :: es => do let pipes := String.join (List.replicate en.depth "│ ") let pipes := match en.status with | Status.sintro => s!"├ " | Status.intr...
def
Tactic
[ "Lean.Meta.Basic", "Mathlib.Tactic.Explode.Datatypes" ]
Mathlib/Tactic/Explode/Pretty.lean
rowToMessageData
Render a particular row of the Fitch table.
entriesToMessageData (entries : Entries) : MetaM MessageData := do let paddedLines ← padRight <| entries.l.map fun entry => m!"{entry.line!}" let paddedDeps ← padRight <| entries.l.map fun entry => String.intercalate "," <| entry.deps.map (fun dep => (dep.map toString).getD "_") let paddedThms ← padRight <| e...
def
Tactic
[ "Lean.Meta.Basic", "Mathlib.Tactic.Explode.Datatypes" ]
Mathlib/Tactic/Explode/Pretty.lean
entriesToMessageData
Given all `Entries`, return the entire Fitch table.
private dischargerTraceMessage {ε : Type*} (prop : Expr) : Except ε (Option Expr) → SimpM MessageData | .error _ | .ok none => return m!"{crossEmoji} discharge {prop}" | .ok (some _) => return m!"{checkEmoji} discharge {prop}" open private Simp.dischargeUsingAssumption? from Lean.Meta.Tactic.Simp.Rewrite
def
Tactic
[ "Mathlib.Tactic.Positivity.Core", "Mathlib.Util.DischargerAsTactic" ]
Mathlib/Tactic/FieldSimp/Discharger.lean
dischargerTraceMessage
Constructs a trace message for the `discharge` function.
partial discharge (prop : Expr) : SimpM (Option Expr) := withTraceNode `Tactic.field_simp (dischargerTraceMessage prop) do if let some r ← Simp.dischargeUsingAssumption? prop then return some r let prop : Q(Prop) ← (do pure prop) let pf? ← match prop with | ~q(($e : $α) ≠ $b) => try ...
def
Tactic
[ "Mathlib.Tactic.Positivity.Core", "Mathlib.Util.DischargerAsTactic" ]
Mathlib/Tactic/FieldSimp/Discharger.lean
discharge
Discharge strategy for the `field_simp` tactic.
noncomputable zpow' (a : α) (n : ℤ) : α := if a = 0 ∧ n = 0 then 0 else a ^ n
def
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'
This is a variant of integer exponentiation, defined for internal use in the `field_simp` tactic implementation. It differs from the usual integer exponentiation in that `0 ^ 0` is `0`, not `1`. With this choice, the function `n ↦ a ^ n` is always a homomorphism (`a ^ (n + m) = a ^ n * a ^ m`), even if `a` is zero.
zpow'_add (a : α) (m n : ℤ) : zpow' a (m + n) = zpow' a m * zpow' a n := by by_cases ha : a = 0 · simp [zpow', ha] by_cases hn : n = 0 · simp +contextual [hn, zero_zpow] · simp +contextual [hn, zero_zpow] · simp [zpow', ha, zpow_add₀]
theorem
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_add
null
zpow'_of_ne_zero_right (a : α) (n : ℤ) (hn : n ≠ 0) : zpow' a n = a ^ n := by simp [zpow', hn]
theorem
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_of_ne_zero_right
null
zpow'_of_ne_zero_left (a : α) (n : ℤ) (ha : a ≠ 0) : zpow' a n = a ^ n := by simp [zpow', ha] @[simp]
theorem
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_of_ne_zero_left
null
zero_zpow' (n : ℤ) : zpow' (0 : α) n = 0 := by simp +contextual only [zpow', true_and, ite_eq_left_iff] intro hn exact zero_zpow n hn
lemma
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zero_zpow'
null
zpow'_eq_zero_iff (a : α) (n : ℤ) : zpow' a n = 0 ↔ a = 0 := by obtain rfl | hn := eq_or_ne n 0 · simp [zpow'] · simp [zpow', zpow_eq_zero_iff hn] tauto @[simp]
lemma
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_eq_zero_iff
null
one_zpow' (n : ℤ) : zpow' (1 : α) n = 1 := by simp [zpow'] @[simp]
lemma
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
one_zpow'
null
zpow'_one (a : α) : zpow' a 1 = a := by simp [zpow']
lemma
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_one
null
zpow'_zero_eq_div (a : α) : zpow' a 0 = a / a := by simp [zpow'] by_cases h : a = 0 · simp [h] · simp [h]
lemma
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_zero_eq_div
null
zpow'_zero_of_ne_zero {a : α} (ha : a ≠ 0) : zpow' a 0 = 1 := by simp [zpow', ha]
lemma
Tactic
[ "Mathlib.Algebra.BigOperators.Group.List.Basic", "Mathlib.Algebra.Field.Power", "Mathlib.Algebra.Order.GroupWithZero.Unbundled.Basic", "Mathlib.Util.Qq" ]
Mathlib/Tactic/FieldSimp/Lemmas.lean
zpow'_zero_of_ne_zero
null