1337xyz1337xyz/leandojo-benchmark4-v10 huggingface dataset:
Theorem: Polynomial.aevalTower_id
File: Mathlib/Algebra/Polynomial/AlgebraMap.lean

tactic: ext s
state_before: R : Type u
S : Type v
T : Type w
A : Type z
A' : Type u_1
B : Type u_2
a b : R
n : ℕ
inst✝¹⁰ : CommSemiring R
inst✝⁹ : Semiring A
inst✝⁸ : CommSemiring A'
inst✝⁷ : Semiring B
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R A'
inst✝⁴ : Algebra R B
p q : R[X]
x : A
inst✝³ : CommSemiring S
inst✝² : Algebra S R
inst✝¹ : Algebra S A'
inst✝ : Algebra S B
g : R →ₐ[S] A'
y : A'
⊢ aevalTower (AlgHom.id S S) = aeval
state_after: case h.hX
R : Type u
S : Type v
T : Type w
A : Type z
A' : Type u_1
B : Type u_2
a b : R
n : ℕ
inst✝¹⁰ : CommSemiring R
inst✝⁹ : Semiring A
inst✝⁸ : CommSemiring A'
inst✝⁷ : Semiring B
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R A'
inst✝⁴ : Algebra R B
p q : R[X]
x : A
inst✝³ : CommSemiring S
inst✝² : Algebra S R
inst✝¹ : Algebra S A'
inst✝ : Algebra S B
g : R →ₐ[S] A'
y : A'
s : S
⊢ (aevalTower (AlgHom.id S S) s) X = (aeval s) X

tactic: simp only [eval_X, aevalTower_X, coe_aeval_eq_eval]
state_before: case h.hX
R : Type u
S : Type v
T : Type w
A : Type z
A' : Type u_1
B : Type u_2
a b : R
n : ℕ
inst✝¹⁰ : CommSemiring R
inst✝⁹ : Semiring A
inst✝⁸ : CommSemiring A'
inst✝⁷ : Semiring B
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R A'
inst✝⁴ : Algebra R B
p q : R[X]
x : A
inst✝³ : CommSemiring S
inst✝² : Algebra S R
inst✝¹ : Algebra S A'
inst✝ : Algebra S B
g : R →ₐ[S] A'
y : A'
s : S
⊢ (aevalTower (AlgHom.id S S) s) X = (aeval s) X
state_after: no goals
Theorem: Uniform.continuousWithinAt_iff'_left
File: Mathlib/Topology/UniformSpace/Basic.lean

tactic: rw [ContinuousWithinAt, tendsto_nhds_left]
state_before: α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : TopologicalSpace β
f : β → α
b : β
s : Set β
⊢ ContinuousWithinAt f s b ↔ Tendsto (fun x => (f x, f b)) (𝓝[s] b) (𝓤 α)
state_after: no goals
Theorem: NumberField.mixedEmbedding.normAtPlace_neg
File: Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean

tactic: rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
state_before: K : Type u_1
inst✝ : Field K
w : InfinitePlace K
x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ)
⊢ (normAtPlace w) (-x) = (normAtPlace w) x
state_after: K : Type u_1
inst✝ : Field K
w : InfinitePlace K
x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ)
⊢ (if hw : w.IsReal then ‖(-x).1 ⟨w, hw⟩‖ else ‖(-x).2 ⟨w, ⋯⟩‖) = if hw : w.IsReal then ‖x.1 ⟨w, hw⟩‖ else ‖x.2 ⟨w, ⋯⟩‖

tactic: split_ifs <;> simp
state_before: K : Type u_1
inst✝ : Field K
w : InfinitePlace K
x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ)
⊢ (if hw : w.IsReal then ‖(-x).1 ⟨w, hw⟩‖ else ‖(-x).2 ⟨w, ⋯⟩‖) = if hw : w.IsReal then ‖x.1 ⟨w, hw⟩‖ else ‖x.2 ⟨w, ⋯⟩‖
state_after: no goals
Theorem: ContDiff.dimH_range_le
File: Mathlib/Topology/MetricSpace/HausdorffDimension.lean

tactic: rw [image_univ]
state_before: ι : Type u_1
X : Type u_2
Y : Type u_3
inst✝⁶ : EMetricSpace X
inst✝⁵ : EMetricSpace Y
C K r : ℝ≥0
f✝ : X → Y
s t : Set X
E : Type u_4
F : Type u_5
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
f : E → F
h : ContDiff ℝ 1 f
⊢ dimH (range f) = dimH (f '' univ)
state_after: no goals
Theorem: CategoryTheory.right_unitality_app
File: Mathlib/CategoryTheory/Monoidal/End.lean

tactic: have := congr_app (F.toLaxMonoidalFunctor.right_unitality n) X
state_before: C : Type u
inst✝² : Category.{v, u} C
M : Type u_1
inst✝¹ : Category.{u_2, u_1} M
inst✝ : MonoidalCategory M
F : MonoidalFunctor M (C ⥤ C)
n : M
X : C
⊢ F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X = 𝟙 ((𝟙_ (C ⥤ C)).obj ((F.obj n).obj X))
state_after: C : Type u
inst✝² : Category.{v, u} C
M : Type u_1
inst✝¹ : Category.{u_2, u_1} M
inst✝ : MonoidalCategory M
F : MonoidalFunctor M (C ⥤ C)
n : M
X : C
this : (ρ_ (F.obj n)).hom.app X = (F.obj n ◁ F.ε ≫ F.μ n (𝟙_ M) ≫ F.map (ρ_ n).hom).app X
⊢ F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X = 𝟙 ((𝟙_ (C ⥤ C)).obj ((F.obj n).obj X))

tactic: dsimp at this
state_before: C : Type u
inst✝² : Category.{v, u} C
M : Type u_1
inst✝¹ : Category.{u_2, u_1} M
inst✝ : MonoidalCategory M
F : MonoidalFunctor M (C ⥤ C)
n : M
X : C
this : (ρ_ (F.obj n)).hom.app X = (F.obj n ◁ F.ε ≫ F.μ n (𝟙_ M) ≫ F.map (ρ_ n).hom).app X
⊢ F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X = 𝟙 ((𝟙_ (C ⥤ C)).obj ((F.obj n).obj X))
state_after: C : Type u
inst✝² : Category.{v, u} C
M : Type u_1
inst✝¹ : Category.{u_2, u_1} M
inst✝ : MonoidalCategory M
F : MonoidalFunctor M (C ⥤ C)
n : M
X : C
this : 𝟙 ((F.obj n).obj X) = F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X
⊢ F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X = 𝟙 ((𝟙_ (C ⥤ C)).obj ((F.obj n).obj X))

tactic: simpa using this.symm
state_before: C : Type u
inst✝² : Category.{v, u} C
M : Type u_1
inst✝¹ : Category.{u_2, u_1} M
inst✝ : MonoidalCategory M
F : MonoidalFunctor M (C ⥤ C)
n : M
X : C
this : 𝟙 ((F.obj n).obj X) = F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X
⊢ F.ε.app ((F.obj n).obj X) ≫ (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X = 𝟙 ((𝟙_ (C ⥤ C)).obj ((F.obj n).obj X))
state_after: no goals
Theorem: mul_sub_mul_div_mul_neg_iff
File: Mathlib/Algebra/Order/Field/Basic.lean

tactic: rw [mul_comm b c, ← div_sub_div _ _ hc hd, sub_lt_zero]
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hc : c ≠ 0
hd : d ≠ 0
⊢ (a * d - b * c) / (c * d) < 0 ↔ a / c < b / d
state_after: no goals
Theorem: SimplexCategory.len_lt_of_mono
File: Mathlib/AlgebraicTopology/SimplexCategory.lean

tactic: rcases lt_or_eq_of_le (len_le_of_mono hi) with (h | h)
state_before: Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
⊢ Δ'.len < Δ.len
state_after: case inl
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len < Δ.len
⊢ Δ'.len < Δ.len

case inr
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ Δ'.len < Δ.len

tactic: exact h
state_before: case inl
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len < Δ.len
⊢ Δ'.len < Δ.len
state_after: no goals

tactic: exfalso
state_before: case inr
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ Δ'.len < Δ.len
state_after: case inr
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ False

tactic: exact hi' (by ext; exact h.symm)
state_before: case inr
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ False
state_after: no goals

tactic: ext
state_before: Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ Δ = Δ'
state_after: case a
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ Δ.len = Δ'.len

tactic: exact h.symm
state_before: case a
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : Δ'.len = Δ.len
⊢ Δ.len = Δ'.len
state_after: no goals
Theorem: AkraBazziRecurrence.dist_r_b'
File: Mathlib/Computability/AkraBazzi/AkraBazzi.lean

tactic: rw [Filter.eventually_all]
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∀ᶠ (n : ℕ) in atTop, ∀ (i : α), ‖↑(r i n) - b i * ↑n‖ ≤ ↑n / log ↑n ^ 2
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∀ (i : α), ∀ᶠ (x : ℕ) in atTop, ‖↑(r i x) - b i * ↑x‖ ≤ ↑x / log ↑x ^ 2

tactic: intro i
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∀ (i : α), ∀ᶠ (x : ℕ) in atTop, ‖↑(r i x) - b i * ↑x‖ ≤ ↑x / log ↑x ^ 2
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
i : α
⊢ ∀ᶠ (x : ℕ) in atTop, ‖↑(r i x) - b i * ↑x‖ ≤ ↑x / log ↑x ^ 2

tactic: simpa using IsLittleO.eventuallyLE (R.dist_r_b i)
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
i : α
⊢ ∀ᶠ (x : ℕ) in atTop, ‖↑(r i x) - b i * ↑x‖ ≤ ↑x / log ↑x ^ 2
state_after: no goals
Theorem: String.get_cons_addChar
File: .lake/packages/batteries/Batteries/Data/String/Lemmas.lean

tactic: simp [get, utf8GetAux, Pos.zero_ne_addChar, utf8GetAux_addChar_right_cancel]
state_before: c : Char
cs : List Char
i : Pos
⊢ { data := c :: cs }.get (i + c) = { data := cs }.get i
state_after: no goals
Theorem: Filter.hasBasis_iSup
File: Mathlib/Order/Filter/Bases.lean

tactic: simp only [hasBasis_iff, (hl _).mem_iff, Classical.skolem, forall_and, iUnion_subset_iff,
  mem_iSup]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι✝ : Sort u_4
ι'✝ : Sort u_5
l✝ l' : Filter α
p✝ : ι✝ → Prop
s✝ : ι✝ → Set α
t✝ : Set α
i : ι✝
p' : ι'✝ → Prop
s' : ι'✝ → Set α
i' : ι'✝
ι : Sort u_6
ι' : ι → Type u_7
l : ι → Filter α
p : (i : ι) → ι' i → Prop
s : (i : ι) → ι' i → Set α
hl : ∀ (i : ι), (l i).HasBasis (p i) (s i)
t : Set α
⊢ t ∈ ⨆ i, l i ↔ ∃ i, (∀ (i_1 : ι), p i_1 (i i_1)) ∧ ⋃ i_1, s i_1 (i i_1) ⊆ t
state_after: no goals
Theorem: existsUnique_sub_zsmul_mem_Ioc
File: Mathlib/Algebra/Order/Archimedean.lean

tactic: simpa only [Equiv.neg_apply, neg_zsmul, sub_neg_eq_add] using
  existsUnique_add_zsmul_mem_Ioc ha b c
state_before: α : Type u_1
M : Type u_2
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : Archimedean α
a : α
ha : 0 < a
b c : α
⊢ ∃! x, b - (Equiv.neg ℤ) x • a ∈ Ioc c (c + a)
state_after: no goals
Theorem: symmDiff_assoc
File: Mathlib/Order/SymmDiff.lean

tactic: rw [symmDiff_symmDiff_left, symmDiff_symmDiff_right]
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
π : ι → Type u_4
inst✝ : GeneralizedBooleanAlgebra α
a b c d : α
⊢ a ∆ b ∆ c = a ∆ (b ∆ c)
state_after: no goals
Theorem: Filter.top_prod
File: Mathlib/Order/Filter/Prod.lean

tactic: dsimp only [SProd.sprod]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Sort u_5
s : Set α
t : Set β
f : Filter α
g : Filter β
⊢ ⊤ ×ˢ g = comap Prod.snd g
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Sort u_5
s : Set α
t : Set β
f : Filter α
g : Filter β
⊢ ⊤.prod g = comap Prod.snd g

tactic: rw [Filter.prod, comap_top, top_inf_eq]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Sort u_5
s : Set α
t : Set β
f : Filter α
g : Filter β
⊢ ⊤.prod g = comap Prod.snd g
state_after: no goals
Theorem: Function.monotone_iterate_of_id_le
File: Mathlib/Order/Iterate.lean

tactic: rw [iterate_succ_apply']
state_before: α : Type u_1
inst✝ : Preorder α
f : α → α
h : id ≤ f
n : ℕ
x : α
⊢ f^[n] x ≤ f^[n + 1] x
state_after: α : Type u_1
inst✝ : Preorder α
f : α → α
h : id ≤ f
n : ℕ
x : α
⊢ f^[n] x ≤ f (f^[n] x)

tactic: exact h _
state_before: α : Type u_1
inst✝ : Preorder α
f : α → α
h : id ≤ f
n : ℕ
x : α
⊢ f^[n] x ≤ f (f^[n] x)
state_after: no goals
Theorem: Pi.image_update_openSegment
File: Mathlib/Analysis/Convex/Segment.lean

tactic: rw [openSegment_eq_image₂, openSegment_eq_image₂, image_image]
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
ι : Type u_5
π : ι → Type u_6
inst✝³ : OrderedSemiring 𝕜
inst✝² : (i : ι) → AddCommMonoid (π i)
inst✝¹ : (i : ι) → Module 𝕜 (π i)
s : Set ι
inst✝ : DecidableEq ι
i : ι
x₁ x₂ : π i
y : (i : ι) → π i
⊢ update y i '' openSegment 𝕜 x₁ x₂ = openSegment 𝕜 (update y i x₁) (update y i x₂)
state_after: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
ι : Type u_5
π : ι → Type u_6
inst✝³ : OrderedSemiring 𝕜
inst✝² : (i : ι) → AddCommMonoid (π i)
inst✝¹ : (i : ι) → Module 𝕜 (π i)
s : Set ι
inst✝ : DecidableEq ι
i : ι
x₁ x₂ : π i
y : (i : ι) → π i
⊢ (fun x => update y i (x.1 • x₁ + x.2 • x₂)) '' {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1} =
    (fun p => p.1 • update y i x₁ + p.2 • update y i x₂) '' {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1}

tactic: refine EqOn.image_eq fun a ha ↦ ?_
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
ι : Type u_5
π : ι → Type u_6
inst✝³ : OrderedSemiring 𝕜
inst✝² : (i : ι) → AddCommMonoid (π i)
inst✝¹ : (i : ι) → Module 𝕜 (π i)
s : Set ι
inst✝ : DecidableEq ι
i : ι
x₁ x₂ : π i
y : (i : ι) → π i
⊢ (fun x => update y i (x.1 • x₁ + x.2 • x₂)) '' {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1} =
    (fun p => p.1 • update y i x₁ + p.2 • update y i x₂) '' {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1}
state_after: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
ι : Type u_5
π : ι → Type u_6
inst✝³ : OrderedSemiring 𝕜
inst✝² : (i : ι) → AddCommMonoid (π i)
inst✝¹ : (i : ι) → Module 𝕜 (π i)
s : Set ι
inst✝ : DecidableEq ι
i : ι
x₁ x₂ : π i
y : (i : ι) → π i
a : 𝕜 × 𝕜
ha : a ∈ {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1}
⊢ update y i (a.1 • x₁ + a.2 • x₂) = a.1 • update y i x₁ + a.2 • update y i x₂

tactic: simp only [← update_smul, ← update_add, Convex.combo_self ha.2.2]
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
ι : Type u_5
π : ι → Type u_6
inst✝³ : OrderedSemiring 𝕜
inst✝² : (i : ι) → AddCommMonoid (π i)
inst✝¹ : (i : ι) → Module 𝕜 (π i)
s : Set ι
inst✝ : DecidableEq ι
i : ι
x₁ x₂ : π i
y : (i : ι) → π i
a : 𝕜 × 𝕜
ha : a ∈ {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1}
⊢ update y i (a.1 • x₁ + a.2 • x₂) = a.1 • update y i x₁ + a.2 • update y i x₂
state_after: no goals
Theorem: Function.Surjective.denseRange
File: Mathlib/Topology/Basic.lean

tactic: simp [hf.range_eq]
state_before: X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
f✝¹ : X → Y
s✝ : Set X
x✝ : X
y : Y
α : Type u_4
ι : Type u_5
f✝ : α → X
g : X → Y
f : α → X
s : Set X
hf : Surjective f
x : X
⊢ x ∈ closure (range f)
state_after: no goals
Theorem: div_le_one'
File: Mathlib/Algebra/Order/Group/Defs.lean

tactic: rw [← mul_le_mul_iff_right b, one_mul, div_eq_mul_inv, inv_mul_cancel_right]
state_before: α : Type u
inst✝² : Group α
inst✝¹ : LE α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ a / b ≤ 1 ↔ a ≤ b
state_after: no goals
Theorem: numDerangements_succ
File: Mathlib/Combinatorics/Derangements/Finite.lean

tactic: induction' n with n hn
state_before: α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
⊢ ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
state_after: case zero
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
⊢ ↑(numDerangements (0 + 1)) = (↑0 + 1) * ↑(numDerangements 0) - (-1) ^ 0

case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
⊢ ↑(numDerangements (n + 1 + 1)) = (↑(n + 1) + 1) * ↑(numDerangements (n + 1)) - (-1) ^ (n + 1)

tactic: rfl
state_before: case zero
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
⊢ ↑(numDerangements (0 + 1)) = (↑0 + 1) * ↑(numDerangements 0) - (-1) ^ 0
state_after: no goals

tactic: simp only [numDerangements_add_two, hn, pow_succ, Int.ofNat_mul, Int.ofNat_add, Int.ofNat_succ]
state_before: case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
⊢ ↑(numDerangements (n + 1 + 1)) = (↑(n + 1) + 1) * ↑(numDerangements (n + 1)) - (-1) ^ (n + 1)
state_after: case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
⊢ (↑n + 1) * (↑(numDerangements n) + ((↑n + 1) * ↑(numDerangements n) - (-1) ^ n)) =
    (↑n + 1 + 1) * ((↑n + 1) * ↑(numDerangements n) - (-1) ^ n) - (-1) ^ n * -1

tactic: ring
state_before: case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
⊢ (↑n + 1) * (↑(numDerangements n) + ((↑n + 1) * ↑(numDerangements n) - (-1) ^ n)) =
    (↑n + 1 + 1) * ((↑n + 1) * ↑(numDerangements n) - (-1) ^ n) - (-1) ^ n * -1
state_after: no goals
Theorem: Real.cos_sub_pi_div_two
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean

tactic: simp [sub_eq_add_neg, cos_add]
state_before: x : ℝ
⊢ cos (x - π / 2) = sin x
state_after: no goals
Theorem: mul_neg_of_pos_of_neg
File: Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean

tactic: simpa only [mul_zero] using mul_lt_mul_of_pos_left hb ha
state_before: α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : PosMulStrictMono α
ha : 0 < a
hb : b < 0
⊢ a * b < 0
state_after: no goals
Theorem: PNat.exists_prime_and_dvd
File: Mathlib/Data/PNat/Prime.lean

tactic: obtain ⟨p, hp⟩ := Nat.exists_prime_and_dvd (mt coe_eq_one_iff.mp hn)
state_before: n : ℕ+
hn : n ≠ 1
⊢ ∃ p, p.Prime ∧ p ∣ n
state_after: case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ ∃ p, p.Prime ∧ p ∣ n

tactic: exists (⟨p, Nat.Prime.pos hp.left⟩ : ℕ+)
state_before: case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ ∃ p, p.Prime ∧ p ∣ n
state_after: case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ Prime ⟨p, ⋯⟩ ∧ ⟨p, ⋯⟩ ∣ n

tactic: rw [dvd_iff]
state_before: case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ Prime ⟨p, ⋯⟩ ∧ ⟨p, ⋯⟩ ∣ n
state_after: case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ Prime ⟨p, ⋯⟩ ∧ ↑⟨p, ⋯⟩ ∣ ↑n

tactic: apply hp
state_before: case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ Prime ⟨p, ⋯⟩ ∧ ↑⟨p, ⋯⟩ ∣ ↑n
state_after: no goals
Theorem: FiniteDimensional.basisUnique_repr_eq_zero_iff
File: Mathlib/LinearAlgebra/Dimension/Free.lean

tactic: rw [hv, LinearEquiv.map_zero, Finsupp.zero_apply]
state_before: R : Type u
M M₁ : Type v
M' : Type v'
inst✝¹¹ : Ring R
inst✝¹⁰ : StrongRankCondition R
inst✝⁹ : AddCommGroup M
inst✝⁸ : Module R M
inst✝⁷ : Module.Free R M
inst✝⁶ : AddCommGroup M'
inst✝⁵ : Module R M'
inst✝⁴ : Module.Free R M'
inst✝³ : AddCommGroup M₁
inst✝² : Module R M₁
inst✝¹ : Module.Free R M₁
ι : Type u_1
inst✝ : Unique ι
h : finrank R M = 1
v : M
i : ι
hv : v = 0
⊢ ((basisUnique ι h).repr v) i = 0
state_after: no goals
Theorem: IsPrimitiveRoot.power_basis_int'_dim
File: Mathlib/NumberTheory/Cyclotomic/Rat.lean

tactic: erw [@integralPowerBasis_dim p 1 K _ _ _ _ (by convert hcycl; rw [pow_one]) (by rwa [pow_one]),
  pow_one]
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ hζ.integralPowerBasis'.dim = φ ↑p
state_after: no goals

tactic: convert hcycl
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ IsCyclotomicExtension {p ^ 1} ℚ K
state_after: case h.e'_1.h.e'_4
p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ p ^ 1 = p

tactic: rw [pow_one]
state_before: case h.e'_1.h.e'_4
p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ p ^ 1 = p
state_after: no goals

tactic: rwa [pow_one]
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ IsPrimitiveRoot ζ ↑(p ^ 1)
state_after: no goals
Theorem: PartialHomeomorph.ext_iff
File: Mathlib/Topology/PartialHomeomorph.lean

tactic: rintro rfl
state_before: X : Type u_1
X' : Type u_2
Y : Type u_3
Y' : Type u_4
Z : Type u_5
Z' : Type u_6
inst✝⁵ : TopologicalSpace X
inst✝⁴ : TopologicalSpace X'
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Y'
inst✝¹ : TopologicalSpace Z
inst✝ : TopologicalSpace Z'
e✝ e e' : PartialHomeomorph X Y
⊢ e = e' → (∀ (x : X), ↑e x = ↑e' x) ∧ (∀ (x : Y), ↑e.symm x = ↑e'.symm x) ∧ e.source = e'.source
state_after: X : Type u_1
X' : Type u_2
Y : Type u_3
Y' : Type u_4
Z : Type u_5
Z' : Type u_6
inst✝⁵ : TopologicalSpace X
inst✝⁴ : TopologicalSpace X'
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Y'
inst✝¹ : TopologicalSpace Z
inst✝ : TopologicalSpace Z'
e✝ e : PartialHomeomorph X Y
⊢ (∀ (x : X), ↑e x = ↑e x) ∧ (∀ (x : Y), ↑e.symm x = ↑e.symm x) ∧ e.source = e.source

tactic: exact ⟨fun x => rfl, fun x => rfl, rfl⟩
state_before: X : Type u_1
X' : Type u_2
Y : Type u_3
Y' : Type u_4
Z : Type u_5
Z' : Type u_6
inst✝⁵ : TopologicalSpace X
inst✝⁴ : TopologicalSpace X'
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Y'
inst✝¹ : TopologicalSpace Z
inst✝ : TopologicalSpace Z'
e✝ e : PartialHomeomorph X Y
⊢ (∀ (x : X), ↑e x = ↑e x) ∧ (∀ (x : Y), ↑e.symm x = ↑e.symm x) ∧ e.source = e.source
state_after: no goals
Theorem: Ordinal.relIso_enum'
File: Mathlib/SetTheory/Ordinal/Basic.lean

tactic: refine inductionOn o ?_
state_before: α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
⊢ ∀ (hr : o < type r) (hs : o < type s), f (enum r o hr) = enum s o hs
state_after: α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
⊢ ∀ (α_1 : Type u) (r_1 : α_1 → α_1 → Prop) [inst : IsWellOrder α_1 r_1] (hr : type r_1 < type r)
    (hs : type r_1 < type s), f (enum r (type r_1) hr) = enum s (type r_1) hs

tactic: rintro γ t wo ⟨g⟩ ⟨h⟩
state_before: α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
⊢ ∀ (α_1 : Type u) (r_1 : α_1 → α_1 → Prop) [inst : IsWellOrder α_1 r_1] (hr : type r_1 < type r)
    (hs : type r_1 < type s), f (enum r (type r_1) hr) = enum s (type r_1) hs
state_after: case intro.intro
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
γ : Type u
t : γ → γ → Prop
wo : IsWellOrder γ t
g : t ≺i r
h : t ≺i s
⊢ f (enum r (type t) ⋯) = enum s (type t) ⋯

tactic: rw [enum_type g, enum_type (PrincipalSeg.ltEquiv g f)]
state_before: case intro.intro
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
γ : Type u
t : γ → γ → Prop
wo : IsWellOrder γ t
g : t ≺i r
h : t ≺i s
⊢ f (enum r (type t) ⋯) = enum s (type t) ⋯
state_after: case intro.intro
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
γ : Type u
t : γ → γ → Prop
wo : IsWellOrder γ t
g : t ≺i r
h : t ≺i s
⊢ f g.top = (g.ltEquiv f).top

tactic: rfl
state_before: case intro.intro
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
α β : Type u
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsWellOrder α r
inst✝ : IsWellOrder β s
f : r ≃r s
o : Ordinal.{u}
γ : Type u
t : γ → γ → Prop
wo : IsWellOrder γ t
g : t ≺i r
h : t ≺i s
⊢ f g.top = (g.ltEquiv f).top
state_after: no goals
Theorem: CategoryTheory.MonoidalCategory.tensor_left_iff
File: Mathlib/CategoryTheory/Monoidal/Category.lean

tactic: simp
state_before: C✝ : Type u
𝒞 : Category.{v, u} C✝
inst✝² : MonoidalCategory C✝
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : MonoidalCategory C
U V W X✝ Y✝ Z X Y : C
f g : X ⟶ Y
⊢ 𝟙 (𝟙_ C) ⊗ f = 𝟙 (𝟙_ C) ⊗ g ↔ f = g
state_after: no goals