1337xyz1337xyz/leandojo-benchmark4-v10 huggingface dataset:
Theorem: Nat.evenOddRec_odd
File: Mathlib/Data/Nat/EvenOddRec.lean

tactic: rw [evenOddRec, binaryRec_eq]
state_before: P : ℕ → Sort u_1
h0 : P 0
h_even : (i : ℕ) → P i → P (2 * i)
h_odd : (i : ℕ) → P i → P (2 * i + 1)
H : h_even 0 h0 = h0
n : ℕ
⊢ HEq (evenOddRec h0 h_even h_odd (bit true n)) (h_odd n (evenOddRec h0 h_even h_odd n))
state_after: P : ℕ → Sort u_1
h0 : P 0
h_even : (i : ℕ) → P i → P (2 * i)
h_odd : (i : ℕ) → P i → P (2 * i + 1)
H : h_even 0 h0 = h0
n : ℕ
⊢ HEq
    (match true, n,
      binaryRec h0
        (fun x x_1 x_2 =>
          match x, x_1, x_2 with
          | false, i, hi => ⋯ ▸ h_even i hi
          | true, i, hi => ⋯ ▸ h_odd i hi)
        n with
    | false, i, hi => ⋯ ▸ h_even i hi
    | true, i, hi => ⋯ ▸ h_odd i hi)
    (h_odd n (evenOddRec h0 h_even h_odd n))

case h
P : ℕ → Sort u_1
h0 : P 0
h_even : (i : ℕ) → P i → P (2 * i)
h_odd : (i : ℕ) → P i → P (2 * i + 1)
H : h_even 0 h0 = h0
n : ℕ
⊢ (match false, 0, h0 with
    | false, i, hi => ⋯ ▸ h_even i hi
    | true, i, hi => ⋯ ▸ h_odd i hi) =
    h0

tactic: apply eq_rec_heq
state_before: P : ℕ → Sort u_1
h0 : P 0
h_even : (i : ℕ) → P i → P (2 * i)
h_odd : (i : ℕ) → P i → P (2 * i + 1)
H : h_even 0 h0 = h0
n : ℕ
⊢ HEq
    (match true, n,
      binaryRec h0
        (fun x x_1 x_2 =>
          match x, x_1, x_2 with
          | false, i, hi => ⋯ ▸ h_even i hi
          | true, i, hi => ⋯ ▸ h_odd i hi)
        n with
    | false, i, hi => ⋯ ▸ h_even i hi
    | true, i, hi => ⋯ ▸ h_odd i hi)
    (h_odd n (evenOddRec h0 h_even h_odd n))
state_after: no goals

tactic: exact H
state_before: case h
P : ℕ → Sort u_1
h0 : P 0
h_even : (i : ℕ) → P i → P (2 * i)
h_odd : (i : ℕ) → P i → P (2 * i + 1)
H : h_even 0 h0 = h0
n : ℕ
⊢ (match false, 0, h0 with
    | false, i, hi => ⋯ ▸ h_even i hi
    | true, i, hi => ⋯ ▸ h_odd i hi) =
    h0
state_after: no goals
Theorem: LinearMap.polar_zero
File: Mathlib/Analysis/LocallyConvex/Polar.lean

tactic: refine Set.eq_univ_iff_forall.mpr fun y x hx => ?_
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁴ : NormedCommRing 𝕜
inst✝³ : AddCommMonoid E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 E
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
⊢ B.polar {0} = Set.univ
state_after: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁴ : NormedCommRing 𝕜
inst✝³ : AddCommMonoid E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 E
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
y : F
x : E
hx : x ∈ {0}
⊢ ‖(B x) y‖ ≤ 1

tactic: rw [Set.mem_singleton_iff.mp hx, map_zero, LinearMap.zero_apply, norm_zero]
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁴ : NormedCommRing 𝕜
inst✝³ : AddCommMonoid E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 E
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
y : F
x : E
hx : x ∈ {0}
⊢ ‖(B x) y‖ ≤ 1
state_after: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁴ : NormedCommRing 𝕜
inst✝³ : AddCommMonoid E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 E
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
y : F
x : E
hx : x ∈ {0}
⊢ 0 ≤ 1

tactic: exact zero_le_one
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁴ : NormedCommRing 𝕜
inst✝³ : AddCommMonoid E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 E
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
y : F
x : E
hx : x ∈ {0}
⊢ 0 ≤ 1
state_after: no goals
Theorem: PartialHomeomorph.ofSet_univ_eq_refl
File: Mathlib/Topology/PartialHomeomorph.lean

tactic: ext <;> simp
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 : PartialHomeomorph X Y
s : Set X
hs : IsOpen s
⊢ ofSet univ ⋯ = PartialHomeomorph.refl X
state_after: no goals
Theorem: Polynomial.derivative_comp
File: Mathlib/Algebra/Polynomial/Derivative.lean

tactic: induction p using Polynomial.induction_on'
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
p q : R[X]
⊢ derivative (p.comp q) = derivative q * (derivative p).comp q
state_after: case h_add
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
q p✝ q✝ : R[X]
a✝¹ : derivative (p✝.comp q) = derivative q * (derivative p✝).comp q
a✝ : derivative (q✝.comp q) = derivative q * (derivative q✝).comp q
⊢ derivative ((p✝ + q✝).comp q) = derivative q * (derivative (p✝ + q✝)).comp q

case h_monomial
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
q : R[X]
n✝ : ℕ
a✝ : R
⊢ derivative (((monomial n✝) a✝).comp q) = derivative q * (derivative ((monomial n✝) a✝)).comp q

tactic: simp [*, mul_add]
state_before: case h_add
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
q p✝ q✝ : R[X]
a✝¹ : derivative (p✝.comp q) = derivative q * (derivative p✝).comp q
a✝ : derivative (q✝.comp q) = derivative q * (derivative q✝).comp q
⊢ derivative ((p✝ + q✝).comp q) = derivative q * (derivative (p✝ + q✝)).comp q
state_after: no goals

tactic: simp only [derivative_pow, derivative_mul, monomial_comp, derivative_monomial, derivative_C,
  zero_mul, C_eq_natCast, zero_add, RingHom.map_mul]
state_before: case h_monomial
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
q : R[X]
n✝ : ℕ
a✝ : R
⊢ derivative (((monomial n✝) a✝).comp q) = derivative q * (derivative ((monomial n✝) a✝)).comp q
state_after: case h_monomial
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
q : R[X]
n✝ : ℕ
a✝ : R
⊢ C a✝ * (↑n✝ * q ^ (n✝ - 1) * derivative q) = derivative q * (C a✝ * ↑n✝ * q ^ (n✝ - 1))

tactic: ring
state_before: case h_monomial
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : CommSemiring R
q : R[X]
n✝ : ℕ
a✝ : R
⊢ C a✝ * (↑n✝ * q ^ (n✝ - 1) * derivative q) = derivative q * (C a✝ * ↑n✝ * q ^ (n✝ - 1))
state_after: no goals
Theorem: Filter.Germ.const_abs
File: Mathlib/Order/Filter/FilterProduct.lean

tactic: rw [abs_def, map_const]
state_before: α : Type u
β : Type v
φ : Ultrafilter α
inst✝ : LinearOrderedAddCommGroup β
x : β
⊢ ↑|x| = |↑x|
state_after: no goals
Theorem: discreteTopology_iff_orderTopology_of_pred_succ
File: Mathlib/Topology/Instances/Discrete.lean

tactic: refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
⊢ DiscreteTopology α ↔ OrderTopology α
state_after: case refine_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : DiscreteTopology α
⊢ inst✝³ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}

case refine_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : OrderTopology α
⊢ inst✝³ = ⊥

tactic: rw [h.eq_bot]
state_before: case refine_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : DiscreteTopology α
⊢ inst✝³ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}
state_after: case refine_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : DiscreteTopology α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}

tactic: exact LinearOrder.bot_topologicalSpace_eq_generateFrom
state_before: case refine_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : DiscreteTopology α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a}
state_after: no goals

tactic: rw [h.topology_eq_generate_intervals]
state_before: case refine_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : OrderTopology α
⊢ inst✝³ = ⊥
state_after: case refine_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : OrderTopology α
⊢ generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} = ⊥

tactic: exact LinearOrder.bot_topologicalSpace_eq_generateFrom.symm
state_before: case refine_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : OrderTopology α
⊢ generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} = ⊥
state_after: no goals
Theorem: CochainComplex.HomComplex.Cochain.δ_rightUnshift
File: Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean

tactic: obtain ⟨γ', rfl⟩ := (rightShiftAddEquiv K L n a n' hn).surjective γ
state_before: C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
R : Type u_1
inst✝¹ : Ring R
inst✝ : Linear R C
K L M : CochainComplex C ℤ
n✝ : ℤ
γ✝ γ₁ γ₂ : Cochain K L n✝
a n' : ℤ
γ : Cochain K ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj L) n'
n : ℤ
hn : n' + a = n
m m' : ℤ
hm' : m' + a = m
⊢ δ n m (γ.rightUnshift n hn) = a.negOnePow • (δ n' m' γ).rightUnshift m hm'
state_after: case intro
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
R : Type u_1
inst✝¹ : Ring R
inst✝ : Linear R C
K L M : CochainComplex C ℤ
n✝ : ℤ
γ γ₁ γ₂ : Cochain K L n✝
a n' n : ℤ
hn : n' + a = n
m m' : ℤ
hm' : m' + a = m
γ' : Cochain K L n
⊢ δ n m (((rightShiftAddEquiv K L n a n' hn) γ').rightUnshift n hn) =
    a.negOnePow • (δ n' m' ((rightShiftAddEquiv K L n a n' hn) γ')).rightUnshift m hm'

tactic: dsimp
state_before: case intro
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
R : Type u_1
inst✝¹ : Ring R
inst✝ : Linear R C
K L M : CochainComplex C ℤ
n✝ : ℤ
γ γ₁ γ₂ : Cochain K L n✝
a n' n : ℤ
hn : n' + a = n
m m' : ℤ
hm' : m' + a = m
γ' : Cochain K L n
⊢ δ n m (((rightShiftAddEquiv K L n a n' hn) γ').rightUnshift n hn) =
    a.negOnePow • (δ n' m' ((rightShiftAddEquiv K L n a n' hn) γ')).rightUnshift m hm'
state_after: case intro
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
R : Type u_1
inst✝¹ : Ring R
inst✝ : Linear R C
K L M : CochainComplex C ℤ
n✝ : ℤ
γ γ₁ γ₂ : Cochain K L n✝
a n' n : ℤ
hn : n' + a = n
m m' : ℤ
hm' : m' + a = m
γ' : Cochain K L n
⊢ δ n m ((γ'.rightShift a n' hn).rightUnshift n hn) = a.negOnePow • (δ n' m' (γ'.rightShift a n' hn)).rightUnshift m hm'

tactic: simp only [rightUnshift_rightShift, γ'.δ_rightShift a n' m' hn m hm', rightUnshift_units_smul,
  smul_smul, Int.units_mul_self, one_smul]
state_before: case intro
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
R : Type u_1
inst✝¹ : Ring R
inst✝ : Linear R C
K L M : CochainComplex C ℤ
n✝ : ℤ
γ γ₁ γ₂ : Cochain K L n✝
a n' n : ℤ
hn : n' + a = n
m m' : ℤ
hm' : m' + a = m
γ' : Cochain K L n
⊢ δ n m ((γ'.rightShift a n' hn).rightUnshift n hn) = a.negOnePow • (δ n' m' (γ'.rightShift a n' hn)).rightUnshift m hm'
state_after: no goals
Theorem: sign_eq_zero_iff
File: Mathlib/Data/Sign.lean

tactic: refine ⟨fun h => ?_, fun h => h.symm ▸ sign_zero⟩
state_before: α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
⊢ sign a = 0 ↔ a = 0
state_after: α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : sign a = 0
⊢ a = 0

tactic: rw [sign_apply] at h
state_before: α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : sign a = 0
⊢ a = 0
state_after: α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : (if 0 < a then 1 else if a < 0 then -1 else 0) = 0
⊢ a = 0

tactic: split_ifs at h with h_1 h_2
state_before: α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : (if 0 < a then 1 else if a < 0 then -1 else 0) = 0
⊢ a = 0
state_after: case neg
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h_1 : ¬0 < a
h_2 : ¬a < 0
h : 0 = 0
⊢ a = 0

tactic: cases' h
state_before: case neg
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h_1 : ¬0 < a
h_2 : ¬a < 0
h : 0 = 0
⊢ a = 0
state_after: case neg.refl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h_1 : ¬0 < a
h_2 : ¬a < 0
⊢ a = 0

tactic: exact (le_of_not_lt h_1).eq_of_not_lt h_2
state_before: case neg.refl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h_1 : ¬0 < a
h_2 : ¬a < 0
⊢ a = 0
state_after: no goals
Theorem: ProbabilityTheory.integral_truncation_eq_intervalIntegral
File: Mathlib/Probability/StrongLaw.lean

tactic: simpa using moment_truncation_eq_intervalIntegral hf hA one_ne_zero
state_before: α : Type u_1
m : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : AEStronglyMeasurable f μ
A : ℝ
hA : 0 ≤ A
⊢ ∫ (x : α), truncation f A x ∂μ = ∫ (y : ℝ) in -A..A, y ∂Measure.map f μ
state_after: no goals
Theorem: CategoryTheory.HasLiftingProperty.op
File: Mathlib/CategoryTheory/LiftingProperties/Basic.lean

tactic: simp only [CommSq.HasLift.iff_unop, Quiver.Hom.unop_op]
state_before: C : Type u_1
inst✝ : Category.{u_2, u_1} C
A B B' X Y Y' : C
i : A ⟶ B
i' : B ⟶ B'
p : X ⟶ Y
p' : Y ⟶ Y'
h : HasLiftingProperty i p
f : { unop := Y } ⟶ { unop := B }
g : { unop := X } ⟶ { unop := A }
sq : CommSq f p.op i.op g
⊢ sq.HasLift
state_after: C : Type u_1
inst✝ : Category.{u_2, u_1} C
A B B' X Y Y' : C
i : A ⟶ B
i' : B ⟶ B'
p : X ⟶ Y
p' : Y ⟶ Y'
h : HasLiftingProperty i p
f : { unop := Y } ⟶ { unop := B }
g : { unop := X } ⟶ { unop := A }
sq : CommSq f p.op i.op g
⊢ ⋯.HasLift

tactic: infer_instance
state_before: C : Type u_1
inst✝ : Category.{u_2, u_1} C
A B B' X Y Y' : C
i : A ⟶ B
i' : B ⟶ B'
p : X ⟶ Y
p' : Y ⟶ Y'
h : HasLiftingProperty i p
f : { unop := Y } ⟶ { unop := B }
g : { unop := X } ⟶ { unop := A }
sq : CommSq f p.op i.op g
⊢ ⋯.HasLift
state_after: no goals
Theorem: closure_thickening
File: Mathlib/Analysis/NormedSpace/Pointwise.lean

tactic: rw [← cthickening_zero, cthickening_thickening le_rfl hδ, zero_add]
state_before: 𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace ℝ E
x y z : E
δ ε : ℝ
hδ : 0 < δ
s : Set E
⊢ closure (thickening δ s) = cthickening δ s
state_after: no goals
Theorem: Subsemiring.op_closure
File: Mathlib/Algebra/Ring/Subsemiring/MulOpposite.lean

tactic: simp_rw [closure, op_sInf, Set.preimage_setOf_eq, unop_coe]
state_before: ι : Sort u_1
R : Type u_2
inst✝ : NonAssocSemiring R
s : Set R
⊢ (closure s).op = closure (MulOpposite.unop ⁻¹' s)
state_after: ι : Sort u_1
R : Type u_2
inst✝ : NonAssocSemiring R
s : Set R
⊢ sInf {a | s ⊆ MulOpposite.op ⁻¹' ↑a} = sInf {S | MulOpposite.unop ⁻¹' s ⊆ ↑S}

tactic: congr with a
state_before: ι : Sort u_1
R : Type u_2
inst✝ : NonAssocSemiring R
s : Set R
⊢ sInf {a | s ⊆ MulOpposite.op ⁻¹' ↑a} = sInf {S | MulOpposite.unop ⁻¹' s ⊆ ↑S}
state_after: case e_a.h
ι : Sort u_1
R : Type u_2
inst✝ : NonAssocSemiring R
s : Set R
a : Subsemiring Rᵐᵒᵖ
⊢ a ∈ {a | s ⊆ MulOpposite.op ⁻¹' ↑a} ↔ a ∈ {S | MulOpposite.unop ⁻¹' s ⊆ ↑S}

tactic: exact MulOpposite.unop_surjective.forall
state_before: case e_a.h
ι : Sort u_1
R : Type u_2
inst✝ : NonAssocSemiring R
s : Set R
a : Subsemiring Rᵐᵒᵖ
⊢ a ∈ {a | s ⊆ MulOpposite.op ⁻¹' ↑a} ↔ a ∈ {S | MulOpposite.unop ⁻¹' s ⊆ ↑S}
state_after: no goals
Theorem: Int.natAbs_odd
File: Mathlib/Algebra/Ring/Int.lean

tactic: rw [odd_iff_not_even, Nat.odd_iff_not_even, natAbs_even]
state_before: m n : ℤ
⊢ Odd n.natAbs ↔ Odd n
state_after: no goals
Theorem: Pell.isPell_nat
File: Mathlib/NumberTheory/PellMatiyasevic.lean

tactic: rw [Int.ofNat_sub (Int.le_of_ofNat_le_ofNat <| Int.le.intro_sub _ h)]
state_before: a : ℕ
a1 : 1 < a
x y : ℕ
h : IsPell { re := ↑x, im := ↑y }
⊢ ↑(x * x - Pell.d a1 * y * y) = ↑1
state_after: a : ℕ
a1 : 1 < a
x y : ℕ
h : IsPell { re := ↑x, im := ↑y }
⊢ ↑(x * x) - ↑(Pell.d a1 * y * y) = ↑1

tactic: exact h
state_before: a : ℕ
a1 : 1 < a
x y : ℕ
h : IsPell { re := ↑x, im := ↑y }
⊢ ↑(x * x) - ↑(Pell.d a1 * y * y) = ↑1
state_after: no goals

tactic: rw [← Int.ofNat_sub <| le_of_lt <| Nat.lt_of_sub_eq_succ h, h]
state_before: a : ℕ
a1 : 1 < a
x y : ℕ
h : x * x - Pell.d a1 * y * y = 1
⊢ ↑(x * x) - ↑(Pell.d a1 * y * y) = 1
state_after: a : ℕ
a1 : 1 < a
x y : ℕ
h : x * x - Pell.d a1 * y * y = 1
⊢ ↑1 = 1

tactic: rfl
state_before: a : ℕ
a1 : 1 < a
x y : ℕ
h : x * x - Pell.d a1 * y * y = 1
⊢ ↑1 = 1
state_after: no goals
Theorem: List.Chain'.length_sub_one_le_two_mul_count_bool
File: Mathlib/Data/Bool/Count.lean

tactic: rw [hl.two_mul_count_bool_eq_ite]
state_before: l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) l
b : Bool
⊢ l.length - 1 ≤ 2 * count b l
state_after: l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) l
b : Bool
⊢ l.length - 1 ≤ if Even l.length then l.length else if (some b == l.head?) = true then l.length + 1 else l.length - 1

tactic: split_ifs <;> simp [le_tsub_add, Nat.le_succ_of_le]
state_before: l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) l
b : Bool
⊢ l.length - 1 ≤ if Even l.length then l.length else if (some b == l.head?) = true then l.length + 1 else l.length - 1
state_after: no goals
Theorem: LinearMap.det_toLin
File: Mathlib/LinearAlgebra/Determinant.lean

tactic: rw [← LinearMap.det_toMatrix b, LinearMap.toMatrix_toLin]
state_before: R : Type u_1
inst✝⁹ : CommRing R
M : Type u_2
inst✝⁸ : AddCommGroup M
inst✝⁷ : Module R M
M' : Type u_3
inst✝⁶ : AddCommGroup M'
inst✝⁵ : Module R M'
ι : Type u_4
inst✝⁴ : DecidableEq ι
inst✝³ : Fintype ι
e : Basis ι R M
A : Type u_5
inst✝² : CommRing A
inst✝¹ : Module A M
κ : Type u_6
inst✝ : Fintype κ
b : Basis ι R M
f : Matrix ι ι R
⊢ LinearMap.det ((toLin b b) f) = f.det
state_after: no goals
Theorem: Polynomial.isUnit_map
File: Mathlib/Algebra/Polynomial/FieldDivision.lean

tactic: simp_rw [isUnit_iff_degree_eq_zero, degree_map]
state_before: R : Type u
S : Type v
k : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Field R
p q : R[X]
inst✝ : Field k
f : R →+* k
⊢ IsUnit (map f p) ↔ IsUnit p
state_after: no goals
Theorem: List.length_sigma'
File: Mathlib/Data/List/ProdSigma.lean

tactic: induction' l₁ with x l₁ IH
state_before: α : Type u_1
β : Type u_2
σ : α → Type u_3
l₁ : List α
l₂ : (a : α) → List (σ a)
⊢ (l₁.sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) l₁)
state_after: case nil
α : Type u_1
β : Type u_2
σ : α → Type u_3
l₂ : (a : α) → List (σ a)
⊢ ([].sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) [])

case cons
α : Type u_1
β : Type u_2
σ : α → Type u_3
l₂ : (a : α) → List (σ a)
x : α
l₁ : List α
IH : (l₁.sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) l₁)
⊢ ((x :: l₁).sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) (x :: l₁))

tactic: rfl
state_before: case nil
α : Type u_1
β : Type u_2
σ : α → Type u_3
l₂ : (a : α) → List (σ a)
⊢ ([].sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) [])
state_after: no goals

tactic: simp only [map, sigma_cons, length_append, length_map, IH, Nat.sum_cons]
state_before: case cons
α : Type u_1
β : Type u_2
σ : α → Type u_3
l₂ : (a : α) → List (σ a)
x : α
l₁ : List α
IH : (l₁.sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) l₁)
⊢ ((x :: l₁).sigma l₂).length = Nat.sum (map (fun a => (l₂ a).length) (x :: l₁))
state_after: no goals
Theorem: MeasureTheory.Measure.restrict_univ
File: Mathlib/MeasureTheory/Measure/Restrict.lean

tactic: simp [hs]
state_before: R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s✝ s' t s : Set α
hs : MeasurableSet s
⊢ (μ.restrict univ) s = μ s
state_after: no goals
Theorem: Set.image_add_const_Iic
File: Mathlib/Data/Set/Pointwise/Interval.lean

tactic: simp
state_before: α : Type u_1
inst✝ : OrderedAddCommGroup α
a b c : α
⊢ (fun x => x + a) '' Iic b = Iic (b + a)
state_after: no goals
Theorem: minpoly.natDegree_eq_one_iff
File: Mathlib/FieldTheory/Minpoly/Basic.lean

tactic: rw [← Polynomial.degree_eq_iff_natDegree_eq_of_pos zero_lt_one]
state_before: A : Type u_1
B : Type u_2
B' : Type u_3
inst✝³ : CommRing A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : Nontrivial B
⊢ (minpoly A x).natDegree = 1 ↔ x ∈ (algebraMap A B).range
state_after: A : Type u_1
B : Type u_2
B' : Type u_3
inst✝³ : CommRing A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : Nontrivial B
⊢ (minpoly A x).degree = ↑1 ↔ x ∈ (algebraMap A B).range

tactic: exact degree_eq_one_iff
state_before: A : Type u_1
B : Type u_2
B' : Type u_3
inst✝³ : CommRing A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : Nontrivial B
⊢ (minpoly A x).degree = ↑1 ↔ x ∈ (algebraMap A B).range
state_after: no goals
Theorem: Matrix.fromBlocks_transpose
File: Mathlib/Data/Matrix/Block.lean

tactic: ext i j
state_before: l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
p : Type u_5
q : Type u_6
m' : o → Type u_7
n' : o → Type u_8
p' : o → Type u_9
R : Type u_10
S : Type u_11
α : Type u_12
β : Type u_13
A : Matrix n l α
B : Matrix n m α
C : Matrix o l α
D : Matrix o m α
⊢ (fromBlocks A B C D)ᵀ = fromBlocks Aᵀ Cᵀ Bᵀ Dᵀ
state_after: case a
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
p : Type u_5
q : Type u_6
m' : o → Type u_7
n' : o → Type u_8
p' : o → Type u_9
R : Type u_10
S : Type u_11
α : Type u_12
β : Type u_13
A : Matrix n l α
B : Matrix n m α
C : Matrix o l α
D : Matrix o m α
i : l ⊕ m
j : n ⊕ o
⊢ (fromBlocks A B C D)ᵀ i j = fromBlocks Aᵀ Cᵀ Bᵀ Dᵀ i j

tactic: rcases i with ⟨⟩ <;> rcases j with ⟨⟩ <;> simp [fromBlocks]
state_before: case a
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
p : Type u_5
q : Type u_6
m' : o → Type u_7
n' : o → Type u_8
p' : o → Type u_9
R : Type u_10
S : Type u_11
α : Type u_12
β : Type u_13
A : Matrix n l α
B : Matrix n m α
C : Matrix o l α
D : Matrix o m α
i : l ⊕ m
j : n ⊕ o
⊢ (fromBlocks A B C D)ᵀ i j = fromBlocks Aᵀ Cᵀ Bᵀ Dᵀ i j
state_after: no goals
Theorem: Real.Angle.two_nsmul_toReal_eq_two_mul_add_two_pi
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean

tactic: nth_rw 1 [← coe_toReal θ]
state_before: θ : Angle
⊢ (2 • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2
state_after: θ : Angle
⊢ (2 • ↑θ.toReal).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2

tactic: rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_add_two_pi_iff, Set.mem_Ioc]
state_before: θ : Angle
⊢ (2 • ↑θ.toReal).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2
state_after: θ : Angle
⊢ -3 * π < 2 * θ.toReal ∧ 2 * θ.toReal ≤ -π ↔ θ.toReal ≤ -π / 2

tactic: refine
  ⟨fun h => by linarith, fun h =>
    ⟨by linarith [pi_pos, neg_pi_lt_toReal θ], (le_div_iff' (zero_lt_two' ℝ)).1 h⟩⟩
state_before: θ : Angle
⊢ -3 * π < 2 * θ.toReal ∧ 2 * θ.toReal ≤ -π ↔ θ.toReal ≤ -π / 2
state_after: no goals

tactic: linarith
state_before: θ : Angle
h : -3 * π < 2 * θ.toReal ∧ 2 * θ.toReal ≤ -π
⊢ θ.toReal ≤ -π / 2
state_after: no goals

tactic: linarith [pi_pos, neg_pi_lt_toReal θ]
state_before: θ : Angle
h : θ.toReal ≤ -π / 2
⊢ -3 * π < 2 * θ.toReal
state_after: no goals
Theorem: Rat.num_mk
File: Mathlib/Data/Rat/Lemmas.lean

tactic: have (m : ℕ) : Int.natAbs (m + 1) = m + 1 := by
  rw [← Nat.cast_one, ← Nat.cast_add, Int.natAbs_cast]
state_before: n d : ℤ
⊢ (n /. d).num = d.sign * n / ↑(n.gcd d)
state_after: n d : ℤ
this : ∀ (m : ℕ), (↑m + 1).natAbs = m + 1
⊢ (n /. d).num = d.sign * n / ↑(n.gcd d)

tactic: rcases d with ((_ | _) | _) <;>
rw [← Int.div_eq_ediv_of_dvd] <;>
simp [divInt, mkRat, Rat.normalize, Nat.succPNat, Int.sign, Int.gcd,
  Int.zero_ediv, Int.ofNat_dvd_left, Nat.gcd_dvd_left, this]
state_before: n d : ℤ
this : ∀ (m : ℕ), (↑m + 1).natAbs = m + 1
⊢ (n /. d).num = d.sign * n / ↑(n.gcd d)
state_after: no goals

tactic: rw [← Nat.cast_one, ← Nat.cast_add, Int.natAbs_cast]
state_before: n d : ℤ
m : ℕ
⊢ (↑m + 1).natAbs = m + 1
state_after: no goals
Theorem: MvPolynomial.support_rename_of_injective
File: Mathlib/Algebra/MvPolynomial/Rename.lean

tactic: rw [rename_eq]
state_before: σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
p : MvPolynomial σ R
f : σ → τ
inst✝ : DecidableEq τ
h : Injective f
⊢ ((rename f) p).support = Finset.image (Finsupp.mapDomain f) p.support
state_after: σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
p : MvPolynomial σ R
f : σ → τ
inst✝ : DecidableEq τ
h : Injective f
⊢ support (Finsupp.mapDomain (Finsupp.mapDomain f) p) = Finset.image (Finsupp.mapDomain f) p.support

tactic: exact Finsupp.mapDomain_support_of_injective (mapDomain_injective h) _
state_before: σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
p : MvPolynomial σ R
f : σ → τ
inst✝ : DecidableEq τ
h : Injective f
⊢ support (Finsupp.mapDomain (Finsupp.mapDomain f) p) = Finset.image (Finsupp.mapDomain f) p.support
state_after: no goals