tasksource/leandojo huggingface dataset:
Theorem: Stream'.WSeq.exists_get?_of_mem
File: Mathlib/Data/Seq/WSeq.lean

tactic: apply mem_rec_on h
state_before: α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h : a ∈ s
⊢ ∃ n, some a ∈ get? s n

tactic: intro a' s' h
state_before: case h1
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h : a ∈ s
⊢ ∀ (b : α) (s' : WSeq α), (a = b ∨ ∃ n, some a ∈ get? s' n) → ∃ n, some a ∈ get? (cons b s') n

tactic: cases' h with h h
state_before: case h1
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
h : a = a' ∨ ∃ n, some a ∈ get? s' n
⊢ ∃ n, some a ∈ get? (cons a' s') n

tactic: exists 0
state_before: case h1.inl
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
h : a = a'
⊢ ∃ n, some a ∈ get? (cons a' s') n

tactic: simp only [get?, drop, head_cons]
state_before: case h1.inl
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
h : a = a'
⊢ some a ∈ get? (cons a' s') 0

tactic: rw [h]
state_before: case h1.inl
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
h : a = a'
⊢ some a ∈ Computation.pure (some a')

tactic: apply ret_mem
state_before: case h1.inl
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
h : a = a'
⊢ some a' ∈ Computation.pure (some a')

tactic: cases' h with n h
state_before: case h1.inr
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
h : ∃ n, some a ∈ get? s' n
⊢ ∃ n, some a ∈ get? (cons a' s') n

tactic: exists n + 1
state_before: case h1.inr.intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
n : ℕ
h : some a ∈ get? s' n
⊢ ∃ n, some a ∈ get? (cons a' s') n

tactic: simpa [get?]
state_before: case h1.inr.intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
a' : α
s' : WSeq α
n : ℕ
h : some a ∈ get? s' n
⊢ some a ∈ get? (cons a' s') (n + 1)

tactic: intro s' h
state_before: case h2
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h : a ∈ s
⊢ ∀ (s : WSeq α), (∃ n, some a ∈ get? s n) → ∃ n, some a ∈ get? (think s) n

tactic: cases' h with n h
state_before: case h2
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
s' : WSeq α
h : ∃ n, some a ∈ get? s' n
⊢ ∃ n, some a ∈ get? (think s') n

tactic: exists n
state_before: case h2.intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
s' : WSeq α
n : ℕ
h : some a ∈ get? s' n
⊢ ∃ n, some a ∈ get? (think s') n

tactic: simp [get?]
state_before: case h2.intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
s' : WSeq α
n : ℕ
h : some a ∈ get? s' n
⊢ some a ∈ get? (think s') n

tactic: apply think_mem h
state_before: case h2.intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h✝ : a ∈ s
s' : WSeq α
n : ℕ
h : some a ∈ get? s' n
⊢ some a ∈ Computation.think (head (drop s' n))
Theorem: NNReal.rpow_add_le_mul_rpow_add_rpow
File: Mathlib/Analysis/MeanInequalitiesPow.lean

tactic: rcases eq_or_lt_of_le hp with (rfl | h'p)
state_before: ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
p : ℝ
hp : 1 ≤ p
⊢ (z₁ + z₂) ^ p ≤ 2 ^ (p - 1) * (z₁ ^ p + z₂ ^ p)

tactic: convert rpow_arith_mean_le_arith_mean2_rpow (1 / 2) (1 / 2) (2 * z₁) (2 * z₂) (add_halves 1) hp
  using 1
state_before: case inr
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
p : ℝ
hp : 1 ≤ p
h'p : 1 < p
⊢ (z₁ + z₂) ^ p ≤ 2 ^ (p - 1) * (z₁ ^ p + z₂ ^ p)

tactic: simp only [rpow_one, sub_self, rpow_zero, one_mul]
state_before: case inl
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
hp : 1 ≤ 1
⊢ (z₁ + z₂) ^ 1 ≤ 2 ^ (1 - 1) * (z₁ ^ 1 + z₂ ^ 1)

tactic: rfl
state_before: case inl
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
hp : 1 ≤ 1
⊢ z₁ + z₂ ≤ z₁ + z₂

tactic: simp only [one_div, inv_mul_cancel_left₀, Ne.def, mul_eq_zero, two_ne_zero, one_ne_zero,
  not_false_iff]
state_before: case h.e'_3
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
p : ℝ
hp : 1 ≤ p
h'p : 1 < p
⊢ (z₁ + z₂) ^ p = (1 / 2 * (2 * z₁) + 1 / 2 * (2 * z₂)) ^ p

tactic: have A : p - 1 ≠ 0 := ne_of_gt (sub_pos.2 h'p)
state_before: case h.e'_4
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
p : ℝ
hp : 1 ≤ p
h'p : 1 < p
⊢ 2 ^ (p - 1) * (z₁ ^ p + z₂ ^ p) = 1 / 2 * (2 * z₁) ^ p + 1 / 2 * (2 * z₂) ^ p

tactic: simp only [mul_rpow, rpow_sub' _ A, _root_.div_eq_inv_mul, rpow_one, mul_one]
state_before: case h.e'_4
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
p : ℝ
hp : 1 ≤ p
h'p : 1 < p
A : p - 1 ≠ 0
⊢ 2 ^ (p - 1) * (z₁ ^ p + z₂ ^ p) = 1 / 2 * (2 * z₁) ^ p + 1 / 2 * (2 * z₂) ^ p

tactic: ring
state_before: case h.e'_4
ι : Type u
s : Finset ι
z₁ z₂ : ℝ≥0
p : ℝ
hp : 1 ≤ p
h'p : 1 < p
A : p - 1 ≠ 0
⊢ 2⁻¹ * 2 ^ p * (z₁ ^ p + z₂ ^ p) = 2⁻¹ * (2 ^ p * z₁ ^ p) + 2⁻¹ * (2 ^ p * z₂ ^ p)
Theorem: String.valid_next
File: Std/Data/String/Lemmas.lean

tactic: match s, p, h with
| ⟨_⟩, ⟨_⟩, ⟨cs, [], rfl, rfl⟩ => simp at h₂
| ⟨_⟩, ⟨_⟩, ⟨cs, c::cs', rfl, rfl⟩ =>
  rw [utf8ByteSize.go_eq, next_of_valid]
  simpa using Pos.Valid.mk (cs ++ [c]) cs'
state_before: s : String
p : Pos
h : Pos.Valid s p
h₂ : p < endPos s
⊢ Pos.Valid s (next s p)

tactic: simp at h₂
state_before: s : String
p : Pos
h : Pos.Valid s p
cs : List Char
h₂ : { byteIdx := utf8ByteSize.go cs } < endPos { data := cs ++ [] }
⊢ Pos.Valid { data := cs ++ [] } (next { data := cs ++ [] } { byteIdx := utf8ByteSize.go cs })

tactic: rw [utf8ByteSize.go_eq, next_of_valid]
state_before: s : String
p : Pos
h : Pos.Valid s p
cs : List Char
c : Char
cs' : List Char
h₂ : { byteIdx := utf8ByteSize.go cs } < endPos { data := cs ++ c :: cs' }
⊢ Pos.Valid { data := cs ++ c :: cs' } (next { data := cs ++ c :: cs' } { byteIdx := utf8ByteSize.go cs })

tactic: simpa using Pos.Valid.mk (cs ++ [c]) cs'
state_before: s : String
p : Pos
h : Pos.Valid s p
cs : List Char
c : Char
cs' : List Char
h₂ : { byteIdx := utf8ByteSize.go cs } < endPos { data := cs ++ c :: cs' }
⊢ Pos.Valid { data := cs ++ c :: cs' } { byteIdx := utf8Len cs + csize c }
Theorem: Filter.compl_mem_coprodᵢ
File: Mathlib/Order/Filter/Pi.lean

tactic: simp only [Filter.coprodᵢ, mem_iSup, compl_mem_comap]
state_before: ι : Type u_1
α : ι → Type u_2
f f₁ f₂ : (i : ι) → Filter (α i)
s✝ : (i : ι) → Set (α i)
s : Set ((i : ι) → α i)
⊢ sᶜ ∈ Filter.coprodᵢ f ↔ ∀ (i : ι), (eval i '' s)ᶜ ∈ f i
Theorem: CategoryTheory.Limits.pushoutComparison_map_desc
File: Mathlib/CategoryTheory/Limits/Shapes/Pullbacks.lean

tactic: simp only [← G.map_comp, w]
state_before: C : Type u
inst✝³ : Category C
D : Type u₂
inst✝² : Category D
W✝ X Y Z : C
G : C ⥤ D
f : X ⟶ Y
g : X ⟶ Z
inst✝¹ : HasPushout f g
inst✝ : HasPushout (G.map f) (G.map g)
W : C
h : Y ⟶ W
k : Z ⟶ W
w : f ≫ h = g ≫ k
⊢ G.map f ≫ G.map h = G.map g ≫ G.map k

tactic: ext <;> simp [← G.map_comp]
state_before: C : Type u
inst✝³ : Category C
D : Type u₂
inst✝² : Category D
W✝ X Y Z : C
G : C ⥤ D
f : X ⟶ Y
g : X ⟶ Z
inst✝¹ : HasPushout f g
inst✝ : HasPushout (G.map f) (G.map g)
W : C
h : Y ⟶ W
k : Z ⟶ W
w : f ≫ h = g ≫ k
⊢ pushoutComparison G f g ≫ G.map (pushout.desc h k w) =
    pushout.desc (G.map h) (G.map k) (_ : G.map f ≫ G.map h = G.map g ≫ G.map k)
Theorem: Equiv.swap_apply_of_ne_of_ne
File: Mathlib/Logic/Equiv/Basic.lean

tactic: simp (config := { contextual := true }) [swap_apply_def]
state_before: α : Sort u_1
inst✝ : DecidableEq α
a b x : α
⊢ x ≠ a → x ≠ b → ↑(swap a b) x = x
Theorem: inf_sdiff_right_comm
File: Mathlib/Order/BooleanAlgebra.lean

tactic: rw [@inf_comm _ _ x, inf_comm, inf_sdiff_assoc]
state_before: α : Type u
β : Type ?u.39578
w x y z : α
inst✝ : GeneralizedBooleanAlgebra α
⊢ x \ z ⊓ y = (x ⊓ y) \ z
Theorem: GeneralizedContinuedFraction.continuants_recurrence
File: Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean

tactic: rw [nth_cont_eq_succ_nth_cont_aux] at nth_conts_eq succ_nth_conts_eq
state_before: K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp ppred pred : Pair K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
nth_conts_eq : continuants g n = ppred
succ_nth_conts_eq : continuants g (n + 1) = pred
⊢ continuants g (n + 2) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }

tactic: exact continuants_recurrenceAux succ_nth_s_eq nth_conts_eq succ_nth_conts_eq
state_before: K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp ppred pred : Pair K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
nth_conts_eq : continuantsAux g (n + 1) = ppred
succ_nth_conts_eq : continuantsAux g (n + 1 + 1) = pred
⊢ continuants g (n + 2) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }
Theorem: List.prod_eq_one
File: Mathlib/Data/List/BigOperators/Basic.lean

tactic: induction' l with i l hil
state_before: ι : Type ?u.143653
α : Type ?u.143656
M : Type u_1
N : Type ?u.143662
P : Type ?u.143665
M₀ : Type ?u.143668
G : Type ?u.143671
R : Type ?u.143674
inst✝ : Monoid M
l : List M
hl : ∀ (x : M), x ∈ l → x = 1
⊢ prod l = 1

tactic: rw [List.prod_cons, hil fun x hx => hl _ (mem_cons_of_mem i hx), hl _ (mem_cons_self i l),
  one_mul]
state_before: case cons
ι : Type ?u.143653
α : Type ?u.143656
M : Type u_1
N : Type ?u.143662
P : Type ?u.143665
M₀ : Type ?u.143668
G : Type ?u.143671
R : Type ?u.143674
inst✝ : Monoid M
l✝ : List M
hl✝ : ∀ (x : M), x ∈ l✝ → x = 1
i : M
l : List M
hil : (∀ (x : M), x ∈ l → x = 1) → prod l = 1
hl : ∀ (x : M), x ∈ i :: l → x = 1
⊢ prod (i :: l) = 1

tactic: rfl
state_before: case nil
ι : Type ?u.143653
α : Type ?u.143656
M : Type u_1
N : Type ?u.143662
P : Type ?u.143665
M₀ : Type ?u.143668
G : Type ?u.143671
R : Type ?u.143674
inst✝ : Monoid M
l : List M
hl✝ : ∀ (x : M), x ∈ l → x = 1
hl : ∀ (x : M), x ∈ [] → x = 1
⊢ prod [] = 1
Theorem: CategoryTheory.hasFiniteProducts_of_has_binary_and_terminal
File: Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean

tactic: refine' ⟨fun n => ⟨fun K => _⟩⟩
state_before: J : Type v
inst✝⁴ : SmallCategory J
C : Type u
inst✝³ : Category C
D : Type u'
inst✝² : Category D
inst✝¹ : HasBinaryProducts C
inst✝ : HasTerminal C
⊢ HasFiniteProducts C

tactic: letI := hasProduct_fin n fun n => K.obj ⟨n⟩
state_before: J : Type v
inst✝⁴ : SmallCategory J
C : Type u
inst✝³ : Category C
D : Type u'
inst✝² : Category D
inst✝¹ : HasBinaryProducts C
inst✝ : HasTerminal C
n : ℕ
K : Discrete (Fin n) ⥤ C
⊢ HasLimit K

tactic: let that : (Discrete.functor fun n => K.obj ⟨n⟩) ≅ K := Discrete.natIso fun ⟨i⟩ => Iso.refl _
state_before: J : Type v
inst✝⁴ : SmallCategory J
C : Type u
inst✝³ : Category C
D : Type u'
inst✝² : Category D
inst✝¹ : HasBinaryProducts C
inst✝ : HasTerminal C
n : ℕ
K : Discrete (Fin n) ⥤ C
this : HasProduct fun n_1 => K.obj { as := n_1 } := CategoryTheory.hasProduct_fin n fun n_1 => K.obj { as := n_1 }
⊢ HasLimit K

tactic: apply @hasLimitOfIso  _ _ _ _ _ _ this that
state_before: J : Type v
inst✝⁴ : SmallCategory J
C : Type u
inst✝³ : Category C
D : Type u'
inst✝² : Category D
inst✝¹ : HasBinaryProducts C
inst✝ : HasTerminal C
n : ℕ
K : Discrete (Fin n) ⥤ C
this : HasProduct fun n_1 => K.obj { as := n_1 } := CategoryTheory.hasProduct_fin n fun n_1 => K.obj { as := n_1 }
that : (Discrete.functor fun n_1 => K.obj { as := n_1 }) ≅ K :=
  Discrete.natIso fun x =>
    match x with
    | { as := i } => Iso.refl ((Discrete.functor fun n_1 => K.obj { as := n_1 }).obj { as := i })
⊢ HasLimit K
Theorem: MeasureTheory.withDensity_add_left
File: Mathlib/MeasureTheory/Integral/Lebesgue.lean

tactic: refine' Measure.ext fun s hs => _
state_before: α : Type u_1
β : Type ?u.1755617
γ : Type ?u.1755620
δ : Type ?u.1755623
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
hf : Measurable f
g : α → ℝ≥0∞
⊢ withDensity μ (f + g) = withDensity μ f + withDensity μ g

tactic: rw [withDensity_apply _ hs, Measure.add_apply, withDensity_apply _ hs, withDensity_apply _ hs,
  ← lintegral_add_left hf]
state_before: α : Type u_1
β : Type ?u.1755617
γ : Type ?u.1755620
δ : Type ?u.1755623
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
hf : Measurable f
g : α → ℝ≥0∞
s : Set α
hs : MeasurableSet s
⊢ ↑↑(withDensity μ (f + g)) s = ↑↑(withDensity μ f + withDensity μ g) s

tactic: rfl
state_before: α : Type u_1
β : Type ?u.1755617
γ : Type ?u.1755620
δ : Type ?u.1755623
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
hf : Measurable f
g : α → ℝ≥0∞
s : Set α
hs : MeasurableSet s
⊢ (∫⁻ (a : α) in s, (f + g) a ∂μ) = ∫⁻ (a : α) in s, f a + g a ∂μ
Theorem: CategoryTheory.FreeMonoidalCategory.tensorFunc_obj_map
File: Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean

tactic: cases n
state_before: C : Type u
Z : F C
n n' : (Discrete ∘ NormalMonoidalObject) C
f : n ⟶ n'
⊢ ((tensorFunc C).obj Z).map f = inclusion.map f ⊗ 𝟙 Z

tactic: cases n'
state_before: case mk
C : Type u
Z : F C
n' : (Discrete ∘ NormalMonoidalObject) C
as✝ : NormalMonoidalObject C
f : { as := as✝ } ⟶ n'
⊢ ((tensorFunc C).obj Z).map f = inclusion.map f ⊗ 𝟙 Z

tactic: rcases f with ⟨⟨h⟩⟩
state_before: case mk.mk
C : Type u
Z : F C
as✝¹ as✝ : NormalMonoidalObject C
f : { as := as✝¹ } ⟶ { as := as✝ }
⊢ ((tensorFunc C).obj Z).map f = inclusion.map f ⊗ 𝟙 Z

tactic: dsimp at h
state_before: case mk.mk.up.up
C : Type u
Z : F C
as✝¹ as✝ : NormalMonoidalObject C
h : { as := as✝¹ }.as = { as := as✝ }.as
⊢ ((tensorFunc C).obj Z).map { down := { down := h } } = inclusion.map { down := { down := h } } ⊗ 𝟙 Z

tactic: subst h
state_before: case mk.mk.up.up
C : Type u
Z : F C
as✝¹ as✝ : NormalMonoidalObject C
h : as✝¹ = as✝
⊢ ((tensorFunc C).obj Z).map { down := { down := h } } = inclusion.map { down := { down := h } } ⊗ 𝟙 Z

tactic: simp
state_before: case mk.mk.up.up
C : Type u
Z : F C
as✝ : NormalMonoidalObject C
⊢ ((tensorFunc C).obj Z).map { down := { down := (_ : as✝ = as✝) } } =
    inclusion.map { down := { down := (_ : as✝ = as✝) } } ⊗ 𝟙 Z
Theorem: Rat.num_den_mk
File: Mathlib/Data/Rat/Lemmas.lean

tactic: obtain rfl | hn := eq_or_ne n 0
state_before: q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
⊢ ∃ c, n = c * q.num ∧ d = c * ↑q.den

tactic: have hqdn : q.num ∣ n := by
  rw [qdf]
  exact Rat.num_dvd _ hd
state_before: case inr
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
⊢ ∃ c, n = c * q.num ∧ d = c * ↑q.den

tactic: refine' ⟨n / q.num, _, _⟩
state_before: case inr
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
hqdn : q.num ∣ n
⊢ ∃ c, n = c * q.num ∧ d = c * ↑q.den

tactic: simp [qdf]
state_before: case inl
q : ℚ
d : ℤ
hd : d ≠ 0
qdf : q = 0 /. d
⊢ ∃ c, 0 = c * q.num ∧ d = c * ↑q.den

tactic: refine' (divInt_eq_iff _ hd).mp _
state_before: q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
⊢ q.num * d = n * ↑q.den

tactic: exact Int.coe_nat_ne_zero.mpr (Rat.den_nz _)
state_before: case refine'_1
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
⊢ ↑q.den ≠ 0

tactic: rwa [num_den]
state_before: case refine'_2
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
⊢ q.num /. ↑q.den = n /. d

tactic: rw [qdf]
state_before: q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
⊢ q.num ∣ n

tactic: exact Rat.num_dvd _ hd
state_before: q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
⊢ (n /. d).num ∣ n

tactic: rw [Int.ediv_mul_cancel hqdn]
state_before: case inr.refine'_1
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
hqdn : q.num ∣ n
⊢ n = n / q.num * q.num

tactic: refine' Int.eq_mul_div_of_mul_eq_mul_of_dvd_left _ hqdn this
state_before: case inr.refine'_2
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
hqdn : q.num ∣ n
⊢ d = n / q.num * ↑q.den

tactic: rw [qdf]
state_before: case inr.refine'_2
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
hqdn : q.num ∣ n
⊢ q.num ≠ 0

tactic: exact Rat.num_ne_zero_of_ne_zero ((divInt_ne_zero hd).mpr hn)
state_before: case inr.refine'_2
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
this : q.num * d = n * ↑q.den
hqdn : q.num ∣ n
⊢ (n /. d).num ≠ 0
Theorem: WithSeminorms.first_countable
File: Mathlib/Analysis/LocallyConvex/WithSeminorms.lean

tactic: have : (𝓝 (0 : E)).IsCountablyGenerated := by
  rw [p.withSeminorms_iff_nhds_eq_iInf.mp hp]
  exact Filter.iInf.isCountablyGenerated _
state_before: 𝕜 : Type u_1
𝕜₂ : Type ?u.848749
𝕝 : Type ?u.848752
𝕝₂ : Type ?u.848755
E : Type u_2
F : Type ?u.848761
G : Type ?u.848764
ι : Type u_3
ι' : Type ?u.848770
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : AddCommGroup E
inst✝⁴ : Module 𝕜 E
inst✝³ : Nonempty ι
inst✝² : Countable ι
p : SeminormFamily 𝕜 E ι
inst✝¹ : UniformSpace E
inst✝ : UniformAddGroup E
hp : WithSeminorms p
⊢ FirstCountableTopology E

tactic: haveI : (uniformity E).IsCountablyGenerated := UniformAddGroup.uniformity_countably_generated
state_before: 𝕜 : Type u_1
𝕜₂ : Type ?u.848749
𝕝 : Type ?u.848752
𝕝₂ : Type ?u.848755
E : Type u_2
F : Type ?u.848761
G : Type ?u.848764
ι : Type u_3
ι' : Type ?u.848770
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : AddCommGroup E
inst✝⁴ : Module 𝕜 E
inst✝³ : Nonempty ι
inst✝² : Countable ι
p : SeminormFamily 𝕜 E ι
inst✝¹ : UniformSpace E
inst✝ : UniformAddGroup E
hp : WithSeminorms p
this : Filter.IsCountablyGenerated (𝓝 0)
⊢ FirstCountableTopology E

tactic: exact UniformSpace.firstCountableTopology E
state_before: 𝕜 : Type u_1
𝕜₂ : Type ?u.848749
𝕝 : Type ?u.848752
𝕝₂ : Type ?u.848755
E : Type u_2
F : Type ?u.848761
G : Type ?u.848764
ι : Type u_3
ι' : Type ?u.848770
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : AddCommGroup E
inst✝⁴ : Module 𝕜 E
inst✝³ : Nonempty ι
inst✝² : Countable ι
p : SeminormFamily 𝕜 E ι
inst✝¹ : UniformSpace E
inst✝ : UniformAddGroup E
hp : WithSeminorms p
this✝ : Filter.IsCountablyGenerated (𝓝 0)
this : Filter.IsCountablyGenerated (uniformity E)
⊢ FirstCountableTopology E

tactic: rw [p.withSeminorms_iff_nhds_eq_iInf.mp hp]
state_before: 𝕜 : Type u_1
𝕜₂ : Type ?u.848749
𝕝 : Type ?u.848752
𝕝₂ : Type ?u.848755
E : Type u_2
F : Type ?u.848761
G : Type ?u.848764
ι : Type u_3
ι' : Type ?u.848770
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : AddCommGroup E
inst✝⁴ : Module 𝕜 E
inst✝³ : Nonempty ι
inst✝² : Countable ι
p : SeminormFamily 𝕜 E ι
inst✝¹ : UniformSpace E
inst✝ : UniformAddGroup E
hp : WithSeminorms p
⊢ Filter.IsCountablyGenerated (𝓝 0)

tactic: exact Filter.iInf.isCountablyGenerated _
state_before: 𝕜 : Type u_1
𝕜₂ : Type ?u.848749
𝕝 : Type ?u.848752
𝕝₂ : Type ?u.848755
E : Type u_2
F : Type ?u.848761
G : Type ?u.848764
ι : Type u_3
ι' : Type ?u.848770
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : AddCommGroup E
inst✝⁴ : Module 𝕜 E
inst✝³ : Nonempty ι
inst✝² : Countable ι
p : SeminormFamily 𝕜 E ι
inst✝¹ : UniformSpace E
inst✝ : UniformAddGroup E
hp : WithSeminorms p
⊢ Filter.IsCountablyGenerated (⨅ (i : ι), Filter.comap (↑(p i)) (𝓝 0))
Theorem: String.all_iff
File: Std/Data/String/Lemmas.lean

tactic: simp [all_eq]
state_before: s : String
p : Char → Bool
⊢ all s p = true ↔ ∀ (c : Char), c ∈ s.data → p c = true
Theorem: Dfinsupp.comp_liftAddHom
File: Mathlib/Data/Dfinsupp/Basic.lean

tactic: rw [liftAddHom_symm_apply, AddMonoidHom.comp_assoc, liftAddHom_comp_single]
state_before: ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
δ : Type u_1
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : AddCommMonoid γ
inst✝ : AddCommMonoid δ
g : γ →+ δ
f : (i : ι) → β i →+ γ
a : ι
⊢ ↑(AddEquiv.symm liftAddHom) (AddMonoidHom.comp g (↑liftAddHom f)) a = AddMonoidHom.comp g (f a)
Theorem: Finset.lcm_congr
File: Mathlib/Algebra/GCDMonoid/Finset.lean

tactic: subst hs
state_before: α : Type u_2
β : Type u_1
γ : Type ?u.7148
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s s₁ s₂ : Finset β
f✝ f g : β → α
hs : s₁ = s₂
hfg : ∀ (a : β), a ∈ s₂ → f a = g a
⊢ lcm s₁ f = lcm s₂ g

tactic: exact Finset.fold_congr hfg
state_before: α : Type u_2
β : Type u_1
γ : Type ?u.7148
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s s₁ : Finset β
f✝ f g : β → α
hfg : ∀ (a : β), a ∈ s₁ → f a = g a
⊢ lcm s₁ f = lcm s₁ g
Theorem: CategoryTheory.NonPreadditiveAbelian.add_assoc
File: Mathlib/CategoryTheory/Abelian/NonPreadditive.lean

tactic: conv_lhs =>
  congr; rw [add_def]
state_before: C : Type u
inst✝¹ : Category C
inst✝ : NonPreadditiveAbelian C
X Y : C
a b c : X ⟶ Y
⊢ a + b + c = a + (b + c)

tactic: rw [sub_add, ← add_neg, neg_sub', neg_neg]
state_before: C : Type u
inst✝¹ : Category C
inst✝ : NonPreadditiveAbelian C
X Y : C
a b c : X ⟶ Y
⊢ a - -b + c = a + (b + c)
Theorem: List.diff_append
File: Std/Data/List/Lemmas.lean

tactic: simp only [diff_eq_foldl, foldl_append]
state_before: α : Type u_1
inst✝ : DecidableEq α
l₁ l₂ l₃ : List α
⊢ List.diff l₁ (l₂ ++ l₃) = List.diff (List.diff l₁ l₂) l₃
Theorem: map_symmDiff
File: Mathlib/Order/Heyting/Hom.lean

tactic: simp_rw [symmDiff, map_sup, map_sdiff]
state_before: F : Type u_3
α : Type u_2
β : Type u_1
γ : Type ?u.40368
δ : Type ?u.40371
inst✝² : CoheytingAlgebra α
inst✝¹ : CoheytingAlgebra β
inst✝ : CoheytingHomClass F α β
f : F
a b : α
⊢ ↑f (a ∆ b) = ↑f a ∆ ↑f b
Theorem: Subsemiring.mem_iSup_of_directed
File: Mathlib/RingTheory/Subsemiring/Basic.lean

tactic: refine' ⟨_, fun ⟨i, hi⟩ => (SetLike.le_def.1 <| le_iSup S i) hi⟩
state_before: R : Type u
S✝ : Type v
T : Type w
inst✝² : NonAssocSemiring R
M : Submonoid R
inst✝¹ : NonAssocSemiring S✝
inst✝ : NonAssocSemiring T
ι : Sort u_1
hι : Nonempty ι
S : ι → Subsemiring R
hS : Directed (fun x x_1 => x ≤ x_1) S
x : R
⊢ (x ∈ ⨆ (i : ι), S i) ↔ ∃ i, x ∈ S i

tactic: let U : Subsemiring R :=
  Subsemiring.mk' (⋃ i, (S i : Set R)) (⨆ i, (S i).toSubmonoid)
    (Submonoid.coe_iSup_of_directed <| hS.mono_comp _ fun _ _ => id) (⨆ i, (S i).toAddSubmonoid)
    (AddSubmonoid.coe_iSup_of_directed <| hS.mono_comp _ fun _ _ => id)
state_before: R : Type u
S✝ : Type v
T : Type w
inst✝² : NonAssocSemiring R
M : Submonoid R
inst✝¹ : NonAssocSemiring S✝
inst✝ : NonAssocSemiring T
ι : Sort u_1
hι : Nonempty ι
S : ι → Subsemiring R
hS : Directed (fun x x_1 => x ≤ x_1) S
x : R
⊢ (x ∈ ⨆ (i : ι), S i) → ∃ i, x ∈ S i

tactic: suffices h : (⨆ i, S i) ≤ U by simpa using @h x
state_before: R : Type u
S✝ : Type v
T : Type w
inst✝² : NonAssocSemiring R
M : Submonoid R
inst✝¹ : NonAssocSemiring S✝
inst✝ : NonAssocSemiring T
ι : Sort u_1
hι : Nonempty ι
S : ι → Subsemiring R
hS : Directed (fun x x_1 => x ≤ x_1) S
x : R
U : Subsemiring R :=
  Subsemiring.mk' (⋃ (i : ι), ↑(S i)) (⨆ (i : ι), (S i).toSubmonoid)
    (_ : ↑(⨆ (i : ι), (S i).toSubmonoid) = ⋃ (i : ι), ↑(S i).toSubmonoid) (⨆ (i : ι), toAddSubmonoid (S i))
    (_ : ↑(⨆ (i : ι), toAddSubmonoid (S i)) = ⋃ (i : ι), ↑(toAddSubmonoid (S i)))
⊢ (x ∈ ⨆ (i : ι), S i) → ∃ i, x ∈ S i

tactic: exact iSup_le fun i x hx => Set.mem_iUnion.2 ⟨i, hx⟩
state_before: R : Type u
S✝ : Type v
T : Type w
inst✝² : NonAssocSemiring R
M : Submonoid R
inst✝¹ : NonAssocSemiring S✝
inst✝ : NonAssocSemiring T
ι : Sort u_1
hι : Nonempty ι
S : ι → Subsemiring R
hS : Directed (fun x x_1 => x ≤ x_1) S
x : R
U : Subsemiring R :=
  Subsemiring.mk' (⋃ (i : ι), ↑(S i)) (⨆ (i : ι), (S i).toSubmonoid)
    (_ : ↑(⨆ (i : ι), (S i).toSubmonoid) = ⋃ (i : ι), ↑(S i).toSubmonoid) (⨆ (i : ι), toAddSubmonoid (S i))
    (_ : ↑(⨆ (i : ι), toAddSubmonoid (S i)) = ⋃ (i : ι), ↑(toAddSubmonoid (S i)))
⊢ (⨆ (i : ι), S i) ≤ U

tactic: simpa using @h x
state_before: R : Type u
S✝ : Type v
T : Type w
inst✝² : NonAssocSemiring R
M : Submonoid R
inst✝¹ : NonAssocSemiring S✝
inst✝ : NonAssocSemiring T
ι : Sort u_1
hι : Nonempty ι
S : ι → Subsemiring R
hS : Directed (fun x x_1 => x ≤ x_1) S
x : R
U : Subsemiring R :=
  Subsemiring.mk' (⋃ (i : ι), ↑(S i)) (⨆ (i : ι), (S i).toSubmonoid)
    (_ : ↑(⨆ (i : ι), (S i).toSubmonoid) = ⋃ (i : ι), ↑(S i).toSubmonoid) (⨆ (i : ι), toAddSubmonoid (S i))
    (_ : ↑(⨆ (i : ι), toAddSubmonoid (S i)) = ⋃ (i : ι), ↑(toAddSubmonoid (S i)))
h : (⨆ (i : ι), S i) ≤ U
⊢ (x ∈ ⨆ (i : ι), S i) → ∃ i, x ∈ S i
Theorem: List.count_eq_of_nodup
File: Mathlib/Data/List/Nodup.lean

tactic: split_ifs with h
state_before: α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a✝ b : α
inst✝ : DecidableEq α
a : α
l : List α
d : Nodup l
⊢ count a l = if a ∈ l then 1 else 0

tactic: exact count_eq_one_of_mem d h
state_before: case inl
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a✝ b : α
inst✝ : DecidableEq α
a : α
l : List α
d : Nodup l
h : a ∈ l
⊢ count a l = 1

tactic: exact count_eq_zero_of_not_mem h
state_before: case inr
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a✝ b : α
inst✝ : DecidableEq α
a : α
l : List α
d : Nodup l
h : ¬a ∈ l
⊢ count a l = 0