tasksource/leandojo huggingface dataset:
Theorem: Rel.abs_edgeDensity_sub_edgeDensity_le_one_sub_mul
File: Mathlib/Combinatorics/SimpleGraph/Density.lean

tactic: refine' abs_sub_le_iff.2 ⟨edgeDensity_sub_edgeDensity_le_one_sub_mul r hs ht hs₂ ht₂, _⟩
state_before: 𝕜 : Type ?u.36968
ι : Type ?u.36971
κ : Type ?u.36974
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrderedField 𝕜
r : α → β → Prop
inst✝ : (a : α) → DecidablePred (r a)
s s₁ s₂ : Finset α
t t₁ t₂ : Finset β
a : α
b : β
δ : 𝕜
hs : s₂ ⊆ s₁
ht : t₂ ⊆ t₁
hs₂ : Finset.Nonempty s₂
ht₂ : Finset.Nonempty t₂
⊢ abs (edgeDensity r s₂ t₂ - edgeDensity r s₁ t₁) ≤ 1 - ↑(card s₂) / ↑(card s₁) * (↑(card t₂) / ↑(card t₁))

tactic: rw [← add_sub_cancel (edgeDensity r s₁ t₁) (edgeDensity (fun x y ↦ ¬r x y) s₁ t₁),
  ← add_sub_cancel (edgeDensity r s₂ t₂) (edgeDensity (fun x y ↦ ¬r x y) s₂ t₂),
  edgeDensity_add_edgeDensity_compl _ (hs₂.mono hs) (ht₂.mono ht),
  edgeDensity_add_edgeDensity_compl _ hs₂ ht₂, sub_sub_sub_cancel_left]
state_before: 𝕜 : Type ?u.36968
ι : Type ?u.36971
κ : Type ?u.36974
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrderedField 𝕜
r : α → β → Prop
inst✝ : (a : α) → DecidablePred (r a)
s s₁ s₂ : Finset α
t t₁ t₂ : Finset β
a : α
b : β
δ : 𝕜
hs : s₂ ⊆ s₁
ht : t₂ ⊆ t₁
hs₂ : Finset.Nonempty s₂
ht₂ : Finset.Nonempty t₂
⊢ edgeDensity r s₁ t₁ - edgeDensity r s₂ t₂ ≤ 1 - ↑(card s₂) / ↑(card s₁) * (↑(card t₂) / ↑(card t₁))

tactic: exact edgeDensity_sub_edgeDensity_le_one_sub_mul _ hs ht hs₂ ht₂
state_before: 𝕜 : Type ?u.36968
ι : Type ?u.36971
κ : Type ?u.36974
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrderedField 𝕜
r : α → β → Prop
inst✝ : (a : α) → DecidablePred (r a)
s s₁ s₂ : Finset α
t t₁ t₂ : Finset β
a : α
b : β
δ : 𝕜
hs : s₂ ⊆ s₁
ht : t₂ ⊆ t₁
hs₂ : Finset.Nonempty s₂
ht₂ : Finset.Nonempty t₂
⊢ edgeDensity (fun x y => ¬r x y) s₂ t₂ - edgeDensity (fun x y => ¬r x y) s₁ t₁ ≤
    1 - ↑(card s₂) / ↑(card s₁) * (↑(card t₂) / ↑(card t₁))
Theorem: CategoryTheory.Presieve.extend_restrict
File: Mathlib/CategoryTheory/Sites/SheafOfTypes.lean

tactic: rw [compatible_iff_sieveCompatible] at t
state_before: C : Type u₁
inst✝ : Category C
P Q U : Cᵒᵖ ⥤ Type w
X Y : C
S : Sieve X
R : Presieve X
J J₂ : GrothendieckTopology C
x : FamilyOfElements P (generate R).arrows
t : FamilyOfElements.Compatible x
⊢ FamilyOfElements.sieveExtend (FamilyOfElements.restrict (_ : R ≤ (generate R).arrows) x) = x

tactic: funext _ _ h
state_before: C : Type u₁
inst✝ : Category C
P Q U : Cᵒᵖ ⥤ Type w
X Y : C
S : Sieve X
R : Presieve X
J J₂ : GrothendieckTopology C
x : FamilyOfElements P (generate R).arrows
t : FamilyOfElements.SieveCompatible x
⊢ FamilyOfElements.sieveExtend (FamilyOfElements.restrict (_ : R ≤ (generate R).arrows) x) = x

tactic: apply (t _ _ _).symm.trans
state_before: case h.h.h
C : Type u₁
inst✝ : Category C
P Q U : Cᵒᵖ ⥤ Type w
X Y : C
S : Sieve X
R : Presieve X
J J₂ : GrothendieckTopology C
x : FamilyOfElements P (generate R).arrows
t : FamilyOfElements.SieveCompatible x
x✝¹ : C
x✝ : x✝¹ ⟶ X
h : (generate R).arrows x✝
⊢ FamilyOfElements.sieveExtend (FamilyOfElements.restrict (_ : R ≤ (generate R).arrows) x) x✝ h = x x✝ h

tactic: congr
state_before: case h.h.h
C : Type u₁
inst✝ : Category C
P Q U : Cᵒᵖ ⥤ Type w
X Y : C
S : Sieve X
R : Presieve X
J J₂ : GrothendieckTopology C
x : FamilyOfElements P (generate R).arrows
t : FamilyOfElements.SieveCompatible x
x✝¹ : C
x✝ : x✝¹ ⟶ X
h : (generate R).arrows x✝
⊢ x
      (Exists.choose (_ : ∃ h_1 g, R g ∧ h_1 ≫ g = x✝) ≫
        Exists.choose (_ : ∃ g, R g ∧ Exists.choose (_ : ∃ h_1 g, R g ∧ h_1 ≫ g = x✝) ≫ g = x✝))
      (_ :
        (generate R).arrows
          (Exists.choose (_ : ∃ h_1 g, R g ∧ h_1 ≫ g = x✝) ≫
            Exists.choose (_ : ∃ g, R g ∧ Exists.choose (_ : ∃ h_1 g, R g ∧ h_1 ≫ g = x✝) ≫ g = x✝))) =
    x x✝ h

tactic: exact h.choose_spec.choose_spec.choose_spec.2
state_before: case h.h.h.e_f
C : Type u₁
inst✝ : Category C
P Q U : Cᵒᵖ ⥤ Type w
X Y : C
S : Sieve X
R : Presieve X
J J₂ : GrothendieckTopology C
x : FamilyOfElements P (generate R).arrows
t : FamilyOfElements.SieveCompatible x
x✝¹ : C
x✝ : x✝¹ ⟶ X
h : (generate R).arrows x✝
⊢ Exists.choose (_ : ∃ h_1 g, R g ∧ h_1 ≫ g = x✝) ≫
      Exists.choose (_ : ∃ g, R g ∧ Exists.choose (_ : ∃ h_1 g, R g ∧ h_1 ≫ g = x✝) ≫ g = x✝) =
    x✝
Theorem: Padic.div_nat_pos
File: Mathlib/NumberTheory/Padics/PadicNumbers.lean

tactic: exact_mod_cast succ_pos _
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : CauSeq ℚ_[p] ↑padicNormE
n : ℕ
⊢ 0 < ↑n + 1
Theorem: Nat.pow_dvd_pow_iff
File: Mathlib/Data/Nat/GCD/Basic.lean

tactic: refine' ⟨fun h => _, fun h => pow_dvd_pow_of_dvd h _⟩
state_before: a b n : ℕ
n0 : 0 < n
⊢ a ^ n ∣ b ^ n ↔ a ∣ b

tactic: cases' Nat.eq_zero_or_pos (gcd a b) with g0 g0
state_before: a b n : ℕ
n0 : 0 < n
h : a ^ n ∣ b ^ n
⊢ a ∣ b

tactic: rcases exists_coprime' g0 with ⟨g, a', b', g0', co, rfl, rfl⟩
state_before: case inr
a b n : ℕ
n0 : 0 < n
h : a ^ n ∣ b ^ n
g0 : gcd a b > 0
⊢ a ∣ b

tactic: rw [mul_pow, mul_pow] at h
state_before: case inr.intro.intro.intro.intro.intro.intro
n : ℕ
n0 : 0 < n
g : ℕ
a' b' : ℕ
g0' : 0 < g
co : coprime a' b'
h : (a' * g) ^ n ∣ (b' * g) ^ n
g0 : gcd (a' * g) (b' * g) > 0
⊢ a' * g ∣ b' * g

tactic: replace h := Nat.dvd_of_mul_dvd_mul_right (pow_pos g0' _) h
state_before: case inr.intro.intro.intro.intro.intro.intro
n : ℕ
n0 : 0 < n
g : ℕ
a' b' : ℕ
g0' : 0 < g
co : coprime a' b'
h : a' ^ n * g ^ n ∣ b' ^ n * g ^ n
g0 : gcd (a' * g) (b' * g) > 0
⊢ a' * g ∣ b' * g

tactic: have := pow_dvd_pow a' n0
state_before: case inr.intro.intro.intro.intro.intro.intro
n : ℕ
n0 : 0 < n
g : ℕ
a' b' : ℕ
g0' : 0 < g
co : coprime a' b'
g0 : gcd (a' * g) (b' * g) > 0
h : a' ^ n ∣ b' ^ n
⊢ a' * g ∣ b' * g

tactic: rw [pow_one, (co.pow n n).eq_one_of_dvd h] at this
state_before: case inr.intro.intro.intro.intro.intro.intro
n : ℕ
n0 : 0 < n
g : ℕ
a' b' : ℕ
g0' : 0 < g
co : coprime a' b'
g0 : gcd (a' * g) (b' * g) > 0
h : a' ^ n ∣ b' ^ n
this : a' ^ succ 0 ∣ a' ^ n
⊢ a' * g ∣ b' * g

tactic: simp [eq_one_of_dvd_one this]
state_before: case inr.intro.intro.intro.intro.intro.intro
n : ℕ
n0 : 0 < n
g : ℕ
a' b' : ℕ
g0' : 0 < g
co : coprime a' b'
g0 : gcd (a' * g) (b' * g) > 0
h : a' ^ n ∣ b' ^ n
this : a' ∣ 1
⊢ a' * g ∣ b' * g

tactic: simp [eq_zero_of_gcd_eq_zero_right g0]
state_before: case inl
a b n : ℕ
n0 : 0 < n
h : a ^ n ∣ b ^ n
g0 : gcd a b = 0
⊢ a ∣ b
Theorem: Nat.xgcd_zero_left
File: Mathlib/Data/Int/GCD.lean

tactic: simp [xgcdAux]
state_before: s t : ℤ
r' : ℕ
s' t' : ℤ
⊢ xgcdAux 0 s t r' s' t' = (r', s', t')
Theorem: PowerSeries.rescale_mk
File: Mathlib/RingTheory/PowerSeries/Basic.lean

tactic: ext
state_before: R : Type u_1
inst✝ : CommSemiring R
f : ℕ → R
a : R
⊢ ↑(rescale a) (mk f) = mk fun n => a ^ n * f n

tactic: rw [coeff_rescale, coeff_mk, coeff_mk]
state_before: case h
R : Type u_1
inst✝ : CommSemiring R
f : ℕ → R
a : R
n✝ : ℕ
⊢ ↑(coeff R n✝) (↑(rescale a) (mk f)) = ↑(coeff R n✝) (mk fun n => a ^ n * f n)
Theorem: MeasureTheory.weightedSMul_smul
File: Mathlib/MeasureTheory/Integral/Bochner.lean

tactic: simp_rw [weightedSMul_apply, smul_comm]
state_before: α : Type u_3
E : Type ?u.60121
F : Type u_2
𝕜 : Type u_1
inst✝⁴ : NormedAddCommGroup F
inst✝³ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
inst✝² : NormedField 𝕜
inst✝¹ : NormedSpace 𝕜 F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
s : Set α
x : F
⊢ ↑(weightedSMul μ s) (c • x) = c • ↑(weightedSMul μ s) x
Theorem: MvPolynomial.degrees_indicator
File: Mathlib/FieldTheory/Finite/Polynomial.lean

tactic: rw [indicator]
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
⊢ degrees (indicator c) ≤ ∑ s : σ, (Fintype.card K - 1) • {s}

tactic: refine' le_trans (degrees_prod _ _) (Finset.sum_le_sum fun s _ => _)
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
⊢ degrees (∏ n : σ, (1 - (X n - ↑C (c n)) ^ (Fintype.card K - 1))) ≤ ∑ s : σ, (Fintype.card K - 1) • {s}

tactic: refine' le_trans (degrees_sub _ _) _
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
s : σ
x✝ : s ∈ Finset.univ
⊢ degrees (1 - (X s - ↑C (c s)) ^ (Fintype.card K - 1)) ≤ (Fintype.card K - 1) • {s}

tactic: rw [degrees_one, ← bot_eq_zero, bot_sup_eq]
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
s : σ
x✝ : s ∈ Finset.univ
⊢ degrees 1 ⊔ degrees ((X s - ↑C (c s)) ^ (Fintype.card K - 1)) ≤ (Fintype.card K - 1) • {s}

tactic: refine' le_trans (degrees_pow _ _) (nsmul_le_nsmul_of_le_right _ _)
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
s : σ
x✝ : s ∈ Finset.univ
⊢ degrees ((X s - ↑C (c s)) ^ (Fintype.card K - 1)) ≤ (Fintype.card K - 1) • {s}

tactic: refine' le_trans (degrees_sub _ _) _
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
s : σ
x✝ : s ∈ Finset.univ
⊢ degrees (X s - ↑C (c s)) ≤ {s}

tactic: rw [degrees_C, ← bot_eq_zero, sup_bot_eq]
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
s : σ
x✝ : s ∈ Finset.univ
⊢ degrees (X s) ⊔ degrees (↑C (c s)) ≤ {s}

tactic: exact degrees_X' _
state_before: K : Type u_2
σ : Type u_1
inst✝² : Fintype K
inst✝¹ : Fintype σ
inst✝ : CommRing K
c : σ → K
s : σ
x✝ : s ∈ Finset.univ
⊢ degrees (X s) ≤ {s}
Theorem: CategoryTheory.Limits.Types.Image.lift_fac
File: Mathlib/CategoryTheory/Limits/Types.lean

tactic: funext x
state_before: J : Type v
inst✝ : SmallCategory J
α β : Type u
f : α ⟶ β
F' : MonoFactorisation f
⊢ lift F' ≫ F'.m = ι f

tactic: change (F'.e ≫ F'.m) _ = _
state_before: case h
J : Type v
inst✝ : SmallCategory J
α β : Type u
f : α ⟶ β
F' : MonoFactorisation f
x : Image f
⊢ (lift F' ≫ F'.m) x = ι f x

tactic: rw [F'.fac, (Classical.indefiniteDescription _ x.2).2]
state_before: case h
J : Type v
inst✝ : SmallCategory J
α β : Type u
f : α ⟶ β
F' : MonoFactorisation f
x : Image f
⊢ (F'.e ≫ F'.m) ↑(Classical.indefiniteDescription (fun x_1 => f x_1 = ↑x) (_ : ↑x ∈ Set.range f)) = ι f x

tactic: rfl
state_before: case h
J : Type v
inst✝ : SmallCategory J
α β : Type u
f : α ⟶ β
F' : MonoFactorisation f
x : Image f
⊢ ↑x = ι f x
Theorem: EReal.coe_toReal
File: Mathlib/Data/Real/EReal.lean

tactic: lift x to ℝ using ⟨hx, h'x⟩
state_before: x : EReal
hx : x ≠ ⊤
h'x : x ≠ ⊥
⊢ ↑(toReal x) = x

tactic: rfl
state_before: case intro
x : ℝ
hx : ↑x ≠ ⊤
h'x : ↑x ≠ ⊥
⊢ ↑(toReal ↑x) = ↑x
Theorem: LowerSet.one_mul
File: Mathlib/Algebra/Order/UpperLower.lean

tactic: rw [← smul_eq_mul, ← Set.iUnion_smul_set]
state_before: α : Type u_1
inst✝ : OrderedCommGroup α
s✝ t : Set α
a : α
s : LowerSet α
⊢ Set.Iic 1 * ↑s ⊆ ↑s

tactic: exact Set.iUnion₂_subset fun _ ↦ s.lower.smul_subset
state_before: α : Type u_1
inst✝ : OrderedCommGroup α
s✝ t : Set α
a : α
s : LowerSet α
⊢ (⋃ (a : α) (_ : a ∈ Set.Iic 1), a • ↑s) ⊆ ↑s
Theorem: Nat.Iio_eq_range
File: Mathlib/Data/Nat/Interval.lean

tactic: ext (b x)
state_before: a b c : ℕ
⊢ Iio = range

tactic: rw [mem_Iio, mem_range]
state_before: case h.a
a b✝ c b x : ℕ
⊢ x ∈ Iio b ↔ x ∈ range b
Theorem: List.Chain'.two_mul_count_bool_eq_ite
File: Mathlib/Data/Bool/Count.lean

tactic: by_cases h2 : Even (length l)
state_before: l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) l
b : Bool
⊢ 2 * count b l =
    if Even (length l) then length l else if (some b == head? l) = true then length l + 1 else length l - 1

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

tactic: cases' l with x l
state_before: case neg
l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) l
b : Bool
h2 : ¬Even (length l)
⊢ 2 * count b l =
    if Even (length l) then length l else if (some b == head? l) = true then length l + 1 else length l - 1

tactic: simp only [if_neg h2, count_cons', mul_add, head?, Option.mem_some_iff, @eq_comm _ x]
state_before: case neg.cons
b x : Bool
l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) (x :: l)
h2 : ¬Even (length (x :: l))
⊢ 2 * count b (x :: l) =
    if Even (length (x :: l)) then length (x :: l)
    else if (some b == head? (x :: l)) = true then length (x :: l) + 1 else length (x :: l) - 1

tactic: rw [length_cons, Nat.even_add_one, not_not] at h2
state_before: case neg.cons
b x : Bool
l : List Bool
hl : Chain' (fun x x_1 => x ≠ x_1) (x :: l)
h2 : ¬Even (length (x :: l))
⊢ (2 * count b l + 2 * if b = x then 1 else 0) =
    if (some b == some x) = true then length (x :: l) + 1 else length (x :: l) - 1

tactic: rw [hl.two_mul_count_bool_of_even h2]
state_before: case neg.cons
b x : Bool
l : List Bool
h2 : Even (length l)
hl : Chain' (fun x x_1 => x ≠ x_1) l
⊢ (2 * count b l + 2 * if b = x then 1 else 0) =
    if (some b == some x) = true then length (x :: l) + 1 else length (x :: l) - 1

tactic: cases b <;> cases x <;> split_ifs <;> simp <;> contradiction
state_before: case neg.cons
b x : Bool
l : List Bool
h2 : Even (length l)
hl : Chain' (fun x x_1 => x ≠ x_1) l
⊢ (length l + 2 * if b = x then 1 else 0) =
    if (some b == some x) = true then length (x :: l) + 1 else length (x :: l) - 1

tactic: exact (h2 even_zero).elim
state_before: case neg.nil
b : Bool
hl : Chain' (fun x x_1 => x ≠ x_1) []
h2 : ¬Even (length [])
⊢ 2 * count b [] =
    if Even (length []) then length [] else if (some b == head? []) = true then length [] + 1 else length [] - 1
Theorem: inv_mul_mul_self
File: Mathlib/Algebra/GroupWithZero/Basic.lean

tactic: by_cases h : a = 0
state_before: α : Type ?u.25133
M₀ : Type ?u.25136
G₀ : Type u_1
M₀' : Type ?u.25142
G₀' : Type ?u.25145
F : Type ?u.25148
F' : Type ?u.25151
inst✝ : GroupWithZero G₀
a✝ b c a : G₀
⊢ a⁻¹ * a * a = a

tactic: rw [h, inv_zero, mul_zero]
state_before: case pos
α : Type ?u.25133
M₀ : Type ?u.25136
G₀ : Type u_1
M₀' : Type ?u.25142
G₀' : Type ?u.25145
F : Type ?u.25148
F' : Type ?u.25151
inst✝ : GroupWithZero G₀
a✝ b c a : G₀
h : a = 0
⊢ a⁻¹ * a * a = a

tactic: rw [inv_mul_cancel h, one_mul]
state_before: case neg
α : Type ?u.25133
M₀ : Type ?u.25136
G₀ : Type u_1
M₀' : Type ?u.25142
G₀' : Type ?u.25145
F : Type ?u.25148
F' : Type ?u.25151
inst✝ : GroupWithZero G₀
a✝ b c a : G₀
h : ¬a = 0
⊢ a⁻¹ * a * a = a
Theorem: lt_of_smul_lt_smul_of_nonpos
File: Mathlib/Algebra/Order/Module.lean

tactic: rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff] at h
state_before: k : Type u_2
M : Type u_1
N : Type ?u.22212
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c : k
h : c • a < c • b
hc : c ≤ 0
⊢ b < a

tactic: exact lt_of_smul_lt_smul_of_nonneg h (neg_nonneg_of_nonpos hc)
state_before: k : Type u_2
M : Type u_1
N : Type ?u.22212
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c : k
h : -c • b < -c • a
hc : c ≤ 0
⊢ b < a
Theorem: DistribMulActionHom.id_apply
File: Mathlib/Algebra/Hom/GroupAction.lean

tactic: rfl
state_before: M' : Type ?u.147246
X : Type ?u.147249
inst✝²³ : SMul M' X
Y : Type ?u.147256
inst✝²² : SMul M' Y
Z : Type ?u.147263
inst✝²¹ : SMul M' Z
M : Type u_2
inst✝²⁰ : Monoid M
A : Type u_1
inst✝¹⁹ : AddMonoid A
inst✝¹⁸ : DistribMulAction M A
A' : Type ?u.147304
inst✝¹⁷ : AddGroup A'
inst✝¹⁶ : DistribMulAction M A'
B : Type ?u.147580
inst✝¹⁵ : AddMonoid B
inst✝¹⁴ : DistribMulAction M B
B' : Type ?u.147606
inst✝¹³ : AddGroup B'
inst✝¹² : DistribMulAction M B'
C : Type ?u.147882
inst✝¹¹ : AddMonoid C
inst✝¹⁰ : DistribMulAction M C
R : Type ?u.147908
inst✝⁹ : Semiring R
inst✝⁸ : MulSemiringAction M R
R' : Type ?u.147935
inst✝⁷ : Ring R'
inst✝⁶ : MulSemiringAction M R'
S : Type ?u.148131
inst✝⁵ : Semiring S
inst✝⁴ : MulSemiringAction M S
S' : Type ?u.148158
inst✝³ : Ring S'
inst✝² : MulSemiringAction M S'
T : Type ?u.148354
inst✝¹ : Semiring T
inst✝ : MulSemiringAction M T
x : A
⊢ ↑(DistribMulActionHom.id M) x = x
Theorem: Multiset.nsmul_singleton
File: Mathlib/Data/Multiset/Basic.lean

tactic: rw [← replicate_one, nsmul_replicate, mul_one]
state_before: α : Type u_1
β : Type ?u.91193
γ : Type ?u.91196
a : α
n : ℕ
⊢ n • {a} = replicate n a
Theorem: finrank_span_finset_le_card
File: Mathlib/LinearAlgebra/Finrank.lean

tactic: simp
state_before: K : Type u
V : Type v
inst✝² : DivisionRing K
inst✝¹ : AddCommGroup V
inst✝ : Module K V
s : Finset V
⊢ Finset.card (Set.toFinset ↑s) = Finset.card s
Theorem: mul_inv_le_iff_le_mul'
File: Mathlib/Algebra/Order/Group/Defs.lean

tactic: rw [← inv_mul_le_iff_le_mul, mul_comm]
state_before: α : Type u
inst✝² : CommGroup α
inst✝¹ : LE α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ a * b⁻¹ ≤ c ↔ a ≤ b * c
Theorem: CategoryTheory.MonoidalCategory.id_tensor_rightUnitor_inv
File: Mathlib/CategoryTheory/Monoidal/CoherenceLemmas.lean

tactic: coherence
state_before: C : Type u_2
inst✝¹ : Category C
inst✝ : MonoidalCategory C
X Y : C
⊢ 𝟙 X ⊗ (ρ_ Y).inv = (ρ_ (X ⊗ Y)).inv ≫ (α_ X Y tensorUnit').hom
Theorem: smul_sphere'
File: Mathlib/Analysis/NormedSpace/Pointwise.lean

tactic: ext y
state_before: 𝕜 : Type u_1
E : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
c : 𝕜
hc : c ≠ 0
x : E
r : ℝ
⊢ c • sphere x r = sphere (c • x) (‖c‖ * r)

tactic: rw [mem_smul_set_iff_inv_smul_mem₀ hc]
state_before: case h
𝕜 : Type u_1
E : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
c : 𝕜
hc : c ≠ 0
x : E
r : ℝ
y : E
⊢ y ∈ c • sphere x r ↔ y ∈ sphere (c • x) (‖c‖ * r)

tactic: conv_lhs => rw [← inv_smul_smul₀ hc x]
state_before: case h
𝕜 : Type u_1
E : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
c : 𝕜
hc : c ≠ 0
x : E
r : ℝ
y : E
⊢ c⁻¹ • y ∈ sphere x r ↔ y ∈ sphere (c • x) (‖c‖ * r)

tactic: simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne',
  mul_comm r]
state_before: case h
𝕜 : Type u_1
E : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
c : 𝕜
hc : c ≠ 0
x : E
r : ℝ
y : E
⊢ c⁻¹ • y ∈ sphere (c⁻¹ • c • x) r ↔ y ∈ sphere (c • x) (‖c‖ * r)
Theorem: Nat.doubleFactorial_two_mul
File: Mathlib/Data/Nat/Factorial/DoubleFactorial.lean

tactic: rw [mul_add, mul_one, doubleFactorial_add_two, factorial, pow_succ, doubleFactorial_two_mul _,
  succ_eq_add_one]
state_before: n : ℕ
⊢ (2 * (n + 1))‼ = 2 ^ (n + 1) * (n + 1)!

tactic: ring
state_before: n : ℕ
⊢ (2 * n + 2) * (2 ^ n * n !) = 2 ^ n * 2 * ((n + 1) * n !)
Theorem: dist_le_tsum_dist_of_tendsto₀
File: Mathlib/Topology/Algebra/InfiniteSum/Real.lean

tactic: simpa only [zero_add] using dist_le_tsum_dist_of_tendsto h ha 0
state_before: α : Type u_1
inst✝ : PseudoMetricSpace α
f : ℕ → α
a : α
h : Summable fun n => dist (f n) (f (Nat.succ n))
ha : Tendsto f atTop (𝓝 a)
⊢ dist (f 0) a ≤ ∑' (n : ℕ), dist (f n) (f (Nat.succ n))
Theorem: Behrend.lower_bound_le_one
File: Mathlib/Combinatorics/Additive/Behrend.lean

tactic: obtain rfl | hN := hN.eq_or_lt
state_before: α : Type ?u.881020
β : Type ?u.881023
n d k N : ℕ
x : Fin n → ℕ
hN : 1 ≤ N
hN' : N ≤ 4096
⊢ ↑N * exp (-4 * Real.sqrt (log ↑N)) ≤ 1

tactic: norm_num
state_before: case inl
α : Type ?u.881020
β : Type ?u.881023
n d k : ℕ
x : Fin n → ℕ
hN : 1 ≤ 1
hN' : 1 ≤ 4096
⊢ ↑1 * exp (-4 * Real.sqrt (log ↑1)) ≤ 1

tactic: exact lower_bound_le_one' hN hN'
state_before: case inr
α : Type ?u.881020
β : Type ?u.881023
n d k N : ℕ
x : Fin n → ℕ
hN✝ : 1 ≤ N
hN' : N ≤ 4096
hN : 1 < N
⊢ ↑N * exp (-4 * Real.sqrt (log ↑N)) ≤ 1
Theorem: List.enum_get?
File: Mathlib/Data/List/Basic.lean

tactic: simp only [enum, enumFrom_get?, zero_add]
state_before: ι : Type ?u.431551
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
⊢ ∀ (l : List α) (n : ℕ), get? (enum l) n = (fun a => (n, a)) <$> get? l n

tactic: intros
state_before: ι : Type ?u.431551
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
⊢ List α → ℕ → True

tactic: trivial
state_before: ι : Type ?u.431551
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ l✝ : List α
n✝ : ℕ
⊢ True
Theorem: StateT.seqRight_eq
File: src/lean/Init/Control/Lawful.lean

tactic: apply ext
state_before: m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
⊢ (SeqRight.seqRight x fun x => y) = Seq.seq (const α id <$> x) fun x => y

tactic: intro s
state_before: case h
m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
⊢ ∀ (s : σ), run (SeqRight.seqRight x fun x => y) s = run (Seq.seq (const α id <$> x) fun x => y) s

tactic: simp [map_eq_pure_bind, const]
state_before: case h
m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
s : σ
⊢ run (SeqRight.seqRight x fun x => y) s = run (Seq.seq (const α id <$> x) fun x => y) s

tactic: apply bind_congr
state_before: case h
m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
s : σ
⊢ (do
      let p ← run x s
      run y p.snd) =
    do
    let x ← run x s
    let a ← run y x.snd
    pure (a.fst, a.snd)

tactic: intro p
state_before: case h.h
m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
s : σ
⊢ ∀ (a : α × σ),
    run y a.snd = do
      let a ← run y a.snd
      pure (a.fst, a.snd)

tactic: cases p
state_before: case h.h
m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
s : σ
p : α × σ
⊢ run y p.snd = do
    let a ← run y p.snd
    pure (a.fst, a.snd)

tactic: simp [Prod.eta]
state_before: case h.h.mk
m : Type u_1 → Type u_2
σ α β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : StateT σ m α
y : StateT σ m β
s : σ
fst✝ : α
snd✝ : σ
⊢ run y (fst✝, snd✝).snd = do
    let a ← run y (fst✝, snd✝).snd
    pure (a.fst, a.snd)
Theorem: List.map_erase
File: Mathlib/Data/List/Basic.lean

tactic: have this : Eq a = Eq (f a) ∘ f := by ext b; simp [finj.eq_iff]
state_before: ι : Type ?u.425891
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
⊢ map f (List.erase l a) = List.erase (map f l) (f a)

tactic: simp [erase_eq_eraseP, erase_eq_eraseP, eraseP_map, this]
state_before: ι : Type ?u.425891
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
this : Eq a = Eq (f a) ∘ f
⊢ map f (List.erase l a) = List.erase (map f l) (f a)

tactic: rfl
state_before: ι : Type ?u.425891
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
this : Eq a = Eq (f a) ∘ f
⊢ map f (eraseP (fun b => decide (f a = f b)) l) = map f (eraseP ((fun b => decide (f a = b)) ∘ f) l)

tactic: ext b
state_before: ι : Type ?u.425891
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
⊢ Eq a = Eq (f a) ∘ f

tactic: simp [finj.eq_iff]
state_before: case h.a
ι : Type ?u.425891
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
finj : Injective f
a : α
l : List α
b : α
⊢ a = b ↔ (Eq (f a) ∘ f) b
Theorem: Even.add_odd
File: Mathlib/Algebra/Parity.lean

tactic: rintro ⟨m, rfl⟩ ⟨n, rfl⟩
state_before: F : Type ?u.81616
α : Type u_1
β : Type ?u.81622
R : Type ?u.81625
inst✝¹ : Semiring α
inst✝ : Semiring β
m n : α
⊢ Even m → Odd n → Odd (m + n)

tactic: exact ⟨m + n, by rw [mul_add, ← two_mul, add_assoc]⟩
state_before: case intro.intro
F : Type ?u.81616
α : Type u_1
β : Type ?u.81622
R : Type ?u.81625
inst✝¹ : Semiring α
inst✝ : Semiring β
m n : α
⊢ Odd (m + m + (2 * n + 1))

tactic: rw [mul_add, ← two_mul, add_assoc]
state_before: F : Type ?u.81616
α : Type u_1
β : Type ?u.81622
R : Type ?u.81625
inst✝¹ : Semiring α
inst✝ : Semiring β
m n : α
⊢ m + m + (2 * n + 1) = 2 * (m + n) + 1