tasksource/leandojo huggingface dataset:
Theorem: Basis.ext
File: Mathlib/LinearAlgebra/Basis.lean

tactic: ext x
state_before: ι : Type u_5
ι' : Type ?u.181637
R : Type u_1
R₂ : Type ?u.181643
K : Type ?u.181646
M : Type u_3
M' : Type ?u.181652
M'' : Type ?u.181655
V : Type u
V' : Type ?u.181660
inst✝⁹ : Semiring R
inst✝⁸ : AddCommMonoid M
inst✝⁷ : Module R M
inst✝⁶ : AddCommMonoid M'
inst✝⁵ : Module R M'
b b₁ : Basis ι R M
i : ι
c : R
x : M
R₁ : Type u_2
inst✝⁴ : Semiring R₁
σ : R →+* R₁
σ' : R₁ →+* R
inst✝³ : RingHomInvPair σ σ'
inst✝² : RingHomInvPair σ' σ
M₁ : Type u_4
inst✝¹ : AddCommMonoid M₁
inst✝ : Module R₁ M₁
f₁ f₂ : M →ₛₗ[σ] M₁
h : ∀ (i : ι), ↑f₁ (↑b i) = ↑f₂ (↑b i)
⊢ f₁ = f₂

tactic: rw [← b.total_repr x, Finsupp.total_apply, Finsupp.sum]
state_before: case h
ι : Type u_5
ι' : Type ?u.181637
R : Type u_1
R₂ : Type ?u.181643
K : Type ?u.181646
M : Type u_3
M' : Type ?u.181652
M'' : Type ?u.181655
V : Type u
V' : Type ?u.181660
inst✝⁹ : Semiring R
inst✝⁸ : AddCommMonoid M
inst✝⁷ : Module R M
inst✝⁶ : AddCommMonoid M'
inst✝⁵ : Module R M'
b b₁ : Basis ι R M
i : ι
c : R
x✝ : M
R₁ : Type u_2
inst✝⁴ : Semiring R₁
σ : R →+* R₁
σ' : R₁ →+* R
inst✝³ : RingHomInvPair σ σ'
inst✝² : RingHomInvPair σ' σ
M₁ : Type u_4
inst✝¹ : AddCommMonoid M₁
inst✝ : Module R₁ M₁
f₁ f₂ : M →ₛₗ[σ] M₁
h : ∀ (i : ι), ↑f₁ (↑b i) = ↑f₂ (↑b i)
x : M
⊢ ↑f₁ x = ↑f₂ x

tactic: simp only [LinearMap.map_sum, LinearMap.map_smulₛₗ, h]
state_before: case h
ι : Type u_5
ι' : Type ?u.181637
R : Type u_1
R₂ : Type ?u.181643
K : Type ?u.181646
M : Type u_3
M' : Type ?u.181652
M'' : Type ?u.181655
V : Type u
V' : Type ?u.181660
inst✝⁹ : Semiring R
inst✝⁸ : AddCommMonoid M
inst✝⁷ : Module R M
inst✝⁶ : AddCommMonoid M'
inst✝⁵ : Module R M'
b b₁ : Basis ι R M
i : ι
c : R
x✝ : M
R₁ : Type u_2
inst✝⁴ : Semiring R₁
σ : R →+* R₁
σ' : R₁ →+* R
inst✝³ : RingHomInvPair σ σ'
inst✝² : RingHomInvPair σ' σ
M₁ : Type u_4
inst✝¹ : AddCommMonoid M₁
inst✝ : Module R₁ M₁
f₁ f₂ : M →ₛₗ[σ] M₁
h : ∀ (i : ι), ↑f₁ (↑b i) = ↑f₂ (↑b i)
x : M
⊢ ↑f₁ (∑ a in (↑b.repr x).support, ↑(↑b.repr x) a • ↑b a) = ↑f₂ (∑ a in (↑b.repr x).support, ↑(↑b.repr x) a • ↑b a)
Theorem: Rat.divInt_add_divInt
File: Std/Data/Rat/Lemmas.lean

tactic: rcases Int.eq_nat_or_neg d₁ with ⟨_, rfl | rfl⟩ <;>
rcases Int.eq_nat_or_neg d₂ with ⟨_, rfl | rfl⟩ <;>
simp_all [Int.ofNat_eq_zero, Int.neg_eq_zero, divInt_neg', Int.mul_neg,
  Int.ofNat_mul_ofNat, Int.neg_add, Int.neg_mul, mkRat_add_mkRat]
state_before: n₁ n₂ d₁ d₂ : Int
z₁ : d₁ ≠ 0
z₂ : d₂ ≠ 0
⊢ n₁ /. d₁ + n₂ /. d₂ = (n₁ * d₂ + n₂ * d₁) /. (d₁ * d₂)
Theorem: Ideal.IsLocal.mem_jacobson_or_exists_inv
File: Mathlib/RingTheory/JacobsonIdeal.lean

tactic: rw [← hpq, mul_comm, ← hr, ← neg_sub, add_sub_cancel]
state_before: R : Type u
S : Type v
inst✝ : CommRing R
I : Ideal R
hi : IsLocal I
x : R
h : I ⊔ span {x} = ⊤
p : R
hpi : p ∈ I
q : R
hq : q ∈ span {x}
hpq : p + q = 1
r : R
hr : q = x * r
⊢ r * x - 1 ∈ I

tactic: exact I.neg_mem hpi
state_before: R : Type u
S : Type v
inst✝ : CommRing R
I : Ideal R
hi : IsLocal I
x : R
h : I ⊔ span {x} = ⊤
p : R
hpi : p ∈ I
q : R
hq : q ∈ span {x}
hpq : p + q = 1
r : R
hr : q = x * r
⊢ -p ∈ I
Theorem: IsPreconnected.union'
File: Mathlib/Topology/Connected.lean

tactic: rcases H with ⟨x, hxs, hxt⟩
state_before: α : Type u
β : Type v
ι : Type ?u.4171
π : ι → Type ?u.4176
inst✝ : TopologicalSpace α
s✝ t✝ u v s t : Set α
H : Set.Nonempty (s ∩ t)
hs : IsPreconnected s
ht : IsPreconnected t
⊢ IsPreconnected (s ∪ t)

tactic: exact hs.union x hxs hxt ht
state_before: case intro.intro
α : Type u
β : Type v
ι : Type ?u.4171
π : ι → Type ?u.4176
inst✝ : TopologicalSpace α
s✝ t✝ u v s t : Set α
hs : IsPreconnected s
ht : IsPreconnected t
x : α
hxs : x ∈ s
hxt : x ∈ t
⊢ IsPreconnected (s ∪ t)
Theorem: ContinuousMap.hasSum_apply
File: Mathlib/Topology/ContinuousFunction/Algebra.lean

tactic: let evₓ : AddMonoidHom C(α, β) β := (Pi.evalAddMonoidHom _ x).comp coeFnAddMonoidHom
state_before: α : Type u_2
β : Type u_3
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
γ : Type u_1
inst✝² : LocallyCompactSpace α
inst✝¹ : AddCommMonoid β
inst✝ : ContinuousAdd β
f : γ → C(α, β)
g : C(α, β)
hf : HasSum f g
x : α
⊢ HasSum (fun i => ↑(f i) x) (↑g x)

tactic: exact hf.map evₓ (ContinuousMap.continuous_eval_const' x)
state_before: α : Type u_2
β : Type u_3
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
γ : Type u_1
inst✝² : LocallyCompactSpace α
inst✝¹ : AddCommMonoid β
inst✝ : ContinuousAdd β
f : γ → C(α, β)
g : C(α, β)
hf : HasSum f g
x : α
evₓ : C(α, β) →+ β := AddMonoidHom.comp (Pi.evalAddMonoidHom (fun a => β) x) coeFnAddMonoidHom
⊢ HasSum (fun i => ↑(f i) x) (↑g x)
Theorem: Pi.lex_desc
File: Mathlib/Data/Pi/Lex.lean

tactic: simpa only [Pi.toLex_apply, Function.comp_apply, Equiv.swap_apply_left] using h₂
state_before: ι : Type u_2
β : ι → Type ?u.33701
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
α : Type u_1
inst✝² : Preorder ι
inst✝¹ : DecidableEq ι
inst✝ : Preorder α
f : ι → α
i j : ι
h₁ : i < j
h₂ : f j < f i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (↑toLex (f ∘ ↑(Equiv.swap i j)) i) (↑toLex f i)
Theorem: AddCircle.gcd_mul_addOrderOf_div_eq
File: Mathlib/Topology/Instances/AddCircle.lean

tactic: rw [mul_comm_div, ← nsmul_eq_mul, coe_nsmul, addOrderOf_nsmul'']
state_before: 𝕜 : Type u_1
B : Type ?u.183351
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n m : ℕ
hn : 0 < n
⊢ Nat.gcd m n * addOrderOf ↑(↑m / ↑n * p) = n

tactic: rw [addOrderOf_period_div hn, Nat.gcd_comm, Nat.mul_div_cancel']
state_before: 𝕜 : Type u_1
B : Type ?u.183351
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n m : ℕ
hn : 0 < n
⊢ Nat.gcd m n * (addOrderOf ↑(p / ↑n) / Nat.gcd (addOrderOf ↑(p / ↑n)) m) = n

tactic: exact n.gcd_dvd_left m
state_before: 𝕜 : Type u_1
B : Type ?u.183351
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n m : ℕ
hn : 0 < n
⊢ Nat.gcd n m ∣ n

tactic: rw [← addOrderOf_pos_iff, addOrderOf_period_div hn]
state_before: case h
𝕜 : Type u_1
B : Type ?u.183351
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n m : ℕ
hn : 0 < n
⊢ IsOfFinAddOrder ↑(p / ↑n)

tactic: exact hn
state_before: case h
𝕜 : Type u_1
B : Type ?u.183351
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n m : ℕ
hn : 0 < n
⊢ 0 < n
Theorem: List.get_enumFrom
File: Mathlib/Data/List/Basic.lean

tactic: simpa [length_enumFrom] using i.2
state_before: ι : Type ?u.450946
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ l : List α
n : ℕ
i : Fin (length (enumFrom n l))
⊢ ↑i < length l

tactic: rw [← Option.some_inj, ← get?_eq_get]
state_before: ι : Type ?u.450946
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ l : List α
n : ℕ
i : Fin (length (enumFrom n l))
hi : optParam (↑i < length l) (_ : ↑i < length l)
⊢ get (enumFrom n l) i = (n + ↑i, get l { val := ↑i, isLt := hi })

tactic: simp [enumFrom_get?, get?_eq_get hi]
state_before: ι : Type ?u.450946
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ l : List α
n : ℕ
i : Fin (length (enumFrom n l))
hi : optParam (↑i < length l) (_ : ↑i < length l)
⊢ get? (enumFrom n l) ↑i = some (n + ↑i, get l { val := ↑i, isLt := hi })
Theorem: GeneralizedContinuedFraction.continuants_stable_of_terminated
File: Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean

tactic: simp only [nth_cont_eq_succ_nth_cont_aux,
  continuantsAux_stable_of_terminated (Nat.pred_le_iff.mp n_le_m) terminated_at_n]
state_before: K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_le_m : n ≤ m
terminated_at_n : TerminatedAt g n
⊢ continuants g m = continuants g n
Theorem: thickenedIndicator_mono
File: Mathlib/Topology/MetricSpace/ThickenedIndicator.lean

tactic: intro x
state_before: α : Type u_1
inst✝ : PseudoEMetricSpace α
δ₁ δ₂ : ℝ
δ₁_pos : 0 < δ₁
δ₂_pos : 0 < δ₂
hle : δ₁ ≤ δ₂
E : Set α
⊢ ↑(thickenedIndicator δ₁_pos E) ≤ ↑(thickenedIndicator δ₂_pos E)

tactic: apply (toNNReal_le_toNNReal thickenedIndicatorAux_lt_top.ne thickenedIndicatorAux_lt_top.ne).mpr
state_before: α : Type u_1
inst✝ : PseudoEMetricSpace α
δ₁ δ₂ : ℝ
δ₁_pos : 0 < δ₁
δ₂_pos : 0 < δ₂
hle : δ₁ ≤ δ₂
E : Set α
x : α
⊢ ↑(thickenedIndicator δ₁_pos E) x ≤ ↑(thickenedIndicator δ₂_pos E) x

tactic: apply thickenedIndicatorAux_mono hle
state_before: α : Type u_1
inst✝ : PseudoEMetricSpace α
δ₁ δ₂ : ℝ
δ₁_pos : 0 < δ₁
δ₂_pos : 0 < δ₂
hle : δ₁ ≤ δ₂
E : Set α
x : α
⊢ thickenedIndicatorAux δ₁ E x ≤ thickenedIndicatorAux δ₂ E x
Theorem: le_sdiff_sup
File: Mathlib/Order/Heyting/Basic.lean

tactic: rw [sup_comm, ← sdiff_le_iff]
state_before: ι : Type ?u.90830
α : Type u_1
β : Type ?u.90836
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a ≤ a \ b ⊔ b
Theorem: PolynomialModule.comp_smul
File: Mathlib/Data/Polynomial/Module.lean

tactic: rw [comp_apply, map_smul, eval_smul, Polynomial.comp, Polynomial.eval_map, comp_apply]
state_before: R : Type u_1
M : Type u_2
inst✝¹² : CommRing R
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Module R M
I : Ideal R
S : Type ?u.708718
inst✝⁹ : CommSemiring S
inst✝⁸ : Algebra S R
inst✝⁷ : Module S M
inst✝⁶ : IsScalarTower S R M
R' : Type ?u.711370
M' : Type ?u.711373
inst✝⁵ : CommRing R'
inst✝⁴ : AddCommGroup M'
inst✝³ : Module R' M'
inst✝² : Algebra R R'
inst✝¹ : Module R M'
inst✝ : IsScalarTower R R' M'
p p' : R[X]
q : PolynomialModule R M
⊢ ↑(comp p) (p' • q) = Polynomial.comp p' p • ↑(comp p) q

tactic: rfl
state_before: R : Type u_1
M : Type u_2
inst✝¹² : CommRing R
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Module R M
I : Ideal R
S : Type ?u.708718
inst✝⁹ : CommSemiring S
inst✝⁸ : Algebra S R
inst✝⁷ : Module S M
inst✝⁶ : IsScalarTower S R M
R' : Type ?u.711370
M' : Type ?u.711373
inst✝⁵ : CommRing R'
inst✝⁴ : AddCommGroup M'
inst✝³ : Module R' M'
inst✝² : Algebra R R'
inst✝¹ : Module R M'
inst✝ : IsScalarTower R R' M'
p p' : R[X]
q : PolynomialModule R M
⊢ eval₂ (algebraMap R R[X]) p p' • ↑(eval p) (↑(map R[X] (lsingle R 0)) q) =
    eval₂ C p p' • ↑(eval p) (↑(map R[X] (lsingle R 0)) q)
Theorem: lp.single_neg
File: Mathlib/Analysis/NormedSpace/lpSpace.lean

tactic: refine' ext (funext (fun (j : α) => _))
state_before: α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type ?u.866464
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
⊢ lp.single p i (-a) = -lp.single p i a

tactic: by_cases hi : j = i
state_before: α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type ?u.866464
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
⊢ ↑(lp.single p i (-a)) j = ↑(-lp.single p i a) j

tactic: subst hi
state_before: case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type ?u.866464
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
hi : j = i
⊢ ↑(lp.single p i (-a)) j = ↑(-lp.single p i a) j

tactic: simp [lp.single_apply_self]
state_before: case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type ?u.866464
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
j : α
a : E j
⊢ ↑(lp.single p j (-a)) j = ↑(-lp.single p j a) j

tactic: simp [lp.single_apply_ne p i _ hi]
state_before: case neg
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type ?u.866464
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
hi : ¬j = i
⊢ ↑(lp.single p i (-a)) j = ↑(-lp.single p i a) j
Theorem: Set.ncard_eq_one
File: Mathlib/Data/Set/Ncard.lean

tactic: refine' ⟨fun h ↦ _, by rintro ⟨a, rfl⟩; rw [ncard_singleton]⟩
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a b x y : α
f : α → β
⊢ ncard s = 1 ↔ ∃ a, s = {a}

tactic: have hft := (Finite_of_ncard_ne_zero (ne_zero_of_eq_one h)).fintype
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a b x y : α
f : α → β
h : ncard s = 1
⊢ ∃ a, s = {a}

tactic: simp_rw [ncard_eq_toFinset_card', @Finset.card_eq_one _ (toFinset s)] at h
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a b x y : α
f : α → β
h : ncard s = 1
hft : Fintype ↑s
⊢ ∃ a, s = {a}

tactic: refine' h.imp fun a ha ↦ _
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a b x y : α
f : α → β
hft : Fintype ↑s
h : ∃ a, toFinset s = {a}
⊢ ∃ a, s = {a}

tactic: simp_rw [Set.ext_iff, mem_singleton_iff]
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a✝ b x y : α
f : α → β
hft : Fintype ↑s
h : ∃ a, toFinset s = {a}
a : α
ha : toFinset s = {a}
⊢ s = {a}

tactic: simp only [Finset.ext_iff, mem_toFinset, Finset.mem_singleton] at ha
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a✝ b x y : α
f : α → β
hft : Fintype ↑s
h : ∃ a, toFinset s = {a}
a : α
ha : toFinset s = {a}
⊢ ∀ (x : α), x ∈ s ↔ x = a

tactic: exact ha
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a✝ b x y : α
f : α → β
hft : Fintype ↑s
h : ∃ a, toFinset s = {a}
a : α
ha : ∀ (a_1 : α), a_1 ∈ s ↔ a_1 = a
⊢ ∀ (x : α), x ∈ s ↔ x = a

tactic: rintro ⟨a, rfl⟩
state_before: α : Type u_1
β : Type ?u.138753
s t : Set α
a b x y : α
f : α → β
⊢ (∃ a, s = {a}) → ncard s = 1

tactic: rw [ncard_singleton]
state_before: case intro
α : Type u_1
β : Type ?u.138753
t : Set α
a✝ b x y : α
f : α → β
a : α
⊢ ncard {a} = 1
Theorem: Real.le_toNNReal_iff_coe_le
File: Mathlib/Data/Real/NNReal.lean

tactic: rw [← NNReal.coe_le_coe, Real.coe_toNNReal p hp]
state_before: r : ℝ≥0
p : ℝ
hp : 0 ≤ p
⊢ r ≤ toNNReal p ↔ ↑r ≤ p
Theorem: RatFunc.toFractionRing_smul
File: Mathlib/FieldTheory/RatFunc.lean

tactic: cases p
state_before: K : Type u
inst✝¹ : CommRing K
R : Type u_1
inst✝ : SMul R (FractionRing K[X])
c : R
p : RatFunc K
⊢ (c • p).toFractionRing = c • p.toFractionRing

tactic: rw [← ofFractionRing_smul]
state_before: case ofFractionRing
K : Type u
inst✝¹ : CommRing K
R : Type u_1
inst✝ : SMul R (FractionRing K[X])
c : R
toFractionRing✝ : FractionRing K[X]
⊢ (c • { toFractionRing := toFractionRing✝ }).toFractionRing = c • { toFractionRing := toFractionRing✝ }.toFractionRing
Theorem: Polynomial.modByMonic_eq_self_iff
File: Mathlib/Data/Polynomial/Div.lean

tactic: have : ¬degree q ≤ degree p := not_le_of_gt h
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝¹ : Ring R
p q : R[X]
inst✝ : Nontrivial R
hq : Monic q
h : degree p < degree q
⊢ p %ₘ q = p

tactic: unfold modByMonic divModByMonicAux
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝¹ : Ring R
p q : R[X]
inst✝ : Nontrivial R
hq : Monic q
h : degree p < degree q
this : ¬degree q ≤ degree p
⊢ p %ₘ q = p

tactic: dsimp
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝¹ : Ring R
p q : R[X]
inst✝ : Nontrivial R
hq : Monic q
h : degree p < degree q
this : ¬degree q ≤ degree p
⊢ (if h : Monic q then
      (if h_1 : degree q ≤ degree p ∧ p ≠ 0 then
          let z := ↑C (leadingCoeff p) * X ^ (natDegree p - natDegree q);
          let_fun _wf := (_ : degree (p - ↑C (leadingCoeff p) * X ^ (natDegree p - natDegree q) * q) < degree p);
          let dm := divModByMonicAux (p - z * q) (_ : Monic q);
          (z + dm.fst, dm.snd)
        else (0, p)).snd
    else p) =
    p

tactic: rw [dif_pos hq, if_neg (mt And.left this)]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a b : R
n : ℕ
inst✝¹ : Ring R
p q : R[X]
inst✝ : Nontrivial R
hq : Monic q
h : degree p < degree q
this : ¬degree q ≤ degree p
⊢ (if h : Monic q then
      (if degree q ≤ degree p ∧ ¬p = 0 then
          (↑C (leadingCoeff p) * X ^ (natDegree p - natDegree q) +
              (divModByMonicAux (p - ↑C (leadingCoeff p) * X ^ (natDegree p - natDegree q) * q) (_ : Monic q)).fst,
            (divModByMonicAux (p - ↑C (leadingCoeff p) * X ^ (natDegree p - natDegree q) * q) (_ : Monic q)).snd)
        else (0, p)).snd
    else p) =
    p
Theorem: Monoid.exponentExists_iff_ne_zero
File: Mathlib/GroupTheory/Exponent.lean

tactic: rw [exponent]
state_before: G : Type u
inst✝ : Monoid G
⊢ ExponentExists G ↔ exponent G ≠ 0

tactic: split_ifs with h
state_before: G : Type u
inst✝ : Monoid G
⊢ ExponentExists G ↔ (if h : ExponentExists G then Nat.find h else 0) ≠ 0

tactic: simp [h, @not_lt_zero' ℕ]
state_before: case inl
G : Type u
inst✝ : Monoid G
h : ExponentExists G
⊢ ExponentExists G ↔ Nat.find h ≠ 0

tactic: tauto
state_before: case inr
G : Type u
inst✝ : Monoid G
h : ¬ExponentExists G
⊢ ExponentExists G ↔ 0 ≠ 0
Theorem: MeasureTheory.OuterMeasure.top_caratheodory
File: Mathlib/MeasureTheory/Measure/OuterMeasure.lean

tactic: simp [ht]
state_before: α : Type u_1
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : t = ∅
⊢ ↑⊤ (t ∩ s) + ↑⊤ (t \ s) ≤ ↑⊤ t

tactic: simp only [ht, top_apply, le_top]
state_before: α : Type u_1
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : Set.Nonempty t
⊢ ↑⊤ (t ∩ s) + ↑⊤ (t \ s) ≤ ↑⊤ t
Theorem: Measurable.ennreal_induction
File: Mathlib/MeasureTheory/Function/SimpleFunc.lean

tactic: convert h_iSup (fun n => (eapprox f n).measurable) (monotone_eapprox f) _ using 1
state_before: α : Type u_1
inst✝ : MeasurableSpace α
P : (α → ℝ≥0∞) → Prop
h_ind : ∀ (c : ℝ≥0∞) ⦃s : Set α⦄, MeasurableSet s → P (Set.indicator s fun x => c)
h_add : ∀ ⦃f g : α → ℝ≥0∞⦄, Disjoint (support f) (support g) → Measurable f → Measurable g → P f → P g → P (f + g)
h_iSup :
  ∀ ⦃f : ℕ → α → ℝ≥0∞⦄, (∀ (n : ℕ), Measurable (f n)) → Monotone f → (∀ (n : ℕ), P (f n)) → P fun x => ⨆ (n : ℕ), f n x
f : α → ℝ≥0∞
hf : Measurable f
⊢ P f

tactic: ext1 x
state_before: case h.e'_1
α : Type u_1
inst✝ : MeasurableSpace α
P : (α → ℝ≥0∞) → Prop
h_ind : ∀ (c : ℝ≥0∞) ⦃s : Set α⦄, MeasurableSet s → P (Set.indicator s fun x => c)
h_add : ∀ ⦃f g : α → ℝ≥0∞⦄, Disjoint (support f) (support g) → Measurable f → Measurable g → P f → P g → P (f + g)
h_iSup :
  ∀ ⦃f : ℕ → α → ℝ≥0∞⦄, (∀ (n : ℕ), Measurable (f n)) → Monotone f → (∀ (n : ℕ), P (f n)) → P fun x => ⨆ (n : ℕ), f n x
f : α → ℝ≥0∞
hf : Measurable f
⊢ f = fun x => ⨆ (n : ℕ), ↑(eapprox f n) x

tactic: rw [iSup_eapprox_apply f hf]
state_before: case h.e'_1.h
α : Type u_1
inst✝ : MeasurableSpace α
P : (α → ℝ≥0∞) → Prop
h_ind : ∀ (c : ℝ≥0∞) ⦃s : Set α⦄, MeasurableSet s → P (Set.indicator s fun x => c)
h_add : ∀ ⦃f g : α → ℝ≥0∞⦄, Disjoint (support f) (support g) → Measurable f → Measurable g → P f → P g → P (f + g)
h_iSup :
  ∀ ⦃f : ℕ → α → ℝ≥0∞⦄, (∀ (n : ℕ), Measurable (f n)) → Monotone f → (∀ (n : ℕ), P (f n)) → P fun x => ⨆ (n : ℕ), f n x
f : α → ℝ≥0∞
hf : Measurable f
x : α
⊢ f x = ⨆ (n : ℕ), ↑(eapprox f n) x

tactic: exact fun n =>
  SimpleFunc.induction (fun c s hs => h_ind c hs)
    (fun f g hfg hf hg => h_add hfg f.measurable g.measurable hf hg) (eapprox f n)
state_before: α : Type u_1
inst✝ : MeasurableSpace α
P : (α → ℝ≥0∞) → Prop
h_ind : ∀ (c : ℝ≥0∞) ⦃s : Set α⦄, MeasurableSet s → P (Set.indicator s fun x => c)
h_add : ∀ ⦃f g : α → ℝ≥0∞⦄, Disjoint (support f) (support g) → Measurable f → Measurable g → P f → P g → P (f + g)
h_iSup :
  ∀ ⦃f : ℕ → α → ℝ≥0∞⦄, (∀ (n : ℕ), Measurable (f n)) → Monotone f → (∀ (n : ℕ), P (f n)) → P fun x => ⨆ (n : ℕ), f n x
f : α → ℝ≥0∞
hf : Measurable f
⊢ ∀ (n : ℕ), P ↑(eapprox f n)
Theorem: Subsemigroup.mem_iSup
File: Mathlib/GroupTheory/Subsemigroup/Basic.lean

tactic: rw [← closure_singleton_le_iff_mem, le_iSup_iff]
state_before: M : Type u_2
N : Type ?u.21456
A : Type ?u.21459
inst✝¹ : Mul M
s : Set M
inst✝ : Add A
t : Set A
S : Subsemigroup M
ι : Sort u_1
p : ι → Subsemigroup M
m : M
⊢ (m ∈ ⨆ (i : ι), p i) ↔ ∀ (N : Subsemigroup M), (∀ (i : ι), p i ≤ N) → m ∈ N

tactic: simp only [closure_singleton_le_iff_mem]
state_before: M : Type u_2
N : Type ?u.21456
A : Type ?u.21459
inst✝¹ : Mul M
s : Set M
inst✝ : Add A
t : Set A
S : Subsemigroup M
ι : Sort u_1
p : ι → Subsemigroup M
m : M
⊢ (∀ (b : Subsemigroup M), (∀ (i : ι), p i ≤ b) → closure {m} ≤ b) ↔
    ∀ (N : Subsemigroup M), (∀ (i : ι), p i ≤ N) → m ∈ N
Theorem: CategoryTheory.Limits.biprod.isoProd_inv
File: Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean

tactic: apply biprod.hom_ext <;> simp [Iso.inv_comp_eq]
state_before: J : Type w
C : Type u
inst✝² : Category C
inst✝¹ : HasZeroMorphisms C
P Q X Y : C
inst✝ : HasBinaryBiproduct X Y
⊢ (isoProd X Y).inv = lift prod.fst prod.snd
Theorem: Set.image_prod_mk_subset_prod
File: Mathlib/Data/Set/Prod.lean

tactic: rintro _ ⟨x, hx, rfl⟩
state_before: α : Type u_1
β : Type u_3
γ : Type u_2
δ : Type ?u.83491
s✝ s₁ s₂ : Set α
t t₁ t₂ : Set β
a : α
b : β
f : α → β
g : α → γ
s : Set α
⊢ (fun x => (f x, g x)) '' s ⊆ (f '' s) ×ˢ (g '' s)

tactic: exact mk_mem_prod (mem_image_of_mem f hx) (mem_image_of_mem g hx)
state_before: case intro.intro
α : Type u_1
β : Type u_3
γ : Type u_2
δ : Type ?u.83491
s✝ s₁ s₂ : Set α
t t₁ t₂ : Set β
a : α
b : β
f : α → β
g : α → γ
s : Set α
x : α
hx : x ∈ s
⊢ (fun x => (f x, g x)) x ∈ (f '' s) ×ˢ (g '' s)
Theorem: Multiset.prod_nonneg
File: Mathlib/Algebra/BigOperators/Multiset/Basic.lean

tactic: revert h
state_before: ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
h : ∀ (a : α), a ∈ m → 0 ≤ a
⊢ 0 ≤ prod m

tactic: refine' m.induction_on _ _
state_before: ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
⊢ (∀ (a : α), a ∈ m → 0 ≤ a) → 0 ≤ prod m

tactic: intro a s hs ih
state_before: case refine'_2
ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
⊢ ∀ ⦃a : α⦄ {s : Multiset α},
    ((∀ (a : α), a ∈ s → 0 ≤ a) → 0 ≤ prod s) → (∀ (a_2 : α), a_2 ∈ a ::ₘ s → 0 ≤ a_2) → 0 ≤ prod (a ::ₘ s)

tactic: rw [prod_cons]
state_before: case refine'_2
ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
a : α
s : Multiset α
hs : (∀ (a : α), a ∈ s → 0 ≤ a) → 0 ≤ prod s
ih : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → 0 ≤ a_1
⊢ 0 ≤ prod (a ::ₘ s)

tactic: exact mul_nonneg (ih _ <| mem_cons_self _ _) (hs fun a ha => ih _ <| mem_cons_of_mem ha)
state_before: case refine'_2
ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
a : α
s : Multiset α
hs : (∀ (a : α), a ∈ s → 0 ≤ a) → 0 ≤ prod s
ih : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → 0 ≤ a_1
⊢ 0 ≤ a * prod s

tactic: rintro -
state_before: case refine'_1
ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
⊢ (∀ (a : α), a ∈ 0 → 0 ≤ a) → 0 ≤ prod 0

tactic: rw [prod_zero]
state_before: case refine'_1
ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
⊢ 0 ≤ prod 0

tactic: exact zero_le_one
state_before: case refine'_1
ι : Type ?u.134844
α : Type u_1
β : Type ?u.134850
γ : Type ?u.134853
inst✝ : OrderedCommSemiring α
m : Multiset α
⊢ 0 ≤ 1
Theorem: IsPGroup.to_le
File: Mathlib/GroupTheory/PGroup.lean

tactic: change ((Subgroup.inclusion hHK) a : G) = (Subgroup.inclusion hHK) b
state_before: p : ℕ
G : Type u_1
inst✝ : Group G
H K : Subgroup G
hK : IsPGroup p { x // x ∈ K }
hHK : H ≤ K
a b : { x // x ∈ H }
h : ↑(Subgroup.inclusion hHK) a = ↑(Subgroup.inclusion hHK) b
⊢ ↑a = ↑b

tactic: apply Subtype.ext_iff.mp h
state_before: p : ℕ
G : Type u_1
inst✝ : Group G
H K : Subgroup G
hK : IsPGroup p { x // x ∈ K }
hHK : H ≤ K
a b : { x // x ∈ H }
h : ↑(Subgroup.inclusion hHK) a = ↑(Subgroup.inclusion hHK) b
⊢ ↑(↑(Subgroup.inclusion hHK) a) = ↑(↑(Subgroup.inclusion hHK) b)
Theorem: irrational_nat_mul_iff
File: Mathlib/Data/Real/Irrational.lean

tactic: rw [← cast_coe_nat, irrational_rat_mul_iff, Nat.cast_ne_zero]
state_before: q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (↑n * x) ↔ n ≠ 0 ∧ Irrational x