tasksource/leandojo huggingface dataset:
Theorem: Associates.mem_factors_of_dvd
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: rw [factors_mk _ ha0]
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
hd : p ∣ a
⊢ Associates.mk p ∈ factors (Associates.mk a)

tactic: exact mem_factorSet_some.mpr (mem_factors'_of_dvd ha0 hp hd)
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
hd : p ∣ a
⊢ Associates.mk p ∈ ↑(factors' a)
Theorem: realPart_add_I_smul_imaginaryPart
File: Mathlib/Data/Complex/Module.lean

tactic: simpa only [smul_smul, realPart_apply_coe, imaginaryPart_apply_coe, neg_smul, I_mul_I, one_smul,
  neg_sub, add_add_sub_cancel, smul_sub, smul_add, neg_sub_neg, invOf_eq_inv] using
  invOf_two_smul_add_invOf_two_smul ℝ a
state_before: A : Type u_1
inst✝³ : AddCommGroup A
inst✝² : Module ℂ A
inst✝¹ : StarAddMonoid A
inst✝ : StarModule ℂ A
a : A
⊢ ↑(↑ℜ a) + I • ↑(↑ℑ a) = a
Theorem: Rel.codom_inv
File: Mathlib/Data/Rel.lean

tactic: ext x
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.1354
r : Rel α β
⊢ codom (inv r) = dom r

tactic: rfl
state_before: case h
α : Type u_1
β : Type u_2
γ : Type ?u.1354
r : Rel α β
x : α
⊢ x ∈ codom (inv r) ↔ x ∈ dom r
Theorem: Std.RBNode.balance2_All
File: Std/Data/RBMap/WF.lean

tactic: unfold balance2
state_before: α : Type u_1
p : α → Prop
l : RBNode α
v : α
r : RBNode α
⊢ All p (balance2 l v r) ↔ p v ∧ All p l ∧ All p r

tactic: split <;> simp [and_assoc, and_left_comm]
state_before: α : Type u_1
p : α → Prop
l : RBNode α
v : α
r : RBNode α
⊢ All p
      (match l, v, r with
      | a, x, node red (node red b y c) z d => node red (node black a x b) y (node black c z d)
      | a, x, node red b y (node red c z d) => node red (node black a x b) y (node black c z d)
      | a, x, b => node black a x b) ↔
    p v ∧ All p l ∧ All p r
Theorem: CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation_ι_app_hom
File: Mathlib/CategoryTheory/Limits/FunctorCategory.lean

tactic: dsimp [colimitObjIsoColimitCompEvaluation]
state_before: C : Type u
inst✝⁴ : Category C
D : Type u'
inst✝³ : Category D
J : Type u₁
inst✝² : Category J
K : Type u₂
inst✝¹ : Category K
inst✝ : HasColimitsOfShape J C
F : J ⥤ K ⥤ C
j : J
k : K
⊢ (colimit.ι F j).app k ≫ (colimitObjIsoColimitCompEvaluation F k).hom = colimit.ι (F ⋙ (evaluation K C).obj k) j

tactic: rw [← Iso.eq_comp_inv]
state_before: C : Type u
inst✝⁴ : Category C
D : Type u'
inst✝³ : Category D
J : Type u₁
inst✝² : Category J
K : Type u₂
inst✝¹ : Category K
inst✝ : HasColimitsOfShape J C
F : J ⥤ K ⥤ C
j : J
k : K
⊢ (colimit.ι F j).app k ≫ (preservesColimitIso ((evaluation K C).obj k) F).hom =
    colimit.ι (F ⋙ (evaluation K C).obj k) j

tactic: simp
state_before: C : Type u
inst✝⁴ : Category C
D : Type u'
inst✝³ : Category D
J : Type u₁
inst✝² : Category J
K : Type u₂
inst✝¹ : Category K
inst✝ : HasColimitsOfShape J C
F : J ⥤ K ⥤ C
j : J
k : K
⊢ (colimit.ι F j).app k =
    colimit.ι (F ⋙ (evaluation K C).obj k) j ≫ (preservesColimitIso ((evaluation K C).obj k) F).inv
Theorem: Polynomial.eval₂_sum
File: Mathlib/Data/Polynomial/Eval.lean

tactic: let T : R[X] →+ S :=
  { toFun := eval₂ f x
    map_zero' := eval₂_zero _ _
    map_add' := fun p q => eval₂_add _ _ }
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝² : Semiring R
p✝ q r : R[X]
inst✝¹ : Semiring S
f : R →+* S
x✝ : S
inst✝ : Semiring T
p : T[X]
g : ℕ → T → R[X]
x : S
⊢ eval₂ f x (sum p g) = sum p fun n a => eval₂ f x (g n a)

tactic: have A : ∀ y, eval₂ f x y = T y := fun y => rfl
state_before: R : Type u
S : Type v
T✝ : Type w
ι : Type y
a b : R
m n : ℕ
inst✝² : Semiring R
p✝ q r : R[X]
inst✝¹ : Semiring S
f : R →+* S
x✝ : S
inst✝ : Semiring T✝
p : T✝[X]
g : ℕ → T✝ → R[X]
x : S
T : R[X] →+ S :=
  { toZeroHom := { toFun := eval₂ f x, map_zero' := (_ : eval₂ f x 0 = 0) },
    map_add' := (_ : ∀ (p q : R[X]), eval₂ f x (p + q) = eval₂ f x p + eval₂ f x q) }
⊢ eval₂ f x (sum p g) = sum p fun n a => eval₂ f x (g n a)

tactic: simp only [A]
state_before: R : Type u
S : Type v
T✝ : Type w
ι : Type y
a b : R
m n : ℕ
inst✝² : Semiring R
p✝ q r : R[X]
inst✝¹ : Semiring S
f : R →+* S
x✝ : S
inst✝ : Semiring T✝
p : T✝[X]
g : ℕ → T✝ → R[X]
x : S
T : R[X] →+ S :=
  { toZeroHom := { toFun := eval₂ f x, map_zero' := (_ : eval₂ f x 0 = 0) },
    map_add' := (_ : ∀ (p q : R[X]), eval₂ f x (p + q) = eval₂ f x p + eval₂ f x q) }
A : ∀ (y : R[X]), eval₂ f x y = ↑T y
⊢ eval₂ f x (sum p g) = sum p fun n a => eval₂ f x (g n a)

tactic: rw [sum, T.map_sum, sum]
state_before: R : Type u
S : Type v
T✝ : Type w
ι : Type y
a b : R
m n : ℕ
inst✝² : Semiring R
p✝ q r : R[X]
inst✝¹ : Semiring S
f : R →+* S
x✝ : S
inst✝ : Semiring T✝
p : T✝[X]
g : ℕ → T✝ → R[X]
x : S
T : R[X] →+ S :=
  { toZeroHom := { toFun := eval₂ f x, map_zero' := (_ : eval₂ f x 0 = 0) },
    map_add' := (_ : ∀ (p q : R[X]), eval₂ f x (p + q) = eval₂ f x p + eval₂ f x q) }
A : ∀ (y : R[X]), eval₂ f x y = ↑T y
⊢ ↑{ toZeroHom := { toFun := eval₂ f x, map_zero' := (_ : eval₂ f x 0 = 0) },
          map_add' := (_ : ∀ (p q : R[X]), eval₂ f x (p + q) = eval₂ f x p + eval₂ f x q) }
      (sum p g) =
    sum p fun n a =>
      ↑{ toZeroHom := { toFun := eval₂ f x, map_zero' := (_ : eval₂ f x 0 = 0) },
            map_add' := (_ : ∀ (p q : R[X]), eval₂ f x (p + q) = eval₂ f x p + eval₂ f x q) }
        (g n a)
Theorem: QuaternionAlgebra.star_eq_self
File: Mathlib/Algebra/Quaternion.lean

tactic: simp [QuaternionAlgebra.ext_iff, neg_eq_iff_add_eq_zero, add_self_eq_zero]
state_before: S : Type ?u.319486
T : Type ?u.319489
R : Type u_1
inst✝² : CommRing R
c₁✝ c₂✝ r x y z : R
a✝ b c : ℍ[R,c₁✝,c₂✝]
inst✝¹ : NoZeroDivisors R
inst✝ : CharZero R
c₁ c₂ : R
a : ℍ[R,c₁,c₂]
⊢ star a = a ↔ a = ↑a.re
Theorem: MeasureTheory.Measure.measure_ae_null_of_prod_null
File: Mathlib/MeasureTheory/Constructions/Prod/Basic.lean

tactic: obtain ⟨t, hst, mt, ht⟩ := exists_measurable_superset_of_null h
state_before: α : Type u_2
α' : Type ?u.4447841
β : Type u_1
β' : Type ?u.4447847
γ : Type ?u.4447850
E : Type ?u.4447853
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SigmaFinite ν
s : Set (α × β)
h : ↑↑(Measure.prod μ ν) s = 0
⊢ (fun x => ↑↑ν (Prod.mk x ⁻¹' s)) =ᶠ[ae μ] 0

tactic: rw [measure_prod_null mt] at ht
state_before: case intro.intro.intro
α : Type u_2
α' : Type ?u.4447841
β : Type u_1
β' : Type ?u.4447847
γ : Type ?u.4447850
E : Type ?u.4447853
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SigmaFinite ν
s : Set (α × β)
h : ↑↑(Measure.prod μ ν) s = 0
t : Set (α × β)
hst : s ⊆ t
mt : MeasurableSet t
ht : ↑↑(Measure.prod μ ν) t = 0
⊢ (fun x => ↑↑ν (Prod.mk x ⁻¹' s)) =ᶠ[ae μ] 0

tactic: rw [eventuallyLE_antisymm_iff]
state_before: case intro.intro.intro
α : Type u_2
α' : Type ?u.4447841
β : Type u_1
β' : Type ?u.4447847
γ : Type ?u.4447850
E : Type ?u.4447853
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SigmaFinite ν
s : Set (α × β)
h : ↑↑(Measure.prod μ ν) s = 0
t : Set (α × β)
hst : s ⊆ t
mt : MeasurableSet t
ht : (fun x => ↑↑ν (Prod.mk x ⁻¹' t)) =ᶠ[ae μ] 0
⊢ (fun x => ↑↑ν (Prod.mk x ⁻¹' s)) =ᶠ[ae μ] 0

tactic: exact
  ⟨EventuallyLE.trans_eq (eventually_of_forall fun x => (measure_mono (preimage_mono hst) : _))
      ht,
    eventually_of_forall fun x => zero_le _⟩
state_before: case intro.intro.intro
α : Type u_2
α' : Type ?u.4447841
β : Type u_1
β' : Type ?u.4447847
γ : Type ?u.4447850
E : Type ?u.4447853
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SigmaFinite ν
s : Set (α × β)
h : ↑↑(Measure.prod μ ν) s = 0
t : Set (α × β)
hst : s ⊆ t
mt : MeasurableSet t
ht : (fun x => ↑↑ν (Prod.mk x ⁻¹' t)) =ᶠ[ae μ] 0
⊢ (fun x => ↑↑ν (Prod.mk x ⁻¹' s)) ≤ᶠ[ae μ] 0 ∧ 0 ≤ᶠ[ae μ] fun x => ↑↑ν (Prod.mk x ⁻¹' s)
Theorem: CategoryTheory.Exact.lift_comp
File: Mathlib/CategoryTheory/Preadditive/Projective.lean

tactic: simp only [Exact.lift]
state_before: C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
inst✝² : HasEqualizers C
inst✝¹ : HasImages C
P Q R S : C
inst✝ : Projective P
h : P ⟶ R
f : Q ⟶ R
g : R ⟶ S
hfg : Exact f g
w : h ≫ g = 0
⊢ lift h f g hfg w ≫ f = h

tactic: conv_lhs =>
  congr
  rfl
  rw [← imageSubobject_arrow_comp f]
state_before: C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
inst✝² : HasEqualizers C
inst✝¹ : HasImages C
P Q R S : C
inst✝ : Projective P
h : P ⟶ R
f : Q ⟶ R
g : R ⟶ S
hfg : Exact f g
w : h ≫ g = 0
⊢ factorThru (factorThru (factorThruKernelSubobject g h w) (imageToKernel f g (_ : f ≫ g = 0)))
        (factorThruImageSubobject f) ≫
      f =
    h

tactic: haveI := hfg.epi
state_before: C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
inst✝² : HasEqualizers C
inst✝¹ : HasImages C
P Q R S : C
inst✝ : Projective P
h : P ⟶ R
f : Q ⟶ R
g : R ⟶ S
hfg : Exact f g
w : h ≫ g = 0
⊢ factorThru (factorThru (factorThruKernelSubobject g h w) (imageToKernel f g (_ : f ≫ g = 0)))
        (factorThruImageSubobject f) ≫
      factorThruImageSubobject f ≫ Subobject.arrow (imageSubobject f) =
    h

tactic: rw [← Category.assoc, factorThru_comp, ← imageToKernel_arrow f g, ← Category.assoc,
  CategoryTheory.Projective.factorThru_comp, factorThruKernelSubobject_comp_arrow]
state_before: C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
inst✝² : HasEqualizers C
inst✝¹ : HasImages C
P Q R S : C
inst✝ : Projective P
h : P ⟶ R
f : Q ⟶ R
g : R ⟶ S
hfg : Exact f g
w : h ≫ g = 0
this : Epi (imageToKernel f g (_ : f ≫ g = 0))
⊢ factorThru (factorThru (factorThruKernelSubobject g h w) (imageToKernel f g (_ : f ≫ g = 0)))
        (factorThruImageSubobject f) ≫
      factorThruImageSubobject f ≫ Subobject.arrow (imageSubobject f) =
    h
Theorem: List.Nodup.subperm
File: Mathlib/Data/List/Perm.lean

tactic: induction' d with a l₁' h d IH
state_before: α : Type uu
β : Type vv
l₁ l₂ : List α
d : Nodup l₁
H : l₁ ⊆ l₂
⊢ l₁ <+~ l₂

tactic: exact ⟨nil, Perm.nil, nil_sublist _⟩
state_before: case nil
α : Type uu
β : Type vv
l₁ l₂ : List α
H✝ : l₁ ⊆ l₂
H : [] ⊆ l₂
⊢ [] <+~ l₂

tactic: cases' forall_mem_cons.1 H with H₁ H₂
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ : List α
H✝ : l₁ ⊆ l₂
a : α
l₁' : List α
h : ∀ (a' : α), a' ∈ l₁' → a ≠ a'
d : Pairwise (fun x x_1 => x ≠ x_1) l₁'
IH : l₁' ⊆ l₂ → l₁' <+~ l₂
H : a :: l₁' ⊆ l₂
⊢ a :: l₁' <+~ l₂

tactic: simp at h
state_before: case cons.intro
α : Type uu
β : Type vv
l₁ l₂ : List α
H✝ : l₁ ⊆ l₂
a : α
l₁' : List α
h : ∀ (a' : α), a' ∈ l₁' → a ≠ a'
d : Pairwise (fun x x_1 => x ≠ x_1) l₁'
IH : l₁' ⊆ l₂ → l₁' <+~ l₂
H : a :: l₁' ⊆ l₂
H₁ : a ∈ l₂
H₂ : ∀ (x : α), x ∈ l₁' → x ∈ l₂
⊢ a :: l₁' <+~ l₂

tactic: exact cons_subperm_of_mem d h H₁ (IH H₂)
state_before: case cons.intro
α : Type uu
β : Type vv
l₁ l₂ : List α
H✝ : l₁ ⊆ l₂
a : α
l₁' : List α
d : Pairwise (fun x x_1 => x ≠ x_1) l₁'
IH : l₁' ⊆ l₂ → l₁' <+~ l₂
H : a :: l₁' ⊆ l₂
H₁ : a ∈ l₂
H₂ : ∀ (x : α), x ∈ l₁' → x ∈ l₂
h : ¬a ∈ l₁'
⊢ a :: l₁' <+~ l₂
Theorem: CategoryTheory.Subobject.factors_right_of_factors_add
File: Mathlib/CategoryTheory/Subobject/FactorThru.lean

tactic: simp
state_before: C : Type u₁
inst✝² : Category C
X✝ Y✝ Z : C
D : Type u₂
inst✝¹ : Category D
inst✝ : Preadditive C
X Y : C
P : Subobject Y
f g : X ⟶ Y
w : Factors P (f + g)
wf : Factors P f
⊢ (factorThru P (f + g) w - factorThru P f wf) ≫ MonoOver.arrow (representative.obj P) = g
Theorem: AnalyticAt.sub
File: Mathlib/Analysis/Analytic/Basic.lean

tactic: simpa only [sub_eq_add_neg] using hf.add hg.neg
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.559282
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
f g : E → F
p pf pg : FormalMultilinearSeries 𝕜 E F
x : E
r r' : ℝ≥0∞
hf : AnalyticAt 𝕜 f x
hg : AnalyticAt 𝕜 g x
⊢ AnalyticAt 𝕜 (f - g) x
Theorem: CategoryTheory.Limits.colimit.pre_id
File: Mathlib/CategoryTheory/Limits/HasLimits.lean

tactic: aesop_cat
state_before: J : Type u₁
inst✝³ : Category J
K : Type u₂
inst✝² : Category K
C : Type u
inst✝¹ : Category C
F✝ : J ⥤ C
inst✝ : HasColimitsOfShape J C
G : J ⥤ C
α : F✝ ⟶ G
F : J ⥤ C
⊢ pre F (𝟭 J) = colim.map (leftUnitor F).hom
Theorem: Matrix.det_mul_left_comm
File: Mathlib/LinearAlgebra/Matrix/Determinant.lean

tactic: rw [← Matrix.mul_assoc, ← Matrix.mul_assoc, det_mul, det_mul_comm M N, ← det_mul]
state_before: m : Type u_1
n : Type ?u.899819
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
M N P : Matrix m m R
⊢ det (M ⬝ (N ⬝ P)) = det (N ⬝ (M ⬝ P))
Theorem: Polynomial.degree_lt_degree
File: Mathlib/Data/Polynomial/Degree/Definitions.lean

tactic: by_cases hp : p = 0
state_before: R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
⊢ degree p < degree q

tactic: simp [hp]
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
hp : p = 0
⊢ degree p < degree q

tactic: rw [bot_lt_iff_ne_bot]
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
hp : p = 0
⊢ ⊥ < degree q

tactic: intro hq
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
hp : p = 0
⊢ degree q ≠ ⊥

tactic: simp [hp, degree_eq_bot.mp hq, lt_irrefl] at h
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
hp : p = 0
hq : degree q = ⊥
⊢ False

tactic: rw [degree_eq_natDegree hp, degree_eq_natDegree <| ne_zero_of_natDegree_gt h,
  Nat.cast_withBot, Nat.cast_withBot]
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
hp : ¬p = 0
⊢ degree p < degree q

tactic: exact_mod_cast h
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p q : R[X]
ι : Type ?u.467624
h : natDegree p < natDegree q
hp : ¬p = 0
⊢ ↑(natDegree p) < ↑(natDegree q)
Theorem: isAlgebraic_algebraMap_iff
File: Mathlib/RingTheory/Algebraic.lean

tactic: rwa [map_zero, ← aeval_algebraMap_apply]
state_before: R : Type u
S : Type u_1
A : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Ring A
inst✝³ : Algebra R A
inst✝² : Algebra R S
inst✝¹ : Algebra S A
inst✝ : IsScalarTower R S A
a : S
h : Function.Injective ↑(algebraMap S A)
x✝ : IsAlgebraic R (↑(algebraMap S A) a)
p : R[X]
hp0 : p ≠ 0
hp : ↑(aeval (↑(algebraMap S A) a)) p = 0
⊢ ↑(algebraMap S A) (↑(aeval a) p) = ↑(algebraMap S A) 0
Theorem: List.count_eq_length
File: Mathlib/Data/List/Count.lean

tactic: simp_rw [count, countp_eq_length, beq_iff_eq, eq_comm]
state_before: α : Type u_1
l : List α
inst✝ : DecidableEq α
a : α
⊢ count a l = length l ↔ ∀ (b : α), b ∈ l → a = b
Theorem: Nat.Prime.eq_one_or_self_of_dvd
File: Mathlib/Data/Nat/Prime.lean

tactic: obtain ⟨n, hn⟩ := hm
state_before: p : ℕ
pp : Prime p
m : ℕ
hm : m ∣ p
⊢ m = 1 ∨ m = p

tactic: have := pp.isUnit_or_isUnit hn
state_before: case intro
p : ℕ
pp : Prime p
m n : ℕ
hn : p = m * n
⊢ m = 1 ∨ m = p

tactic: rw [Nat.isUnit_iff, Nat.isUnit_iff] at this
state_before: case intro
p : ℕ
pp : Prime p
m n : ℕ
hn : p = m * n
this : IsUnit m ∨ IsUnit n
⊢ m = 1 ∨ m = p

tactic: apply Or.imp_right _ this
state_before: case intro
p : ℕ
pp : Prime p
m n : ℕ
hn : p = m * n
this : m = 1 ∨ n = 1
⊢ m = 1 ∨ m = p

tactic: rintro rfl
state_before: p : ℕ
pp : Prime p
m n : ℕ
hn : p = m * n
this : m = 1 ∨ n = 1
⊢ n = 1 → m = p

tactic: rw [hn, mul_one]
state_before: p : ℕ
pp : Prime p
m : ℕ
hn : p = m * 1
this : m = 1 ∨ 1 = 1
⊢ m = p
Theorem: UFModel.Models.push
File: Mathlib/Data/UnionFind.lean

tactic: intro H
state_before: case g
α : Type u_1
arr : Array (UFNode α)
n : ℕ
m : UFModel n
H : Models arr m
k : ℕ
hk : k = n + 1
x : α
⊢ (Agrees arr (fun x => x.rank) fun i => rank m ↑i) →
    Agrees (Array.push arr { parent := n, value := x, rank := 0 }) (fun x => x.rank) fun i =>
      rank (UFModel.push m k (_ : n ≤ k)) ↑i

tactic: refine H.push _ hk _ _ (fun i h ↦ ?_) (fun h ↦ ?_) <;>
simp [UFModel.push, h, lt_irrefl]
state_before: case g
α : Type u_1
arr : Array (UFNode α)
n : ℕ
m : UFModel n
H✝ : Models arr m
k : ℕ
hk : k = n + 1
x : α
H : Agrees arr (fun x => x.rank) fun i => rank m ↑i
⊢ Agrees (Array.push arr { parent := n, value := x, rank := 0 }) (fun x => x.rank) fun i =>
    rank (UFModel.push m k (_ : n ≤ k)) ↑i
Theorem: Set.Icc_diff_pi_univ_Ioc_subset
File: Mathlib/Data/Set/Intervals/Pi.lean

tactic: rintro a ⟨⟨hax, haz⟩, hay⟩
state_before: ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y z : (i : ι) → α i
⊢ (Icc x z \ pi univ fun i => Ioc (y i) (z i)) ⊆ ⋃ (i : ι), Icc x (update z i (y i))

tactic: simpa [not_and_or, hax, le_update_iff, haz _] using hay
state_before: case intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y z a : (i : ι) → α i
hay : ¬a ∈ pi univ fun i => Ioc (y i) (z i)
hax : x ≤ a
haz : a ≤ z
⊢ a ∈ ⋃ (i : ι), Icc x (update z i (y i))
Theorem: Int.dvd_neg
File: Std/Data/Int/DivMod.lean

tactic: constructor <;> exact fun ⟨k, e⟩ =>
  ⟨-k, by simp [← e, Int.neg_mul, Int.mul_neg, Int.neg_neg]⟩
state_before: a b : Int
⊢ a ∣ -b ↔ a ∣ b

tactic: simp [← e, Int.neg_mul, Int.mul_neg, Int.neg_neg]
state_before: a b : Int
x✝ : a ∣ b
k : Int
e : b = a * k
⊢ -b = a * -k
Theorem: Multiset.coe_product
File: Mathlib/Data/Multiset/Bind.lean

tactic: dsimp only [SProd.sprod]
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.54312
δ : Type ?u.54315
a : α
b : β
s : Multiset α
t : Multiset β
l₁ : List α
l₂ : List β
⊢ ↑l₁ ×ˢ ↑l₂ = ↑(l₁ ×ˢ l₂)

tactic: rw [product, List.product, ← coe_bind]
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.54312
δ : Type ?u.54315
a : α
b : β
s : Multiset α
t : Multiset β
l₁ : List α
l₂ : List β
⊢ product ↑l₁ ↑l₂ = ↑(List.product l₁ l₂)

tactic: simp
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.54312
δ : Type ?u.54315
a : α
b : β
s : Multiset α
t : Multiset β
l₁ : List α
l₂ : List β
⊢ (bind ↑l₁ fun a => map (Prod.mk a) ↑l₂) = bind ↑l₁ fun a => ↑(List.map (Prod.mk a) l₂)
Theorem: StrictConcaveOn.translate_left
File: Mathlib/Analysis/Convex/Function.lean

tactic: simpa only [add_comm] using hf.translate_right c
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type ?u.720082
α : Type ?u.720085
β : Type u_3
ι : Type ?u.720091
inst✝⁴ : OrderedSemiring 𝕜
inst✝³ : AddCancelCommMonoid E
inst✝² : OrderedAddCommMonoid β
inst✝¹ : Module 𝕜 E
inst✝ : SMul 𝕜 β
s : Set E
f : E → β
hf : StrictConcaveOn 𝕜 s f
c : E
⊢ StrictConcaveOn 𝕜 ((fun z => c + z) ⁻¹' s) (f ∘ fun z => z + c)
Theorem: lowerClosure_mul_distrib
File: Mathlib/Algebra/Order/UpperLower.lean

tactic: rw [LowerSet.coe_mul, mul_lowerClosure, lowerClosure_mul, LowerSet.lowerClosure]
state_before: α : Type u_1
inst✝ : OrderedCommGroup α
s t : Set α
a : α
⊢ ↑(lowerClosure (s * t)) = ↑(lowerClosure s * lowerClosure t)
Theorem: Fin.insertNth_last
File: Mathlib/Data/Fin/Tuple/Basic.lean

tactic: refine' insertNth_eq_iff.2 ⟨by simp, _⟩
state_before: m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
⊢ insertNth (last n) x p = snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x

tactic: ext j
state_before: m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
⊢ p = fun j =>
    snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (↑(succAbove (last n)) j)

tactic: apply eq_of_heq
state_before: case h
m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
j : Fin n
⊢ p j =
    snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (↑(succAbove (last n)) j)

tactic: trans snoc (fun j ↦ _root_.cast (congr_arg α (succAbove_last_apply j)) (p j)) x (castSucc j)
state_before: case h.h
m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
j : Fin n
⊢ HEq (p j)
    (snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (↑(succAbove (last n)) j))

tactic: simp
state_before: m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
⊢ snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (last n) = x

tactic: rw [snoc_castSucc]
state_before: m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
j : Fin n
⊢ HEq (p j) (snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (↑castSucc j))

tactic: exact (cast_heq _ _).symm
state_before: m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
j : Fin n
⊢ HEq (p j) (_root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j))

tactic: apply congr_arg_heq
state_before: m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
j : Fin n
⊢ HEq (snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (↑castSucc j))
    (snoc (fun j => _root_.cast (_ : α (↑(succAbove (last n)) j) = α (↑castSucc j)) (p j)) x (↑(succAbove (last n)) j))

tactic: rw [succAbove_last]
state_before: case a
m n : ℕ
α : Fin (n + 1) → Type u
β : Type v
x : α (last n)
p : (j : Fin n) → α (↑(succAbove (last n)) j)
j : Fin n
⊢ ↑castSucc j = ↑(succAbove (last n)) j