ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
Theorem: Function.Periodic.comp
File: Mathlib/Algebra/Periodic.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
f g✝ : α → β
c c₁ c₂ x : α
inst✝ : Add α
h : Periodic f c
g : β → γ
⊢ Periodic (g ∘ f) c
state_after: no goals
tactic: simp_all
Theorem: WeakDual.CharacterSpace.union_zero_isClosed
File: Mathlib/Topology/Algebra/Module/CharacterSpace.lean

Proof steps:
state_before: 𝕜 : Type u_1
A : Type u_2
inst✝⁸ : CommSemiring 𝕜
inst✝⁷ : TopologicalSpace 𝕜
inst✝⁶ : ContinuousAdd 𝕜
inst✝⁵ : ContinuousConstSMul 𝕜 𝕜
inst✝⁴ : NonUnitalNonAssocSemiring A
inst✝³ : TopologicalSpace A
inst✝² : Module 𝕜 A
inst✝¹ : T2Space 𝕜
inst✝ : ContinuousMul 𝕜
⊢ IsClosed (characterSpace 𝕜 A ∪ {0})
state_after: 𝕜 : Type u_1
A : Type u_2
inst✝⁸ : CommSemiring 𝕜
inst✝⁷ : TopologicalSpace 𝕜
inst✝⁶ : ContinuousAdd 𝕜
inst✝⁵ : ContinuousConstSMul 𝕜 𝕜
inst✝⁴ : NonUnitalNonAssocSemiring A
inst✝³ : TopologicalSpace A
inst✝² : Module 𝕜 A
inst✝¹ : T2Space 𝕜
inst✝ : ContinuousMul 𝕜
⊢ IsClosed (⋂ i, ⋂ i_1, {x | x (i * i_1) = x i * x i_1})
tactic: simp only [union_zero, Set.setOf_forall]
state_before: 𝕜 : Type u_1
A : Type u_2
inst✝⁸ : CommSemiring 𝕜
inst✝⁷ : TopologicalSpace 𝕜
inst✝⁶ : ContinuousAdd 𝕜
inst✝⁵ : ContinuousConstSMul 𝕜 𝕜
inst✝⁴ : NonUnitalNonAssocSemiring A
inst✝³ : TopologicalSpace A
inst✝² : Module 𝕜 A
inst✝¹ : T2Space 𝕜
inst✝ : ContinuousMul 𝕜
⊢ IsClosed (⋂ i, ⋂ i_1, {x | x (i * i_1) = x i * x i_1})
state_after: no goals
tactic: exact
    isClosed_iInter fun x =>
      isClosed_iInter fun y =>
        isClosed_eq (eval_continuous _) <| (eval_continuous _).mul (eval_continuous _)
Theorem: Finset.prod_eq_prod_diff_singleton_mul
File: Mathlib/Algebra/BigOperators/Group/Finset.lean

Proof steps:
state_before: ι : Type u_1
κ : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
s✝ s₁ s₂ : Finset α
a : α
f✝ g : α → β
inst✝¹ : CommMonoid β
inst✝ : DecidableEq α
s : Finset α
i : α
h : i ∈ s
f : α → β
⊢ ∏ x ∈ s, f x = (∏ x ∈ s \ {i}, f x) * f i
state_after: no goals
tactic: rw [prod_eq_mul_prod_diff_singleton h, mul_comm]
Theorem: Ordinal.principal_mul_iff_mul_left_eq
File: Mathlib/SetTheory/Ordinal/Principal.lean

Proof steps:
state_before: o : Ordinal.{u_1}
⊢ Principal (fun x x_1 => x * x_1) o ↔ ∀ (a : Ordinal.{u_1}), 0 < a → a < o → a * o = o
state_after: case refine_1
o : Ordinal.{u_1}
h : Principal (fun x x_1 => x * x_1) o
a : Ordinal.{u_1}
ha₀ : 0 < a
hao : a < o
⊢ a * o = o

case refine_2
o : Ordinal.{u_1}
h : ∀ (a : Ordinal.{u_1}), 0 < a → a < o → a * o = o
a b : Ordinal.{u_1}
hao : a < o
hbo : b < o
⊢ (fun x x_1 => x * x_1) a b < o
tactic: refine ⟨fun h a ha₀ hao => ?_, fun h a b hao hbo => ?_⟩
Theorem: UpperHalfPlane.smulAux'_im
File: Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean

Proof steps:
state_before: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ (smulAux' g z).im = (↑↑g).det * z.im / Complex.normSq (denom g z)
state_after: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ (num g z).im * (denom g z).re / Complex.normSq (denom g z) -
      (num g z).re * (denom g z).im / Complex.normSq (denom g z) =
    (↑↑g).det * z.im / Complex.normSq (denom g z)
tactic: rw [smulAux', Complex.div_im]
state_before: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ (num g z).im * (denom g z).re / Complex.normSq (denom g z) -
      (num g z).re * (denom g z).im / Complex.normSq (denom g z) =
    (↑↑g).det * z.im / Complex.normSq (denom g z)
state_after: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ ↑↑g 0 0 * z.im * (↑↑g 1 0 * z.re + ↑↑g 1 1) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) -
      (↑↑g 0 0 * z.re + ↑↑g 0 1) * (↑↑g 1 0 * z.im) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) =
    (↑↑g).det * z.im / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1))
tactic: field_simp [smulAux', num, denom]
state_before: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ ↑↑g 0 0 * z.im * (↑↑g 1 0 * z.re + ↑↑g 1 1) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) -
      (↑↑g 0 0 * z.re + ↑↑g 0 1) * (↑↑g 1 0 * z.im) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) =
    (↑↑g).det * z.im / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1))
state_after: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ ↑↑g 0 0 * z.im * (↑↑g 1 0 * z.re + ↑↑g 1 1) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) -
      (↑↑g 0 0 * z.re + ↑↑g 0 1) * (↑↑g 1 0 * z.im) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) =
    (↑↑g 0 0 * ↑↑g 1 1 - ↑↑g 0 1 * ↑↑g 1 0) * z.im / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1))
tactic: rw [Matrix.det_fin_two ((g : GL (Fin 2) ℝ) : Matrix (Fin 2) (Fin 2) ℝ)]
state_before: g : ↥GL(2, ℝ)⁺
z : ℍ
⊢ ↑↑g 0 0 * z.im * (↑↑g 1 0 * z.re + ↑↑g 1 1) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) -
      (↑↑g 0 0 * z.re + ↑↑g 0 1) * (↑↑g 1 0 * z.im) / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1)) =
    (↑↑g 0 0 * ↑↑g 1 1 - ↑↑g 0 1 * ↑↑g 1 0) * z.im / Complex.normSq (↑(↑↑g 1 0) * ↑z + ↑(↑↑g 1 1))
state_after: no goals
tactic: ring
Theorem: CompositionSeries.eq_snoc_eraseLast
File: Mathlib/Order/JordanHolder.lean

Proof steps:
state_before: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
⊢ s = (eraseLast s).snoc (last s) ⋯
state_after: case h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
x : X
⊢ x ∈ s ↔ x ∈ (eraseLast s).snoc (last s) ⋯
tactic: ext x
state_before: case h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
x : X
⊢ x ∈ s ↔ x ∈ (eraseLast s).snoc (last s) ⋯
state_after: case h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
x : X
⊢ x ∈ s ↔ ¬x = last s ∧ x ∈ s ∨ x = last s
tactic: simp only [mem_snoc, mem_eraseLast h, ne_eq]
state_before: case h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
x : X
⊢ x ∈ s ↔ ¬x = last s ∧ x ∈ s ∨ x = last s
state_after: no goals
tactic: by_cases h : x = s.last <;> simp [*, s.last_mem]
Theorem: Filter.lift'_bot
File: Mathlib/Order/Filter/Lift.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
f f₁ f₂ : Filter α
h h₁ h₂ : Set α → Set β
hh : Monotone h
⊢ ⊥.lift' h = 𝓟 (h ∅)
state_after: no goals
tactic: rw [← principal_empty, lift'_principal hh]
Theorem: MeasureTheory.SimpleFunc.lintegral_eq_lintegral
File: Mathlib/MeasureTheory/Integral/Lebesgue.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m✝ : MeasurableSpace α
μ✝ ν : Measure α
m : MeasurableSpace α
f : α →ₛ ℝ≥0∞
μ : Measure α
⊢ ∫⁻ (a : α), ↑f a ∂μ = f.lintegral μ
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m✝ : MeasurableSpace α
μ✝ ν : Measure α
m : MeasurableSpace α
f : α →ₛ ℝ≥0∞
μ : Measure α
⊢ ⨆ g, ⨆ (_ : ↑g ≤ fun a => ↑f a), g.lintegral μ = f.lintegral μ
tactic: rw [MeasureTheory.lintegral]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m✝ : MeasurableSpace α
μ✝ ν : Measure α
m : MeasurableSpace α
f : α →ₛ ℝ≥0∞
μ : Measure α
⊢ ⨆ g, ⨆ (_ : ↑g ≤ fun a => ↑f a), g.lintegral μ = f.lintegral μ
state_after: no goals
tactic: exact le_antisymm (iSup₂_le fun g hg => lintegral_mono hg <| le_rfl)
    (le_iSup₂_of_le f le_rfl le_rfl)
Theorem: RingHom.finiteType_stableUnderBaseChange
File: Mathlib/RingTheory/RingHom/FiniteType.lean

Proof steps:
state_before: ⊢ StableUnderBaseChange @FiniteType
state_after: case h₁

⊢ RespectsIso @FiniteType

case h₂

⊢ ∀ ⦃R S T : Type u_1⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], (algebraMap R T).FiniteType → Algebra.TensorProduct.includeLeftRingHom.FiniteType
tactic: apply StableUnderBaseChange.mk
Theorem: CategoryTheory.Limits.coconeOfDiagramTerminal_pt
File: Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean

Proof steps:
state_before: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
J : Type u
inst✝ : Category.{v, u} J
X : J
tX : IsTerminal X
F : J ⥤ C
j j' : J
k : j ⟶ j'
⊢ F.map k ≫ (fun j => F.map (tX.from j)) j' = (fun j => F.map (tX.from j)) j ≫ ((Functor.const J).obj (F.obj X)).map k
state_after: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
J : Type u
inst✝ : Category.{v, u} J
X : J
tX : IsTerminal X
F : J ⥤ C
j j' : J
k : j ⟶ j'
⊢ F.map k ≫ F.map (tX.from j') = F.map (tX.from j) ≫ 𝟙 (F.obj X)
tactic: dsimp
state_before: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
J : Type u
inst✝ : Category.{v, u} J
X : J
tX : IsTerminal X
F : J ⥤ C
j j' : J
k : j ⟶ j'
⊢ F.map k ≫ F.map (tX.from j') = F.map (tX.from j) ≫ 𝟙 (F.obj X)
state_after: no goals
tactic: rw [← F.map_comp, Category.comp_id, tX.hom_ext (k ≫ tX.from j') (tX.from j)]
Theorem: Subgroup.closure_inv
File: Mathlib/Algebra/Group/Subgroup/Pointwise.lean

Proof steps:
state_before: α : Type u_1
G : Type u_2
A : Type u_3
S : Type u_4
inst✝¹ : Group G
inst✝ : AddGroup A
s✝ s : Set G
⊢ closure s⁻¹ = closure s
state_after: no goals
tactic: simp only [← toSubmonoid_eq, closure_toSubmonoid, inv_inv, union_comm]
Theorem: inv_antitoneOn_Ioi
File: Mathlib/Algebra/Order/Field/Basic.lean

Proof steps:
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
⊢ AntitoneOn (fun x => x⁻¹) (Set.Ioi 0)
state_after: case h.e'_5.h.h.e'_3
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
x✝ : α
⊢ x✝ = x✝ - 0
tactic: convert sub_inv_antitoneOn_Ioi
state_before: case h.e'_5.h.h.e'_3
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
x✝ : α
⊢ x✝ = x✝ - 0
state_after: no goals
tactic: exact (sub_zero _).symm
Theorem: LaurentPolynomial.degree_C_ite
File: Mathlib/Algebra/Polynomial/Laurent.lean

Proof steps:
state_before: R : Type u_1
inst✝¹ : Semiring R
inst✝ : DecidableEq R
a : R
⊢ (C a).degree = if a = 0 then ⊥ else 0
state_after: no goals
tactic: split_ifs with h <;> simp only [h, map_zero, degree_zero, degree_C, Ne, not_false_iff]
Theorem: Real.logb_neg_iff
File: Mathlib/Analysis/SpecialFunctions/Log/Base.lean

Proof steps:
state_before: b x y : ℝ
hb : 1 < b
h : 0 < x
⊢ logb b x < 0 ↔ x < 1
state_after: b x y : ℝ
hb : 1 < b
h : 0 < x
⊢ logb b x < logb ?m.18267 1 ↔ x < 1

b x y : ℝ
hb : 1 < b
h : 0 < x
⊢ ℝ
tactic: rw [← logb_one]
state_before: b x y : ℝ
hb : 1 < b
h : 0 < x
⊢ logb b x < logb ?m.18267 1 ↔ x < 1

b x y : ℝ
hb : 1 < b
h : 0 < x
⊢ ℝ
state_after: no goals
tactic: exact logb_lt_logb_iff hb h zero_lt_one
Theorem: MaximalSpectrum.toPrimeSpectrum_injective
File: Mathlib/RingTheory/MaximalSpectrum.lean

Proof steps:
state_before: R : Type u
inst✝ : CommRing R
x✝¹ x✝ : MaximalSpectrum R
asIdeal✝¹ : Ideal R
IsMaximal✝¹ : asIdeal✝¹.IsMaximal
asIdeal✝ : Ideal R
IsMaximal✝ : asIdeal✝.IsMaximal
h :
  { asIdeal := asIdeal✝¹, IsMaximal := IsMaximal✝¹ }.toPrimeSpectrum =
    { asIdeal := asIdeal✝, IsMaximal := IsMaximal✝ }.toPrimeSpectrum
⊢ { asIdeal := asIdeal✝¹, IsMaximal := IsMaximal✝¹ } = { asIdeal := asIdeal✝, IsMaximal := IsMaximal✝ }
state_after: no goals
tactic: simpa only [MaximalSpectrum.mk.injEq] using (PrimeSpectrum.ext_iff _ _).mp h
Theorem: Complex.hasDerivAt_Gammaℂ_one
File: Mathlib/NumberTheory/Harmonic/GammaDeriv.lean

Proof steps:
state_before: ⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
state_after: f : ℂ → ℂ := fun s => 2 * (2 * ↑π) ^ (-s)
⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
tactic: let f (s : ℂ) : ℂ := 2 * (2 * π) ^ (-s)
state_before: f : ℂ → ℂ := fun s => 2 * (2 * ↑π) ^ (-s)
⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
state_after: f : ℂ → ℂ := fun s => 2 * (2 * ↑π) ^ (-s)
this : HasDerivAt (fun s => 2 * (2 * ↑π) ^ (-s)) (-log (2 * ↑π) / ↑π) 1
⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
tactic: have : HasDerivAt (fun s : ℂ ↦ 2 * (2 * π : ℂ) ^ (-s)) (-log (2 * π) / π) 1 := by
    have := (hasDerivAt_neg' (1 : ℂ)).const_cpow (c := 2 * π)
      (Or.inl (by exact_mod_cast Real.two_pi_pos.ne'))
    refine (this.const_mul 2).congr_deriv ?_
    rw [mul_neg_one, mul_neg, cpow_neg_one, ← div_eq_inv_mul, ← mul_div_assoc,
      mul_div_mul_left _ _ two_ne_zero, neg_div]
state_before: f : ℂ → ℂ := fun s => 2 * (2 * ↑π) ^ (-s)
this : HasDerivAt (fun s => 2 * (2 * ↑π) ^ (-s)) (-log (2 * ↑π) / ↑π) 1
⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
state_after: f : ℂ → ℂ := fun s => 2 * (2 * ↑π) ^ (-s)
this✝ : HasDerivAt (fun s => 2 * (2 * ↑π) ^ (-s)) (-log (2 * ↑π) / ↑π) 1
this : HasDerivAt (fun y => 2 * (2 * ↑π) ^ (-y) * Gamma y) (-log (2 * ↑π) / ↑π * Gamma 1 + 2 * (2 * ↑π) ^ (-1) * -↑γ) 1
⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
tactic: have := this.mul hasDerivAt_Gamma_one
state_before: f : ℂ → ℂ := fun s => 2 * (2 * ↑π) ^ (-s)
this✝ : HasDerivAt (fun s => 2 * (2 * ↑π) ^ (-s)) (-log (2 * ↑π) / ↑π) 1
this : HasDerivAt (fun y => 2 * (2 * ↑π) ^ (-y) * Gamma y) (-log (2 * ↑π) / ↑π * Gamma 1 + 2 * (2 * ↑π) ^ (-1) * -↑γ) 1
⊢ HasDerivAt Gammaℂ (-(↑γ + log (2 * ↑π)) / ↑π) 1
state_after: no goals
tactic: rwa [Gamma_one, mul_one, cpow_neg_one, ← div_eq_mul_inv, ← div_div, div_self two_ne_zero,
    mul_comm (1 / _), mul_one_div, ← _root_.add_div, ← neg_add, add_comm] at this
Theorem: AddSubmonoid.sup_eq_range
File: Mathlib/Algebra/Group/Submonoid/Membership.lean

Proof steps:
state_before: M : Type u_1
A : Type u_2
B : Type u_3
N : Type u_4
inst✝ : CommMonoid N
s t : Submonoid N
⊢ s ⊔ t = mrange (s.subtype.coprod t.subtype)
state_after: no goals
tactic: rw [mrange_eq_map, ← mrange_inl_sup_mrange_inr, map_sup, map_mrange, coprod_comp_inl, map_mrange,
    coprod_comp_inr, range_subtype, range_subtype]
Theorem: inseparable_prod
File: Mathlib/Topology/Inseparable.lean

Proof steps:
state_before: X : Type u_1
Y : Type u_2
Z : Type u_3
α : Type u_4
ι : Type u_5
π : ι → Type u_6
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : TopologicalSpace Z
inst✝ : (i : ι) → TopologicalSpace (π i)
x y z : X
s : Set X
f g : X → Y
x₁ x₂ : X
y₁ y₂ : Y
⊢ ((x₁, y₁) ~ᵢ (x₂, y₂)) ↔ (x₁ ~ᵢ x₂) ∧ (y₁ ~ᵢ y₂)
state_after: no goals
tactic: simp only [Inseparable, nhds_prod_eq, prod_inj]
Theorem: Fin.modNat_rev
File: Mathlib/Data/Fin/Basic.lean

Proof steps:
state_before: n m : ℕ
i : Fin (m * n)
⊢ i.rev.modNat = i.modNat.rev
state_after: case h
n m : ℕ
i : Fin (m * n)
⊢ ↑i.rev.modNat = ↑i.modNat.rev
tactic: ext
state_before: case h
n m : ℕ
i : Fin (m * n)
⊢ ↑i.rev.modNat = ↑i.modNat.rev
state_after: case h
n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
⊢ ↑i.rev.modNat = ↑i.modNat.rev
tactic: have H₁ : i % n + 1 ≤ n := i.modNat.is_lt
state_before: case h
n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
⊢ ↑i.rev.modNat = ↑i.modNat.rev
state_after: case h
n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ ↑i.rev.modNat = ↑i.modNat.rev
tactic: have H₂ : i / n < m := i.divNat.is_lt
state_before: case h
n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ ↑i.rev.modNat = ↑i.modNat.rev
state_after: case h
n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ (m * n - (↑i + 1)) % n = n - (↑i % n + 1)
tactic: simp only [coe_modNat, val_rev]
state_before: case h
n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ (m * n - (↑i + 1)) % n = n - (↑i % n + 1)
state_after: no goals
tactic: calc
    (m * n - (i + 1)) % n = (m * n - ((i / n) * n + i % n + 1)) % n := by rw [Nat.div_add_mod']
    _ = ((m - i / n - 1) * n + (n - (i % n + 1))) % n := by
      rw [Nat.mul_sub_right_distrib, Nat.one_mul, Nat.sub_add_sub_cancel _ H₁,
        Nat.mul_sub_right_distrib, Nat.sub_sub, Nat.add_assoc]
      exact Nat.le_mul_of_pos_left _ <| Nat.le_sub_of_add_le' H₂
    _ = n - (i % n + 1) := by
      rw [Nat.mul_comm, Nat.mul_add_mod, Nat.mod_eq_of_lt]; exact i.modNat.rev.is_lt
Theorem: ProbabilityTheory.cond_toMeasurable_eq
File: Mathlib/Probability/ConditionalProbability.lean

Proof steps:
state_before: Ω : Type u_1
Ω' : Type u_2
α : Type u_3
m : MeasurableSpace Ω
m' : MeasurableSpace Ω'
μ : Measure Ω
s t : Set Ω
⊢ μ[|toMeasurable μ s] = μ[|s]
state_after: Ω : Type u_1
Ω' : Type u_2
α : Type u_3
m : MeasurableSpace Ω
m' : MeasurableSpace Ω'
μ : Measure Ω
s t : Set Ω
⊢ (μ (toMeasurable μ s))⁻¹ • μ.restrict (toMeasurable μ s) = (μ s)⁻¹ • μ.restrict s
tactic: unfold cond
state_before: Ω : Type u_1
Ω' : Type u_2
α : Type u_3
m : MeasurableSpace Ω
m' : MeasurableSpace Ω'
μ : Measure Ω
s t : Set Ω
⊢ (μ (toMeasurable μ s))⁻¹ • μ.restrict (toMeasurable μ s) = (μ s)⁻¹ • μ.restrict s
state_after: case pos
Ω : Type u_1
Ω' : Type u_2
α : Type u_3
m : MeasurableSpace Ω
m' : MeasurableSpace Ω'
μ : Measure Ω
s t : Set Ω
hnt : μ s = ⊤
⊢ (μ (toMeasurable μ s))⁻¹ • μ.restrict (toMeasurable μ s) = (μ s)⁻¹ • μ.restrict s

case neg
Ω : Type u_1
Ω' : Type u_2
α : Type u_3
m : MeasurableSpace Ω
m' : MeasurableSpace Ω'
μ : Measure Ω
s t : Set Ω
hnt : ¬μ s = ⊤
⊢ (μ (toMeasurable μ s))⁻¹ • μ.restrict (toMeasurable μ s) = (μ s)⁻¹ • μ.restrict s
tactic: by_cases hnt : μ s = ∞
Theorem: Field.finSepDegree_mul_finInsepDegree
File: Mathlib/FieldTheory/PurelyInseparable.lean

Proof steps:
state_before: F : Type u
E : Type v
inst✝⁴ : Field F
inst✝³ : Field E
inst✝² : Algebra F E
K : Type w
inst✝¹ : Field K
inst✝ : Algebra F K
⊢ finSepDegree F E * finInsepDegree F E = finrank F E
state_after: case pos
F : Type u
E : Type v
inst✝⁴ : Field F
inst✝³ : Field E
inst✝² : Algebra F E
K : Type w
inst✝¹ : Field K
inst✝ : Algebra F K
halg : Algebra.IsAlgebraic F E
⊢ finSepDegree F E * finInsepDegree F E = finrank F E

case neg
F : Type u
E : Type v
inst✝⁴ : Field F
inst✝³ : Field E
inst✝² : Algebra F E
K : Type w
inst✝¹ : Field K
inst✝ : Algebra F K
halg : ¬Algebra.IsAlgebraic F E
⊢ finSepDegree F E * finInsepDegree F E = finrank F E
tactic: by_cases halg : Algebra.IsAlgebraic F E
state_before: case neg
F : Type u
E : Type v
inst✝⁴ : Field F
inst✝³ : Field E
inst✝² : Algebra F E
K : Type w
inst✝¹ : Field K
inst✝ : Algebra F K
halg : ¬Algebra.IsAlgebraic F E
⊢ finSepDegree F E * finInsepDegree F E = finrank F E
state_after: no goals
tactic: rw [finInsepDegree, finrank_of_infinite_dimensional (K := F) (V := E) fun _ ↦
      halg (Algebra.IsAlgebraic.of_finite F E),
    finrank_of_infinite_dimensional (K := separableClosure F E) (V := E) fun _ ↦
      halg ((separableClosure.isAlgebraic F E).trans),
    mul_zero]
Theorem: nhds_add
File: Mathlib/Topology/Algebra/Group/Basic.lean

Proof steps:
state_before: G : Type w
H : Type x
α : Type u
β : Type v
inst✝² : TopologicalSpace G
inst✝¹ : Group G
inst✝ : TopologicalGroup G
x y : G
⊢ 𝓝 (x * y) = map (fun x_1 => x * x_1) (map (fun x => x * y) (𝓝 1 * 𝓝 1))
state_after: no goals
tactic: simp
state_before: G : Type w
H : Type x
α : Type u
β : Type v
inst✝² : TopologicalSpace G
inst✝¹ : Group G
inst✝ : TopologicalGroup G
x y : G
⊢ map (fun x_1 => x * x_1) (map (fun x => x * y) (𝓝 1 * 𝓝 1)) = map₂ (fun a b => x * (a * b * y)) (𝓝 1) (𝓝 1)
state_after: no goals
tactic: rw [← map₂_mul, map_map₂, map_map₂]
state_before: G : Type w
H : Type x
α : Type u
β : Type v
inst✝² : TopologicalSpace G
inst✝¹ : Group G
inst✝ : TopologicalGroup G
x y : G
⊢ map₂ (fun a b => x * (a * b * y)) (𝓝 1) (𝓝 1) = map₂ (fun a b => x * a * (b * y)) (𝓝 1) (𝓝 1)
state_after: no goals
tactic: simp only [mul_assoc]
state_before: G : Type w
H : Type x
α : Type u
β : Type v
inst✝² : TopologicalSpace G
inst✝¹ : Group G
inst✝ : TopologicalGroup G
x y : G
⊢ map₂ (fun a b => x * a * (b * y)) (𝓝 1) (𝓝 1) = 𝓝 x * 𝓝 y
state_after: no goals
tactic: rw [← map_mul_left_nhds_one x, ← map_mul_right_nhds_one y, ← map₂_mul, map₂_map_left,
        map₂_map_right]
Theorem: Fin.image_succAbove_univ
File: Mathlib/Data/Fintype/Basic.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
n : ℕ
i : Fin (n + 1)
⊢ image i.succAbove univ = {i}ᶜ
state_after: case a
α : Type u_1
β : Type u_2
γ : Type u_3
n : ℕ
i m : Fin (n + 1)
⊢ m ∈ image i.succAbove univ ↔ m ∈ {i}ᶜ
tactic: ext m
state_before: case a
α : Type u_1
β : Type u_2
γ : Type u_3
n : ℕ
i m : Fin (n + 1)
⊢ m ∈ image i.succAbove univ ↔ m ∈ {i}ᶜ
state_after: no goals
tactic: simp
Theorem: NonUnitalRingHom.map_range
File: Mathlib/RingTheory/NonUnitalSubring/Basic.lean

Proof steps:
state_before: R : Type u
S : Type v
T : Type u_1
inst✝² : NonUnitalNonAssocRing R
inst✝¹ : NonUnitalNonAssocRing S
inst✝ : NonUnitalNonAssocRing T
g : S →ₙ+* T
f : R →ₙ+* S
⊢ NonUnitalSubring.map g f.range = (g.comp f).range
state_after: no goals
tactic: simpa only [range_eq_map] using (⊤ : NonUnitalSubring R).map_map g f
Theorem: derivWithin.comp_of_eq
File: Mathlib/Analysis/Calculus/Deriv/Comp.lean

Proof steps:
state_before: 𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
s' t' : Set 𝕜'
h : 𝕜 → 𝕜'
h₁ : 𝕜 → 𝕜
h₂ : 𝕜' → 𝕜'
h' h₂' : 𝕜'
h₁' : 𝕜
g₁ : 𝕜' → F
g₁' : F
L' : Filter 𝕜'
y : 𝕜'
hh₂ : DifferentiableWithinAt 𝕜' h₂ s' y
hh : DifferentiableWithinAt 𝕜 h s x
hs : MapsTo h s s'
hxs : UniqueDiffWithinAt 𝕜 s x
hy : y = h x
⊢ derivWithin (h₂ ∘ h) s x = derivWithin h₂ s' (h x) * derivWithin h s x
state_after: 𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
s' t' : Set 𝕜'
h : 𝕜 → 𝕜'
h₁ : 𝕜 → 𝕜
h₂ : 𝕜' → 𝕜'
h' h₂' : 𝕜'
h₁' : 𝕜
g₁ : 𝕜' → F
g₁' : F
L' : Filter 𝕜'
y : 𝕜'
hh₂ : DifferentiableWithinAt 𝕜' h₂ s' (h x)
hh : DifferentiableWithinAt 𝕜 h s x
hs : MapsTo h s s'
hxs : UniqueDiffWithinAt 𝕜 s x
hy : y = h x
⊢ derivWithin (h₂ ∘ h) s x = derivWithin h₂ s' (h x) * derivWithin h s x
tactic: rw [hy] at hh₂
state_before: 𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
s' t' : Set 𝕜'
h : 𝕜 → 𝕜'
h₁ : 𝕜 → 𝕜
h₂ : 𝕜' → 𝕜'
h' h₂' : 𝕜'
h₁' : 𝕜
g₁ : 𝕜' → F
g₁' : F
L' : Filter 𝕜'
y : 𝕜'
hh₂ : DifferentiableWithinAt 𝕜' h₂ s' (h x)
hh : DifferentiableWithinAt 𝕜 h s x
hs : MapsTo h s s'
hxs : UniqueDiffWithinAt 𝕜 s x
hy : y = h x
⊢ derivWithin (h₂ ∘ h) s x = derivWithin h₂ s' (h x) * derivWithin h s x
state_after: no goals
tactic: exact derivWithin.comp x hh₂ hh hs hxs
Theorem: Matrix.zpow_neg_one
File: Mathlib/LinearAlgebra/Matrix/ZPow.lean

Proof steps:
state_before: n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
⊢ A ^ (-1) = A⁻¹
state_after: case h.e'_3.h.e'_3
n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
⊢ A = DivInvMonoid.zpow (↑(Nat.succ 0)) A
tactic: convert DivInvMonoid.zpow_neg' 0 A
state_before: case h.e'_3.h.e'_3
n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
⊢ A = DivInvMonoid.zpow (↑(Nat.succ 0)) A
state_after: no goals
tactic: simp only [zpow_one, Int.ofNat_zero, Int.ofNat_succ, zpow_eq_pow, zero_add]
Theorem: Valuation.isEquiv_iff_val_eq_one
File: Mathlib/RingTheory/Valuation/Basic.lean

Proof steps:
state_before: K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : LinearOrderedCommGroupWithZero Γ₀
inst✝ : LinearOrderedCommGroupWithZero Γ'₀
v : Valuation K Γ₀
v' : Valuation K Γ'₀
⊢ v.IsEquiv v' ↔ ∀ {x : K}, v x = 1 ↔ v' x = 1
state_after: case mp
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : LinearOrderedCommGroupWithZero Γ₀
inst✝ : LinearOrderedCommGroupWithZero Γ'₀
v : Valuation K Γ₀
v' : Valuation K Γ'₀
⊢ v.IsEquiv v' → ∀ {x : K}, v x = 1 ↔ v' x = 1

case mpr
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : LinearOrderedCommGroupWithZero Γ₀
inst✝ : LinearOrderedCommGroupWithZero Γ'₀
v : Valuation K Γ₀
v' : Valuation K Γ'₀
⊢ (∀ {x : K}, v x = 1 ↔ v' x = 1) → v.IsEquiv v'
tactic: constructor