ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
Theorem: CategoryTheory.Iso.homCongr_trans
File: Mathlib/CategoryTheory/HomCongr.lean

Proof steps:
state_before: C : Type u
inst✝ : Category.{v, u} C
X₁ Y₁ X₂ Y₂ X₃ Y₃ : C
α₁ : X₁ ≅ X₂
β₁ : Y₁ ≅ Y₂
α₂ : X₂ ≅ X₃
β₂ : Y₂ ≅ Y₃
f : X₁ ⟶ Y₁
⊢ ((α₁ ≪≫ α₂).homCongr (β₁ ≪≫ β₂)) f = ((α₁.homCongr β₁).trans (α₂.homCongr β₂)) f
state_after: no goals
tactic: simp
Theorem: ascPochhammer_eval_cast
File: Mathlib/RingTheory/Polynomial/Pochhammer.lean

Proof steps:
state_before: S : Type u
inst✝ : Semiring S
n k : ℕ
⊢ ↑(eval k (ascPochhammer ℕ n)) = eval (↑k) (ascPochhammer S n)
state_after: no goals
tactic: rw [← ascPochhammer_map (algebraMap ℕ S), eval_map, ← eq_natCast (algebraMap ℕ S),
      eval₂_at_natCast,Nat.cast_id]
Theorem: DirectSum.coe_decompose_mul_add_of_left_mem
File: Mathlib/RingTheory/GradedAlgebra/Basic.lean

Proof steps:
state_before: ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : DecidableEq ι
inst✝⁴ : Semiring A
inst✝³ : SetLike σ A
inst✝² : AddSubmonoidClass σ A
𝒜 : ι → σ
i j : ι
inst✝¹ : AddLeftCancelMonoid ι
inst✝ : GradedRing 𝒜
a b : A
a_mem : a ∈ 𝒜 i
⊢ ↑(((decompose 𝒜) (a * b)) (i + j)) = a * ↑(((decompose 𝒜) b) j)
state_after: case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : DecidableEq ι
inst✝⁴ : Semiring A
inst✝³ : SetLike σ A
inst✝² : AddSubmonoidClass σ A
𝒜 : ι → σ
i j : ι
inst✝¹ : AddLeftCancelMonoid ι
inst✝ : GradedRing 𝒜
b : A
a : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (↑a * b)) (i + j)) = ↑a * ↑(((decompose 𝒜) b) j)
tactic: lift a to 𝒜 i using a_mem
state_before: case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : DecidableEq ι
inst✝⁴ : Semiring A
inst✝³ : SetLike σ A
inst✝² : AddSubmonoidClass σ A
𝒜 : ι → σ
i j : ι
inst✝¹ : AddLeftCancelMonoid ι
inst✝ : GradedRing 𝒜
b : A
a : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (↑a * b)) (i + j)) = ↑a * ↑(((decompose 𝒜) b) j)
state_after: no goals
tactic: rw [decompose_mul, decompose_coe, coe_of_mul_apply_add]
Theorem: abs_abs_sub_abs_le_abs_sub
File: Mathlib/Algebra/Order/Group/Abs.lean

Proof steps:
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c d a b : α
⊢ |b| - |a| ≤ |a - b|
state_after: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c d a b : α
⊢ |b| - |a| ≤ |b - a|
tactic: rw [abs_sub_comm]
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c d a b : α
⊢ |b| - |a| ≤ |b - a|
state_after: no goals
tactic: apply abs_sub_abs_le_abs_sub
Theorem: CoxeterSystem.isRightInversion_inv_iff
File: Mathlib/GroupTheory/Coxeter/Inversion.lean

Proof steps:
state_before: B : Type u_1
W : Type u_2
inst✝ : Group W
M : CoxeterMatrix B
cs : CoxeterSystem M W
w t : W
⊢ cs.IsRightInversion w⁻¹ t ↔ cs.IsLeftInversion w t
state_after: case h
B : Type u_1
W : Type u_2
inst✝ : Group W
M : CoxeterMatrix B
cs : CoxeterSystem M W
w t : W
⊢ cs.IsReflection t → (cs.length (w⁻¹ * t) < cs.length w⁻¹ ↔ cs.length (t * w) < cs.length w)
tactic: apply and_congr_right
state_before: case h
B : Type u_1
W : Type u_2
inst✝ : Group W
M : CoxeterMatrix B
cs : CoxeterSystem M W
w t : W
⊢ cs.IsReflection t → (cs.length (w⁻¹ * t) < cs.length w⁻¹ ↔ cs.length (t * w) < cs.length w)
state_after: case h
B : Type u_1
W : Type u_2
inst✝ : Group W
M : CoxeterMatrix B
cs : CoxeterSystem M W
w t : W
ht : cs.IsReflection t
⊢ cs.length (w⁻¹ * t) < cs.length w⁻¹ ↔ cs.length (t * w) < cs.length w
tactic: intro ht
state_before: case h
B : Type u_1
W : Type u_2
inst✝ : Group W
M : CoxeterMatrix B
cs : CoxeterSystem M W
w t : W
ht : cs.IsReflection t
⊢ cs.length (w⁻¹ * t) < cs.length w⁻¹ ↔ cs.length (t * w) < cs.length w
state_after: no goals
tactic: rw [← length_inv, mul_inv_rev, inv_inv, ht.inv, cs.length_inv w]
Theorem: CategoryTheory.Equivalence.cancel_counitInv_right_assoc'
File: Mathlib/CategoryTheory/Equivalence.lean

Proof steps:
state_before: C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
e : C ≌ D
W X X' Y Y' Z : D
f : W ⟶ X
g : X ⟶ Y
h : Y ⟶ Z
f' : W ⟶ X'
g' : X' ⟶ Y'
h' : Y' ⟶ Z
⊢ f ≫ g ≫ h ≫ e.counitInv.app Z = f' ≫ g' ≫ h' ≫ e.counitInv.app Z ↔ f ≫ g ≫ h = f' ≫ g' ≫ h'
state_after: no goals
tactic: simp only [← Category.assoc, cancel_mono]
Theorem: Cardinal.cantorFunctionAux_false
File: Mathlib/Data/Real/Cardinality.lean

Proof steps:
state_before: c : ℝ
f g : ℕ → Bool
n : ℕ
h : f n = false
⊢ cantorFunctionAux c f n = 0
state_after: no goals
tactic: simp [cantorFunctionAux, h]
Theorem: Orientation.oangle_sign_sub_right_eq_neg
File: Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean

Proof steps:
state_before: V : Type u_1
V' : Type u_2
inst✝⁵ : NormedAddCommGroup V
inst✝⁴ : NormedAddCommGroup V'
inst✝³ : InnerProductSpace ℝ V
inst✝² : InnerProductSpace ℝ V'
inst✝¹ : Fact (finrank ℝ V = 2)
inst✝ : Fact (finrank ℝ V' = 2)
o : Orientation ℝ V (Fin 2)
x y : V
⊢ (o.oangle x (x - y)).sign = -(o.oangle x y).sign
state_after: no goals
tactic: rw [← o.oangle_sign_smul_sub_right x y 1, one_smul]
Theorem: List.formPerm_apply_mem_ne_self_iff
File: Mathlib/GroupTheory/Perm/List.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
hl : l.Nodup
x : α
hx : x ∈ l
⊢ l.formPerm x ≠ x ↔ 2 ≤ l.length
state_after: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
hl : l.Nodup
x : α
hx : x ∈ l
⊢ 1 < l.length ↔ 2 ≤ l.length
tactic: rw [Ne, formPerm_apply_mem_eq_self_iff _ hl x hx, not_le]
state_before: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
hl : l.Nodup
x : α
hx : x ∈ l
⊢ 1 < l.length ↔ 2 ≤ l.length
state_after: no goals
tactic: exact ⟨Nat.succ_le_of_lt, Nat.lt_of_succ_le⟩
Theorem: Set.injective_codRestrict
File: Mathlib/Data/Set/Function.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
f : ι → α
s : Set α
h : ∀ (x : ι), f x ∈ s
⊢ Injective (codRestrict f s h) ↔ Injective f
state_after: no goals
tactic: simp only [Injective, Subtype.ext_iff, val_codRestrict_apply]
Theorem: Set.equitableOn_iff_exists_image_subset_icc
File: Mathlib/Data/Set/Equitable.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
s : Set α
f : α → ℕ
⊢ s.EquitableOn f ↔ ∃ b, f '' s ⊆ Icc b (b + 1)
state_after: no goals
tactic: simpa only [image_subset_iff] using equitableOn_iff_exists_le_le_add_one
Theorem: AlgebraicGeometry.IsLocalAtTarget.of_openCover
File: Mathlib/AlgebraicGeometry/Morphisms/Basic.lean

Proof steps:
state_before: P : MorphismProperty Scheme
hP : IsLocalAtTarget P
X Y U V : Scheme
f : X ⟶ Y
g : U ⟶ Y
inst✝ : IsOpenImmersion g
𝒰 : Y.OpenCover
H : ∀ (i : (𝒰.pullbackCover f).J), P (𝒰.pullbackHom f i)
⊢ P f
state_after: P : MorphismProperty Scheme
hP : IsLocalAtTarget P
X Y U V : Scheme
f : X ⟶ Y
g : U ⟶ Y
inst✝ : IsOpenImmersion g
𝒰 : Y.OpenCover
H : ∀ (i : (𝒰.pullbackCover f).J), P (𝒰.pullbackHom f i)
⊢ ∀ (i : 𝒰.J), P (f ∣_ Scheme.Hom.opensRange (𝒰.map i))
tactic: apply of_iSup_eq_top (fun i ↦ (𝒰.map i).opensRange) 𝒰.iSup_opensRange
state_before: P : MorphismProperty Scheme
hP : IsLocalAtTarget P
X Y U V : Scheme
f : X ⟶ Y
g : U ⟶ Y
inst✝ : IsOpenImmersion g
𝒰 : Y.OpenCover
H : ∀ (i : (𝒰.pullbackCover f).J), P (𝒰.pullbackHom f i)
⊢ ∀ (i : 𝒰.J), P (f ∣_ Scheme.Hom.opensRange (𝒰.map i))
state_after: no goals
tactic: exact fun i ↦ (P.arrow_mk_iso_iff (morphismRestrictOpensRange f _)).mpr (H i)
Theorem: CommMon_.EquivLaxBraidedFunctorPUnit.commMonToLaxBraided_map_toNatTrans_app
File: Mathlib/CategoryTheory/Monoidal/CommMon_.lean

Proof steps:
state_before: C : Type u₁
inst✝² : Category.{v₁, u₁} C
inst✝¹ : MonoidalCategory C
inst✝ : BraidedCategory C
X✝ Y✝ : CommMon_ C
f : X✝ ⟶ Y✝
x✝² x✝¹ : Discrete PUnit.{u + 1}
x✝ : x✝² ⟶ x✝¹
⊢ ((fun A =>
              { obj := fun x => A.X, map := fun {X Y} x => 𝟙 ((fun x => A.X) X), map_id := ⋯, map_comp := ⋯, ε := A.one,
                μ := fun x x => A.mul, μ_natural_left := ⋯, μ_natural_right := ⋯, associativity := ⋯,
                left_unitality := ⋯, right_unitality := ⋯, braided := ⋯ })
            X✝).map
        x✝ ≫
      (fun x => f.hom) x✝¹ =
    (fun x => f.hom) x✝² ≫
      ((fun A =>
              { obj := fun x => A.X, map := fun {X Y} x => 𝟙 ((fun x => A.X) X), map_id := ⋯, map_comp := ⋯, ε := A.one,
                μ := fun x x => A.mul, μ_natural_left := ⋯, μ_natural_right := ⋯, associativity := ⋯,
                left_unitality := ⋯, right_unitality := ⋯, braided := ⋯ })
            Y✝).map
        x✝
state_after: C : Type u₁
inst✝² : Category.{v₁, u₁} C
inst✝¹ : MonoidalCategory C
inst✝ : BraidedCategory C
X✝ Y✝ : CommMon_ C
f : X✝ ⟶ Y✝
x✝² x✝¹ : Discrete PUnit.{u + 1}
x✝ : x✝² ⟶ x✝¹
⊢ 𝟙 X✝.X ≫ f.hom = f.hom ≫ 𝟙 Y✝.X
tactic: dsimp
state_before: C : Type u₁
inst✝² : Category.{v₁, u₁} C
inst✝¹ : MonoidalCategory C
inst✝ : BraidedCategory C
X✝ Y✝ : CommMon_ C
f : X✝ ⟶ Y✝
x✝² x✝¹ : Discrete PUnit.{u + 1}
x✝ : x✝² ⟶ x✝¹
⊢ 𝟙 X✝.X ≫ f.hom = f.hom ≫ 𝟙 Y✝.X
state_after: no goals
tactic: rw [Category.id_comp, Category.comp_id]
Theorem: Polynomial.eval_multiset_prod_X_sub_C_derivative
File: Mathlib/Algebra/Polynomial/Derivative.lean

Proof steps:
state_before: R : Type u
S✝ : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : CommRing R
inst✝ : DecidableEq R
S : Multiset R
r : R
hr : r ∈ S
⊢ eval r (derivative (Multiset.map (fun a => X - C a) S).prod) = (Multiset.map (fun a => r - a) (S.erase r)).prod
state_after: R : Type u
S✝ : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : CommRing R
inst✝ : DecidableEq R
S : Multiset R
r : R
hr : r ∈ S
⊢ eval r (derivative (Multiset.map (fun a => X - C a) (r ::ₘ S.erase r)).prod) =
    (Multiset.map (fun a => r - a) (S.erase r)).prod
tactic: nth_rw 1 [← Multiset.cons_erase hr]
state_before: R : Type u
S✝ : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : CommRing R
inst✝ : DecidableEq R
S : Multiset R
r : R
hr : r ∈ S
⊢ eval r (derivative (Multiset.map (fun a => X - C a) (r ::ₘ S.erase r)).prod) =
    (Multiset.map (fun a => r - a) (S.erase r)).prod
state_after: R : Type u
S✝ : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : CommRing R
inst✝ : DecidableEq R
S : Multiset R
r : R
hr : r ∈ S
this :
  ↑(evalRingHom r) (Multiset.map (fun a => X - C a) (S.erase r)).prod =
    (Multiset.map (⇑↑(evalRingHom r)) (Multiset.map (fun a => X - C a) (S.erase r))).prod
⊢ eval r (derivative (Multiset.map (fun a => X - C a) (r ::ₘ S.erase r)).prod) =
    (Multiset.map (fun a => r - a) (S.erase r)).prod
tactic: have := (evalRingHom r).map_multiset_prod (Multiset.map (fun a => X - C a) (S.erase r))
state_before: R : Type u
S✝ : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : CommRing R
inst✝ : DecidableEq R
S : Multiset R
r : R
hr : r ∈ S
this :
  ↑(evalRingHom r) (Multiset.map (fun a => X - C a) (S.erase r)).prod =
    (Multiset.map (⇑↑(evalRingHom r)) (Multiset.map (fun a => X - C a) (S.erase r))).prod
⊢ eval r (derivative (Multiset.map (fun a => X - C a) (r ::ₘ S.erase r)).prod) =
    (Multiset.map (fun a => r - a) (S.erase r)).prod
state_after: no goals
tactic: simpa using this
Theorem: Submonoid.comap_id
File: Mathlib/Algebra/Group/Submonoid/Operations.lean

Proof steps:
state_before: M : Type u_1
N : Type u_2
P : Type u_3
inst✝³ : MulOneClass M
inst✝² : MulOneClass N
inst✝¹ : MulOneClass P
S✝ : Submonoid M
F : Type u_4
inst✝ : FunLike F M N
mc : MonoidHomClass F M N
S : Submonoid P
⊢ ∀ (x : P), x ∈ comap (MonoidHom.id P) S ↔ x ∈ S
state_after: no goals
tactic: simp
Theorem: EuclideanSpace.closedBall_zero_eq
File: Mathlib/Analysis/InnerProductSpace/PiL2.lean

Proof steps:
state_before: ι : Type u_1
ι' : Type u_2
𝕜 : Type u_3
inst✝⁹ : _root_.RCLike 𝕜
E : Type u_4
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace 𝕜 E
E' : Type u_5
inst✝⁶ : NormedAddCommGroup E'
inst✝⁵ : InnerProductSpace 𝕜 E'
F : Type u_6
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace ℝ F
F' : Type u_7
inst✝² : NormedAddCommGroup F'
inst✝¹ : InnerProductSpace ℝ F'
n : Type u_8
inst✝ : Fintype n
r : ℝ
hr : 0 ≤ r
⊢ Metric.closedBall 0 r = {x | ∑ i : n, x i ^ 2 ≤ r ^ 2}
state_after: case h
ι : Type u_1
ι' : Type u_2
𝕜 : Type u_3
inst✝⁹ : _root_.RCLike 𝕜
E : Type u_4
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace 𝕜 E
E' : Type u_5
inst✝⁶ : NormedAddCommGroup E'
inst✝⁵ : InnerProductSpace 𝕜 E'
F : Type u_6
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace ℝ F
F' : Type u_7
inst✝² : NormedAddCommGroup F'
inst✝¹ : InnerProductSpace ℝ F'
n : Type u_8
inst✝ : Fintype n
r : ℝ
hr : 0 ≤ r
x✝ : EuclideanSpace ℝ n
⊢ x✝ ∈ Metric.closedBall 0 r ↔ x✝ ∈ {x | ∑ i : n, x i ^ 2 ≤ r ^ 2}
tactic: ext
state_before: case h
ι : Type u_1
ι' : Type u_2
𝕜 : Type u_3
inst✝⁹ : _root_.RCLike 𝕜
E : Type u_4
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace 𝕜 E
E' : Type u_5
inst✝⁶ : NormedAddCommGroup E'
inst✝⁵ : InnerProductSpace 𝕜 E'
F : Type u_6
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace ℝ F
F' : Type u_7
inst✝² : NormedAddCommGroup F'
inst✝¹ : InnerProductSpace ℝ F'
n : Type u_8
inst✝ : Fintype n
r : ℝ
hr : 0 ≤ r
x✝ : EuclideanSpace ℝ n
⊢ x✝ ∈ Metric.closedBall 0 r ↔ x✝ ∈ {x | ∑ i : n, x i ^ 2 ≤ r ^ 2}
state_after: no goals
tactic: simp_rw [mem_setOf, mem_closedBall_zero_iff, norm_eq, norm_eq_abs, sq_abs, sqrt_le_left hr]
Theorem: CategoryTheory.Preadditive.mono_of_isZero_kernel'
File: Mathlib/CategoryTheory/Preadditive/Basic.lean

Proof steps:
state_before: C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
P Q R : C
f✝ f' : P ⟶ Q
g✝ g' : Q ⟶ R
X Y : C
f : X ⟶ Y
c : KernelFork f
hc : IsLimit c
h : IsZero c.pt
P✝ : C
g : P✝ ⟶ X
hg : g ≫ f = 0
⊢ g = 0
state_after: case mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
P Q R : C
f✝ f' : P ⟶ Q
g✝ g' : Q ⟶ R
X Y : C
f : X ⟶ Y
c : KernelFork f
hc : IsLimit c
h : IsZero c.pt
P✝ : C
g : P✝ ⟶ X
hg : g ≫ f = 0
a : P✝ ⟶ c.pt
ha : a ≫ Fork.ι c = g
⊢ g = 0
tactic: obtain ⟨a, ha⟩ := KernelFork.IsLimit.lift' hc _ hg
state_before: case mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
P Q R : C
f✝ f' : P ⟶ Q
g✝ g' : Q ⟶ R
X Y : C
f : X ⟶ Y
c : KernelFork f
hc : IsLimit c
h : IsZero c.pt
P✝ : C
g : P✝ ⟶ X
hg : g ≫ f = 0
a : P✝ ⟶ c.pt
ha : a ≫ Fork.ι c = g
⊢ g = 0
state_after: no goals
tactic: rw [← ha, h.eq_of_tgt a 0, Limits.zero_comp]
Theorem: EuclideanGeometry.dist_sq_mul_dist_add_dist_sq_mul_dist
File: Mathlib/Geometry/Euclidean/Triangle.lean

Proof steps:
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c p : P
h : ∠ b p c = π
⊢ dist a b ^ 2 * dist c p + dist a c ^ 2 * dist b p = dist b c * (dist a p ^ 2 + dist b p * dist c p)
state_after: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c p : P
h : ∠ b p c = π
⊢ (dist a p * dist a p + dist b p * dist b p - 2 * dist a p * dist b p * -Real.cos (∠ a p c)) * dist c p +
      (dist a p * dist a p + dist c p * dist c p - 2 * dist a p * dist c p * Real.cos (∠ a p c)) * dist b p =
    (dist b p + dist c p) * (dist a p ^ 2 + dist b p * dist c p)
tactic: rw [pow_two, pow_two, law_cos a p b, law_cos a p c,
    eq_sub_of_add_eq (angle_add_angle_eq_pi_of_angle_eq_pi a h), Real.cos_pi_sub,
    dist_eq_add_dist_of_angle_eq_pi h]
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c p : P
h : ∠ b p c = π
⊢ (dist a p * dist a p + dist b p * dist b p - 2 * dist a p * dist b p * -Real.cos (∠ a p c)) * dist c p +
      (dist a p * dist a p + dist c p * dist c p - 2 * dist a p * dist c p * Real.cos (∠ a p c)) * dist b p =
    (dist b p + dist c p) * (dist a p ^ 2 + dist b p * dist c p)
state_after: no goals
tactic: ring
Theorem: Nat.sum_totient
File: Mathlib/Data/Nat/Totient.lean

Proof steps:
state_before: n : ℕ
⊢ n.divisors.sum φ = n
state_after: case inl

⊢ (divisors 0).sum φ = 0

case inr
n : ℕ
hn : n > 0
⊢ n.divisors.sum φ = n
tactic: rcases n.eq_zero_or_pos with (rfl | hn)
state_before: case inr
n : ℕ
hn : n > 0
⊢ n.divisors.sum φ = n
state_after: case inr
n : ℕ
hn : n > 0
⊢ ∑ d ∈ n.divisors, φ (n / d) = n
tactic: rw [← sum_div_divisors n φ]
state_before: case inr
n : ℕ
hn : n > 0
⊢ ∑ d ∈ n.divisors, φ (n / d) = n
state_after: case inr
n : ℕ
hn : n > 0
this : n = ∑ d ∈ n.divisors, (filter (fun k => n.gcd k = d) (range n)).card
⊢ ∑ d ∈ n.divisors, φ (n / d) = n
tactic: have : n = ∑ d ∈ n.divisors, (filter (fun k : ℕ => n.gcd k = d) (range n)).card := by
    nth_rw 1 [← card_range n]
    refine card_eq_sum_card_fiberwise fun x _ => mem_divisors.2 ⟨?_, hn.ne'⟩
    apply gcd_dvd_left
state_before: case inr
n : ℕ
hn : n > 0
this : n = ∑ d ∈ n.divisors, (filter (fun k => n.gcd k = d) (range n)).card
⊢ ∑ d ∈ n.divisors, φ (n / d) = n
state_after: case inr
n : ℕ
hn : n > 0
this : n = ∑ d ∈ n.divisors, (filter (fun k => n.gcd k = d) (range n)).card
⊢ ∑ d ∈ n.divisors, φ (n / d) = ∑ d ∈ n.divisors, (filter (fun k => n.gcd k = d) (range n)).card
tactic: nth_rw 3 [this]
state_before: case inr
n : ℕ
hn : n > 0
this : n = ∑ d ∈ n.divisors, (filter (fun k => n.gcd k = d) (range n)).card
⊢ ∑ d ∈ n.divisors, φ (n / d) = ∑ d ∈ n.divisors, (filter (fun k => n.gcd k = d) (range n)).card
state_after: no goals
tactic: exact sum_congr rfl fun x hx => totient_div_of_dvd (dvd_of_mem_divisors hx)
Theorem: Set.univ_prod
File: Mathlib/Data/Set/Prod.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
s s₁ s₂ : Set α
t✝ t₁ t₂ : Set β
a : α
b : β
t : Set β
⊢ univ ×ˢ t = Prod.snd ⁻¹' t
state_after: no goals
tactic: simp [prod_eq]
Theorem: ZetaAsymptotics.tendsto_riemannZeta_sub_one_div_nhds_right
File: Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean

Proof steps:
state_before: ⊢ Tendsto (fun s => riemannZeta ↑s - 1 / (↑s - 1)) (𝓝[>] 1) (𝓝 ↑γ)
state_after: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
tactic: suffices Tendsto (fun s : ℝ ↦ (∑' n : ℕ, 1 / (n + 1 : ℝ) ^ s) - 1 / (s - 1))
    (𝓝[>] 1) (𝓝 γ) by
    apply ((Complex.continuous_ofReal.tendsto _).comp this).congr'
    filter_upwards [self_mem_nhdsWithin] with s hs
    simp only [Function.comp_apply, Complex.ofReal_sub, Complex.ofReal_div,
      Complex.ofReal_one, sub_left_inj, Complex.ofReal_tsum]
    rw [zeta_eq_tsum_one_div_nat_add_one_cpow (by simpa using hs)]
    congr 1 with n
    rw [Complex.ofReal_cpow (by positivity)]
    norm_cast
state_before: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
state_after: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
tactic: suffices aux2 : Tendsto (fun s : ℝ ↦ (∑' n : ℕ, 1 / (n + 1 : ℝ) ^ s) - 1 / (s - 1))
    (𝓝[>] 1) (𝓝 (1 - term_tsum 1)) by
    have := term_tsum_one.tsum_eq
    rw [← term_tsum, eq_sub_iff_add_eq, ← eq_sub_iff_add_eq'] at this
    simpa only [this] using aux2
state_before: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
state_after: case hl

⊢ ?f₁ =ᶠ[𝓝[>] 1] fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)

case h

⊢ Tendsto ?f₁ (𝓝[>] 1) (𝓝 (1 - term_tsum 1))

case f₁

⊢ ℝ → ℝ
tactic: apply Tendsto.congr'
Theorem: Num.lt_to_nat
File: Mathlib/Data/Num/Lemmas.lean

Proof steps:
state_before: α : Type u_1
m n : Num
h : Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
state_after: α : Type u_1
m n : Num
h : ↑m < ↑n
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
tactic: simp only at h
state_before: α : Type u_1
m n : Num
h : ↑m < ↑n
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
state_after: no goals
tactic: simp [h]
state_before: α : Type u_1
m n : Num
h : Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
state_after: α : Type u_1
m n : Num
h : m = n
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
tactic: simp only at h
state_before: α : Type u_1
m n : Num
h : m = n
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
state_after: no goals
tactic: simp [h, lt_irrefl]
state_before: α : Type u_1
m n : Num
h : Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.gt = Ordering.lt
state_after: no goals
tactic: simp [not_lt_of_gt h]
Theorem: PrimeSpectrum.localization_comap_inducing
File: Mathlib/AlgebraicGeometry/PrimeSpectrum/Basic.lean

Proof steps:
state_before: R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
⊢ Inducing ⇑(comap (algebraMap R S))
state_after: R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
Z : Set (PrimeSpectrum S)
⊢ IsClosed Z ↔ IsClosed Z
tactic: refine ⟨TopologicalSpace.ext_isClosed fun Z ↦ ?_⟩
state_before: R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
Z : Set (PrimeSpectrum S)
⊢ IsClosed Z ↔ IsClosed Z
state_after: R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
Z : Set (PrimeSpectrum S)
⊢ (∃ s, zeroLocus s = Z) ↔ ∃ a, zeroLocus (⇑(algebraMap R S) '' a) = Z
tactic: simp_rw [isClosed_induced_iff, isClosed_iff_zeroLocus, @eq_comm _ _ (zeroLocus _),
    exists_exists_eq_and, preimage_comap_zeroLocus]
state_before: R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
Z : Set (PrimeSpectrum S)
⊢ (∃ s, zeroLocus s = Z) ↔ ∃ a, zeroLocus (⇑(algebraMap R S) '' a) = Z
state_after: case mp
R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
Z : Set (PrimeSpectrum S)
⊢ (∃ s, zeroLocus s = Z) → ∃ a, zeroLocus (⇑(algebraMap R S) '' a) = Z

case mpr
R : Type u
S : Type v
inst✝⁴ : CommSemiring R
inst✝³ : CommSemiring S
S' : Type u_1
inst✝² : CommSemiring S'
f : R →+* S
inst✝¹ : Algebra R S
M : Submonoid R
inst✝ : IsLocalization M S
Z : Set (PrimeSpectrum S)
⊢ (∃ a, zeroLocus (⇑(algebraMap R S) '' a) = Z) → ∃ s, zeroLocus s = Z
tactic: constructor
Theorem: jacobiSym.quadratic_reciprocity_one_mod_four
File: Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean

Proof steps:
state_before: a b : ℕ
ha : a % 4 = 1
hb : Odd b
⊢ J(↑a | b) = J(↑b | a)
state_after: no goals
tactic: rw [quadratic_reciprocity (odd_iff.mpr (odd_of_mod_four_eq_one ha)) hb, pow_mul,
    neg_one_pow_div_two_of_one_mod_four ha, one_pow, one_mul]
Theorem: GaussianInt.toComplex_div_im
File: Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean

Proof steps:
state_before: x y : ℤ[i]
⊢ (toComplex (x / y)).im = ↑(round (toComplex x / toComplex y).im)
state_after: x y : ℤ[i]
⊢ (toComplex { re := round ↑(↑(x * star y).re / ↑(norm y)), im := round ↑(↑(x * star y).im / ↑(norm y)) }).im =
    ↑(round (toComplex x / toComplex y).im)
tactic: rw [div_def, ← @Rat.round_cast ℝ _ _, ← @Rat.round_cast ℝ _ _]
state_before: x y : ℤ[i]
⊢ (toComplex { re := round ↑(↑(x * star y).re / ↑(norm y)), im := round ↑(↑(x * star y).im / ↑(norm y)) }).im =
    ↑(round (toComplex x / toComplex y).im)
state_after: no goals
tactic: simp [-Rat.round_cast, mul_assoc, div_eq_mul_inv, mul_add, add_mul]
Theorem: Function.Semiconj.injOn_range
File: Mathlib/Data/Set/Function.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
fa : α → α
fb : β → β
f : α → β
g : β → γ
s t : Set α
h : Semiconj f fa fb
ha : Injective fa
hf : InjOn f (range fa)
⊢ InjOn fb (range f)
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
fa : α → α
fb : β → β
f : α → β
g : β → γ
s t : Set α
h : Semiconj f fa fb
ha : Injective fa
hf : InjOn f (fa '' univ)
⊢ InjOn fb (f '' univ)
tactic: rw [← image_univ] at *
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
fa : α → α
fb : β → β
f : α → β
g : β → γ
s t : Set α
h : Semiconj f fa fb
ha : Injective fa
hf : InjOn f (fa '' univ)
⊢ InjOn fb (f '' univ)
state_after: no goals
tactic: exact h.injOn_image ha.injOn hf