tasksource/leandojo huggingface dataset:
Theorem: Array.size_reverse
File: Std/Data/Array/Lemmas.lean

tactic: simp only [reverse]
state_before: α : Type u_1
a : Array α
⊢ size (reverse a) = size a

tactic: split <;> simp [go]
state_before: α : Type u_1
a : Array α
⊢ size
      (if h : size a ≤ 1 then a
      else reverse.loop a 0 { val := size a - 1, isLt := (_ : Nat.pred (Nat.sub (size a) 0) < Nat.sub (size a) 0) }) =
    size a

tactic: rw [reverse.loop]
state_before: α : Type u_1
a as : Array α
i : Nat
j : Fin (size as)
⊢ size (reverse.loop as i j) = size as

tactic: have := reverse.termination h
state_before: α : Type u_1
a as : Array α
i : Nat
j : Fin (size as)
h : i < j.val
⊢ size
      (if h : i < j.val then
        let_fun this := (_ : j.val - 1 - (i + 1) < j.val - i);
        let as_1 := swap as { val := i, isLt := (_ : i < size as) } j;
        let_fun this := (_ : j.val - 1 < size as_1);
        reverse.loop as_1 (i + 1) { val := j.val - 1, isLt := this }
      else as) =
    size as

tactic: simp [h]
state_before: α : Type u_1
a as : Array α
i : Nat
j : Fin (size as)
h : ¬i < j.val
⊢ size
      (if h : i < j.val then
        let_fun this := (_ : j.val - 1 - (i + 1) < j.val - i);
        let as_1 := swap as { val := i, isLt := (_ : i < size as) } j;
        let_fun this := (_ : j.val - 1 < size as_1);
        reverse.loop as_1 (i + 1) { val := j.val - 1, isLt := this }
      else as) =
    size as
Theorem: MeasureTheory.ExistsSeqTendstoAe.seqTendstoAeSeq_spec
File: Mathlib/MeasureTheory/Function/ConvergenceInMeasure.lean

tactic: cases n
state_before: α : Type u_1
ι : Type ?u.17265
E : Type u_2
m : MeasurableSpace α
μ : Measure α
inst✝ : MetricSpace E
f : ℕ → α → E
g : α → E
hfg : TendstoInMeasure μ f atTop g
n k : ℕ
hn : seqTendstoAeSeq hfg n ≤ k
⊢ ↑↑μ {x | 2⁻¹ ^ n ≤ dist (f k x) (g x)} ≤ 2⁻¹ ^ n

tactic: exact Classical.choose_spec (exists_nat_measure_lt_two_inv hfg 0) k hn
state_before: case zero
α : Type u_1
ι : Type ?u.17265
E : Type u_2
m : MeasurableSpace α
μ : Measure α
inst✝ : MetricSpace E
f : ℕ → α → E
g : α → E
hfg : TendstoInMeasure μ f atTop g
k : ℕ
hn : seqTendstoAeSeq hfg Nat.zero ≤ k
⊢ ↑↑μ {x | 2⁻¹ ^ Nat.zero ≤ dist (f k x) (g x)} ≤ 2⁻¹ ^ Nat.zero

tactic: exact Classical.choose_spec
  (exists_nat_measure_lt_two_inv hfg _) _ (le_trans (le_max_left _ _) hn)
state_before: case succ
α : Type u_1
ι : Type ?u.17265
E : Type u_2
m : MeasurableSpace α
μ : Measure α
inst✝ : MetricSpace E
f : ℕ → α → E
g : α → E
hfg : TendstoInMeasure μ f atTop g
k n✝ : ℕ
hn : seqTendstoAeSeq hfg (Nat.succ n✝) ≤ k
⊢ ↑↑μ {x | 2⁻¹ ^ Nat.succ n✝ ≤ dist (f k x) (g x)} ≤ 2⁻¹ ^ Nat.succ n✝
Theorem: Nat.add_mod_left
File: Std/Data/Nat/Lemmas.lean

tactic: rw [Nat.add_comm, add_mod_right]
state_before: x z : Nat
⊢ (x + z) % x = z % x
Theorem: CategoryTheory.OplaxNatTrans.whiskerLeft_naturality_comp
File: Mathlib/CategoryTheory/Bicategory/NaturalTransformation.lean

tactic: simp_rw [← whiskerLeft_comp, naturality_comp]
state_before: B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H : OplaxFunctor B C
η : OplaxNatTrans F G
θ : OplaxNatTrans G H
a b c : B
a' : C
f : a' ⟶ (↑G.toPrelaxFunctor).obj a
g : a ⟶ b
h : b ⟶ c
⊢ f ◁ naturality θ (g ≫ h) ≫ f ◁ app θ a ◁ OplaxFunctor.mapComp H g h =
    f ◁ OplaxFunctor.mapComp G g h ▷ app θ c ≫
      f ◁ (α_ ((↑G.toPrelaxFunctor).map g) ((↑G.toPrelaxFunctor).map h) (app θ c)).hom ≫
        f ◁ (↑G.toPrelaxFunctor).map g ◁ naturality θ h ≫
          f ◁ (α_ ((↑G.toPrelaxFunctor).map g) (app θ b) ((↑H.toPrelaxFunctor).map h)).inv ≫
            f ◁ naturality θ g ▷ (↑H.toPrelaxFunctor).map h ≫
              f ◁ (α_ (app θ a) ((↑H.toPrelaxFunctor).map g) ((↑H.toPrelaxFunctor).map h)).hom
Theorem: CompleteLattice.inf_continuous
File: Mathlib/Order/OmegaCompletePartialOrder.lean

tactic: refine' fun c => eq_of_forall_ge_iff fun z => _
state_before: α : Type u_1
β : Type u_2
inst✝¹ : OmegaCompletePartialOrder α
inst✝ : CompleteLinearOrder β
f g : α →o β
hf : Continuous f
hg : Continuous g
⊢ Continuous (f ⊓ g)

tactic: simp only [inf_le_iff, hf c, hg c, ωSup_le_iff, ←forall_or_left, ←forall_or_right,
           Chain.map_coe, OrderHom.coe_inf, ge_iff_le, Pi.inf_apply, Function.comp]
state_before: α : Type u_1
β : Type u_2
inst✝¹ : OmegaCompletePartialOrder α
inst✝ : CompleteLinearOrder β
f g : α →o β
hf : Continuous f
hg : Continuous g
c : Chain α
z : β
⊢ ↑(f ⊓ g) (ωSup c) ≤ z ↔ ωSup (Chain.map c (f ⊓ g)) ≤ z

tactic: exact ⟨λ h _ => h _ _, λ h i j => (h (max j i)).imp (le_trans $ f.mono $ c.mono $ le_max_left _ _)
  (le_trans $ g.mono $ c.mono $ le_max_right _ _)⟩
state_before: α : Type u_1
β : Type u_2
inst✝¹ : OmegaCompletePartialOrder α
inst✝ : CompleteLinearOrder β
f g : α →o β
hf : Continuous f
hg : Continuous g
c : Chain α
z : β
⊢ (∀ (x x_1 : ℕ), ↑f (↑c x_1) ≤ z ∨ ↑g (↑c x) ≤ z) ↔ ∀ (i : ℕ), ↑f (↑c i) ≤ z ∨ ↑g (↑c i) ≤ z
Theorem: SemidirectProduct.inl_aut
File: Mathlib/GroupTheory/SemidirectProduct.lean

tactic: ext <;> simp
state_before: N : Type u_1
G : Type u_2
H : Type ?u.74038
inst✝² : Group N
inst✝¹ : Group G
inst✝ : Group H
φ : G →* MulAut N
g : G
n : N
⊢ ↑inl (↑(↑φ g) n) = ↑inr g * ↑inl n * ↑inr g⁻¹
Theorem: Localization.AtPrime.map_eq_maximalIdeal
File: Mathlib/RingTheory/Localization/AtPrime.lean

tactic: convert congr_arg (Ideal.map (algebraMap R (Localization.AtPrime I)))
(AtPrime.comap_maximalIdeal (hI := hI)).symm
state_before: R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type ?u.79647
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type ?u.79827
inst✝ : CommSemiring P
I : Ideal R
hI : Ideal.IsPrime I
⊢ Ideal.map (algebraMap R (Localization.AtPrime I)) I = LocalRing.maximalIdeal (Localization (Ideal.primeCompl I))

tactic: rw [map_comap I.primeCompl]
state_before: case h.e'_3
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type ?u.79647
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type ?u.79827
inst✝ : CommSemiring P
I : Ideal R
hI : Ideal.IsPrime I
⊢ LocalRing.maximalIdeal (Localization (Ideal.primeCompl I)) =
    Ideal.map (algebraMap R (Localization.AtPrime I))
      (Ideal.comap (algebraMap R (Localization.AtPrime I)) (LocalRing.maximalIdeal (Localization (Ideal.primeCompl I))))
Theorem: Cardinal.powerlt_aleph0_le
File: Mathlib/SetTheory/Cardinal/Ordinal.lean

tactic: cases' le_or_lt ℵ₀ c with h h
state_before: c : Cardinal
⊢ c ^< ℵ₀ ≤ max c ℵ₀

tactic: rw [powerlt_le]
state_before: case inr
c : Cardinal
h : c < ℵ₀
⊢ c ^< ℵ₀ ≤ max c ℵ₀

tactic: exact fun c' hc' => (power_lt_aleph0 h hc').le.trans (le_max_right _ _)
state_before: case inr
c : Cardinal
h : c < ℵ₀
⊢ ∀ (x : Cardinal), x < ℵ₀ → c ^ x ≤ max c ℵ₀

tactic: rw [powerlt_aleph0 h]
state_before: case inl
c : Cardinal
h : ℵ₀ ≤ c
⊢ c ^< ℵ₀ ≤ max c ℵ₀

tactic: apply le_max_left
state_before: case inl
c : Cardinal
h : ℵ₀ ≤ c
⊢ c ≤ max c ℵ₀
Theorem: Bool.apply_apply_apply
File: Mathlib/Data/Bool/Basic.lean

tactic: cases x <;> cases h₁ : f true <;> cases h₂ : f false <;> simp only [h₁, h₂]
state_before: f : Bool → Bool
x : Bool
⊢ f (f (f x)) = f x
Theorem: uniformGroup_comap
File: Mathlib/Topology/Algebra/UniformGroup.lean

tactic: letI : UniformSpace β := u.comap f
state_before: α : Type ?u.119518
β : Type u_3
inst✝⁶ : UniformSpace α
inst✝⁵ : Group α
inst✝⁴ : UniformGroup α
inst✝³ : Group β
γ : Type u_1
inst✝² : Group γ
u : UniformSpace γ
inst✝¹ : UniformGroup γ
F : Type u_2
inst✝ : MonoidHomClass F β γ
f : F
⊢ UniformContinuous fun p => p.fst / p.snd

tactic: refine' uniformContinuous_comap' _
state_before: α : Type ?u.119518
β : Type u_3
inst✝⁶ : UniformSpace α
inst✝⁵ : Group α
inst✝⁴ : UniformGroup α
inst✝³ : Group β
γ : Type u_1
inst✝² : Group γ
u : UniformSpace γ
inst✝¹ : UniformGroup γ
F : Type u_2
inst✝ : MonoidHomClass F β γ
f : F
this : UniformSpace β := UniformSpace.comap (↑f) u
⊢ UniformContinuous fun p => p.fst / p.snd

tactic: simp_rw [Function.comp, map_div]
state_before: α : Type ?u.119518
β : Type u_3
inst✝⁶ : UniformSpace α
inst✝⁵ : Group α
inst✝⁴ : UniformGroup α
inst✝³ : Group β
γ : Type u_1
inst✝² : Group γ
u : UniformSpace γ
inst✝¹ : UniformGroup γ
F : Type u_2
inst✝ : MonoidHomClass F β γ
f : F
this : UniformSpace β := UniformSpace.comap (↑f) u
⊢ UniformContinuous (↑f ∘ fun p => p.fst / p.snd)

tactic: change UniformContinuous ((fun p : γ × γ => p.1 / p.2) ∘ Prod.map f f)
state_before: α : Type ?u.119518
β : Type u_3
inst✝⁶ : UniformSpace α
inst✝⁵ : Group α
inst✝⁴ : UniformGroup α
inst✝³ : Group β
γ : Type u_1
inst✝² : Group γ
u : UniformSpace γ
inst✝¹ : UniformGroup γ
F : Type u_2
inst✝ : MonoidHomClass F β γ
f : F
this : UniformSpace β := UniformSpace.comap (↑f) u
⊢ UniformContinuous fun x => ↑f x.fst / ↑f x.snd

tactic: exact uniformContinuous_div.comp (uniformContinuous_comap.prod_map uniformContinuous_comap)
state_before: α : Type ?u.119518
β : Type u_3
inst✝⁶ : UniformSpace α
inst✝⁵ : Group α
inst✝⁴ : UniformGroup α
inst✝³ : Group β
γ : Type u_1
inst✝² : Group γ
u : UniformSpace γ
inst✝¹ : UniformGroup γ
F : Type u_2
inst✝ : MonoidHomClass F β γ
f : F
this : UniformSpace β := UniformSpace.comap (↑f) u
⊢ UniformContinuous ((fun p => p.fst / p.snd) ∘ Prod.map ↑f ↑f)
Theorem: OnePoint.isOpen_compl_image_coe
File: Mathlib/Topology/Compactification/OnePoint.lean

tactic: rw [isOpen_iff_of_mem, ← preimage_compl, compl_compl, preimage_image_eq _ coe_injective]
state_before: X : Type u_1
inst✝ : TopologicalSpace X
s✝ : Set (OnePoint X)
t s : Set X
⊢ IsOpen ((some '' s)ᶜ) ↔ IsClosed s ∧ IsCompact s

tactic: exact infty_not_mem_image_coe
state_before: X : Type u_1
inst✝ : TopologicalSpace X
s✝ : Set (OnePoint X)
t s : Set X
⊢ ∞ ∈ (some '' s)ᶜ
Theorem: Ideal.eq_jacobson_iff_sInf_maximal
File: Mathlib/RingTheory/JacobsonIdeal.lean

tactic: use fun hI => ⟨{ J : Ideal R | I ≤ J ∧ J.IsMaximal }, ⟨fun _ hJ => Or.inl hJ.right, hI.symm⟩⟩
state_before: R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I : Ideal R
⊢ jacobson I = I ↔ ∃ M, (∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤) ∧ I = sInf M

tactic: rintro ⟨M, hM, hInf⟩
state_before: R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I : Ideal R
⊢ (∃ M, (∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤) ∧ I = sInf M) → jacobson I = I

tactic: refine le_antisymm (fun x hx => ?_) le_jacobson
state_before: case intro.intro
R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I : Ideal R
M : Set (Ideal R)
hM : ∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤
hInf : I = sInf M
⊢ jacobson I = I

tactic: rw [hInf, mem_sInf]
state_before: case intro.intro
R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I : Ideal R
M : Set (Ideal R)
hM : ∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤
hInf : I = sInf M
x : R
hx : x ∈ jacobson I
⊢ x ∈ I

tactic: intro I hI
state_before: case intro.intro
R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I : Ideal R
M : Set (Ideal R)
hM : ∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤
hInf : I = sInf M
x : R
hx : x ∈ jacobson I
⊢ ∀ ⦃I : Ideal R⦄, I ∈ M → x ∈ I

tactic: cases' hM I hI with is_max is_top
state_before: case intro.intro
R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I✝ : Ideal R
M : Set (Ideal R)
hM : ∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤
hInf : I✝ = sInf M
x : R
hx : x ∈ jacobson I✝
I : Ideal R
hI : I ∈ M
⊢ x ∈ I

tactic: exact (mem_sInf.1 hx) ⟨le_sInf_iff.1 (le_of_eq hInf) I hI, is_max⟩
state_before: case intro.intro.inl
R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I✝ : Ideal R
M : Set (Ideal R)
hM : ∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤
hInf : I✝ = sInf M
x : R
hx : x ∈ jacobson I✝
I : Ideal R
hI : I ∈ M
is_max : IsMaximal I
⊢ x ∈ I

tactic: exact is_top.symm ▸ Submodule.mem_top
state_before: case intro.intro.inr
R : Type u
S : Type v
inst✝¹ : Ring R
inst✝ : Ring S
I✝ : Ideal R
M : Set (Ideal R)
hM : ∀ (J : Ideal R), J ∈ M → IsMaximal J ∨ J = ⊤
hInf : I✝ = sInf M
x : R
hx : x ∈ jacobson I✝
I : Ideal R
hI : I ∈ M
is_top : I = ⊤
⊢ x ∈ I
Theorem: Filter.map₂_map_right
File: Mathlib/Order/Filter/NAry.lean

tactic: rw [map₂_swap, map₂_map_left, map₂_swap]
state_before: α : Type u_2
α' : Type ?u.36798
β : Type u_4
β' : Type ?u.36804
γ : Type u_3
γ' : Type ?u.36810
δ : Type u_1
δ' : Type ?u.36816
ε : Type ?u.36819
ε' : Type ?u.36822
m✝ : α → β → γ
f f₁ f₂ : Filter α
g g₁ g₂ : Filter β
h h₁ h₂ : Filter γ
s s₁ s₂ : Set α
t t₁ t₂ : Set β
u : Set γ
v : Set δ
a : α
b : β
c : γ
m : α → γ → δ
n : β → γ
⊢ map₂ m f (map n g) = map₂ (fun a b => m a (n b)) f g
Theorem: MeasureTheory.Measure.prod_restrict
File: Mathlib/MeasureTheory/Constructions/Prod/Basic.lean

tactic: refine' prod_eq fun s' t' hs' ht' => _
state_before: α : Type u_1
α' : Type ?u.4487971
β : Type u_2
β' : Type ?u.4487977
γ : Type ?u.4487980
E : Type ?u.4487983
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : MeasurableSpace β
inst✝⁴ : MeasurableSpace β'
inst✝³ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝² : NormedAddCommGroup E
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set α
t : Set β
⊢ Measure.prod (restrict μ s) (restrict ν t) = restrict (Measure.prod μ ν) (s ×ˢ t)

tactic: rw [restrict_apply (hs'.prod ht'), prod_inter_prod, prod_prod, restrict_apply hs',
  restrict_apply ht']
state_before: α : Type u_1
α' : Type ?u.4487971
β : Type u_2
β' : Type ?u.4487977
γ : Type ?u.4487980
E : Type ?u.4487983
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : MeasurableSpace β
inst✝⁴ : MeasurableSpace β'
inst✝³ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝² : NormedAddCommGroup E
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set α
t : Set β
s' : Set α
t' : Set β
hs' : MeasurableSet s'
ht' : MeasurableSet t'
⊢ ↑↑(restrict (Measure.prod μ ν) (s ×ˢ t)) (s' ×ˢ t') = ↑↑(restrict μ s) s' * ↑↑(restrict ν t) t'
Theorem: Rat.cast_bit1
File: Mathlib/Data/Rat/Cast.lean

tactic: rw [bit1, cast_add, cast_one, cast_bit0]
state_before: F : Type ?u.48517
ι : Type ?u.48520
α : Type u_1
β : Type ?u.48526
inst✝¹ : DivisionRing α
inst✝ : CharZero α
n : ℚ
⊢ ↑(bit1 n) = bit1 ↑n

tactic: rfl
state_before: F : Type ?u.48517
ι : Type ?u.48520
α : Type u_1
β : Type ?u.48526
inst✝¹ : DivisionRing α
inst✝ : CharZero α
n : ℚ
⊢ bit0 ↑n + 1 = bit1 ↑n
Theorem: Array.mapM_eq_mapM_data
File: Std/Data/Array/Lemmas.lean

tactic: rw [mapM, foldlM_eq_foldlM_data, ← List.foldrM_reverse, mkEmpty_eq]
state_before: m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
⊢ mapM f arr = do
    let __do_lift ← List.mapM f arr.data
    pure { data := __do_lift }

tactic: conv => rhs; rw [← List.reverse_reverse arr.data]
state_before: m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
⊢ List.foldrM
      (fun a bs => do
        let b ← f a
        pure (push bs b))
      #[] (List.reverse arr.data) =
    do
    let __do_lift ← List.mapM f arr.data
    pure { data := __do_lift }

tactic: induction arr.data.reverse with
| nil => simp; rfl
| cons a l ih => simp [ih]; simp [push]
state_before: m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
⊢ List.foldrM
      (fun a bs => do
        let b ← f a
        pure (push bs b))
      #[] (List.reverse arr.data) =
    do
    let __do_lift ← List.mapM f (List.reverse (List.reverse arr.data))
    pure { data := __do_lift }

tactic: simp
state_before: case nil
m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
⊢ List.foldrM
      (fun a bs => do
        let b ← f a
        pure (push bs b))
      #[] [] =
    do
    let __do_lift ← List.mapM f (List.reverse [])
    pure { data := __do_lift }

tactic: rfl
state_before: case nil
m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
⊢ pure #[] = pure { data := [] }

tactic: simp [ih]
state_before: case cons
m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
a : α
l : List α
ih :
  List.foldrM
      (fun a bs => do
        let b ← f a
        pure (push bs b))
      #[] l =
    do
    let __do_lift ← List.mapM f (List.reverse l)
    pure { data := __do_lift }
⊢ List.foldrM
      (fun a bs => do
        let b ← f a
        pure (push bs b))
      #[] (a :: l) =
    do
    let __do_lift ← List.mapM f (List.reverse (a :: l))
    pure { data := __do_lift }

tactic: simp [push]
state_before: case cons
m : Type u_1 → Type u_2
α : Type u_3
β : Type u_1
inst✝¹ : Monad m
inst✝ : LawfulMonad m
f : α → m β
arr : Array α
a : α
l : List α
ih :
  List.foldrM
      (fun a bs => do
        let b ← f a
        pure (push bs b))
      #[] l =
    do
    let __do_lift ← List.mapM f (List.reverse l)
    pure { data := __do_lift }
⊢ (do
      let x ← List.mapM f (List.reverse l)
      let b ← f a
      pure (push { data := x } b)) =
    do
    let x ← List.mapM f (List.reverse l)
    let x_1 ← f a
    pure { data := x ++ [x_1] }
Theorem: List.perm_option_to_list
File: Mathlib/Data/List/Perm.lean

tactic: refine' ⟨fun p => _, fun e => e ▸ Perm.refl _⟩
state_before: α : Type uu
β : Type vv
l₁ l₂ : List α
o₁ o₂ : Option α
⊢ Option.toList o₁ ~ Option.toList o₂ ↔ o₁ = o₂

tactic: cases' o₁ with a <;> cases' o₂ with b
state_before: α : Type uu
β : Type vv
l₁ l₂ : List α
o₁ o₂ : Option α
p : Option.toList o₁ ~ Option.toList o₂
⊢ o₁ = o₂

tactic: rfl
state_before: case none.none
α : Type uu
β : Type vv
l₁ l₂ : List α
p : Option.toList none ~ Option.toList none
⊢ none = none

tactic: cases p.length_eq
state_before: case none.some
α : Type uu
β : Type vv
l₁ l₂ : List α
b : α
p : Option.toList none ~ Option.toList (some b)
⊢ none = some b

tactic: cases p.length_eq
state_before: case some.none
α : Type uu
β : Type vv
l₁ l₂ : List α
a : α
p : Option.toList (some a) ~ Option.toList none
⊢ some a = none

tactic: exact Option.mem_toList.1 (p.symm.subset <| by simp)
state_before: case some.some
α : Type uu
β : Type vv
l₁ l₂ : List α
a b : α
p : Option.toList (some a) ~ Option.toList (some b)
⊢ some a = some b

tactic: simp
state_before: α : Type uu
β : Type vv
l₁ l₂ : List α
a b : α
p : Option.toList (some a) ~ Option.toList (some b)
⊢ b ∈ Option.toList (some b)
Theorem: AdjoinRoot.eval₂_root
File: Mathlib/RingTheory/AdjoinRoot.lean

tactic: rw [← algebraMap_eq, ← aeval_def, aeval_eq, mk_self]
state_before: R : Type u
S : Type v
K : Type w
inst✝ : CommRing R
f✝ f : R[X]
⊢ eval₂ (of f) (root f) f = 0
Theorem: Ordnode.all_balance'
File: Mathlib/Data/Ordmap/Ordset.lean

tactic: rw [balance']
state_before: α : Type u_1
P : α → Prop
l : Ordnode α
x : α
r : Ordnode α
⊢ All P (balance' l x r) ↔ All P l ∧ P x ∧ All P r

tactic: split_ifs <;> simp [all_node', all_rotateL, all_rotateR]
state_before: α : Type u_1
P : α → Prop
l : Ordnode α
x : α
r : Ordnode α
⊢ All P
      (if size l + size r ≤ 1 then node' l x r
      else
        if size r > delta * size l then rotateL l x r
        else if size l > delta * size r then rotateR l x r else node' l x r) ↔
    All P l ∧ P x ∧ All P r
Theorem: memℓp_gen
File: Mathlib/Analysis/NormedSpace/lpSpace.lean

tactic: rcases p.trichotomy with (rfl | rfl | hp)
state_before: α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal p
⊢ Memℓp f p

tactic: exact (memℓp_gen_iff hp).2 hf
state_before: case inr.inr
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal p
hp : 0 < ENNReal.toReal p
⊢ Memℓp f p

tactic: apply memℓp_zero
state_before: case inl
α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal 0
⊢ Memℓp f 0

tactic: have H : Summable fun _ : α => (1 : ℝ) := by simpa using hf
state_before: case inl.hf
α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal 0
⊢ Set.Finite {i | f i ≠ 0}

tactic: exact (Set.Finite.of_summable_const (by norm_num) H).subset (Set.subset_univ _)
state_before: case inl.hf
α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal 0
H : Summable fun x => 1
⊢ Set.Finite {i | f i ≠ 0}

tactic: simpa using hf
state_before: α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal 0
⊢ Summable fun x => 1

tactic: norm_num
state_before: α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal 0
H : Summable fun x => 1
⊢ 0 < 1

tactic: apply memℓp_infty
state_before: case inr.inl
α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal ⊤
⊢ Memℓp f ⊤

tactic: have H : Summable fun _ : α => (1 : ℝ) := by simpa using hf
state_before: case inr.inl.hf
α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal ⊤
⊢ BddAbove (Set.range fun i => ‖f i‖)

tactic: simpa using ((Set.Finite.of_summable_const (by norm_num) H).image fun i => ‖f i‖).bddAbove
state_before: case inr.inl.hf
α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal ⊤
H : Summable fun x => 1
⊢ BddAbove (Set.range fun i => ‖f i‖)

tactic: simpa using hf
state_before: α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal ⊤
⊢ Summable fun x => 1

tactic: norm_num
state_before: α : Type u_1
E : α → Type u_2
q : ℝ≥0∞
inst✝ : (i : α) → NormedAddCommGroup (E i)
f : (i : α) → E i
hf : Summable fun i => ‖f i‖ ^ ENNReal.toReal ⊤
H : Summable fun x => 1
⊢ 0 < 1
Theorem: LipschitzWith.dist
File: Mathlib/Topology/MetricSpace/Lipschitz.lean

tactic: rw [← one_add_one_eq_two]
state_before: α : Type u
β : Type v
γ : Type w
ι : Type x
inst✝² : PseudoMetricSpace α
inst✝¹ : PseudoMetricSpace β
inst✝ : PseudoMetricSpace γ
K : ℝ≥0
f : α → β
x y : α
r : ℝ
⊢ LipschitzWith 2 (uncurry dist)

tactic: exact LipschitzWith.uncurry LipschitzWith.dist_left LipschitzWith.dist_right
state_before: α : Type u
β : Type v
γ : Type w
ι : Type x
inst✝² : PseudoMetricSpace α
inst✝¹ : PseudoMetricSpace β
inst✝ : PseudoMetricSpace γ
K : ℝ≥0
f : α → β
x y : α
r : ℝ
⊢ LipschitzWith (1 + 1) (uncurry dist)
Theorem: Num.div_to_nat
File: Mathlib/Data/Num/Lemmas.lean

tactic: simp
state_before: ⊢ ↑(0 / 0) = ↑0 / ↑0
Theorem: Stream'.Seq.map_cons
File: Mathlib/Data/Seq/Seq.lean

tactic: apply Subtype.eq
state_before: α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ map f (cons a { val := s, property := al }) = cons (f a) (map f { val := s, property := al })

tactic: dsimp [cons, map]
state_before: case a
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ ↑(map f (cons a { val := s, property := al })) = ↑(cons (f a) (map f { val := s, property := al }))

tactic: rw [Stream'.map_cons]
state_before: case a
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ Stream'.map (Option.map f) (some a :: s) = some (f a) :: Stream'.map (Option.map f) s

tactic: rfl
state_before: case a
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ Option.map f (some a) :: Stream'.map (Option.map f) s = some (f a) :: Stream'.map (Option.map f) s
Theorem: isLUB_biSup
File: Mathlib/Order/CompleteLattice.lean

tactic: simpa only [range_comp, Subtype.range_coe, iSup_subtype'] using
  @isLUB_iSup α s _ (f ∘ fun x => (x : β))
state_before: α : Type u_2
β : Type u_1
β₂ : Type ?u.163838
γ : Type ?u.163841
ι : Sort ?u.163844
ι' : Sort ?u.163847
κ : ι → Sort ?u.163852
κ' : ι' → Sort ?u.163857
inst✝ : CompleteLattice α
f✝ g s✝ t : ι → α
a b : α
s : Set β
f : β → α
⊢ IsLUB (f '' s) (⨆ (x : β) (_ : x ∈ s), f x)