1337xyz1337xyz/leandojo-benchmark4-v10 huggingface dataset:
Theorem: List.map_erase
File: Mathlib/Data/List/Basic.lean

tactic: rw [erase_eq_eraseP, erase_eq_eraseP, eraseP_map, this]
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
this : (fun x => a == x) = fun x => f a == f x
⊢ map f (l.erase a) = (map f l).erase (f a)
state_after: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
this : (fun x => a == x) = fun x => f a == f x
⊢ map f (eraseP (fun x => f a == f x) l) = map f (eraseP ((fun x => f a == x) ∘ f) l)

tactic: rfl
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
this : (fun x => a == x) = fun x => f a == f x
⊢ map f (eraseP (fun x => f a == f x) l) = map f (eraseP ((fun x => f a == x) ∘ f) l)
state_after: no goals

tactic: ext b
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
⊢ (fun x => a == x) = fun x => f a == f x
state_after: case h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
b : α
⊢ (a == b) = (f a == f b)

tactic: simp [beq_eq_decide, finj.eq_iff]
state_before: case h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
b : α
⊢ (a == b) = (f a == f b)
state_after: no goals
Theorem: tendsto_rpow_atTop_of_base_gt_one
File: Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean

tactic: simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)]
state_before: b : ℝ
hb : 1 < b
⊢ Tendsto (fun x => b ^ x) atBot (𝓝 0)
state_after: b : ℝ
hb : 1 < b
⊢ Tendsto (fun x => rexp (log b * x)) atBot (𝓝 0)

tactic: refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_pos ?_).mpr tendsto_id
state_before: b : ℝ
hb : 1 < b
⊢ Tendsto (fun x => rexp (log b * x)) atBot (𝓝 0)
state_after: b : ℝ
hb : 1 < b
⊢ 0 < log b

tactic: exact (log_pos_iff (by positivity)).mpr <| by aesop
state_before: b : ℝ
hb : 1 < b
⊢ 0 < log b
state_after: no goals

tactic: positivity
state_before: b : ℝ
hb : 1 < b
⊢ 0 < b
state_after: no goals

tactic: aesop
state_before: b : ℝ
hb : 1 < b
⊢ 1 < b
state_after: no goals
Theorem: Ordinal.log_def
File: Mathlib/SetTheory/Ordinal/Exponential.lean

tactic: simp only [log, dif_pos h]
state_before: b : Ordinal.{u_1}
h : 1 < b
x : Ordinal.{u_1}
⊢ log b x = (sInf {o | x < b ^ o}).pred
state_after: no goals
Theorem: Multiset.rel_join
File: Mathlib/Data/Multiset/Bind.lean

tactic: induction h with
| zero => simp
| cons hab hst ih => simpa using hab.add ih
state_before: α : Type u_1
β : Type v
γ : Type u_2
δ : Type u_3
r : α → β → Prop
s : Multiset (Multiset α)
t : Multiset (Multiset β)
h : Rel (Rel r) s t
⊢ Rel r s.join t.join
state_after: no goals

tactic: simp
state_before: case zero
α : Type u_1
β : Type v
γ : Type u_2
δ : Type u_3
r : α → β → Prop
s : Multiset (Multiset α)
t : Multiset (Multiset β)
⊢ Rel r (join 0) (join 0)
state_after: no goals

tactic: simpa using hab.add ih
state_before: case cons
α : Type u_1
β : Type v
γ : Type u_2
δ : Type u_3
r : α → β → Prop
s : Multiset (Multiset α)
t : Multiset (Multiset β)
a✝ : Multiset α
b✝ : Multiset β
as✝ : Multiset (Multiset α)
bs✝ : Multiset (Multiset β)
hab : Rel r a✝ b✝
hst : Rel (Rel r) as✝ bs✝
ih : Rel r as✝.join bs✝.join
⊢ Rel r (a✝ ::ₘ as✝).join (b✝ ::ₘ bs✝).join
state_after: no goals
Theorem: Dioph.diophFn_comp
File: Mathlib/NumberTheory/Dioph.lean

tactic: simp only [vectorAllP_cons]
state_before: α β : Type
n : ℕ
f : Vector3 ℕ n → ℕ
df : DiophFn f
g : Vector3 ((α → ℕ) → ℕ) n
dg : VectorAllP DiophFn g
⊢ VectorAllP DiophFn ((fun v => v none) :: fun i v => g i (v ∘ some))
state_after: α β : Type
n : ℕ
f : Vector3 ℕ n → ℕ
df : DiophFn f
g : Vector3 ((α → ℕ) → ℕ) n
dg : VectorAllP DiophFn g
⊢ (DiophFn fun v => v none) ∧ VectorAllP DiophFn fun i v => g i (v ∘ some)

tactic: exact ⟨proj_dioph none, (vectorAllP_iff_forall _ _).2 fun i =>
      reindex_diophFn _ <| (vectorAllP_iff_forall _ _).1 dg _⟩
state_before: α β : Type
n : ℕ
f : Vector3 ℕ n → ℕ
df : DiophFn f
g : Vector3 ((α → ℕ) → ℕ) n
dg : VectorAllP DiophFn g
⊢ (DiophFn fun v => v none) ∧ VectorAllP DiophFn fun i v => g i (v ∘ some)
state_after: no goals
Theorem: CategoryTheory.Equivalence.funInvIdAssoc_hom_app
File: Mathlib/CategoryTheory/Equivalence.lean

tactic: dsimp [funInvIdAssoc]
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
F : C ⥤ E
X : C
⊢ (e.funInvIdAssoc F).hom.app X = F.map (e.unitInv.app X)
state_after: 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
F : C ⥤ E
X : C
⊢ 𝟙 (F.obj (e.inverse.obj (e.functor.obj X))) ≫ F.map (e.unitIso.inv.app X) ≫ 𝟙 (F.obj X) = F.map (e.unitInv.app X)

tactic: aesop_cat
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
F : C ⥤ E
X : C
⊢ 𝟙 (F.obj (e.inverse.obj (e.functor.obj X))) ≫ F.map (e.unitIso.inv.app X) ≫ 𝟙 (F.obj X) = F.map (e.unitInv.app X)
state_after: no goals
Theorem: InnerProductGeometry.angle_smul_right_of_neg
File: Mathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean

tactic: rw [← neg_neg r, neg_smul, angle_neg_right, angle_smul_right_of_pos x y (neg_pos_of_neg hr),
  angle_neg_right]
state_before: V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x✝ y✝ x y : V
r : ℝ
hr : r < 0
⊢ angle x (r • y) = angle x (-y)
state_after: no goals
Theorem: HomogeneousIdeal.toIdeal_injective
File: Mathlib/RingTheory/GradedAlgebra/HomogeneousIdeal.lean

tactic: simp [h]
state_before: ι : Type u_1
σ : Type u_2
R : Type u_3
A : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : SetLike σ A
inst✝³ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : GradedRing 𝒜
I : Ideal A
x✝¹ x✝ : HomogeneousIdeal 𝒜
x : Submodule A A
hx : Ideal.IsHomogeneous 𝒜 x
y : Submodule A A
hy : Ideal.IsHomogeneous 𝒜 y
h : x = y
⊢ { toSubmodule := x, is_homogeneous' := hx } = { toSubmodule := y, is_homogeneous' := hy }
state_after: no goals
Theorem: AddCommGrp.Colimits.cocone_naturality
File: Mathlib/Algebra/Category/Grp/Colimits.lean

tactic: ext
state_before: J : Type u
inst✝ : Category.{v, u} J
F : J ⥤ AddCommGrp
j j' : J
f : j ⟶ j'
⊢ F.map f ≫ coconeMorphism F j' = coconeMorphism F j
state_after: case w
J : Type u
inst✝ : Category.{v, u} J
F : J ⥤ AddCommGrp
j j' : J
f : j ⟶ j'
x✝ : ↑(F.obj j)
⊢ (F.map f ≫ coconeMorphism F j') x✝ = (coconeMorphism F j) x✝

tactic: apply Quot.sound
state_before: case w
J : Type u
inst✝ : Category.{v, u} J
F : J ⥤ AddCommGrp
j j' : J
f : j ⟶ j'
x✝ : ↑(F.obj j)
⊢ (F.map f ≫ coconeMorphism F j') x✝ = (coconeMorphism F j) x✝
state_after: case w.a
J : Type u
inst✝ : Category.{v, u} J
F : J ⥤ AddCommGrp
j j' : J
f : j ⟶ j'
x✝ : ↑(F.obj j)
⊢ Setoid.r (Prequotient.of j' ((F.map f) x✝)) (Prequotient.of j x✝)

tactic: apply Relation.map
state_before: case w.a
J : Type u
inst✝ : Category.{v, u} J
F : J ⥤ AddCommGrp
j j' : J
f : j ⟶ j'
x✝ : ↑(F.obj j)
⊢ Setoid.r (Prequotient.of j' ((F.map f) x✝)) (Prequotient.of j x✝)
state_after: no goals
Theorem: Wbtw.oangle_sign_eq_of_ne_right
File: Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean

tactic: simp_rw [oangle_rev p₃, Real.Angle.sign_neg, h.symm.oangle_sign_eq_of_ne_left _ hne.symm]
state_before: V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : InnerProductSpace ℝ V
inst✝² : MetricSpace P
inst✝¹ : NormedAddTorsor V P
hd2 : Fact (finrank ℝ V = 2)
inst✝ : Module.Oriented ℝ V (Fin 2)
p₁ p₂ p₃ p₄ : P
h : Wbtw ℝ p₁ p₂ p₃
hne : p₂ ≠ p₃
⊢ (∡ p₂ p₄ p₃).sign = (∡ p₁ p₄ p₃).sign
state_after: no goals
Theorem: HasDerivAt.complexToReal_fderiv
File: Mathlib/Analysis/Complex/RealDeriv.lean

tactic: simpa only [Complex.restrictScalars_one_smulRight] using h.hasFDerivAt.restrictScalars ℝ
state_before: e : ℂ → ℂ
e' : ℂ
z : ℝ
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℂ E
f : ℂ → ℂ
f' x : ℂ
h : HasDerivAt f f' x
⊢ HasFDerivAt f (f' • 1) x
state_after: no goals
Theorem: LocalizedModule.add_comm'
File: Mathlib/Algebra/Module/LocalizedModule.lean

tactic: rw [mk_add_mk, mk_add_mk, add_comm, mul_comm]
state_before: R : Type u
inst✝⁵ : CommSemiring R
S : Submonoid R
M : Type v
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
T : Type u_1
inst✝² : CommSemiring T
inst✝¹ : Algebra R T
inst✝ : IsLocalization S T
x y : LocalizedModule S M
m m' : M
s s' : ↥S
⊢ mk m s + mk m' s' = mk m' s' + mk m s
state_after: no goals
Theorem: PartialHomeomorph.extend_source_mem_nhds
File: Mathlib/Geometry/Manifold/SmoothManifoldWithCorners.lean

tactic: rwa [f.extend_source I]
state_before: 𝕜 : Type u_1
E : Type u_2
M : Type u_3
H : Type u_4
E' : Type u_5
M' : Type u_6
H' : Type u_7
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
inst✝⁵ : TopologicalSpace H
inst✝⁴ : TopologicalSpace M
f f' : PartialHomeomorph M H
I : ModelWithCorners 𝕜 E H
inst✝³ : NormedAddCommGroup E'
inst✝² : NormedSpace 𝕜 E'
inst✝¹ : TopologicalSpace H'
inst✝ : TopologicalSpace M'
I' : ModelWithCorners 𝕜 E' H'
s t : Set M
x : M
h : x ∈ f.source
⊢ x ∈ (f.extend I).source
state_after: no goals
Theorem: FirstOrder.Language.Embedding.subtype_equivRange
File: Mathlib/ModelTheory/Substructures.lean

tactic: ext
state_before: L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : L.Structure M
inst✝¹ : L.Structure N
inst✝ : L.Structure P
S : L.Substructure M
f : M ↪[L] N
⊢ f.toHom.range.subtype.comp f.equivRange.toEmbedding = f
state_after: case h
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : L.Structure M
inst✝¹ : L.Structure N
inst✝ : L.Structure P
S : L.Substructure M
f : M ↪[L] N
x✝ : M
⊢ (f.toHom.range.subtype.comp f.equivRange.toEmbedding) x✝ = f x✝

tactic: rfl
state_before: case h
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : L.Structure M
inst✝¹ : L.Structure N
inst✝ : L.Structure P
S : L.Substructure M
f : M ↪[L] N
x✝ : M
⊢ (f.toHom.range.subtype.comp f.equivRange.toEmbedding) x✝ = f x✝
state_after: no goals
Theorem: List.Perm.kunion_right
File: Mathlib/Data/List/Sigma.lean

tactic: induction p generalizing l with
| nil => rfl
| cons hd _ ih =>
  simp [ih (List.kerase _ _), Perm.cons]
| swap s₁ s₂ l => simp [kerase_comm, Perm.swap]
| trans _ _ ih₁₂ ih₂₃ => exact Perm.trans (ih₁₂ l) (ih₂₃ l)
state_before: α : Type u
β : α → Type v
l✝ l₁✝ l₂✝ : List (Sigma β)
inst✝ : DecidableEq α
l₁ l₂ : List (Sigma β)
p : l₁ ~ l₂
l : List (Sigma β)
⊢ l₁.kunion l ~ l₂.kunion l
state_after: no goals

tactic: rfl
state_before: case nil
α : Type u
β : α → Type v
l✝ l₁✝ l₂✝ : List (Sigma β)
inst✝ : DecidableEq α
l₁ l₂ l : List (Sigma β)
⊢ [].kunion l ~ [].kunion l
state_after: no goals

tactic: simp [ih (List.kerase _ _), Perm.cons]
state_before: case cons
α : Type u
β : α → Type v
l✝ l₁✝¹ l₂✝¹ : List (Sigma β)
inst✝ : DecidableEq α
l₁ l₂ : List (Sigma β)
hd : Sigma β
l₁✝ l₂✝ : List (Sigma β)
a✝ : l₁✝ ~ l₂✝
ih : ∀ (l : List (Sigma β)), l₁✝.kunion l ~ l₂✝.kunion l
l : List (Sigma β)
⊢ (hd :: l₁✝).kunion l ~ (hd :: l₂✝).kunion l
state_after: no goals

tactic: simp [kerase_comm, Perm.swap]
state_before: case swap
α : Type u
β : α → Type v
l✝¹ l₁✝ l₂✝ : List (Sigma β)
inst✝ : DecidableEq α
l₁ l₂ : List (Sigma β)
s₁ s₂ : Sigma β
l✝ : List (Sigma β)
l : List (Sigma β)
⊢ (s₂ :: s₁ :: l✝).kunion l ~ (s₁ :: s₂ :: l✝).kunion l
state_after: no goals

tactic: exact Perm.trans (ih₁₂ l) (ih₂₃ l)
state_before: case trans
α : Type u
β : α → Type v
l✝ l₁✝¹ l₂✝¹ : List (Sigma β)
inst✝ : DecidableEq α
l₁ l₂ : List (Sigma β)
l₁✝ l₂✝ l₃✝ : List (Sigma β)
a✝¹ : l₁✝ ~ l₂✝
a✝ : l₂✝ ~ l₃✝
ih₁₂ : ∀ (l : List (Sigma β)), l₁✝.kunion l ~ l₂✝.kunion l
ih₂₃ : ∀ (l : List (Sigma β)), l₂✝.kunion l ~ l₃✝.kunion l
l : List (Sigma β)
⊢ l₁✝.kunion l ~ l₃✝.kunion l
state_after: no goals
Theorem: circleIntegral.norm_two_pi_i_inv_smul_integral_le_of_norm_le_const
File: Mathlib/MeasureTheory/Integral/CircleIntegral.lean

tactic: have : ‖(2 * π * I : ℂ)⁻¹‖ = (2 * π)⁻¹ := by simp [Real.pi_pos.le]
state_before: E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
R C : ℝ
hR : 0 ≤ R
hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C
⊢ ‖(2 * ↑π * I)⁻¹ • ∮ (z : ℂ) in C(c, R), f z‖ ≤ R * C
state_after: E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
R C : ℝ
hR : 0 ≤ R
hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C
this : ‖(2 * ↑π * I)⁻¹‖ = (2 * π)⁻¹
⊢ ‖(2 * ↑π * I)⁻¹ • ∮ (z : ℂ) in C(c, R), f z‖ ≤ R * C

tactic: rw [norm_smul, this, ← div_eq_inv_mul, div_le_iff Real.two_pi_pos, mul_comm (R * C), ← mul_assoc]
state_before: E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
R C : ℝ
hR : 0 ≤ R
hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C
this : ‖(2 * ↑π * I)⁻¹‖ = (2 * π)⁻¹
⊢ ‖(2 * ↑π * I)⁻¹ • ∮ (z : ℂ) in C(c, R), f z‖ ≤ R * C
state_after: E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
R C : ℝ
hR : 0 ≤ R
hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C
this : ‖(2 * ↑π * I)⁻¹‖ = (2 * π)⁻¹
⊢ ‖∮ (z : ℂ) in C(c, R), f z‖ ≤ 2 * π * R * C

tactic: exact norm_integral_le_of_norm_le_const hR hf
state_before: E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
R C : ℝ
hR : 0 ≤ R
hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C
this : ‖(2 * ↑π * I)⁻¹‖ = (2 * π)⁻¹
⊢ ‖∮ (z : ℂ) in C(c, R), f z‖ ≤ 2 * π * R * C
state_after: no goals

tactic: simp [Real.pi_pos.le]
state_before: E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℂ E
inst✝ : CompleteSpace E
f : ℂ → E
c : ℂ
R C : ℝ
hR : 0 ≤ R
hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C
⊢ ‖(2 * ↑π * I)⁻¹‖ = (2 * π)⁻¹
state_after: no goals
Theorem: CategoryTheory.ShortComplex.rightHomology_ext_iff
File: Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean

tactic: rw [cancel_mono]
state_before: C : Type u_1
inst✝² : Category.{u_2, u_1} C
inst✝¹ : HasZeroMorphisms C
S S₁ S₂ S₃ : ShortComplex C
inst✝ : S.HasRightHomology
A : C
f₁ f₂ : A ⟶ S.rightHomology
⊢ f₁ = f₂ ↔ f₁ ≫ S.rightHomologyι = f₂ ≫ S.rightHomologyι
state_after: no goals
Theorem: Real.smoothTransition.one_of_one_le
File: Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean

tactic: rw [zero_of_nonpos (sub_nonpos.2 h), add_zero]
state_before: x : ℝ
h : 1 ≤ x
⊢ expNegInvGlue x = expNegInvGlue x + expNegInvGlue (1 - x)
state_after: no goals
Theorem: Polynomial.card_support_eq_zero
File: Mathlib/Algebra/Polynomial/Basic.lean

tactic: simp
state_before: R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ p.support.card = 0 ↔ p = 0
state_after: no goals
Theorem: Fin.modNat_rev
File: Mathlib/Data/Fin/Basic.lean

tactic: ext
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: have H₁ : i % n + 1 ≤ n := i.modNat.is_lt
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 < m := i.divNat.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: 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
⊢ ↑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: 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
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: rw [Nat.div_add_mod']
state_before: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ (m * n - (↑i + 1)) % n = (m * n - (↑i / n * n + ↑i % n + 1)) % n
state_after: no goals

tactic: 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]
state_before: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ (m * n - (↑i / n * n + ↑i % n + 1)) % n = ((m - ↑i / n - 1) * n + (n - (↑i % n + 1))) % n
state_after: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ n ≤ (m - ↑i / n) * n

tactic: exact Nat.le_mul_of_pos_left _ <| Nat.le_sub_of_add_le' H₂
state_before: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ n ≤ (m - ↑i / n) * n
state_after: no goals

tactic: rw [Nat.mul_comm, Nat.mul_add_mod, Nat.mod_eq_of_lt]
state_before: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ ((m - ↑i / n - 1) * n + (n - (↑i % n + 1))) % n = n - (↑i % n + 1)
state_after: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ n - (↑i % n + 1) < n

tactic: exact i.modNat.rev.is_lt
state_before: n m : ℕ
i : Fin (m * n)
H₁ : ↑i % n + 1 ≤ n
H₂ : ↑i / n < m
⊢ n - (↑i % n + 1) < n
state_after: no goals
Theorem: Algebra.smul_leftMulMatrix_algebraMap_eq
File: Mathlib/LinearAlgebra/Matrix/ToLin.lean

tactic: rw [smul_leftMulMatrix_algebraMap, blockDiagonal_apply_eq]
state_before: R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : Ring T
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra S T
inst✝⁵ : Algebra R T
inst✝⁴ : IsScalarTower R S T
m : Type u_4
n : Type u_5
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : DecidableEq m
inst✝ : DecidableEq n
b : Basis m R S
c : Basis n S T
x : S
i j : m
k : n
⊢ (leftMulMatrix (b.smul c)) ((algebraMap S T) x) (i, k) (j, k) = (leftMulMatrix b) x i j
state_after: no goals
Theorem: Subgroup.isComplement_singleton_left
File: Mathlib/GroupTheory/Complement.lean

tactic: refine
  ⟨fun h => top_le_iff.mp fun x _ => ?_, fun h => (congr_arg _ h).mpr isComplement_singleton_univ⟩
state_before: G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
g : G
⊢ IsComplement {g} S ↔ S = univ
state_after: G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
g : G
h : IsComplement {g} S
x : G
x✝ : x ∈ ⊤
⊢ x ∈ S

tactic: obtain ⟨⟨⟨z, rfl : z = g⟩, y, _⟩, hy⟩ := h.2 (g * x)
state_before: G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
g : G
h : IsComplement {g} S
x : G
x✝ : x ∈ ⊤
⊢ x ∈ S
state_after: case intro.mk.mk.mk
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
x : G
x✝ : x ∈ ⊤
z : G
h : IsComplement {z} S
y : G
property✝ : y ∈ S
hy : (fun x => ↑x.1 * ↑x.2) (⟨z, ⋯⟩, ⟨y, property✝⟩) = z * x
⊢ x ∈ S

tactic: rwa [← mul_left_cancel hy]
state_before: case intro.mk.mk.mk
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
x : G
x✝ : x ∈ ⊤
z : G
h : IsComplement {z} S
y : G
property✝ : y ∈ S
hy : (fun x => ↑x.1 * ↑x.2) (⟨z, ⋯⟩, ⟨y, property✝⟩) = z * x
⊢ x ∈ S
state_after: no goals
Theorem: Polynomial.cyclotomic_three
File: Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean

tactic: simp [cyclotomic_prime, sum_range_succ']
state_before: R : Type u_1
inst✝ : Ring R
⊢ cyclotomic 3 R = X ^ 2 + X + 1
state_after: no goals
Theorem: Ordnode.insert.valid
File: Mathlib/Data/Ordmap/Ordset.lean

tactic: rw [insert_eq_insertWith]
state_before: α : Type u_1
inst✝² : Preorder α
inst✝¹ : IsTotal α fun x x_1 => x ≤ x_1
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
x : α
t : Ordnode α
h : t.Valid
⊢ (Ordnode.insert x t).Valid
state_after: α : Type u_1
inst✝² : Preorder α
inst✝¹ : IsTotal α fun x x_1 => x ≤ x_1
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
x : α
t : Ordnode α
h : t.Valid
⊢ (insertWith (fun x_1 => x) x t).Valid

tactic: exact insertWith.valid _ _ (fun _ _ => ⟨le_rfl, le_rfl⟩) h
state_before: α : Type u_1
inst✝² : Preorder α
inst✝¹ : IsTotal α fun x x_1 => x ≤ x_1
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
x : α
t : Ordnode α
h : t.Valid
⊢ (insertWith (fun x_1 => x) x t).Valid
state_after: no goals
Theorem: ENNReal.tsum_toReal_eq
File: Mathlib/Topology/Instances/ENNReal.lean

tactic: simp only [ENNReal.toReal, tsum_toNNReal_eq hf, NNReal.coe_tsum]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
f : α → ℝ≥0∞
hf : ∀ (a : α), f a ≠ ⊤
⊢ (∑' (a : α), f a).toReal = ∑' (a : α), (f a).toReal
state_after: no goals
Theorem: FirstOrder.Language.Theory.ModelsBoundedFormula.realize_sentence
File: Mathlib/ModelTheory/Satisfiability.lean

tactic: rw [models_iff_not_satisfiable] at h
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
h : T ⊨ᵇ φ
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
⊢ M ⊨ φ
state_after: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
h : ¬(T ∪ {Formula.not φ}).IsSatisfiable
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
⊢ M ⊨ φ

tactic: contrapose! h
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
h : ¬(T ∪ {Formula.not φ}).IsSatisfiable
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
⊢ M ⊨ φ
state_after: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ (T ∪ {Formula.not φ}).IsSatisfiable

tactic: have : M ⊨ T ∪ {Formula.not φ} := by
  simp only [Set.union_singleton, model_iff, Set.mem_insert_iff, forall_eq_or_imp,
    Sentence.realize_not]
  rw [← model_iff]
  exact ⟨h, inferInstance⟩
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ (T ∪ {Formula.not φ}).IsSatisfiable
state_after: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
this : M ⊨ T ∪ {Formula.not φ}
⊢ (T ∪ {Formula.not φ}).IsSatisfiable

tactic: exact Model.isSatisfiable M
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
this : M ⊨ T ∪ {Formula.not φ}
⊢ (T ∪ {Formula.not φ}).IsSatisfiable
state_after: no goals

tactic: simp only [Set.union_singleton, model_iff, Set.mem_insert_iff, forall_eq_or_imp,
  Sentence.realize_not]
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ M ⊨ T ∪ {Formula.not φ}
state_after: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ ¬M ⊨ φ ∧ ∀ a ∈ T, M ⊨ a

tactic: rw [← model_iff]
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ ¬M ⊨ φ ∧ ∀ a ∈ T, M ⊨ a
state_after: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ ¬M ⊨ φ ∧ M ⊨ T

tactic: exact ⟨h, inferInstance⟩
state_before: L : Language
T : L.Theory
α : Type w
n : ℕ
φ : L.Sentence
M : Type u_1
inst✝² : L.Structure M
inst✝¹ : M ⊨ T
inst✝ : Nonempty M
h : ¬M ⊨ φ
⊢ ¬M ⊨ φ ∧ M ⊨ T
state_after: no goals