ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
Theorem: Polynomial.sum_over_range'
File: Mathlib/Algebra/Polynomial/Degree/Definitions.lean

Proof steps:
state_before: R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p✝ q r : R[X]
inst✝ : AddCommMonoid S
p : R[X]
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
w : p.natDegree < n
⊢ p.sum f = ∑ a ∈ range n, f a (p.coeff a)
state_after: case ofFinsupp
R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p q r : R[X]
inst✝ : AddCommMonoid S
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
w : { toFinsupp := toFinsupp✝ }.natDegree < n
⊢ { toFinsupp := toFinsupp✝ }.sum f = ∑ a ∈ range n, f a ({ toFinsupp := toFinsupp✝ }.coeff a)
tactic: rcases p with ⟨⟩
state_before: case ofFinsupp
R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p q r : R[X]
inst✝ : AddCommMonoid S
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
w : { toFinsupp := toFinsupp✝ }.natDegree < n
⊢ { toFinsupp := toFinsupp✝ }.sum f = ∑ a ∈ range n, f a ({ toFinsupp := toFinsupp✝ }.coeff a)
state_after: case ofFinsupp
R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p q r : R[X]
inst✝ : AddCommMonoid S
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
w : { toFinsupp := toFinsupp✝ }.natDegree < n
this : { toFinsupp := toFinsupp✝ }.support ⊆ range n
⊢ { toFinsupp := toFinsupp✝ }.sum f = ∑ a ∈ range n, f a ({ toFinsupp := toFinsupp✝ }.coeff a)
tactic: have := supp_subset_range w
state_before: case ofFinsupp
R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p q r : R[X]
inst✝ : AddCommMonoid S
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
w : { toFinsupp := toFinsupp✝ }.natDegree < n
this : { toFinsupp := toFinsupp✝ }.support ⊆ range n
⊢ { toFinsupp := toFinsupp✝ }.sum f = ∑ a ∈ range n, f a ({ toFinsupp := toFinsupp✝ }.coeff a)
state_after: case ofFinsupp
R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p q r : R[X]
inst✝ : AddCommMonoid S
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
w : { toFinsupp := toFinsupp✝ }.natDegree < n
this : toFinsupp✝.support ⊆ range n
⊢ ∑ x ∈ toFinsupp✝.support, f x (toFinsupp✝ x) = ∑ x ∈ range n, f x (toFinsupp✝ x)
tactic: simp only [Polynomial.sum, support, coeff, natDegree, degree] at this ⊢
state_before: case ofFinsupp
R : Type u
S : Type v
a b c d : R
n✝ m : ℕ
inst✝¹ : Semiring R
p q r : R[X]
inst✝ : AddCommMonoid S
f : ℕ → R → S
h : ∀ (n : ℕ), f n 0 = 0
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
w : { toFinsupp := toFinsupp✝ }.natDegree < n
this : toFinsupp✝.support ⊆ range n
⊢ ∑ x ∈ toFinsupp✝.support, f x (toFinsupp✝ x) = ∑ x ∈ range n, f x (toFinsupp✝ x)
state_after: no goals
tactic: exact Finsupp.sum_of_support_subset _ this _ fun n _hn => h n
Theorem: StrongConcaveOn.mono
File: Mathlib/Analysis/Convex/Strong.lean

Proof steps:
state_before: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
φ ψ : ℝ → ℝ
s✝ : Set E
a b m✝ : ℝ
x y : E
f✝ g : E → ℝ
s : Set E
f : E → ℝ
m n : ℝ
hmn : m ≤ n
hf : StrongConcaveOn s n f
r : ℝ
⊢ m / 2 * r ^ 2 ≤ n / 2 * r ^ 2
state_after: no goals
tactic: gcongr
Theorem: CategoryTheory.GrothendieckTopology.W_eq_inverseImage_isomorphisms_of_adjunction
File: Mathlib/CategoryTheory/Sites/Localization.lean

Proof steps:
state_before: C : Type u_1
inst✝¹ : Category.{u_4, u_1} C
J : GrothendieckTopology C
A : Type u_2
inst✝ : Category.{u_3, u_2} A
G : (Cᵒᵖ ⥤ A) ⥤ Sheaf J A
adj : G ⊣ sheafToPresheaf J A
⊢ J.W = (MorphismProperty.isomorphisms (Sheaf J A)).inverseImage G
state_after: no goals
tactic: rw [W_eq_W_range_sheafToPresheaf_obj,
    LeftBousfield.W_eq_inverseImage_isomorphisms adj]
Theorem: Polynomial.mem_roots_sub_C'
File: Mathlib/Algebra/Polynomial/Roots.lean

Proof steps:
state_before: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝¹ : CommRing R
inst✝ : IsDomain R
p✝ q p : R[X]
a x : R
⊢ x ∈ (p - C a).roots ↔ p ≠ C a ∧ eval x p = a
state_after: no goals
tactic: rw [mem_roots', IsRoot.def, sub_ne_zero, eval_sub, sub_eq_zero, eval_C]
Theorem: Set.ncard_le_one_of_subsingleton
File: Mathlib/Data/Set/Card.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
s✝ t : Set α
f : α → β
inst✝ : Subsingleton α
s : Set α
⊢ s.ncard ≤ 1
state_after: α : Type u_1
β : Type u_2
s✝ t : Set α
f : α → β
inst✝ : Subsingleton α
s : Set α
⊢ ⋯.toFinset.card ≤ 1
tactic: rw [ncard_eq_toFinset_card]
state_before: α : Type u_1
β : Type u_2
s✝ t : Set α
f : α → β
inst✝ : Subsingleton α
s : Set α
⊢ ⋯.toFinset.card ≤ 1
state_after: no goals
tactic: exact Finset.card_le_one_of_subsingleton _
Theorem: Equiv.arrowCongr_apply
File: Mathlib/Logic/Equiv/Defs.lean

Proof steps:
state_before: α : Sort u
β : Sort v
γ : Sort w
α₁ : Sort u_1
β₁ : Sort u_2
α₂ : Sort u_3
β₂ : Sort u_4
e₁ : α₁ ≃ α₂
e₂ : β₁ ≃ β₂
f : α₁ → β₁
x : α₁
⊢ (fun f => ⇑e₂.symm ∘ f ∘ ⇑e₁) ((fun f => ⇑e₂ ∘ f ∘ ⇑e₁.symm) f) x = f x
state_after: no goals
tactic: simp only [comp_apply, symm_apply_apply]
state_before: α : Sort u
β : Sort v
γ : Sort w
α₁ : Sort u_1
β₁ : Sort u_2
α₂ : Sort u_3
β₂ : Sort u_4
e₁ : α₁ ≃ α₂
e₂ : β₁ ≃ β₂
f : α₂ → β₂
x : α₂
⊢ (fun f => ⇑e₂ ∘ f ∘ ⇑e₁.symm) ((fun f => ⇑e₂.symm ∘ f ∘ ⇑e₁) f) x = f x
state_after: no goals
tactic: simp only [comp_apply, apply_symm_apply]
Theorem: DMatrix.map_sub
File: Mathlib/Data/Matrix/DMatrix.lean

Proof steps:
state_before: l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
α : m → n → Type v
inst✝¹ : (i : m) → (j : n) → AddGroup (α i j)
β : m → n → Type w
inst✝ : (i : m) → (j : n) → AddGroup (β i j)
f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j
M N : DMatrix m n α
⊢ ((M - N).map fun i j => ⇑f) = (M.map fun i j => ⇑f) - N.map fun i j => ⇑f
state_after: case a
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
α : m → n → Type v
inst✝¹ : (i : m) → (j : n) → AddGroup (α i j)
β : m → n → Type w
inst✝ : (i : m) → (j : n) → AddGroup (β i j)
f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j
M N : DMatrix m n α
i✝ : m
j✝ : n
⊢ (M - N).map (fun i j => ⇑f) i✝ j✝ = ((M.map fun i j => ⇑f) - N.map fun i j => ⇑f) i✝ j✝
tactic: ext
state_before: case a
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
α : m → n → Type v
inst✝¹ : (i : m) → (j : n) → AddGroup (α i j)
β : m → n → Type w
inst✝ : (i : m) → (j : n) → AddGroup (β i j)
f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j
M N : DMatrix m n α
i✝ : m
j✝ : n
⊢ (M - N).map (fun i j => ⇑f) i✝ j✝ = ((M.map fun i j => ⇑f) - N.map fun i j => ⇑f) i✝ j✝
state_after: no goals
tactic: simp
Theorem: Nat.ofDigits_modEq'
File: Mathlib/Data/Nat/Digits.lean

Proof steps:
state_before: n b b' k : ℕ
h : b ≡ b' [MOD k]
L : List ℕ
⊢ ofDigits b L ≡ ofDigits b' L [MOD k]
state_after: case nil
n b b' k : ℕ
h : b ≡ b' [MOD k]
⊢ ofDigits b [] ≡ ofDigits b' [] [MOD k]

case cons
n b b' k : ℕ
h : b ≡ b' [MOD k]
d : ℕ
L : List ℕ
ih : ofDigits b L ≡ ofDigits b' L [MOD k]
⊢ ofDigits b (d :: L) ≡ ofDigits b' (d :: L) [MOD k]
tactic: induction' L with d L ih
Theorem: birkhoffAverage_apply_sub_birkhoffAverage
File: Mathlib/Dynamics/BirkhoffSum/Average.lean

Proof steps:
state_before: α : Type u_1
M : Type u_2
R : Type u_3
inst✝² : DivisionRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : α → α
g : α → M
n : ℕ
x : α
⊢ birkhoffAverage R f g n (f x) - birkhoffAverage R f g n x = (↑n)⁻¹ • (g (f^[n] x) - g x)
state_after: no goals
tactic: simp only [birkhoffAverage, birkhoffSum_apply_sub_birkhoffSum, ← smul_sub]
Theorem: rank_lt_aleph0
File: Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean

Proof steps:
state_before: R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
⊢ Module.rank R M < ℵ₀
state_after: R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
⊢ ⨆ ι, #↑↑ι < ℵ₀
tactic: simp only [Module.rank_def]
state_before: R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
⊢ ⨆ ι, #↑↑ι < ℵ₀
state_after: case intro
R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
S : Finset M
hS : span R ↑S = ⊤
⊢ ⨆ ι, #↑↑ι < ℵ₀
tactic: obtain ⟨S, hS⟩ := Module.finite_def.mp ‹Module.Finite R M›
state_before: case intro
R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
S : Finset M
hS : span R ↑S = ⊤
⊢ ⨆ ι, #↑↑ι < ℵ₀
state_after: case intro
R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
S : Finset M
hS : span R ↑S = ⊤
i : { s // LinearIndependent (ι := { x // x ∈ s }) R Subtype.val }
⊢ #↑↑i ≤ ↑S.card
tactic: refine (ciSup_le' fun i => ?_).trans_lt (nat_lt_aleph0 S.card)
state_before: case intro
R : Type u
M : Type v
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
ι : Type w
ι' : Type w'
inst✝¹ : StrongRankCondition R
inst✝ : Module.Finite R M
S : Finset M
hS : span R ↑S = ⊤
i : { s // LinearIndependent (ι := { x // x ∈ s }) R Subtype.val }
⊢ #↑↑i ≤ ↑S.card
state_after: no goals
tactic: exact linearIndependent_le_span_finset _ i.prop S hS
Theorem: RootPairing.injOn_dualMap_subtype_span_root_coroot
File: Mathlib/LinearAlgebra/RootSystem/Basic.lean

Proof steps:
state_before: ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : _root_.Finite ι
P : RootPairing ι R M N
i j : ι
inst✝ : NoZeroSMulDivisors ℤ M
⊢ InjOn (⇑((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip)) (range ⇑P.coroot)
state_after: ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : _root_.Finite ι
P : RootPairing ι R M N
i j : ι
inst✝ : NoZeroSMulDivisors ℤ M
this : InjOn (⇑(span R (range ⇑P.root)).subtype.dualMap) (range (⇑P.toLin.flip ∘ ⇑P.coroot))
⊢ InjOn (⇑((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip)) (range ⇑P.coroot)
tactic: have := injOn_dualMap_subtype_span_range_range (finite_range P.root)
    (c := P.toLin.flip ∘ P.coroot) P.root_coroot_two P.mapsTo_reflection_root
state_before: ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : _root_.Finite ι
P : RootPairing ι R M N
i j : ι
inst✝ : NoZeroSMulDivisors ℤ M
this : InjOn (⇑(span R (range ⇑P.root)).subtype.dualMap) (range (⇑P.toLin.flip ∘ ⇑P.coroot))
⊢ InjOn (⇑((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip)) (range ⇑P.coroot)
state_after: case intro.intro
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : _root_.Finite ι
P : RootPairing ι R M N
i✝ j✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
this : InjOn (⇑(span R (range ⇑P.root)).subtype.dualMap) (range (⇑P.toLin.flip ∘ ⇑P.coroot))
i j : ι
hij :
  ((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip) (P.coroot i) =
    ((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip) (P.coroot j)
⊢ P.coroot i = P.coroot j
tactic: rintro - ⟨i, rfl⟩ - ⟨j, rfl⟩ hij
state_before: case intro.intro
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : _root_.Finite ι
P : RootPairing ι R M N
i✝ j✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
this : InjOn (⇑(span R (range ⇑P.root)).subtype.dualMap) (range (⇑P.toLin.flip ∘ ⇑P.coroot))
i j : ι
hij :
  ((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip) (P.coroot i) =
    ((span R (range ⇑P.root)).subtype.dualMap ∘ₗ P.toLin.flip) (P.coroot j)
⊢ P.coroot i = P.coroot j
state_after: no goals
tactic: exact P.bijectiveRight.injective <| this (mem_range_self i) (mem_range_self j) hij
Theorem: IntervalIntegrable.comp_sub_left
File: Mathlib/MeasureTheory/Integral/IntervalIntegral.lean

Proof steps:
state_before: ι : Type u_1
𝕜 : Type u_2
E : Type u_3
F : Type u_4
A : Type u_5
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedRing A
f g : ℝ → E
a b : ℝ
μ : Measure ℝ
hf : IntervalIntegrable f volume a b
c : ℝ
⊢ IntervalIntegrable (fun x => f (c - x)) volume (c - a) (c - b)
state_after: no goals
tactic: simpa only [neg_sub, ← sub_eq_add_neg] using iff_comp_neg.mp (hf.comp_add_left c)
Theorem: CategoryTheory.Idempotents.Karoubi.hom_ext_iff
File: Mathlib/CategoryTheory/Idempotents/Karoubi.lean

Proof steps:
state_before: C : Type u_1
inst✝ : Category.{u_2, u_1} C
P Q : Karoubi C
f g : P ⟶ Q
⊢ f = g ↔ f.f = g.f
state_after: case mp
C : Type u_1
inst✝ : Category.{u_2, u_1} C
P Q : Karoubi C
f g : P ⟶ Q
⊢ f = g → f.f = g.f

case mpr
C : Type u_1
inst✝ : Category.{u_2, u_1} C
P Q : Karoubi C
f g : P ⟶ Q
⊢ f.f = g.f → f = g
tactic: constructor
Theorem: sub_right_comm
File: Mathlib/Algebra/Group/Basic.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
G : Type u_3
M : Type u_4
inst✝ : DivisionCommMonoid α
a b c d : α
⊢ a / b / c = a / c / b
state_after: no goals
tactic: simp
Theorem: finCongr_refl
File: Mathlib/Data/Fin/Basic.lean

Proof steps:
state_before: n m : ℕ
h : optParam (n = n) ⋯
⊢ finCongr h = Equiv.refl (Fin n)
state_after: case H.h
n m : ℕ
h : optParam (n = n) ⋯
x✝ : Fin n
⊢ ↑((finCongr h) x✝) = ↑((Equiv.refl (Fin n)) x✝)
tactic: ext
state_before: case H.h
n m : ℕ
h : optParam (n = n) ⋯
x✝ : Fin n
⊢ ↑((finCongr h) x✝) = ↑((Equiv.refl (Fin n)) x✝)
state_after: no goals
tactic: simp
Theorem: CategoryTheory.Limits.pullbackDiagonalMapIdIso_hom_fst
File: Mathlib/CategoryTheory/Limits/Shapes/Diagonal.lean

Proof steps:
state_before: C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ : HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)
⊢ (pullbackDiagonalMapIdIso f g i).hom ≫ fst f g =
    snd (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) ≫ fst (f ≫ i) (g ≫ i)
state_after: C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ : HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)
⊢ (asIso
            (map (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) (diagonal i)
              (map ((f ≫ inv (fst i (𝟙 S))) ≫ snd i (𝟙 S)) ((g ≫ inv (fst i (𝟙 S))) ≫ snd i (𝟙 S)) i i
                ((f ≫ inv (fst i (𝟙 S))) ≫ fst i (𝟙 S)) ((g ≫ inv (fst i (𝟙 S))) ≫ fst i (𝟙 S)) (𝟙 S) ⋯ ⋯)
              (𝟙 T) (congrHom ⋯ ⋯).hom (𝟙 (diagonalObj i)) ⋯ ⋯) ≪≫
          pullbackDiagonalMapIso i (𝟙 S) (f ≫ inv (fst i (𝟙 S))) (g ≫ inv (fst i (𝟙 S))) ≪≫
            asIso (map (f ≫ inv (fst i (𝟙 S))) (g ≫ inv (fst i (𝟙 S))) f g (𝟙 X) (𝟙 Y) (fst i (𝟙 S)) ⋯ ⋯)).hom ≫
      fst f g =
    snd (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) ≫ fst (f ≫ i) (g ≫ i)
tactic: delta pullbackDiagonalMapIdIso
state_before: C : Type u_1
inst✝⁵ : Category.{u_2, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ : HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)
⊢ (asIso
            (map (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) (diagonal i)
              (map ((f ≫ inv (fst i (𝟙 S))) ≫ snd i (𝟙 S)) ((g ≫ inv (fst i (𝟙 S))) ≫ snd i (𝟙 S)) i i
                ((f ≫ inv (fst i (𝟙 S))) ≫ fst i (𝟙 S)) ((g ≫ inv (fst i (𝟙 S))) ≫ fst i (𝟙 S)) (𝟙 S) ⋯ ⋯)
              (𝟙 T) (congrHom ⋯ ⋯).hom (𝟙 (diagonalObj i)) ⋯ ⋯) ≪≫
          pullbackDiagonalMapIso i (𝟙 S) (f ≫ inv (fst i (𝟙 S))) (g ≫ inv (fst i (𝟙 S))) ≪≫
            asIso (map (f ≫ inv (fst i (𝟙 S))) (g ≫ inv (fst i (𝟙 S))) f g (𝟙 X) (𝟙 Y) (fst i (𝟙 S)) ⋯ ⋯)).hom ≫
      fst f g =
    snd (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) ≫ fst (f ≫ i) (g ≫ i)
state_after: no goals
tactic: simp
Theorem: Nat.Coprime.coprime_div_left
File: .lake/packages/batteries/Batteries/Data/Nat/Gcd.lean

Proof steps:
state_before: m n a : Nat
cmn : m.Coprime n
dvd : a ∣ m
⊢ (m / a).Coprime n
state_after: no goals
tactic: match eq_zero_or_pos a with
  | .inl h0 =>
    rw [h0] at dvd
    rw [Nat.eq_zero_of_zero_dvd dvd] at cmn ⊢
    simp; assumption
  | .inr hpos =>
    let ⟨k, hk⟩ := dvd
    rw [hk, Nat.mul_div_cancel_left _ hpos]
    rw [hk] at cmn
    exact cmn.coprime_mul_left
Theorem: AddCommGroup.equiv_free_prod_directSum_zmod
File: Mathlib/GroupTheory/FiniteAbelian.lean

Proof steps:
state_before: G : Type u
inst✝ : AddCommGroup G
hG : AddGroup.FG G
⊢ ∃ n ι x p, ∃ (_ : ∀ (i : ι), Nat.Prime (p i)), ∃ e, Nonempty (G ≃+ (Fin n →₀ ℤ) × ⨁ (i : ι), ZMod (p i ^ e i))
state_after: case intro.intro.intro.intro.intro.intro.intro
G : Type u
inst✝ : AddCommGroup G
hG : AddGroup.FG G
n : ℕ
ι : Type
fι : Fintype ι
p : ι → ℤ
hp : ∀ (i : ι), Irreducible (p i)
e : ι → ℕ
f : G ≃ₗ[ℤ] (Fin n →₀ ℤ) × ⨁ (i : ι), ℤ ⧸ Submodule.span ℤ {p i ^ e i}
⊢ ∃ n ι x p, ∃ (_ : ∀ (i : ι), Nat.Prime (p i)), ∃ e, Nonempty (G ≃+ (Fin n →₀ ℤ) × ⨁ (i : ι), ZMod (p i ^ e i))
tactic: obtain ⟨n, ι, fι, p, hp, e, ⟨f⟩⟩ :=
    @Module.equiv_free_prod_directSum _ _ _ _ _ _ _ (Module.Finite.iff_addGroup_fg.mpr hG)
state_before: case intro.intro.intro.intro.intro.intro.intro
G : Type u
inst✝ : AddCommGroup G
hG : AddGroup.FG G
n : ℕ
ι : Type
fι : Fintype ι
p : ι → ℤ
hp : ∀ (i : ι), Irreducible (p i)
e : ι → ℕ
f : G ≃ₗ[ℤ] (Fin n →₀ ℤ) × ⨁ (i : ι), ℤ ⧸ Submodule.span ℤ {p i ^ e i}
⊢ ∃ n ι x p, ∃ (_ : ∀ (i : ι), Nat.Prime (p i)), ∃ e, Nonempty (G ≃+ (Fin n →₀ ℤ) × ⨁ (i : ι), ZMod (p i ^ e i))
state_after: case intro.intro.intro.intro.intro.intro.intro.refine_1
G : Type u
inst✝ : AddCommGroup G
hG : AddGroup.FG G
n : ℕ
ι : Type
fι : Fintype ι
p : ι → ℤ
hp : ∀ (i : ι), Irreducible (p i)
e : ι → ℕ
f : G ≃ₗ[ℤ] (Fin n →₀ ℤ) × ⨁ (i : ι), ℤ ⧸ Submodule.span ℤ {p i ^ e i}
i : ι
⊢ Nat.Prime ((fun i => (p i).natAbs) i)

case intro.intro.intro.intro.intro.intro.intro.refine_2
G : Type u
inst✝ : AddCommGroup G
hG : AddGroup.FG G
n : ℕ
ι : Type
fι : Fintype ι
p : ι → ℤ
hp : ∀ (i : ι), Irreducible (p i)
e : ι → ℕ
f : G ≃ₗ[ℤ] (Fin n →₀ ℤ) × ⨁ (i : ι), ℤ ⧸ Submodule.span ℤ {p i ^ e i}
⊢ G ≃+ (Fin n →₀ ℤ) × ⨁ (i : ι), ZMod ((fun i => (p i).natAbs) i ^ e i)
tactic: refine ⟨n, ι, fι, fun i => (p i).natAbs, fun i => ?_, e, ⟨?_⟩⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.refine_2
G : Type u
inst✝ : AddCommGroup G
hG : AddGroup.FG G
n : ℕ
ι : Type
fι : Fintype ι
p : ι → ℤ
hp : ∀ (i : ι), Irreducible (p i)
e : ι → ℕ
f : G ≃ₗ[ℤ] (Fin n →₀ ℤ) × ⨁ (i : ι), ℤ ⧸ Submodule.span ℤ {p i ^ e i}
⊢ G ≃+ (Fin n →₀ ℤ) × ⨁ (i : ι), ZMod ((fun i => (p i).natAbs) i ^ e i)
state_after: no goals
tactic: exact
    f.toAddEquiv.trans
      ((AddEquiv.refl _).prodCongr <|
        DFinsupp.mapRange.addEquiv fun i =>
          ((Int.quotientSpanEquivZMod _).trans <|
              ZMod.ringEquivCongr <| (p i).natAbs_pow _).toAddEquiv)
Theorem: LazyList.mem_cons
File: .lake/packages/batteries/Batteries/Data/LazyList.lean

Proof steps:
state_before: α : Type u_1
x y : α
ys : Thunk (LazyList α)
⊢ x ∈ cons y ys ↔ x = y ∨ x ∈ ys.get
state_after: no goals
tactic: simp [Membership.mem, LazyList.Mem]
Theorem: Finset.piecewise_le_piecewise'
File: Mathlib/Data/Finset/Piecewise.lean

Proof steps:
state_before: ι : Type u_1
π✝ : ι → Sort u_2
s : Finset ι
f✝ g✝ : (i : ι) → π✝ i
inst✝¹ : (j : ι) → Decidable (j ∈ s)
π : ι → Type u_3
t : Set ι
t' : (i : ι) → Set (π i)
f g f' g' h : (i : ι) → π i
inst✝ : (i : ι) → Preorder (π i)
hf : ∀ x ∈ s, f x ≤ f' x
hg : ∀ x ∉ s, g x ≤ g' x
x : ι
⊢ s.piecewise f g x ≤ s.piecewise f' g' x
state_after: no goals
tactic: by_cases hx : x ∈ s <;> simp [hx, *]
Theorem: ContDiffWithinAt.differentiableWithinAt_iteratedDerivWithin
File: Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean

Proof steps:
state_before: 𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
n✝ : ℕ
f : 𝕜 → F
s : Set 𝕜
x : 𝕜
n : ℕ∞
m : ℕ
h : ContDiffWithinAt 𝕜 n f s x
hmn : ↑m < n
hs : UniqueDiffOn 𝕜 (insert x s)
⊢ DifferentiableWithinAt 𝕜 (iteratedDerivWithin m f s) s x
state_after: no goals
tactic: simpa only [iteratedDerivWithin_eq_equiv_comp,
    LinearIsometryEquiv.comp_differentiableWithinAt_iff] using
    h.differentiableWithinAt_iteratedFDerivWithin hmn hs
Theorem: List.mem_product
File: Mathlib/Data/List/ProdSigma.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
l₁ : List α
l₂ : List β
a : α
b : β
⊢ (a, b) ∈ l₁ ×ˢ l₂ ↔ a ∈ l₁ ∧ b ∈ l₂
state_after: no goals
tactic: simp_all [SProd.sprod, product, mem_bind, mem_map, Prod.ext_iff, exists_prop, and_left_comm,
    exists_and_left, exists_eq_left, exists_eq_right]
Theorem: Set.ncard_diff_singleton_add_one
File: Mathlib/Data/Set/Card.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
s t : Set α
a : α
h : a ∈ s
hs : autoParam s.Finite _auto✝
⊢ (s \ {a}).ncard + 1 = s.ncard
state_after: α : Type u_1
β : Type u_2
s t : Set α
a : α
h : a ∈ s
hs : autoParam s.Finite _auto✝
⊢ ↑(s \ {a}).ncard + 1 = ↑s.ncard
tactic: to_encard_tac
state_before: α : Type u_1
β : Type u_2
s t : Set α
a : α
h : a ∈ s
hs : autoParam s.Finite _auto✝
⊢ ↑(s \ {a}).ncard + 1 = ↑s.ncard
state_after: no goals
tactic: rw [hs.cast_ncard_eq, (hs.diff _).cast_ncard_eq,
    encard_diff_singleton_add_one h]
Theorem: Cardinal.mk_bounded_subset_le
File: Mathlib/SetTheory/Cardinal/Ordinal.lean

Proof steps:
state_before: α : Type u
s : Set α
c : Cardinal.{u}
⊢ #{ t // t ⊆ s ∧ #↑t ≤ c } ≤ max #↑s ℵ₀ ^ c
state_after: α : Type u
s : Set α
c : Cardinal.{u}
⊢ #{ t // t ⊆ s ∧ #↑t ≤ c } ≤ #{ t // #↑t ≤ c }
tactic: refine le_trans ?_ (mk_bounded_set_le s c)
state_before: α : Type u
s : Set α
c : Cardinal.{u}
⊢ #{ t // t ⊆ s ∧ #↑t ≤ c } ≤ #{ t // #↑t ≤ c }
state_after: case refine_1
α : Type u
s : Set α
c : Cardinal.{u}
⊢ { t // t ⊆ s ∧ #↑t ≤ c } ↪ Set ↑s

case refine_2
α : Type u
s : Set α
c : Cardinal.{u}
⊢ ∀ (a : { t // t ⊆ s ∧ #↑t ≤ c }), ?refine_1 a ∈ fun t => Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) ⋯ c
tactic: refine ⟨Embedding.codRestrict _ ?_ ?_⟩
state_before: case refine_2
α : Type u
s : Set α
c : Cardinal.{u}
⊢ ∀ (a : { t // t ⊆ s ∧ #↑t ≤ c }),
    { toFun := fun t => Subtype.val ⁻¹' ↑t, inj' := ⋯ } a ∈ fun t => Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) ⋯ c
state_after: case refine_2.mk.intro
α : Type u
s : Set α
c : Cardinal.{u}
t : Set α
left✝ : t ⊆ s
h2t : #↑t ≤ c
⊢ { toFun := fun t => Subtype.val ⁻¹' ↑t, inj' := ⋯ } ⟨t, ⋯⟩ ∈ fun t => Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) ⋯ c
tactic: rintro ⟨t, _, h2t⟩
state_before: case refine_2.mk.intro
α : Type u
s : Set α
c : Cardinal.{u}
t : Set α
left✝ : t ⊆ s
h2t : #↑t ≤ c
⊢ { toFun := fun t => Subtype.val ⁻¹' ↑t, inj' := ⋯ } ⟨t, ⋯⟩ ∈ fun t => Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) ⋯ c
state_after: no goals
tactic: exact (mk_preimage_of_injective _ _ Subtype.val_injective).trans h2t