tasksource/leandojo huggingface dataset:
Theorem: PiNat.mem_cylinder_iff_dist_le
File: Mathlib/Topology/MetricSpace/PiNat.lean

tactic: rcases eq_or_ne y x with (rfl | hne)
state_before: E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
⊢ y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n

tactic: suffices (∀ i : ℕ, i < n → y i = x i) ↔ n ≤ firstDiff y x by simpa [dist_eq_of_ne hne]
state_before: case inr
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
⊢ y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n

tactic: constructor
state_before: case inr
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
⊢ (∀ (i : ℕ), i < n → y i = x i) ↔ n ≤ firstDiff y x

tactic: simp [PiNat.dist_self]
state_before: case inl
E : ℕ → Type u_1
y : (n : ℕ) → E n
n : ℕ
⊢ y ∈ cylinder y n ↔ dist y y ≤ (1 / 2) ^ n

tactic: simpa [dist_eq_of_ne hne]
state_before: E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
this : (∀ (i : ℕ), i < n → y i = x i) ↔ n ≤ firstDiff y x
⊢ y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n

tactic: intro hy
state_before: case inr.mp
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
⊢ (∀ (i : ℕ), i < n → y i = x i) → n ≤ firstDiff y x

tactic: by_contra' H
state_before: case inr.mp
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
hy : ∀ (i : ℕ), i < n → y i = x i
⊢ n ≤ firstDiff y x

tactic: exact apply_firstDiff_ne hne (hy _ H)
state_before: case inr.mp
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
hy : ∀ (i : ℕ), i < n → y i = x i
H : firstDiff y x < n
⊢ False

tactic: intro h i hi
state_before: case inr.mpr
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
⊢ n ≤ firstDiff y x → ∀ (i : ℕ), i < n → y i = x i

tactic: exact apply_eq_of_lt_firstDiff (hi.trans_le h)
state_before: case inr.mpr
E : ℕ → Type u_1
x y : (n : ℕ) → E n
n : ℕ
hne : y ≠ x
h : n ≤ firstDiff y x
i : ℕ
hi : i < n
⊢ y i = x i
Theorem: ZNum.dvd_to_int
File: Mathlib/Data/Num/Lemmas.lean

tactic: rw [← of_to_int n, e]
state_before: α : Type ?u.1071772
m n : ZNum
x✝ : ↑m ∣ ↑n
k : ℤ
e : ↑n = ↑m * k
⊢ n = m * ↑k

tactic: simp
state_before: α : Type ?u.1071772
m n : ZNum
x✝ : ↑m ∣ ↑n
k : ℤ
e : ↑n = ↑m * k
⊢ ↑(↑m * k) = m * ↑k

tactic: simp [e]
state_before: α : Type ?u.1071772
m n : ZNum
x✝ : m ∣ n
k : ZNum
e : n = m * k
⊢ ↑n = ↑m * ↑k
Theorem: Fin.image_succAbove_univ
File: Mathlib/Data/Fintype/Basic.lean

tactic: ext m
state_before: α : Type ?u.100123
β : Type ?u.100126
γ : Type ?u.100129
n : ℕ
i : Fin (n + 1)
⊢ image (↑(succAbove i)) univ = {i}ᶜ

tactic: simp
state_before: case a
α : Type ?u.100123
β : Type ?u.100126
γ : Type ?u.100129
n : ℕ
i m : Fin (n + 1)
⊢ m ∈ image (↑(succAbove i)) univ ↔ m ∈ {i}ᶜ
Theorem: Int.cast_negOfNat
File: Mathlib/Data/Int/Cast/Basic.lean

tactic: simp [Int.cast_neg, negOfNat_eq]
state_before: R : Type u
inst✝ : AddGroupWithOne R
n : ℕ
⊢ ↑(negOfNat n) = -↑n
Theorem: gramSchmidtNormed_unit_length_coe
File: Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean

tactic: simp only [gramSchmidt_ne_zero_coe n h₀, gramSchmidtNormed, norm_smul_inv_norm, Ne.def,
  not_false_iff]
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
n : ι
h₀ : LinearIndependent 𝕜 (f ∘ Subtype.val)
⊢ ‖gramSchmidtNormed 𝕜 f n‖ = 1
Theorem: LieAlgebra.abelian_iff_derived_succ_eq_bot
File: Mathlib/Algebra/Lie/Solvable.lean

tactic: rw [add_comm, derivedSeriesOfIdeal_add I 1 k, abelian_iff_derived_one_eq_bot]
state_before: R : Type u
L : Type v
M : Type w
L' : Type w₁
inst✝⁴ : CommRing R
inst✝³ : LieRing L
inst✝² : LieAlgebra R L
inst✝¹ : LieRing L'
inst✝ : LieAlgebra R L'
I✝ J : LieIdeal R L
f : L' →ₗ⁅R⁆ L
I : LieIdeal R L
k : ℕ
⊢ IsLieAbelian { x // x ∈ ↑(D k I) } ↔ D (k + 1) I = ⊥
Theorem: Subgroup.mem_centralizer_iff_commutator_eq_one
File: Mathlib/GroupTheory/Subgroup/Basic.lean

tactic: simp only [mem_centralizer_iff, mul_inv_eq_iff_eq_mul, one_mul]
state_before: G : Type u_1
G' : Type ?u.412647
inst✝² : Group G
inst✝¹ : Group G'
A : Type ?u.412656
inst✝ : AddGroup A
H K : Subgroup G
g : G
⊢ g ∈ centralizer H ↔ ∀ (h : G), h ∈ H → h * g * h⁻¹ * g⁻¹ = 1
Theorem: Set.sUnion_eq_iUnion
File: Mathlib/Data/Set/Lattice.lean

tactic: simp only [← sUnion_range, Subtype.range_coe]
state_before: α : Type u_1
β : Type ?u.167312
γ : Type ?u.167315
ι : Sort ?u.167318
ι' : Sort ?u.167321
ι₂ : Sort ?u.167324
κ : ι → Sort ?u.167329
κ₁ : ι → Sort ?u.167334
κ₂ : ι → Sort ?u.167339
κ' : ι' → Sort ?u.167344
s : Set (Set α)
⊢ ⋃₀ s = ⋃ (i : ↑s), ↑i
Theorem: MvPolynomial.pderiv_monomial
File: Mathlib/Data/MvPolynomial/PDeriv.lean

tactic: simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc,
  ← (monomial _).map_smul]
state_before: R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i : σ
⊢ ↑(pderiv i) (↑(monomial s) a) = ↑(monomial (s - single i 1)) (a * ↑(↑s i))

tactic: refine' (Finset.sum_eq_single i (fun j _ hne => _) fun hi => _).trans _
state_before: R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i : σ
⊢ (sum s fun a_1 b => ↑(monomial (s - single a_1 1)) (a * ↑b) * Pi.single i 1 a_1) =
    ↑(monomial (s - single i 1)) (a * ↑(↑s i))

tactic: simp [Pi.single_eq_of_ne hne]
state_before: case refine'_1
R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i j : σ
x✝ : j ∈ s.support
hne : j ≠ i
⊢ (fun a_1 b => ↑(monomial (s - single a_1 1)) (a * ↑b) * Pi.single i 1 a_1) j (↑s j) = 0

tactic: rw [Finsupp.not_mem_support_iff] at hi
state_before: case refine'_2
R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i : σ
hi : ¬i ∈ s.support
⊢ (fun a_1 b => ↑(monomial (s - single a_1 1)) (a * ↑b) * Pi.single i 1 a_1) i (↑s i) = 0

tactic: simp [hi]
state_before: case refine'_2
R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i : σ
hi : ↑s i = 0
⊢ (fun a_1 b => ↑(monomial (s - single a_1 1)) (a * ↑b) * Pi.single i 1 a_1) i (↑s i) = 0

tactic: simp
state_before: case refine'_3
R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i : σ
⊢ (fun a_1 b => ↑(monomial (s - single a_1 1)) (a * ↑b) * Pi.single i 1 a_1) i (↑s i) =
    ↑(monomial (s - single i 1)) (a * ↑(↑s i))
Theorem: CategoryTheory.Bicategory.inv_hom_whiskerLeft
File: Mathlib/CategoryTheory/Bicategory/Basic.lean

tactic: rw [← whiskerLeft_comp, inv_hom_id, whiskerLeft_id]
state_before: B : Type u
inst✝ : Bicategory B
a b c d e : B
f : a ⟶ b
g h : b ⟶ c
η : g ≅ h
⊢ f ◁ η.inv ≫ f ◁ η.hom = 𝟙 (f ≫ h)
Theorem: Nat.succ_mul_succ_eq
File: Std/Data/Nat/Lemmas.lean

tactic: rw [mul_succ, succ_mul, Nat.add_right_comm _ a]
state_before: a b : Nat
⊢ succ a * succ b = a * b + a + b + 1

tactic: rfl
state_before: a b : Nat
⊢ a * b + b + succ a = a * b + b + a + 1
Theorem: Sum.isRight_map
File: Mathlib/Data/Sum/Basic.lean

tactic: cases x <;> rfl
state_before: α : Type u
α' : Type w
β : Type v
β' : Type x
γ : Type u_1
δ : Type u_2
f : α → β
g : γ → δ
x : α ⊕ γ
⊢ isRight (Sum.map f g x) = isRight x
Theorem: IntermediateField.rank_adjoin_simple_eq_one_iff
File: Mathlib/FieldTheory/Adjoin.lean

tactic: rw [rank_adjoin_eq_one_iff]
state_before: F : Type u_2
inst✝² : Field F
E : Type u_1
inst✝¹ : Field E
inst✝ : Algebra F E
α : E
S : Set E
K L : IntermediateField F E
⊢ Module.rank F { x // x ∈ F⟮α⟯ } = 1 ↔ α ∈ ⊥

tactic: exact Set.singleton_subset_iff
state_before: F : Type u_2
inst✝² : Field F
E : Type u_1
inst✝¹ : Field E
inst✝ : Algebra F E
α : E
S : Set E
K L : IntermediateField F E
⊢ Insert.insert ∅ α ⊆ ↑⊥ ↔ α ∈ ⊥
Theorem: Irrational.eventually_forall_le_dist_cast_div
File: Mathlib/Topology/Instances/Irrational.lean

tactic: have A : IsClosed (range (fun m => (n : ℝ)⁻¹ * m : ℤ → ℝ)) :=
  ((isClosedMap_smul₀ (n⁻¹ : ℝ)).comp Int.closedEmbedding_coe_real.isClosedMap).closed_range
state_before: x : ℝ
hx : Irrational x
n : ℕ
⊢ ∀ᶠ (ε : ℝ) in 𝓝 0, ∀ (m : ℤ), ε ≤ dist x (↑m / ↑n)

tactic: have B : x ∉ range (fun m => (n : ℝ)⁻¹ * m : ℤ → ℝ) := by
  rintro ⟨m, rfl⟩
  simp at hx
state_before: x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
⊢ ∀ᶠ (ε : ℝ) in 𝓝 0, ∀ (m : ℤ), ε ≤ dist x (↑m / ↑n)

tactic: rcases Metric.mem_nhds_iff.1 (A.isOpen_compl.mem_nhds B) with ⟨ε, ε0, hε⟩
state_before: x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
B : ¬x ∈ range fun m => (↑n)⁻¹ * ↑m
⊢ ∀ᶠ (ε : ℝ) in 𝓝 0, ∀ (m : ℤ), ε ≤ dist x (↑m / ↑n)

tactic: refine' (ge_mem_nhds ε0).mono fun δ hδ m => not_lt.1 fun hlt => _
state_before: case intro.intro
x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
B : ¬x ∈ range fun m => (↑n)⁻¹ * ↑m
ε : ℝ
ε0 : ε > 0
hε : ball x ε ⊆ (range fun m => (↑n)⁻¹ * ↑m)ᶜ
⊢ ∀ᶠ (ε : ℝ) in 𝓝 0, ∀ (m : ℤ), ε ≤ dist x (↑m / ↑n)

tactic: rw [dist_comm] at hlt
state_before: case intro.intro
x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
B : ¬x ∈ range fun m => (↑n)⁻¹ * ↑m
ε : ℝ
ε0 : ε > 0
hε : ball x ε ⊆ (range fun m => (↑n)⁻¹ * ↑m)ᶜ
δ : ℝ
hδ : δ ≤ ε
m : ℤ
hlt : dist x (↑m / ↑n) < δ
⊢ False

tactic: refine' hε (ball_subset_ball hδ hlt) ⟨m, _⟩
state_before: case intro.intro
x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
B : ¬x ∈ range fun m => (↑n)⁻¹ * ↑m
ε : ℝ
ε0 : ε > 0
hε : ball x ε ⊆ (range fun m => (↑n)⁻¹ * ↑m)ᶜ
δ : ℝ
hδ : δ ≤ ε
m : ℤ
hlt : dist (↑m / ↑n) x < δ
⊢ False

tactic: simp [div_eq_inv_mul]
state_before: case intro.intro
x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
B : ¬x ∈ range fun m => (↑n)⁻¹ * ↑m
ε : ℝ
ε0 : ε > 0
hε : ball x ε ⊆ (range fun m => (↑n)⁻¹ * ↑m)ᶜ
δ : ℝ
hδ : δ ≤ ε
m : ℤ
hlt : dist (↑m / ↑n) x < δ
⊢ (fun m => (↑n)⁻¹ * ↑m) m = ↑m / ↑n

tactic: rintro ⟨m, rfl⟩
state_before: x : ℝ
hx : Irrational x
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
⊢ ¬x ∈ range fun m => (↑n)⁻¹ * ↑m

tactic: simp at hx
state_before: case intro
n : ℕ
A : IsClosed (range fun m => (↑n)⁻¹ * ↑m)
m : ℤ
hx : Irrational ((fun m => (↑n)⁻¹ * ↑m) m)
⊢ False
Theorem: isOpen_sigma_fst_preimage
File: Mathlib/Topology/Constructions.lean

tactic: rw [← biUnion_of_singleton s, preimage_iUnion₂]
state_before: α : Type u
β : Type v
γ : Type ?u.527967
δ : Type ?u.527970
ε : Type ?u.527973
ζ : Type ?u.527976
ι : Type u_1
κ : Type ?u.527982
σ : ι → Type u_2
τ : κ → Type ?u.527992
inst✝² : (i : ι) → TopologicalSpace (σ i)
inst✝¹ : (k : κ) → TopologicalSpace (τ k)
inst✝ : TopologicalSpace α
s : Set ι
⊢ IsOpen (Sigma.fst ⁻¹' s)

tactic: simp only [← range_sigmaMk]
state_before: α : Type u
β : Type v
γ : Type ?u.527967
δ : Type ?u.527970
ε : Type ?u.527973
ζ : Type ?u.527976
ι : Type u_1
κ : Type ?u.527982
σ : ι → Type u_2
τ : κ → Type ?u.527992
inst✝² : (i : ι) → TopologicalSpace (σ i)
inst✝¹ : (k : κ) → TopologicalSpace (τ k)
inst✝ : TopologicalSpace α
s : Set ι
⊢ IsOpen (⋃ (i : ι) (_ : i ∈ s), Sigma.fst ⁻¹' {i})

tactic: exact isOpen_biUnion fun _ _ => isOpen_range_sigmaMk
state_before: α : Type u
β : Type v
γ : Type ?u.527967
δ : Type ?u.527970
ε : Type ?u.527973
ζ : Type ?u.527976
ι : Type u_1
κ : Type ?u.527982
σ : ι → Type u_2
τ : κ → Type ?u.527992
inst✝² : (i : ι) → TopologicalSpace (σ i)
inst✝¹ : (k : κ) → TopologicalSpace (τ k)
inst✝ : TopologicalSpace α
s : Set ι
⊢ IsOpen (⋃ (i : ι) (_ : i ∈ s), range (Sigma.mk i))
Theorem: Bitvec.toFin_val
File: Mathlib/Data/Bitvec/Lemmas.lean

tactic: rw [toFin, Fin.coe_ofNat_eq_mod, Nat.mod_eq_of_lt]
state_before: n : ℕ
v : Bitvec n
⊢ ↑(toFin v) = Bitvec.toNat v

tactic: apply toNat_lt
state_before: n : ℕ
v : Bitvec n
⊢ Bitvec.toNat v < 2 ^ n
Theorem: Setoid.mapOfSurjective_eq_map
File: Mathlib/Data/Setoid/Basic.lean

tactic: rw [← eqvGen_of_setoid (mapOfSurjective r f h hf)]
state_before: α : Type u_1
β : Type u_2
r : Setoid α
f : α → β
h : ker f ≤ r
hf : Surjective f
⊢ map r f = mapOfSurjective r f h hf

tactic: rfl
state_before: α : Type u_1
β : Type u_2
r : Setoid α
f : α → β
h : ker f ≤ r
hf : Surjective f
⊢ map r f = EqvGen.Setoid Setoid.r
Theorem: AddLECancellable.le_tsub_of_add_le_right
File: Mathlib/Algebra/Order/Sub/Defs.lean

tactic: rwa [add_comm]
state_before: α : Type u_1
β : Type ?u.24546
inst✝³ : Preorder α
inst✝² : AddCommSemigroup α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
h : a + b ≤ c
⊢ b + a ≤ c
Theorem: Polynomial.leadingCoeff_normalize
File: Mathlib/Data/Polynomial/FieldDivision.lean

tactic: simp
state_before: R : Type u
S : Type v
k : Type y
A : Type z
a b : R
n : ℕ
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizationMonoid R
p : R[X]
⊢ leadingCoeff (↑normalize p) = ↑normalize (leadingCoeff p)
Theorem: CategoryTheory.Limits.spanExt_hom_app_left
File: Mathlib/CategoryTheory/Limits/Shapes/Pullbacks.lean

tactic: dsimp [spanExt]
state_before: C : Type u
inst✝¹ : Category C
D : Type u₂
inst✝ : Category D
X Y Z X' Y' Z' : C
iX : X ≅ X'
iY : Y ≅ Y'
iZ : Z ≅ Z'
f : X ⟶ Y
g : X ⟶ Z
f' : X' ⟶ Y'
g' : X' ⟶ Z'
wf : iX.hom ≫ f' = f ≫ iY.hom
wg : iX.hom ≫ g' = g ≫ iZ.hom
⊢ (spanExt iX iY iZ wf wg).hom.app WalkingSpan.left = iY.hom
Theorem: AntilipschitzWith.mul_le_dist
File: Mathlib/Topology/MetricSpace/Antilipschitz.lean

tactic: exact_mod_cast hf.mul_le_nndist x y
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.3257
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
K : ℝ≥0
f : α → β
hf : AntilipschitzWith K f
x y : α
⊢ ↑K⁻¹ * dist x y ≤ dist (f x) (f y)
Theorem: MeasurableEmbedding.measurable_comp_iff
File: Mathlib/MeasureTheory/MeasurableSpace.lean

tactic: refine' ⟨fun H => _, hg.measurable.comp⟩
state_before: α : Type u_3
β : Type u_1
γ : Type u_2
δ : Type ?u.382740
δ' : Type ?u.382743
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
⊢ Measurable (g ∘ f) ↔ Measurable f

tactic: suffices Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f) by
  rwa [(rightInverse_rangeSplitting hg.injective).comp_eq_id] at this
state_before: α : Type u_3
β : Type u_1
γ : Type u_2
δ : Type ?u.382740
δ' : Type ?u.382743
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
⊢ Measurable f

tactic: exact hg.measurable_rangeSplitting.comp H.subtype_mk
state_before: α : Type u_3
β : Type u_1
γ : Type u_2
δ : Type ?u.382740
δ' : Type ?u.382743
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
⊢ Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f)

tactic: rwa [(rightInverse_rangeSplitting hg.injective).comp_eq_id] at this
state_before: α : Type u_3
β : Type u_1
γ : Type u_2
δ : Type ?u.382740
δ' : Type ?u.382743
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
this : Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f)
⊢ Measurable f
Theorem: CharP.neg_one_ne_one
File: Mathlib/Algebra/CharP/Basic.lean

tactic: suffices (2 : R) ≠ 0 by
  intro h
  symm at h
  rw [← sub_eq_zero, sub_neg_eq_add] at h
  norm_num at h
  exact this h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
⊢ -1 ≠ 1

tactic: intro h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
⊢ 2 ≠ 0

tactic: rw [show (2 : R) = (2 : ℕ) by norm_cast] at h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
h : 2 = 0
⊢ False

tactic: have := (CharP.cast_eq_zero_iff R p 2).mp h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
h : ↑2 = 0
⊢ False

tactic: have := Nat.le_of_dvd (by decide) this
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
h : ↑2 = 0
this : p ∣ 2
⊢ False

tactic: rw [fact_iff] at *
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
h : ↑2 = 0
this✝ : p ∣ 2
this : p ≤ 2
⊢ False

tactic: linarith
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : 2 < p
h : ↑2 = 0
this✝ : p ∣ 2
this : p ≤ 2
⊢ False

tactic: intro h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
this : 2 ≠ 0
⊢ -1 ≠ 1

tactic: symm at h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
this : 2 ≠ 0
h : -1 = 1
⊢ False

tactic: rw [← sub_eq_zero, sub_neg_eq_add] at h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
this : 2 ≠ 0
h : 1 = -1
⊢ False

tactic: norm_num at h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
this : 2 ≠ 0
h✝ : 1 = -1
h : 1 + 1 = 0
⊢ False

tactic: exact this h
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
this : 2 ≠ 0
h✝ : 1 = -1
h : 2 = 0
⊢ False

tactic: norm_cast
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
h : 2 = 0
⊢ 2 = ↑2

tactic: decide
state_before: R : Type u_1
inst✝² : Ring R
p : ℕ
inst✝¹ : CharP R p
inst✝ : Fact (2 < p)
h : ↑2 = 0
this : p ∣ 2
⊢ 0 < 2
Theorem: Vector.reverse_reverse
File: Mathlib/Data/Vector/Basic.lean

tactic: cases v
state_before: n : ℕ
α : Type u_1
v : Vector α n
⊢ reverse (reverse v) = v

tactic: simp [Vector.reverse]
state_before: case mk
n : ℕ
α : Type u_1
val✝ : List α
property✝ : List.length val✝ = n
⊢ reverse (reverse { val := val✝, property := property✝ }) = { val := val✝, property := property✝ }
Theorem: vadd_vsub_vadd_cancel_left
File: Mathlib/Algebra/AddTorsor.lean

tactic: rw [vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, add_sub_cancel']
state_before: G : Type u_1
P : Type u_2
inst✝¹ : AddCommGroup G
inst✝ : AddTorsor G P
v : G
p1 p2 : P
⊢ v +ᵥ p1 -ᵥ (v +ᵥ p2) = p1 -ᵥ p2
Theorem: FiniteDimensional.finrank_zero_of_subsingleton
File: Mathlib/LinearAlgebra/Finrank.lean

tactic: by_contra h0
state_before: K : Type u
V : Type v
inst✝⁶ : Ring K
inst✝⁵ : AddCommGroup V
inst✝⁴ : Module K V
V₂ : Type v'
inst✝³ : AddCommGroup V₂
inst✝² : Module K V₂
inst✝¹ : Nontrivial K
inst✝ : NoZeroSMulDivisors K V
h : Subsingleton V
⊢ finrank K V = 0

tactic: obtain ⟨x, y, hxy⟩ := nontrivial_of_finrank_pos (Nat.pos_of_ne_zero h0)
state_before: K : Type u
V : Type v
inst✝⁶ : Ring K
inst✝⁵ : AddCommGroup V
inst✝⁴ : Module K V
V₂ : Type v'
inst✝³ : AddCommGroup V₂
inst✝² : Module K V₂
inst✝¹ : Nontrivial K
inst✝ : NoZeroSMulDivisors K V
h : Subsingleton V
h0 : ¬finrank K V = 0
⊢ False

tactic: exact hxy (Subsingleton.elim _ _)
state_before: case mk.intro.intro
K : Type u
V : Type v
inst✝⁶ : Ring K
inst✝⁵ : AddCommGroup V
inst✝⁴ : Module K V
V₂ : Type v'
inst✝³ : AddCommGroup V₂
inst✝² : Module K V₂
inst✝¹ : Nontrivial K
inst✝ : NoZeroSMulDivisors K V
h : Subsingleton V
h0 : ¬finrank K V = 0
x y : V
hxy : x ≠ y
⊢ False
Theorem: Ideal.IsPrincipal.of_comap
File: Mathlib/RingTheory/PrincipalIdealDomain.lean

tactic: rw [Ideal.submodule_span_eq, ← Set.image_singleton, ← Ideal.map_span,
  Ideal.span_singleton_generator, Ideal.map_comap_of_surjective f hf]
state_before: R : Type u
M : Type v
S : Type u_1
N : Type ?u.185417
inst✝⁵ : Ring R
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Ring S
inst✝¹ : Module R M
inst✝ : Module R N
f : R →+* S
hf : Surjective ↑f
I : Ideal S
hI : IsPrincipal (comap f I)
⊢ I = Submodule.span S {↑f (IsPrincipal.generator (comap f I))}
Theorem: TopCat.Presheaf.stalkToFiber_surjective
File: Mathlib/Topology/Sheaves/Sheafify.lean

tactic: apply TopCat.stalkToFiber_surjective
state_before: X : TopCat
F : Presheaf (Type v) X
x : ↑X
⊢ Function.Surjective (stalkToFiber F x)

tactic: intro t
state_before: case w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
⊢ ∀ (t : stalk F x), ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t

tactic: obtain ⟨U, m, s, rfl⟩ := F.germ_exist _ t
state_before: case w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
t : stalk F x
⊢ ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t

tactic: use ⟨U, m⟩
state_before: case w.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (CategoryTheory.forget (Type v)).obj (F.obj U.op)
⊢ ∃ U_1 f x_1,
    f { val := x, property := (_ : x ∈ U_1.obj) } =
      (CategoryTheory.forget (Type v)).map (germ F { val := x, property := m }) s

tactic: fconstructor
state_before: case w.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (CategoryTheory.forget (Type v)).obj (F.obj U.op)
⊢ ∃ f x_1,
    f { val := x, property := (_ : x ∈ { obj := U, property := m }.obj) } =
      (CategoryTheory.forget (Type v)).map (germ F { val := x, property := m }) s

tactic: exact fun y => F.germ y s
state_before: case w.intro.intro.intro.w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (CategoryTheory.forget (Type v)).obj (F.obj U.op)
⊢ (y : { x_1 // x_1 ∈ { obj := U, property := m }.obj }) → stalk F ↑y

tactic: exact ⟨PrelocalPredicate.sheafifyOf ⟨s, fun _ => rfl⟩, rfl⟩
state_before: case w.intro.intro.intro.h
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (CategoryTheory.forget (Type v)).obj (F.obj U.op)
⊢ ∃ x_1,
    germ F { val := x, property := (_ : x ∈ { obj := U, property := m }.obj) } s =
      (CategoryTheory.forget (Type v)).map (germ F { val := x, property := m }) s
Theorem: expSeries_div_hasSum_exp_of_mem_ball
File: Mathlib/Analysis/NormedSpace/Exponential.lean

tactic: rw [← expSeries_apply_eq_div' (𝕂 := 𝕂) x]
state_before: 𝕂 : Type u_2
𝔸 : Type u_1
inst✝³ : NontriviallyNormedField 𝕂
inst✝² : NormedDivisionRing 𝔸
inst✝¹ : NormedAlgebra 𝕂 𝔸
inst✝ : CompleteSpace 𝔸
x : 𝔸
hx : x ∈ EMetric.ball 0 (FormalMultilinearSeries.radius (expSeries 𝕂 𝔸))
⊢ HasSum (fun n => x ^ n / ↑n !) (exp 𝕂 x)

tactic: exact expSeries_hasSum_exp_of_mem_ball x hx
state_before: 𝕂 : Type u_2
𝔸 : Type u_1
inst✝³ : NontriviallyNormedField 𝕂
inst✝² : NormedDivisionRing 𝔸
inst✝¹ : NormedAlgebra 𝕂 𝔸
inst✝ : CompleteSpace 𝔸
x : 𝔸
hx : x ∈ EMetric.ball 0 (FormalMultilinearSeries.radius (expSeries 𝕂 𝔸))
⊢ HasSum (fun n => ↑(expSeries 𝕂 𝔸 n) fun x_1 => x) (exp 𝕂 x)
Theorem: Qpf.Cofix.dest_corec
File: Mathlib/Data/QPF/Univariate/Basic.lean

tactic: conv =>
  lhs
  rw [Cofix.dest, Cofix.corec];
state_before: F : Type u → Type u
inst✝ : Functor F
q : Qpf F
α : Type u
g : α → F α
x : α
⊢ dest (corec g x) = corec g <$> g x

tactic: dsimp
state_before: F : Type u → Type u
inst✝ : Functor F
q : Qpf F
α : Type u
g : α → F α
x : α
⊢ Quot.lift (fun x => Quot.mk Mcongr <$> abs (PFunctor.M.dest x))
      (_ :
        ∀ (x y : PFunctor.M (P F)),
          Mcongr x y →
            (fun x => Quot.mk Mcongr <$> abs (PFunctor.M.dest x)) x =
              (fun x => Quot.mk Mcongr <$> abs (PFunctor.M.dest x)) y)
      (Quot.mk Mcongr (corecF g x)) =
    corec g <$> g x

tactic: rw [corecF_eq, abs_map, abs_repr, ← comp_map]
state_before: F : Type u → Type u
inst✝ : Functor F
q : Qpf F
α : Type u
g : α → F α
x : α
⊢ Quot.mk Mcongr <$> abs (PFunctor.M.dest (corecF g x)) = corec g <$> g x

tactic: rfl
state_before: F : Type u → Type u
inst✝ : Functor F
q : Qpf F
α : Type u
g : α → F α
x : α
⊢ (Quot.mk Mcongr ∘ corecF g) <$> g x = corec g <$> g x
Theorem: Nat.squarefree_iff_nodup_factors
File: Mathlib/Data/Nat/Squarefree.lean

tactic: rw [UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors h0, Nat.factors_eq]
state_before: n : ℕ
h0 : n ≠ 0
⊢ Squarefree n ↔ List.Nodup (factors n)

tactic: simp
state_before: n : ℕ
h0 : n ≠ 0
⊢ Multiset.Nodup ↑(factors n) ↔ List.Nodup (factors n)