tasksource/leandojo huggingface dataset:
Theorem: Equiv.Perm.Disjoint.mul_eq_one_iff
File: Mathlib/GroupTheory/Perm/Support.lean

tactic: simp_rw [ext_iff, one_apply, hστ.mul_apply_eq_iff, forall_and]
state_before: α : Type u_1
f g h σ τ : Perm α
hστ : Disjoint σ τ
⊢ σ * τ = 1 ↔ σ = 1 ∧ τ = 1
Theorem: Padic.valuation_one
File: Mathlib/NumberTheory/Padics/PadicNumbers.lean

tactic: change dite (CauSeq.const (padicNorm p) 1 ≈ _) _ _ = _
state_before: p : ℕ
hp : Fact (Nat.Prime p)
⊢ valuation 1 = 0

tactic: have h : ¬CauSeq.const (padicNorm p) 1 ≈ 0 := by
  intro H
  erw [const_equiv p] at H
  exact one_ne_zero H
state_before: p : ℕ
hp : Fact (Nat.Prime p)
⊢ (if h : const (padicNorm p) 1 ≈ 0 then (fun hf => 0) h
    else (fun hf => padicValRat p (↑(const (padicNorm p) 1) (PadicSeq.stationaryPoint hf))) h) =
    0

tactic: rw [dif_neg h]
state_before: p : ℕ
hp : Fact (Nat.Prime p)
h : ¬const (padicNorm p) 1 ≈ 0
⊢ (if h : const (padicNorm p) 1 ≈ 0 then (fun hf => 0) h
    else (fun hf => padicValRat p (↑(const (padicNorm p) 1) (PadicSeq.stationaryPoint hf))) h) =
    0

tactic: simp
state_before: p : ℕ
hp : Fact (Nat.Prime p)
h : ¬const (padicNorm p) 1 ≈ 0
⊢ (fun hf => padicValRat p (↑(const (padicNorm p) 1) (PadicSeq.stationaryPoint hf))) h = 0

tactic: intro H
state_before: p : ℕ
hp : Fact (Nat.Prime p)
⊢ ¬const (padicNorm p) 1 ≈ 0

tactic: erw [const_equiv p] at H
state_before: p : ℕ
hp : Fact (Nat.Prime p)
H : const (padicNorm p) 1 ≈ 0
⊢ False

tactic: exact one_ne_zero H
state_before: p : ℕ
hp : Fact (Nat.Prime p)
H : 1 = 0
⊢ False
Theorem: insert_mem_nhdsWithin_of_subset_insert
File: Mathlib/Topology/Separation.lean

tactic: rcases eq_or_ne x y with (rfl | h)
state_before: α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : T1Space α
x y : α
s t : Set α
hu : t ⊆ insert y s
⊢ insert x s ∈ 𝓝[t] x

tactic: refine' nhdsWithin_mono x hu _
state_before: case inr
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : T1Space α
x y : α
s t : Set α
hu : t ⊆ insert y s
h : x ≠ y
⊢ insert x s ∈ 𝓝[t] x

tactic: rw [nhdsWithin_insert_of_ne h]
state_before: case inr
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : T1Space α
x y : α
s t : Set α
hu : t ⊆ insert y s
h : x ≠ y
⊢ insert x s ∈ 𝓝[insert y s] x

tactic: exact mem_of_superset self_mem_nhdsWithin (subset_insert x s)
state_before: case inr
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : T1Space α
x y : α
s t : Set α
hu : t ⊆ insert y s
h : x ≠ y
⊢ insert x s ∈ 𝓝[s] x

tactic: exact mem_of_superset self_mem_nhdsWithin hu
state_before: case inl
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : T1Space α
x : α
s t : Set α
hu : t ⊆ insert x s
⊢ insert x s ∈ 𝓝[t] x
Theorem: CategoryTheory.Limits.kernelSubobject_arrow'
File: Mathlib/CategoryTheory/Subobject/Limits.lean

tactic: simp [kernelSubobjectIso]
state_before: C : Type u
inst✝² : Category C
X Y Z : C
inst✝¹ : HasZeroMorphisms C
f : X ⟶ Y
inst✝ : HasKernel f
⊢ (kernelSubobjectIso f).inv ≫ arrow (kernelSubobject f) = kernel.ι f
Theorem: Equiv.Perm.subtypeCongr.trans
File: Mathlib/Logic/Equiv/Basic.lean

tactic: ext x
state_before: ε : Type u_1
p : ε → Prop
inst✝ : DecidablePred p
ep ep' : Perm { a // p a }
en en' : Perm { a // ¬p a }
⊢ (subtypeCongr ep en).trans (subtypeCongr ep' en') = subtypeCongr (ep.trans ep') (en.trans en')

tactic: by_cases h:p x
state_before: case H
ε : Type u_1
p : ε → Prop
inst✝ : DecidablePred p
ep ep' : Perm { a // p a }
en en' : Perm { a // ¬p a }
x : ε
⊢ ↑((subtypeCongr ep en).trans (subtypeCongr ep' en')) x = ↑(subtypeCongr (ep.trans ep') (en.trans en')) x

tactic: have : p (ep ⟨x, h⟩) := Subtype.property _
state_before: case pos
ε : Type u_1
p : ε → Prop
inst✝ : DecidablePred p
ep ep' : Perm { a // p a }
en en' : Perm { a // ¬p a }
x : ε
h : p x
⊢ ↑((subtypeCongr ep en).trans (subtypeCongr ep' en')) x = ↑(subtypeCongr (ep.trans ep') (en.trans en')) x

tactic: simp [Perm.subtypeCongr.apply, h, this]
state_before: case pos
ε : Type u_1
p : ε → Prop
inst✝ : DecidablePred p
ep ep' : Perm { a // p a }
en en' : Perm { a // ¬p a }
x : ε
h : p x
this : p ↑(↑ep { val := x, property := h })
⊢ ↑((subtypeCongr ep en).trans (subtypeCongr ep' en')) x = ↑(subtypeCongr (ep.trans ep') (en.trans en')) x

tactic: have : ¬p (en ⟨x, h⟩) := Subtype.property (en _)
state_before: case neg
ε : Type u_1
p : ε → Prop
inst✝ : DecidablePred p
ep ep' : Perm { a // p a }
en en' : Perm { a // ¬p a }
x : ε
h : ¬p x
⊢ ↑((subtypeCongr ep en).trans (subtypeCongr ep' en')) x = ↑(subtypeCongr (ep.trans ep') (en.trans en')) x

tactic: simp [Perm.subtypeCongr.apply, h, symm_apply_eq, this]
state_before: case neg
ε : Type u_1
p : ε → Prop
inst✝ : DecidablePred p
ep ep' : Perm { a // p a }
en en' : Perm { a // ¬p a }
x : ε
h : ¬p x
this : ¬p ↑(↑en { val := x, property := h })
⊢ ↑((subtypeCongr ep en).trans (subtypeCongr ep' en')) x = ↑(subtypeCongr (ep.trans ep') (en.trans en')) x
Theorem: Turing.BlankExtends.above_of_le
File: Mathlib/Computability/TuringMachine.lean

tactic: rintro ⟨i, rfl⟩ ⟨j, e⟩ h
state_before: Γ : Type u_1
inst✝ : Inhabited Γ
l l₁ l₂ : List Γ
⊢ BlankExtends l₁ l → BlankExtends l₂ l → List.length l₁ ≤ List.length l₂ → BlankExtends l₁ l₂

tactic: use i - j
state_before: case intro.intro
Γ : Type u_1
inst✝ : Inhabited Γ
l₁ l₂ : List Γ
i j : ℕ
e : l₁ ++ List.replicate i default = l₂ ++ List.replicate j default
h : List.length l₁ ≤ List.length l₂
⊢ BlankExtends l₁ l₂

tactic: refine' List.append_right_cancel (e.symm.trans _)
state_before: case intro.intro
Γ : Type u_1
inst✝ : Inhabited Γ
l₁ l₂ : List Γ
i j : ℕ
e : l₁ ++ List.replicate i default = l₂ ++ List.replicate j default
h : List.length l₁ ≤ List.length l₂
⊢ l₂ = l₁ ++ List.replicate (i - j) default

tactic: rw [List.append_assoc, ← List.replicate_add, tsub_add_cancel_of_le]
state_before: case intro.intro
Γ : Type u_1
inst✝ : Inhabited Γ
l₁ l₂ : List Γ
i j : ℕ
e : l₁ ++ List.replicate i default = l₂ ++ List.replicate j default
h : List.length l₁ ≤ List.length l₂
⊢ l₁ ++ List.replicate i default = l₁ ++ List.replicate (i - j) default ++ List.replicate j default

tactic: apply_fun List.length at e
state_before: case intro.intro
Γ : Type u_1
inst✝ : Inhabited Γ
l₁ l₂ : List Γ
i j : ℕ
e : l₁ ++ List.replicate i default = l₂ ++ List.replicate j default
h : List.length l₁ ≤ List.length l₂
⊢ j ≤ i

tactic: simp only [List.length_append, List.length_replicate] at e
state_before: case intro.intro
Γ : Type u_1
inst✝ : Inhabited Γ
l₁ l₂ : List Γ
i j : ℕ
h : List.length l₁ ≤ List.length l₂
e : List.length (l₁ ++ List.replicate i default) = List.length (l₂ ++ List.replicate j default)
⊢ j ≤ i

tactic: rwa [← add_le_add_iff_left, e, add_le_add_iff_right]
state_before: case intro.intro
Γ : Type u_1
inst✝ : Inhabited Γ
l₁ l₂ : List Γ
i j : ℕ
h : List.length l₁ ≤ List.length l₂
e : List.length l₁ + i = List.length l₂ + j
⊢ j ≤ i
Theorem: bddAbove_iff_exists_ge
File: Mathlib/Order/Bounds/Basic.lean

tactic: rw [bddAbove_def, exists_ge_and_iff_exists]
state_before: α : Type u
β : Type v
γ : Type w
ι : Sort x
inst✝² : Preorder α
inst✝¹ : Preorder β
s✝ t : Set α
a b : α
inst✝ : SemilatticeSup γ
s : Set γ
x₀ : γ
⊢ BddAbove s ↔ ∃ x, x₀ ≤ x ∧ ∀ (y : γ), y ∈ s → y ≤ x

tactic: exact Monotone.ball fun x _ => monotone_le
state_before: α : Type u
β : Type v
γ : Type w
ι : Sort x
inst✝² : Preorder α
inst✝¹ : Preorder β
s✝ t : Set α
a b : α
inst✝ : SemilatticeSup γ
s : Set γ
x₀ : γ
⊢ Monotone fun x => ∀ (y : γ), y ∈ s → y ≤ x
Theorem: Associates.mem_factors_iff_dvd
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: constructor
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a p : α
ha0 : a ≠ 0
hp : Irreducible p
⊢ Associates.mk p ∈ factors (Associates.mk a) ↔ p ∣ a

tactic: rw [← mk_dvd_mk]
state_before: case mp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a p : α
ha0 : a ≠ 0
hp : Irreducible p
⊢ Associates.mk p ∈ factors (Associates.mk a) → p ∣ a

tactic: apply dvd_of_mem_factors
state_before: case mp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a p : α
ha0 : a ≠ 0
hp : Irreducible p
⊢ Associates.mk p ∈ factors (Associates.mk a) → Associates.mk p ∣ Associates.mk a

tactic: exact (irreducible_mk p).mpr hp
state_before: case mp.hp
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a p : α
ha0 : a ≠ 0
hp : Irreducible p
⊢ Irreducible (Associates.mk p)

tactic: apply mem_factors_of_dvd ha0 hp
state_before: case mpr
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
dec_irr : (p : Associates α) → Decidable (Irreducible p)
inst✝ : UniqueFactorizationMonoid α
dec : DecidableEq α
dec' : DecidableEq (Associates α)
a p : α
ha0 : a ≠ 0
hp : Irreducible p
⊢ p ∣ a → Associates.mk p ∈ factors (Associates.mk a)
Theorem: vectorSpan_eq_span_vsub_set_right_ne
File: Mathlib/LinearAlgebra/AffineSpace/AffineSubspace.lean

tactic: conv_lhs =>
  rw [vectorSpan_eq_span_vsub_set_right k hp, ← Set.insert_eq_of_mem hp, ←
    Set.insert_diff_singleton, Set.image_insert_eq]
state_before: k : Type u_3
V : Type u_2
P : Type u_1
inst✝³ : Ring k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type ?u.271589
s : Set P
p : P
hp : p ∈ s
⊢ vectorSpan k s = Submodule.span k ((fun x => x -ᵥ p) '' (s \ {p}))

tactic: simp [Submodule.span_insert_eq_span]
state_before: k : Type u_3
V : Type u_2
P : Type u_1
inst✝³ : Ring k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type ?u.271589
s : Set P
p : P
hp : p ∈ s
⊢ Submodule.span k (insert (p -ᵥ p) ((fun x => x -ᵥ p) '' (s \ {p}))) =
    Submodule.span k ((fun x => x -ᵥ p) '' (s \ {p}))
Theorem: Nat.eq_of_perm_factors
File: Mathlib/Data/Nat/Factors.lean

tactic: simpa [prod_factors ha, prod_factors hb] using List.Perm.prod_eq h
state_before: a b : ℕ
ha : a ≠ 0
hb : b ≠ 0
h : factors a ~ factors b
⊢ a = b
Theorem: PowerSeries.coeff_mul_X_pow
File: Mathlib/RingTheory/PowerSeries/Basic.lean

tactic: rw [coeff_mul, Finset.sum_eq_single (d, n), coeff_X_pow, if_pos rfl, mul_one]
state_before: R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ↑(coeff R (d + n)) (p * X ^ n) = ↑(coeff R d) p

tactic: rintro ⟨i, j⟩ h1 h2
state_before: case h₀
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ∀ (b : ℕ × ℕ), b ∈ Finset.Nat.antidiagonal (d + n) → b ≠ (d, n) → ↑(coeff R b.fst) p * ↑(coeff R b.snd) (X ^ n) = 0

tactic: rw [coeff_X_pow, if_neg, MulZeroClass.mul_zero]
state_before: case h₀.mk
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + n)
h2 : (i, j) ≠ (d, n)
⊢ ↑(coeff R (i, j).fst) p * ↑(coeff R (i, j).snd) (X ^ n) = 0

tactic: rintro rfl
state_before: case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + n)
h2 : (i, j) ≠ (d, n)
⊢ ¬(i, j).snd = n

tactic: apply h2
state_before: case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + (i, j).snd)
h2 : (i, j) ≠ (d, (i, j).snd)
⊢ False

tactic: rw [Finset.Nat.mem_antidiagonal, add_right_cancel_iff] at h1
state_before: case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + (i, j).snd)
h2 : (i, j) ≠ (d, (i, j).snd)
⊢ (i, j) = (d, (i, j).snd)

tactic: subst h1
state_before: case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j).fst = d
h2 : (i, j) ≠ (d, (i, j).snd)
⊢ (i, j) = (d, (i, j).snd)

tactic: rfl
state_before: case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
i j : ℕ
h2 : (i, j) ≠ ((i, j).fst, (i, j).snd)
⊢ (i, j) = ((i, j).fst, (i, j).snd)

tactic: exact fun h1 => (h1 (Finset.Nat.mem_antidiagonal.2 rfl)).elim
state_before: case h₁
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ¬(d, n) ∈ Finset.Nat.antidiagonal (d + n) → ↑(coeff R (d, n).fst) p * ↑(coeff R (d, n).snd) (X ^ n) = 0
Theorem: CategoryTheory.Preadditive.isSeparator_iff
File: Mathlib/CategoryTheory/Preadditive/Generator.lean

tactic: simpa only [Limits.comp_zero] using hf
state_before: C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
G : C
hG : IsSeparator G
X Y : C
f : X ⟶ Y
hf : ∀ (h : G ⟶ X), h ≫ f = 0
⊢ ∀ (h : G ⟶ X), h ≫ f = h ≫ 0

tactic: simpa only [Preadditive.comp_sub, sub_eq_zero] using hfg
state_before: C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
G : C
hG : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ (h : G ⟶ X), h ≫ f = 0) → f = 0
X Y : C
f g : X ⟶ Y
hfg : ∀ (h : G ⟶ X), h ≫ f = h ≫ g
⊢ ∀ (h : G ⟶ X), h ≫ (f - g) = 0
Theorem: Ideal.comap_lt_comap_of_integral_mem_sdiff
File: Mathlib/RingTheory/Ideal/Over.lean

tactic: obtain ⟨p, p_monic, hpx⟩ := integral
state_before: R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
integral : IsIntegral R x
⊢ comap (algebraMap R S) I < comap (algebraMap R S) J

tactic: refine' comap_lt_comap_of_root_mem_sdiff hIJ mem _ _
state_before: case intro.intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ comap (algebraMap R S) I < comap (algebraMap R S) J

tactic: swap
state_before: case intro.intro.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ R[X]

case intro.intro.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ Polynomial.map (Quotient.mk (comap (algebraMap R S) I)) ?intro.intro.refine'_1 ≠ 0

case intro.intro.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ eval₂ (algebraMap R S) x ?intro.intro.refine'_1 ∈ I

tactic: convert I.zero_mem
state_before: case intro.intro.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ eval₂ (algebraMap R S) x p ∈ I

tactic: apply map_monic_ne_zero p_monic
state_before: case intro.intro.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ Polynomial.map (Quotient.mk (comap (algebraMap R S) I)) ?intro.intro.refine'_1 ≠ 0
Theorem: Module.injective_module_of_injective_object
File: Mathlib/Algebra/Module/Injective.lean

tactic: skip
state_before: R : Type u
inst✝³ : Ring R
Q : TypeMax
inst✝² : AddCommGroup Q
inst✝¹ : Module R Q
inst✝ : CategoryTheory.Injective (ModuleCat.mk Q)
X Y : TypeMax
ins1 : AddCommGroup X
ins2 : AddCommGroup Y
ins3 : Module R X
ins4 : Module R Y
f : X →ₗ[R] Y
hf : Function.Injective ↑f
g : X →ₗ[R] Q
⊢ ∃ h, ∀ (x : X), ↑h (↑f x) = ↑g x

tactic: rcases@CategoryTheory.Injective.factors (ModuleCat R) _ ⟨Q⟩ _ ⟨X⟩ ⟨Y⟩ g f
    ((ModuleCat.mono_iff_injective _).mpr hf) with
  ⟨h, rfl⟩
state_before: R : Type u
inst✝³ : Ring R
Q : TypeMax
inst✝² : AddCommGroup Q
inst✝¹ : Module R Q
inst✝ : CategoryTheory.Injective (ModuleCat.mk Q)
X Y : TypeMax
ins1 : AddCommGroup X
ins2 : AddCommGroup Y
ins3 : Module R X
ins4 : Module R Y
f : X →ₗ[R] Y
hf : Function.Injective ↑f
g : X →ₗ[R] Q
⊢ ∃ h, ∀ (x : X), ↑h (↑f x) = ↑g x

tactic: exact ⟨h, fun x => rfl⟩
state_before: case intro
R : Type u
inst✝³ : Ring R
Q : TypeMax
inst✝² : AddCommGroup Q
inst✝¹ : Module R Q
inst✝ : CategoryTheory.Injective (ModuleCat.mk Q)
X Y : TypeMax
ins1 : AddCommGroup X
ins2 : AddCommGroup Y
ins3 : Module R X
ins4 : Module R Y
f : X →ₗ[R] Y
hf : Function.Injective ↑f
h : ModuleCat.mk Y ⟶ ModuleCat.mk Q
⊢ ∃ h_1, ∀ (x : X), ↑h_1 (↑f x) = ↑(f ≫ h) x
Theorem: SimpleGraph.Connected.dist_triangle
File: Mathlib/Combinatorics/SimpleGraph/Metric.lean

tactic: obtain ⟨p, hp⟩ := hconn.exists_walk_of_dist u v
state_before: V : Type u_1
G : SimpleGraph V
hconn : Connected G
u v w : V
⊢ dist G u w ≤ dist G u v + dist G v w

tactic: obtain ⟨q, hq⟩ := hconn.exists_walk_of_dist v w
state_before: case intro
V : Type u_1
G : SimpleGraph V
hconn : Connected G
u v w : V
p : Walk G u v
hp : Walk.length p = dist G u v
⊢ dist G u w ≤ dist G u v + dist G v w

tactic: rw [← hp, ← hq, ← Walk.length_append]
state_before: case intro.intro
V : Type u_1
G : SimpleGraph V
hconn : Connected G
u v w : V
p : Walk G u v
hp : Walk.length p = dist G u v
q : Walk G v w
hq : Walk.length q = dist G v w
⊢ dist G u w ≤ dist G u v + dist G v w

tactic: apply dist_le
state_before: case intro.intro
V : Type u_1
G : SimpleGraph V
hconn : Connected G
u v w : V
p : Walk G u v
hp : Walk.length p = dist G u v
q : Walk G v w
hq : Walk.length q = dist G v w
⊢ dist G u w ≤ Walk.length (Walk.append p q)
Theorem: IsUnit.det_zpow
File: Mathlib/LinearAlgebra/Matrix/ZPow.lean

tactic: cases' n with n n
state_before: n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
h : IsUnit (det A)
n : ℤ
⊢ IsUnit (det (A ^ n))

tactic: simpa using h.pow n
state_before: case ofNat
n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
h : IsUnit (det A)
n : ℕ
⊢ IsUnit (det (A ^ ofNat n))

tactic: simpa using h.pow n.succ
state_before: case negSucc
n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
h : IsUnit (det A)
n : ℕ
⊢ IsUnit (det (A ^ -[n+1]))
Theorem: List.bind_append_perm
File: Mathlib/Data/List/Perm.lean

tactic: induction' l with a l IH <;> simp
state_before: α : Type uu
β : Type vv
l₁ l₂ l : List α
f g : α → List β
⊢ List.bind l f ++ List.bind l g ~ List.bind l fun x => f x ++ g x

tactic: refine' (Perm.trans _ (IH.append_left _)).append_left _
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ : List α
f g : α → List β
a : α
l : List α
IH : List.bind l f ++ List.bind l g ~ List.bind l fun x => f x ++ g x
⊢ f a ++ (List.bind l f ++ (g a ++ List.bind l g)) ~ f a ++ (g a ++ List.bind l fun x => f x ++ g x)

tactic: rw [← append_assoc, ← append_assoc]
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ : List α
f g : α → List β
a : α
l : List α
IH : List.bind l f ++ List.bind l g ~ List.bind l fun x => f x ++ g x
⊢ List.bind l f ++ (g a ++ List.bind l g) ~ g a ++ (List.bind l f ++ List.bind l g)

tactic: exact perm_append_comm.append_right _
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ : List α
f g : α → List β
a : α
l : List α
IH : List.bind l f ++ List.bind l g ~ List.bind l fun x => f x ++ g x
⊢ List.bind l f ++ g a ++ List.bind l g ~ g a ++ List.bind l f ++ List.bind l g
Theorem: Int.self_le_toNat
File: Std/Data/Int/Lemmas.lean

tactic: rw [toNat_eq_max]
state_before: a : Int
⊢ a ≤ ↑(toNat a)

tactic: apply Int.le_max_left
state_before: a : Int
⊢ a ≤ max a 0
Theorem: Ideal.closure_ne_top
File: Mathlib/Analysis/NormedSpace/Units.lean

tactic: have h := closure_minimal (coe_subset_nonunits hI) nonunits.isClosed
state_before: R : Type u_1
inst✝¹ : NormedRing R
inst✝ : CompleteSpace R
I : Ideal R
hI : I ≠ ⊤
⊢ Ideal.closure I ≠ ⊤

tactic: simpa only [I.closure.eq_top_iff_one, Ne.def] using mt (@h 1) one_not_mem_nonunits
state_before: R : Type u_1
inst✝¹ : NormedRing R
inst✝ : CompleteSpace R
I : Ideal R
hI : I ≠ ⊤
h : closure ↑I ⊆ nonunits R
⊢ Ideal.closure I ≠ ⊤
Theorem: Multiset.le_iff_count
File: Mathlib/Data/Multiset/Basic.lean

tactic: rw [← (ext.2 fun a => by simp [max_eq_right (al a)] : s ∪ t = t)]
state_before: α : Type u_1
β : Type ?u.411904
γ : Type ?u.411907
inst✝ : DecidableEq α
s t : Multiset α
al : ∀ (a : α), count a s ≤ count a t
⊢ s ≤ t

tactic: apply le_union_left
state_before: α : Type u_1
β : Type ?u.411904
γ : Type ?u.411907
inst✝ : DecidableEq α
s t : Multiset α
al : ∀ (a : α), count a s ≤ count a t
⊢ s ≤ s ∪ t

tactic: simp [max_eq_right (al a)]
state_before: α : Type u_1
β : Type ?u.411904
γ : Type ?u.411907
inst✝ : DecidableEq α
s t : Multiset α
al : ∀ (a : α), count a s ≤ count a t
a : α
⊢ count a (s ∪ t) = count a t
Theorem: extChartAt_target_mem_nhdsWithin'
File: Mathlib/Geometry/Manifold/SmoothManifoldWithCorners.lean

tactic: rwa [← extChartAt_source I]
state_before: 𝕜 : Type u_3
E : Type u_2
M : Type u_1
H : Type u_4
E' : Type ?u.197578
M' : Type ?u.197581
H' : Type ?u.197584
inst✝¹⁰ : NontriviallyNormedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
f f' : LocalHomeomorph M H
I : ModelWithCorners 𝕜 E H
inst✝⁵ : NormedAddCommGroup E'
inst✝⁴ : NormedSpace 𝕜 E'
inst✝³ : TopologicalSpace H'
inst✝² : TopologicalSpace M'
I' : ModelWithCorners 𝕜 E' H'
x : M
s t : Set M
inst✝¹ : ChartedSpace H M
inst✝ : ChartedSpace H' M'
y : M
hy : y ∈ (extChartAt I x).source
⊢ y ∈ (chartAt H x).toLocalEquiv.source
Theorem: LinearMap.toMatrixAlgEquiv_mul
File: Mathlib/LinearAlgebra/Matrix/ToLin.lean

tactic: rw [LinearMap.mul_eq_comp, LinearMap.toMatrixAlgEquiv_comp v₁ f g]
state_before: R : Type u_1
inst✝⁹ : CommSemiring R
l : Type ?u.2673265
m : Type ?u.2673268
n : Type u_3
inst✝⁸ : Fintype n
inst✝⁷ : Fintype m
inst✝⁶ : DecidableEq n
M₁ : Type u_2
M₂ : Type ?u.2673292
inst✝⁵ : AddCommMonoid M₁
inst✝⁴ : AddCommMonoid M₂
inst✝³ : Module R M₁
inst✝² : Module R M₂
v₁ : Basis n R M₁
v₂ : Basis m R M₂
M₃ : Type ?u.2673794
inst✝¹ : AddCommMonoid M₃
inst✝ : Module R M₃
v₃ : Basis l R M₃
f g : M₁ →ₗ[R] M₁
⊢ ↑(toMatrixAlgEquiv v₁) (f * g) = ↑(toMatrixAlgEquiv v₁) f ⬝ ↑(toMatrixAlgEquiv v₁) g
Theorem: Rat.nonneg_add
File: Mathlib/Data/Rat/Order.lean

tactic: have d₁0 : 0 < (d₁ : ℤ) := Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h₁)
state_before: a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
⊢ Rat.Nonneg (n₁ /. ↑d₁) → Rat.Nonneg (n₂ /. ↑d₂) → Rat.Nonneg (n₁ /. ↑d₁ + n₂ /. ↑d₂)

tactic: have d₂0 : 0 < (d₂ : ℤ) := Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h₂)
state_before: a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
d₁0 : 0 < ↑d₁
⊢ Rat.Nonneg (n₁ /. ↑d₁) → Rat.Nonneg (n₂ /. ↑d₂) → Rat.Nonneg (n₁ /. ↑d₁ + n₂ /. ↑d₂)

tactic: simp only [d₁0, d₂0, h₁, h₂, mul_pos, divInt_nonneg, add_def'', Ne.def,
  Nat.cast_eq_zero, not_false_iff]
state_before: a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
d₁0 : 0 < ↑d₁
d₂0 : 0 < ↑d₂
⊢ Rat.Nonneg (n₁ /. ↑d₁) → Rat.Nonneg (n₂ /. ↑d₂) → Rat.Nonneg (n₁ /. ↑d₁ + n₂ /. ↑d₂)

tactic: intro n₁0 n₂0
state_before: a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
d₁0 : 0 < ↑d₁
d₂0 : 0 < ↑d₂
⊢ 0 ≤ n₁ → 0 ≤ n₂ → 0 ≤ n₁ * ↑d₂ + n₂ * ↑d₁

tactic: first |assumption|apply Int.ofNat_zero_le
state_before: case hb.hb
a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
d₁0 : 0 < ↑d₁
d₂0 : 0 < ↑d₂
n₁0 : 0 ≤ n₁
n₂0 : 0 ≤ n₂
⊢ 0 ≤ ↑d₁

tactic: assumption
state_before: case hb.hb
a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
d₁0 : 0 < ↑d₁
d₂0 : 0 < ↑d₂
n₁0 : 0 ≤ n₁
n₂0 : 0 ≤ n₂
⊢ 0 ≤ ↑d₁

tactic: apply Int.ofNat_zero_le
state_before: case hb.hb
a✝ b✝ c a b : ℚ
n₁ : ℤ
d₁ : ℕ
h₁ : d₁ ≠ 0
n₂ : ℤ
d₂ : ℕ
h₂ : d₂ ≠ 0
d₁0 : 0 < ↑d₁
d₂0 : 0 < ↑d₂
n₁0 : 0 ≤ n₁
n₂0 : 0 ≤ n₂
⊢ 0 ≤ ↑d₁