tasksource/leandojo huggingface dataset:
Theorem: intermediate_value_uIcc
File: Mathlib/Topology/Algebra/Order/IntermediateValue.lean

tactic: cases le_total (f a) (f b) <;> simp [*, isPreconnected_uIcc.intermediate_value]
state_before: α : Type u
β : Type v
γ : Type w
inst✝¹⁰ : ConditionallyCompleteLinearOrder α
inst✝⁹ : TopologicalSpace α
inst✝⁸ : OrderTopology α
inst✝⁷ : ConditionallyCompleteLinearOrder β
inst✝⁶ : TopologicalSpace β
inst✝⁵ : OrderTopology β
inst✝⁴ : Nonempty γ
inst✝³ : DenselyOrdered α
a✝ b✝ : α
δ : Type u_1
inst✝² : LinearOrder δ
inst✝¹ : TopologicalSpace δ
inst✝ : OrderClosedTopology δ
a b : α
f : α → δ
hf : ContinuousOn f (uIcc a b)
⊢ uIcc (f a) (f b) ⊆ f '' uIcc a b
Theorem: RatFunc.num_div
File: Mathlib/FieldTheory/RatFunc.lean

tactic: by_cases hq : q = 0
state_before: K : Type u
inst✝ : Field K
p q : K[X]
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)

tactic: simp [hq]
state_before: case pos
K : Type u
inst✝ : Field K
p q : K[X]
hq : q = 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)

tactic: exact num_div' p hq
state_before: case neg
K : Type u
inst✝ : Field K
p q : K[X]
hq : ¬q = 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)
Theorem: TopCat.stalkToFiber_surjective
File: Mathlib/Topology/Sheaves/LocalPredicate.lean

tactic: rcases w t with ⟨U, f, h, rfl⟩
state_before: X : TopCat
T : ↑X → Type v
P : LocalPredicate T
x : ↑X
w : ∀ (t : T x), ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t
t : T x
⊢ ∃ a, stalkToFiber P x a = t

tactic: fconstructor
state_before: case intro.intro.intro
X : TopCat
T : ↑X → Type v
P : LocalPredicate T
x : ↑X
w : ∀ (t : T x), ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t
U : OpenNhds x
f : (y : { x_1 // x_1 ∈ U.obj }) → T ↑y
h : PrelocalPredicate.pred P.toPrelocalPredicate f
⊢ ∃ a, stalkToFiber P x a = f { val := x, property := (_ : x ∈ U.obj) }

tactic: exact (subsheafToTypes P).presheaf.germ ⟨x, U.2⟩ ⟨f, h⟩
state_before: case intro.intro.intro.w
X : TopCat
T : ↑X → Type v
P : LocalPredicate T
x : ↑X
w : ∀ (t : T x), ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t
U : OpenNhds x
f : (y : { x_1 // x_1 ∈ U.obj }) → T ↑y
h : PrelocalPredicate.pred P.toPrelocalPredicate f
⊢ Presheaf.stalk (Sheaf.presheaf (subsheafToTypes P)) x

tactic: exact stalkToFiber_germ _ U.1 ⟨x, U.2⟩ ⟨f, h⟩
state_before: case intro.intro.intro.h
X : TopCat
T : ↑X → Type v
P : LocalPredicate T
x : ↑X
w : ∀ (t : T x), ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t
U : OpenNhds x
f : (y : { x_1 // x_1 ∈ U.obj }) → T ↑y
h : PrelocalPredicate.pred P.toPrelocalPredicate f
⊢ stalkToFiber P x
      (Presheaf.germ (Sheaf.presheaf (subsheafToTypes P)) { val := x, property := (_ : x ∈ U.obj) }
        { val := f, property := h }) =
    f { val := x, property := (_ : x ∈ U.obj) }
Theorem: Turing.tr_eval'
File: Mathlib/Computability/TuringMachine.lean

tactic: rcases(Part.mem_map_iff _).1 h with ⟨b₁, ab, bb⟩
state_before: σ₁ σ₂ : Type u_1
f₁ : σ₁ → Option σ₁
f₂ : σ₂ → Option σ₂
tr : σ₁ → σ₂
H : Respects f₁ f₂ fun a b => tr a = b
a₁ : σ₁
b₂ : σ₂
h : b₂ ∈ tr <$> eval f₁ a₁
⊢ b₂ ∈ eval f₂ (tr a₁)

tactic: rcases tr_eval H rfl ab with ⟨_, rfl, h⟩
state_before: case intro.intro
σ₁ σ₂ : Type u_1
f₁ : σ₁ → Option σ₁
f₂ : σ₂ → Option σ₂
tr : σ₁ → σ₂
H : Respects f₁ f₂ fun a b => tr a = b
a₁ : σ₁
b₂ : σ₂
h : b₂ ∈ tr <$> eval f₁ a₁
b₁ : σ₁
ab : b₁ ∈ eval f₁ a₁
bb : tr b₁ = b₂
⊢ b₂ ∈ eval f₂ (tr a₁)

tactic: rwa [bb] at h
state_before: case intro.intro.intro.intro
σ₁ σ₂ : Type u_1
f₁ : σ₁ → Option σ₁
f₂ : σ₂ → Option σ₂
tr : σ₁ → σ₂
H : Respects f₁ f₂ fun a b => tr a = b
a₁ : σ₁
b₂ : σ₂
h✝ : b₂ ∈ tr <$> eval f₁ a₁
b₁ : σ₁
ab : b₁ ∈ eval f₁ a₁
bb : tr b₁ = b₂
h : tr b₁ ∈ eval f₂ (tr a₁)
⊢ b₂ ∈ eval f₂ (tr a₁)
Theorem: continuousWithinAt_Ioi_iff_Ici
File: Mathlib/Topology/Algebra/Order/LeftRight.lean

tactic: simp only [← Ici_diff_left, continuousWithinAt_diff_self]
state_before: α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : PartialOrder α
inst✝ : TopologicalSpace β
a : α
f : α → β
⊢ ContinuousWithinAt f (Ioi a) a ↔ ContinuousWithinAt f (Ici a) a
Theorem: Int.sign_eq_zero_iff_zero
File: Std/Data/Int/Lemmas.lean

tactic: rw [h, sign_zero]
state_before: a : Int
h : a = 0
⊢ sign a = 0
Theorem: MeasureTheory.NullMeasurableSet.smul
File: Mathlib/MeasureTheory/Group/Action.lean

tactic: simpa only [← preimage_smul_inv] using
  hs.preimage (measurePreserving_smul _ _).quasiMeasurePreserving
state_before: G : Type u_2
M : Type ?u.37423
α : Type u_1
s✝ : Set α
m : MeasurableSpace α
inst✝⁴ : Group G
inst✝³ : MulAction G α
inst✝² : MeasurableSpace G
inst✝¹ : MeasurableSMul G α
c✝ : G
μ : Measure α
inst✝ : SMulInvariantMeasure G α μ
s : Set α
hs : NullMeasurableSet s
c : G
⊢ NullMeasurableSet (c • s)
Theorem: List.map_filter_eq_foldr
File: Mathlib/Data/List/Basic.lean

tactic: induction' as with head tail
state_before: ι : Type ?u.136885
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
f : α → β
p : α → Bool
as : List α
⊢ map f (filter p as) = foldr (fun a bs => bif p a then f a :: bs else bs) [] as

tactic: rfl
state_before: case nil
ι : Type ?u.136885
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
f : α → β
p : α → Bool
⊢ map f (filter p []) = foldr (fun a bs => bif p a then f a :: bs else bs) [] []

tactic: simp only [foldr]
state_before: case cons
ι : Type ?u.136885
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
f : α → β
p : α → Bool
head : α
tail : List α
tail_ih✝ : map f (filter p tail) = foldr (fun a bs => bif p a then f a :: bs else bs) [] tail
⊢ map f (filter p (head :: tail)) = foldr (fun a bs => bif p a then f a :: bs else bs) [] (head :: tail)

tactic: cases hp : p head <;> simp [filter, *]
state_before: case cons
ι : Type ?u.136885
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
f : α → β
p : α → Bool
head : α
tail : List α
tail_ih✝ : map f (filter p tail) = foldr (fun a bs => bif p a then f a :: bs else bs) [] tail
⊢ map f (filter p (head :: tail)) =
    bif p head then f head :: foldr (fun a bs => bif p a then f a :: bs else bs) [] tail
    else foldr (fun a bs => bif p a then f a :: bs else bs) [] tail
Theorem: integral_cos_sq_sub_sin_sq
File: Mathlib/Analysis/SpecialFunctions/Integrals.lean

tactic: simpa only [sq, sub_eq_add_neg, neg_mul_eq_mul_neg] using
  integral_deriv_mul_eq_sub (fun x _ => hasDerivAt_sin x) (fun x _ => hasDerivAt_cos x)
    continuousOn_cos.intervalIntegrable continuousOn_sin.neg.intervalIntegrable
state_before: a b : ℝ
n : ℕ
⊢ (∫ (x : ℝ) in a..b, cos x ^ 2 - sin x ^ 2) = sin b * cos b - sin a * cos a
Theorem: Real.sign_of_pos
File: Mathlib/Data/Real/Sign.lean

tactic: rw [sign, if_pos hr, if_neg hr.not_lt]
state_before: r : ℝ
hr : 0 < r
⊢ sign r = 1
Theorem: PowerSeries.map_C
File: Mathlib/RingTheory/PowerSeries/Basic.lean

tactic: ext
state_before: R : Type u_2
inst✝² : Semiring R
S : Type u_1
T : Type ?u.2847427
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
r : R
⊢ ↑(map f) (↑(C R) r) = ↑(C ((fun x => S) r)) (↑f r)

tactic: simp [coeff_C, apply_ite f]
state_before: case h
R : Type u_2
inst✝² : Semiring R
S : Type u_1
T : Type ?u.2847427
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
r : R
n✝ : ℕ
⊢ ↑(coeff S n✝) (↑(map f) (↑(C R) r)) = ↑(coeff S n✝) (↑(C ((fun x => S) r)) (↑f r))
Theorem: Ordinal.bsup_le_of_brange_subset
File: Mathlib/SetTheory/Ordinal/Arithmetic.lean

tactic: obtain ⟨j, hj, hj'⟩ := h ⟨i, hi, rfl⟩
state_before: α : Type ?u.316558
β : Type ?u.316561
γ : Type ?u.316564
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal
o' : Ordinal
f : (a : Ordinal) → a < o → Ordinal
g : (a : Ordinal) → a < o' → Ordinal
h : brange o f ⊆ brange o' g
i : Ordinal
hi : i < o
⊢ f i hi ≤ bsup o' g

tactic: rw [← hj']
state_before: case intro.intro
α : Type ?u.316558
β : Type ?u.316561
γ : Type ?u.316564
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal
o' : Ordinal
f : (a : Ordinal) → a < o → Ordinal
g : (a : Ordinal) → a < o' → Ordinal
h : brange o f ⊆ brange o' g
i : Ordinal
hi : i < o
j : Ordinal
hj : j < o'
hj' : g j hj = f i hi
⊢ f i hi ≤ bsup o' g

tactic: apply le_bsup
state_before: case intro.intro
α : Type ?u.316558
β : Type ?u.316561
γ : Type ?u.316564
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal
o' : Ordinal
f : (a : Ordinal) → a < o → Ordinal
g : (a : Ordinal) → a < o' → Ordinal
h : brange o f ⊆ brange o' g
i : Ordinal
hi : i < o
j : Ordinal
hj : j < o'
hj' : g j hj = f i hi
⊢ g j hj ≤ bsup o' g
Theorem: RingQuot.Rel.add_right
File: Mathlib/Algebra/RingQuot.lean

tactic: rw [add_comm a b, add_comm a c]
state_before: R : Type u₁
inst✝³ : Semiring R
S : Type u₂
inst✝² : CommSemiring S
A : Type u₃
inst✝¹ : Semiring A
inst✝ : Algebra S A
r : R → R → Prop
a b c : R
h : Rel r b c
⊢ Rel r (a + b) (a + c)

tactic: exact Rel.add_left h
state_before: R : Type u₁
inst✝³ : Semiring R
S : Type u₂
inst✝² : CommSemiring S
A : Type u₃
inst✝¹ : Semiring A
inst✝ : Algebra S A
r : R → R → Prop
a b c : R
h : Rel r b c
⊢ Rel r (b + a) (c + a)
Theorem: OreLocalization.mul_cancel'
File: Mathlib/RingTheory/OreLocalization/Basic.lean

tactic: simp [oreDiv_mul_char r₁ (s * r₂) s t r₂ 1 (by simp)]
state_before: R : Type u_1
inst✝¹ : Monoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
s t : { x // x ∈ S }
⊢ r₁ /ₒ s * (↑s * r₂ /ₒ t) = r₁ * r₂ /ₒ t

tactic: simp
state_before: R : Type u_1
inst✝¹ : Monoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
s t : { x // x ∈ S }
⊢ ↑s * r₂ * ↑1 = ↑s * r₂
Theorem: IsAlgClosed.cardinal_le_max_transcendence_basis
File: Mathlib/FieldTheory/IsAlgClosed/Classification.lean

tactic: rw [Cardinal.eq.2 ⟨hv.1.aevalEquiv.toEquiv⟩]
state_before: R L K : Type u
inst✝³ : CommRing R
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsAlgClosed K
ι : Type u
v : ι → K
hv✝ hv : IsTranscendenceBasis R v
⊢ max (#{ x // x ∈ Algebra.adjoin R (Set.range v) }) ℵ₀ = max (#MvPolynomial ι R) ℵ₀

tactic: simp [max_assoc]
state_before: R L K : Type u
inst✝³ : CommRing R
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsAlgClosed K
ι : Type u
v : ι → K
hv✝ hv : IsTranscendenceBasis R v
⊢ max (max (max (#R) (#ι)) ℵ₀) ℵ₀ = max (max (#R) (#ι)) ℵ₀
Theorem: GeneralizedContinuedFraction.part_denom_none_iff_s_none
File: Mathlib/Algebra/ContinuedFractions/Translations.lean

tactic: cases s_nth_eq : g.s.get? n <;> simp [partialDenominators, s_nth_eq]
state_before: α : Type u_1
g : GeneralizedContinuedFraction α
n : ℕ
⊢ Stream'.Seq.get? (partialDenominators g) n = none ↔ Stream'.Seq.get? g.s n = none
Theorem: MeasureTheory.sum_measure_le_measure_univ
File: Mathlib/MeasureTheory/Measure/MeasureSpace.lean

tactic: rw [← measure_biUnion_finset H h]
state_before: α : Type u_2
β : Type ?u.39043
γ : Type ?u.39046
δ : Type ?u.39049
ι : Type u_1
R : Type ?u.39055
R' : Type ?u.39058
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : Finset ι
t : ι → Set α
h : ∀ (i : ι), i ∈ s → MeasurableSet (t i)
H : PairwiseDisjoint (↑s) t
⊢ ∑ i in s, ↑↑μ (t i) ≤ ↑↑μ univ

tactic: exact measure_mono (subset_univ _)
state_before: α : Type u_2
β : Type ?u.39043
γ : Type ?u.39046
δ : Type ?u.39049
ι : Type u_1
R : Type ?u.39055
R' : Type ?u.39058
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : Finset ι
t : ι → Set α
h : ∀ (i : ι), i ∈ s → MeasurableSet (t i)
H : PairwiseDisjoint (↑s) t
⊢ ↑↑μ (⋃ (b : ι) (_ : b ∈ s), t b) ≤ ↑↑μ univ
Theorem: CategoryTheory.CoverDense.Types.appHom_restrict
File: Mathlib/CategoryTheory/Sites/DenseSubsite.lean

tactic: refine'
  ((ℱ'.cond _ (H.is_cover X)).valid_glue (pushforwardFamily_compatible H α x) f.unop
        (Presieve.in_coverByImage G f.unop)).trans
    _
state_before: C : Type u_4
inst✝⁴ : Category C
D : Type u_2
inst✝³ : Category D
E : Type ?u.63453
inst✝² : Category E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type ?u.63505
inst✝¹ : Category A
G : C ⥤ D
H : CoverDense K G
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ Type v
ℱ' : SheafOfTypes K
α : Functor.op G ⋙ ℱ ⟶ Functor.op G ⋙ ℱ'.val
X : D
Y : C
f : X.op ⟶ (G.obj Y).op
x : ℱ.obj X.op
⊢ ℱ'.val.map f (appHom H α X x) = α.app Y.op (ℱ.map f x)

tactic: apply pushforwardFamily_apply
state_before: C : Type u_4
inst✝⁴ : Category C
D : Type u_2
inst✝³ : Category D
E : Type ?u.63453
inst✝² : Category E
J : GrothendieckTopology C
K : GrothendieckTopology D
L : GrothendieckTopology E
A : Type ?u.63505
inst✝¹ : Category A
G : C ⥤ D
H : CoverDense K G
inst✝ : Full G
ℱ : Dᵒᵖ ⥤ Type v
ℱ' : SheafOfTypes K
α : Functor.op G ⋙ ℱ ⟶ Functor.op G ⋙ ℱ'.val
X : D
Y : C
f : X.op ⟶ (G.obj Y).op
x : ℱ.obj X.op
⊢ pushforwardFamily α x f.unop (_ : coverByImage G X.op.unop f.unop) = α.app Y.op (ℱ.map f x)
Theorem: AddSubmonoid.one_eq_closure
File: Mathlib/GroupTheory/Submonoid/Pointwise.lean

tactic: rw [closure_singleton_eq, one_eq_mrange]
state_before: α : Type ?u.225159
G : Type ?u.225162
M : Type ?u.225165
R : Type u_1
A : Type ?u.225171
inst✝² : Monoid M
inst✝¹ : AddMonoid A
inst✝ : AddMonoidWithOne R
⊢ 1 = closure {1}

tactic: congr 1
state_before: α : Type ?u.225159
G : Type ?u.225162
M : Type ?u.225165
R : Type u_1
A : Type ?u.225171
inst✝² : Monoid M
inst✝¹ : AddMonoid A
inst✝ : AddMonoidWithOne R
⊢ AddMonoidHom.mrange (Nat.castAddMonoidHom R) = AddMonoidHom.mrange (↑(multiplesHom R) 1)

tactic: ext
state_before: case e_f
α : Type ?u.225159
G : Type ?u.225162
M : Type ?u.225165
R : Type u_1
A : Type ?u.225171
inst✝² : Monoid M
inst✝¹ : AddMonoid A
inst✝ : AddMonoidWithOne R
⊢ Nat.castAddMonoidHom R = ↑(multiplesHom R) 1

tactic: simp
state_before: case e_f.a
α : Type ?u.225159
G : Type ?u.225162
M : Type ?u.225165
R : Type u_1
A : Type ?u.225171
inst✝² : Monoid M
inst✝¹ : AddMonoid A
inst✝ : AddMonoidWithOne R
⊢ ↑(Nat.castAddMonoidHom R) 1 = ↑(↑(multiplesHom R) 1) 1
Theorem: Nat.coprime_add_self_right
File: Mathlib/Data/Nat/GCD/Basic.lean

tactic: rw [coprime, coprime, gcd_add_self_right]
state_before: m n : ℕ
⊢ coprime m (n + m) ↔ coprime m n
Theorem: ClassGroup.mk_eq_mk
File: Mathlib/RingTheory/ClassGroup.lean

tactic: erw [QuotientGroup.mk'_eq_mk', canonicalEquiv_self, Units.map_id, Set.exists_range_iff]
state_before: R : Type u_1
K : Type ?u.318539
L : Type ?u.318542
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I J : (FractionalIdeal R⁰ (FractionRing R))ˣ
⊢ ↑mk I = ↑mk J ↔ ∃ x, I * ↑(toPrincipalIdeal R (FractionRing R)) x = J

tactic: rfl
state_before: R : Type u_1
K : Type ?u.318539
L : Type ?u.318542
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I J : (FractionalIdeal R⁰ (FractionRing R))ˣ
⊢ (∃ i,
      ↑(MonoidHom.id (FractionalIdeal R⁰ (FractionRing R))ˣ) I * ↑(toPrincipalIdeal R (FractionRing R)) i =
        ↑(MonoidHom.id (FractionalIdeal R⁰ (FractionRing R))ˣ) J) ↔
    ∃ x, I * ↑(toPrincipalIdeal R (FractionRing R)) x = J
Theorem: HasDerivAt.div_const
File: Mathlib/Analysis/Calculus/Deriv/Mul.lean

tactic: simpa only [div_eq_mul_inv] using hc.mul_const d⁻¹
state_before: 𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜'
inst✝ : NormedAlgebra 𝕜 𝕜'
c d✝ : 𝕜 → 𝕜'
c' d' : 𝕜'
hc : HasDerivAt c c' x
d : 𝕜'
⊢ HasDerivAt (fun x => c x / d) (c' / d) x
Theorem: Int.testBit_zero
File: Mathlib/Data/Int/Bitwise.lean

tactic: rw [bit_coe_nat]
state_before: b : Bool
n : ℕ
⊢ testBit (bit b ↑n) 0 = b

tactic: apply Nat.testBit_zero
state_before: b : Bool
n : ℕ
⊢ testBit (↑(Nat.bit b n)) 0 = b

tactic: rw [bit_negSucc]
state_before: b : Bool
n : ℕ
⊢ testBit (bit b -[n+1]) 0 = b

tactic: dsimp [testBit]
state_before: b : Bool
n : ℕ
⊢ testBit -[Nat.bit (!b) n+1] 0 = b

tactic: rw [Nat.testBit_zero]
state_before: b : Bool
n : ℕ
⊢ (!Nat.testBit (Nat.bit (!b) n) 0) = b

tactic: clear testBit_zero
state_before: b : Bool
n : ℕ
⊢ (!!b) = b

tactic: cases b <;>
rfl
state_before: b : Bool
n : ℕ
⊢ (!!b) = b
Theorem: Nat.properDivisors_prime_pow
File: Mathlib/NumberTheory/Divisors.lean

tactic: ext a
state_before: n p : ℕ
pp : Prime p
k : ℕ
⊢ properDivisors (p ^ k) = map { toFun := Nat.pow p, inj' := (_ : Function.Injective fun n => p ^ n) } (range k)

tactic: simp only [mem_properDivisors, Nat.isUnit_iff, mem_map, mem_range, Function.Embedding.coeFn_mk,
  pow_eq]
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
⊢ a ∈ properDivisors (p ^ k) ↔ a ∈ map { toFun := Nat.pow p, inj' := (_ : Function.Injective fun n => p ^ n) } (range k)

tactic: have := mem_properDivisors_prime_pow pp k (x := a)
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1, a_1 < k ∧ p ^ a_1 = a

tactic: rw [mem_properDivisors] at this
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∈ properDivisors (p ^ k) ↔ ∃ j x, a = p ^ j
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1, a_1 < k ∧ p ^ a_1 = a

tactic: rw [this]
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1, a_1 < k ∧ p ^ a_1 = a

tactic: refine ⟨?_, ?_⟩
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
⊢ (∃ j x, a = p ^ j) ↔ ∃ a_1, a_1 < k ∧ p ^ a_1 = a

tactic: intro h
state_before: case a.refine_1
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
⊢ (∃ j x, a = p ^ j) → ∃ a_2, a_2 < k ∧ p ^ a_2 = a

tactic: rcases h with ⟨j, hj, hap⟩
state_before: case a.refine_1
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
h : ∃ j x, a = p ^ j
⊢ ∃ a_1, a_1 < k ∧ p ^ a_1 = a

tactic: use j
state_before: case a.refine_1.intro.intro
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
j : ℕ
hj : j < k
hap : a = p ^ j
⊢ ∃ a_1, a_1 < k ∧ p ^ a_1 = a

tactic: tauto
state_before: case a.refine_1.intro.intro
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
j : ℕ
hj : j < k
hap : a = p ^ j
⊢ j < k ∧ p ^ j = a

tactic: tauto
state_before: case a.refine_2
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j x, a = p ^ j
⊢ (∃ a_1, a_1 < k ∧ p ^ a_1 = a) → ∃ j x, a = p ^ j
Theorem: Pi.basis_apply
File: Mathlib/LinearAlgebra/StdBasis.lean

tactic: simp
state_before: R : Type u_3
η : Type u_1
ιs : η → Type u_2
Ms : η → Type u_4
inst✝⁴ : Semiring R
inst✝³ : (i : η) → AddCommMonoid (Ms i)
inst✝² : (i : η) → Module R (Ms i)
inst✝¹ : Fintype η
inst✝ : DecidableEq η
s : (j : η) → Basis (ιs j) R (Ms j)
ji : (j : η) × ιs j
⊢ ↑(Pi.basis s).repr (↑(stdBasis R Ms ji.fst) (↑(s ji.fst) ji.snd)) = Finsupp.single ji 1
Theorem: ContinuousWithinAt.diff_iff
File: Mathlib/Topology/ContinuousOn.lean

tactic: simp only [diff_union_self, subset_union_left]
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.325947
δ : Type ?u.325950
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
f : α → β
s t : Set α
x : α
ht : ContinuousWithinAt f t x
h : ContinuousWithinAt f (s \ t) x
⊢ s ⊆ s \ t ∪ t
Theorem: PGame.neg_star
File: Mathlib/SetTheory/Game/PGame.lean

tactic: simp [star]
state_before: ⊢ -star = star
Theorem: Ordnode.Sized.rotateR
File: Mathlib/Data/Ordmap/Ordset.lean

tactic: rw [dual_rotateR]
state_before: α : Type u_1
l : Ordnode α
x : α
r : Ordnode α
hl : Sized l
hr : Sized r
⊢ Sized (Ordnode.dual (Ordnode.rotateR l x r))

tactic: exact hr.dual.rotateL hl.dual
state_before: α : Type u_1
l : Ordnode α
x : α
r : Ordnode α
hl : Sized l
hr : Sized r
⊢ Sized (Ordnode.rotateL (Ordnode.dual r) x (Ordnode.dual l))
Theorem: Nat.mul_dvd_mul_iff_right
File: Mathlib/Data/Nat/Basic.lean

tactic: rw [mul_right_comm, mul_left_inj' hc.ne']
state_before: m n k a b c : ℕ
hc : 0 < c
d : ℕ
⊢ b * c = a * c * d ↔ b = a * d
Theorem: PNat.mod_le
File: Mathlib/Data/PNat/Basic.lean

tactic: change (mod m k : ℕ) ≤ (m : ℕ) ∧ (mod m k : ℕ) ≤ (k : ℕ)
state_before: m k : ℕ+
⊢ mod m k ≤ m ∧ mod m k ≤ k

tactic: rw [mod_coe]
state_before: m k : ℕ+
⊢ ↑(mod m k) ≤ ↑m ∧ ↑(mod m k) ≤ ↑k

tactic: split_ifs with h
state_before: m k : ℕ+
⊢ (if ↑m % ↑k = 0 then ↑k else ↑m % ↑k) ≤ ↑m ∧ (if ↑m % ↑k = 0 then ↑k else ↑m % ↑k) ≤ ↑k

tactic: have hm : (m : ℕ) > 0 := m.pos
state_before: case inl
m k : ℕ+
h : ↑m % ↑k = 0
⊢ ↑k ≤ ↑m ∧ ↑k ≤ ↑k

tactic: rw [← Nat.mod_add_div (m : ℕ) (k : ℕ), h, zero_add] at hm ⊢
state_before: case inl
m k : ℕ+
h : ↑m % ↑k = 0
hm : ↑m > 0
⊢ ↑k ≤ ↑m ∧ ↑k ≤ ↑k

tactic: by_cases h₁ : (m : ℕ) / (k : ℕ) = 0
state_before: case inl
m k : ℕ+
h : ↑m % ↑k = 0
hm : ↑k * (↑m / ↑k) > 0
⊢ ↑k ≤ ↑k * (↑m / ↑k) ∧ ↑k ≤ ↑k

tactic: rw [h₁, mul_zero] at hm
state_before: case pos
m k : ℕ+
h : ↑m % ↑k = 0
hm : ↑k * (↑m / ↑k) > 0
h₁ : ↑m / ↑k = 0
⊢ ↑k ≤ ↑k * (↑m / ↑k) ∧ ↑k ≤ ↑k

tactic: exact (lt_irrefl _ hm).elim
state_before: case pos
m k : ℕ+
h : ↑m % ↑k = 0
hm : 0 > 0
h₁ : ↑m / ↑k = 0
⊢ ↑k ≤ ↑k * (↑m / ↑k) ∧ ↑k ≤ ↑k

tactic: let h₂ : (k : ℕ) * 1 ≤ k * (m / k) :=
  Nat.mul_le_mul_left (k : ℕ) (Nat.succ_le_of_lt (Nat.pos_of_ne_zero h₁))
state_before: case neg
m k : ℕ+
h : ↑m % ↑k = 0
hm : ↑k * (↑m / ↑k) > 0
h₁ : ¬↑m / ↑k = 0
⊢ ↑k ≤ ↑k * (↑m / ↑k) ∧ ↑k ≤ ↑k

tactic: rw [mul_one] at h₂
state_before: case neg
m k : ℕ+
h : ↑m % ↑k = 0
hm : ↑k * (↑m / ↑k) > 0
h₁ : ¬↑m / ↑k = 0
h₂ : ↑k * 1 ≤ ↑k * (↑m / ↑k) := Nat.mul_le_mul_left (↑k) (succ_le_of_lt (Nat.pos_of_ne_zero h₁))
⊢ ↑k ≤ ↑k * (↑m / ↑k) ∧ ↑k ≤ ↑k

tactic: exact ⟨h₂, le_refl (k : ℕ)⟩
state_before: case neg
m k : ℕ+
h : ↑m % ↑k = 0
hm : ↑k * (↑m / ↑k) > 0
h₁ : ¬↑m / ↑k = 0
h₂ : ↑k ≤ ↑k * (↑m / ↑k)
⊢ ↑k ≤ ↑k * (↑m / ↑k) ∧ ↑k ≤ ↑k

tactic: exact ⟨Nat.mod_le (m : ℕ) (k : ℕ), (Nat.mod_lt (m : ℕ) k.pos).le⟩
state_before: case inr
m k : ℕ+
h : ¬↑m % ↑k = 0
⊢ ↑m % ↑k ≤ ↑m ∧ ↑m % ↑k ≤ ↑k
Theorem: Submodule.eq_bot_of_subsingleton
File: Mathlib/Algebra/Module/Submodule/Lattice.lean

tactic: rw [eq_bot_iff]
state_before: R : Type u_1
S : Type ?u.48789
M : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid M
inst✝⁴ : Module R M
inst✝³ : Module S M
inst✝² : SMul S R
inst✝¹ : IsScalarTower S R M
p✝ q p : Submodule R M
inst✝ : Subsingleton { x // x ∈ p }
⊢ p = ⊥

tactic: intro v hv
state_before: R : Type u_1
S : Type ?u.48789
M : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid M
inst✝⁴ : Module R M
inst✝³ : Module S M
inst✝² : SMul S R
inst✝¹ : IsScalarTower S R M
p✝ q p : Submodule R M
inst✝ : Subsingleton { x // x ∈ p }
⊢ p ≤ ⊥

tactic: exact congr_arg Subtype.val (Subsingleton.elim (⟨v, hv⟩ : p) 0)
state_before: R : Type u_1
S : Type ?u.48789
M : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid M
inst✝⁴ : Module R M
inst✝³ : Module S M
inst✝² : SMul S R
inst✝¹ : IsScalarTower S R M
p✝ q p : Submodule R M
inst✝ : Subsingleton { x // x ∈ p }
v : M
hv : v ∈ p
⊢ v ∈ ⊥