l3lab/ntp-mathlib huggingface dataset:
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  

Proof state:
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
⊢ Tendsto (fun w => ∫ (v : V), ↑(e (Multiplicative.ofAdd (-w v))) • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0)

Next tactic:
let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        intro t s
        ext1 v
        simp only [ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.add_apply]
      map_smul' := by
        intro x f
        ext1 v
        simp only [RingHom.id_apply, ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.smul_apply]
      left_inv := by
        intro w
        ext1 v
        simp only [ContinuousLinearMap.coe_comp',
          ContinuousLinearEquiv.coe_coe, Function.comp_apply,
          ContinuousLinearEquiv.symm_apply_apply]
      right_inv := by
        intro w
        ext1 v
        simp only [ContinuousLinearMap.coe_comp',
          ContinuousLinearEquiv.coe_coe, Function.comp_apply,
          ContinuousLinearEquiv.apply_symm_apply] }
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        

Proof state:
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
⊢ ∀ (x y : V →L[ℝ] ℝ),
    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (x + y) =
      (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) x +
        (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) y

Next tactic:
intro t s
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        intro t s
        

Proof state:
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
t s : V →L[ℝ] ℝ
⊢ (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
      (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s

Next tactic:
ext1 v
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        intro t s
        ext1 v
        

Proof state:
case h
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
t s : V →L[ℝ] ℝ
v : V'
⊢ ((fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s)) v =
    ((fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
        (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s)
      v

Next tactic:
simp only [ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.add_apply]
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        intro t s
        ext1 v
        simp only [ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.add_apply]
      map_smul' := by
        

Proof state:
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
⊢ ∀ (r : ℝ) (x : V →L[ℝ] ℝ),
    AddHom.toFun
        { toFun := fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A),
          map_add' :=
            (_ :
              ∀ (t s : V →L[ℝ] ℝ),
                (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
                  (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
                    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s) }
        (r • x) =
      (RingHom.id ℝ) r •
        AddHom.toFun
          { toFun := fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A),
            map_add' :=
              (_ :
                ∀ (t s : V →L[ℝ] ℝ),
                  (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
                    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
                      (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s) }
          x

Next tactic:
intro x f
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        intro t s
        ext1 v
        simp only [ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.add_apply]
      map_smul' := by
        intro x f
        

Proof state:
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f✝ : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
x : ℝ
f : V →L[ℝ] ℝ
⊢ AddHom.toFun
      { toFun := fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A),
        map_add' :=
          (_ :
            ∀ (t s : V →L[ℝ] ℝ),
              (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
                (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
                  (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s) }
      (x • f) =
    (RingHom.id ℝ) x •
      AddHom.toFun
        { toFun := fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A),
          map_add' :=
            (_ :
              ∀ (t s : V →L[ℝ] ℝ),
                (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
                  (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
                    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s) }
        f

Next tactic:
ext1 v
/-- Riemann-Lebesgue lemma for functions on a finite-dimensional real vector space, formulated via
dual space. -/
theorem tendsto_integral_exp_smul_cocompact (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0) := by
  -- We have already proved the result for inner-product spaces, formulated in a way which doesn't
  -- refer to the inner product. So we choose an arbitrary inner-product space isomorphic to V
  -- and port the result over from there.
  let V' := EuclideanSpace ℝ (Fin (finrank ℝ V))
  have A : V ≃L[ℝ] V' := toEuclidean
  borelize V'
  -- various equivs derived from A
  let Aₘ : MeasurableEquiv V V' := A.toHomeomorph.toMeasurableEquiv
  -- isomorphism between duals derived from A -- need to do continuity as a separate step in order
  -- to apply `LinearMap.continuous_of_finiteDimensional`.
  let Adualₗ : (V →L[ℝ] ℝ) ≃ₗ[ℝ] V' →L[ℝ] ℝ :=
    { toFun := fun t => t.comp A.symm.toContinuousLinearMap
      invFun := fun t => t.comp A.toContinuousLinearMap
      map_add' := by
        intro t s
        ext1 v
        simp only [ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.add_apply]
      map_smul' := by
        intro x f
        ext1 v
        

Proof state:
case h
E : Type u_1
V : Type u_2
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : NormedSpace ℂ E
f✝ : V → E
inst✝¹⁰ : AddCommGroup V
inst✝⁹ : TopologicalSpace V
inst✝⁸ : TopologicalAddGroup V
inst✝⁷ : T2Space V
inst✝⁶ : MeasurableSpace V
inst✝⁵ : BorelSpace V
inst✝⁴ : Module ℝ V
inst✝³ : ContinuousSMul ℝ V
inst✝² : FiniteDimensional ℝ V
inst✝¹ : CompleteSpace E
μ : Measure V
inst✝ : Measure.IsAddHaarMeasure μ
V' : Type := EuclideanSpace ℝ (Fin (finrank ℝ V))
A : V ≃L[ℝ] V'
this✝¹ : MeasurableSpace V' := borel V'
this✝ : BorelSpace V'
Aₘ : V ≃ᵐ V' := Homeomorph.toMeasurableEquiv (ContinuousLinearEquiv.toHomeomorph A)
x : ℝ
f : V →L[ℝ] ℝ
v : V'
⊢ (AddHom.toFun
        { toFun := fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A),
          map_add' :=
            (_ :
              ∀ (t s : V →L[ℝ] ℝ),
                (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
                  (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
                    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s) }
        (x • f))
      v =
    ((RingHom.id ℝ) x •
        AddHom.toFun
          { toFun := fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A),
            map_add' :=
              (_ :
                ∀ (t s : V →L[ℝ] ℝ),
                  (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) (t + s) =
                    (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) t +
                      (fun t => ContinuousLinearMap.comp t ↑(ContinuousLinearEquiv.symm A)) s) }
          f)
      v

Next tactic:
simp only [RingHom.id_apply, ContinuousLinearMap.coe_comp', Function.comp_apply,
          ContinuousLinearMap.smul_apply]
theorem nodup_iff_ne_cons_cons {s : Multiset α} : s.Nodup ↔ ∀ a t, s ≠ a ::ₘ a ::ₘ t :=
  nodup_iff_le.trans
    ⟨fun h a t s_eq => h a (s_eq.symm ▸ cons_le_cons a (cons_le_cons a (zero_le _))), fun h a le =>
      let ⟨t, s_eq⟩ := le_iff_exists_add.mp le
      h a t (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t✝ : Multiset α
a✝ : α
s : Multiset α
h : ∀ (a : α) (t : Multiset α), s ≠ a ::ₘ a ::ₘ t
a : α
le : a ::ₘ a ::ₘ 0 ≤ s
t : Multiset α
s_eq : s = a ::ₘ a ::ₘ 0 + t
⊢ s = a ::ₘ a ::ₘ t

Next tactic:
rwa [cons_add, cons_add, zero_add] at s_eq
theorem nodup_iff_count_le_one [DecidableEq α] {s : Multiset α} : Nodup s ↔ ∀ a, count a s ≤ 1 :=
  Quot.induction_on s fun _l => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t : Multiset α
a : α
inst✝ : DecidableEq α
s : Multiset α
_l : List α
⊢ Nodup (Quot.mk Setoid.r _l) ↔ ∀ (a : α), count a (Quot.mk Setoid.r _l) ≤ 1

Next tactic:
simp only [quot_mk_to_coe'', coe_nodup, mem_coe, coe_count]
theorem nodup_iff_count_le_one [DecidableEq α] {s : Multiset α} : Nodup s ↔ ∀ a, count a s ≤ 1 :=
  Quot.induction_on s fun _l => by
    simp only [quot_mk_to_coe'', coe_nodup, mem_coe, coe_count]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t : Multiset α
a : α
inst✝ : DecidableEq α
s : Multiset α
_l : List α
⊢ List.Nodup _l ↔ ∀ (a : α), List.count a _l ≤ 1

Next tactic:
exact List.nodup_iff_count_le_one
theorem nodup_iff_count_eq_one [DecidableEq α] : Nodup s ↔ ∀ a ∈ s, count a s = 1 :=
  Quot.induction_on s fun _l => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s t : Multiset α
a : α
inst✝ : DecidableEq α
_l : List α
⊢ Nodup (Quot.mk Setoid.r _l) ↔ ∀ a ∈ Quot.mk Setoid.r _l, count a (Quot.mk Setoid.r _l) = 1

Next tactic:
simpa using List.nodup_iff_count_eq_one
theorem count_eq_of_nodup [DecidableEq α] {a : α} {s : Multiset α} (d : Nodup s) :
    count a s = if a ∈ s then 1 else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t : Multiset α
a✝ : α
inst✝ : DecidableEq α
a : α
s : Multiset α
d : Nodup s
⊢ count a s = if a ∈ s then 1 else 0

Next tactic:
split_ifs with h
theorem count_eq_of_nodup [DecidableEq α] {a : α} {s : Multiset α} (d : Nodup s) :
    count a s = if a ∈ s then 1 else 0 := by
  split_ifs with h
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t : Multiset α
a✝ : α
inst✝ : DecidableEq α
a : α
s : Multiset α
d : Nodup s
h : a ∈ s
⊢ count a s = 1

Next tactic:
exact count_eq_one_of_mem d h
theorem count_eq_of_nodup [DecidableEq α] {a : α} {s : Multiset α} (d : Nodup s) :
    count a s = if a ∈ s then 1 else 0 := by
  split_ifs with h
  · exact count_eq_one_of_mem d h
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t : Multiset α
a✝ : α
inst✝ : DecidableEq α
a : α
s : Multiset α
d : Nodup s
h : a ∉ s
⊢ count a s = 0

Next tactic:
exact count_eq_zero_of_not_mem h
theorem Nodup.add_iff (d₁ : Nodup s) (d₂ : Nodup t) : Nodup (s + t) ↔ Disjoint s t := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s t : Multiset α
a : α
d₁ : Nodup s
d₂ : Nodup t
⊢ Nodup (s + t) ↔ Disjoint s t

Next tactic:
simp [nodup_add, d₁, d₂]
theorem Nodup.mem_erase_iff [DecidableEq α] {a b : α} {l} (d : Nodup l) :
    a ∈ l.erase b ↔ a ≠ b ∧ a ∈ l := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s t : Multiset α
a✝ : α
inst✝ : DecidableEq α
a b : α
l : Multiset α
d : Nodup l
⊢ a ∈ Multiset.erase l b ↔ a ≠ b ∧ a ∈ l

Next tactic:
rw [d.erase_eq_filter b, mem_filter, and_comm]
protected theorem Nodup.product {t : Multiset β} : Nodup s → Nodup t → Nodup (s ×ˢ t) :=
  Quotient.inductionOn₂ s t fun l₁ l₂ d₁ d₂ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s t✝ : Multiset α
a : α
t : Multiset β
l₁ : List α
l₂ : List β
d₁ : Nodup ⟦l₁⟧
d₂ : Nodup ⟦l₂⟧
⊢ Nodup (⟦l₁⟧ ×ˢ ⟦l₂⟧)

Next tactic:
simp [List.Nodup.product d₁ d₂]
protected theorem Nodup.sigma {σ : α → Type*} {t : ∀ a, Multiset (σ a)} :
    Nodup s → (∀ a, Nodup (t a)) → Nodup (s.sigma t) :=
  Quot.induction_on s fun l₁ => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s t✝ : Multiset α
a : α
σ : α → Type u_4
t : (a : α) → Multiset (σ a)
l₁ : List α
⊢ Nodup (Quot.mk Setoid.r l₁) → (∀ (a : α), Nodup (t a)) → Nodup (Multiset.sigma (Quot.mk Setoid.r l₁) t)

Next tactic:
choose f hf using fun a => Quotient.exists_rep (t a)
protected theorem Nodup.sigma {σ : α → Type*} {t : ∀ a, Multiset (σ a)} :
    Nodup s → (∀ a, Nodup (t a)) → Nodup (s.sigma t) :=
  Quot.induction_on s fun l₁ => by
    choose f hf using fun a => Quotient.exists_rep (t a)
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s t✝ : Multiset α
a : α
σ : α → Type u_4
t : (a : α) → Multiset (σ a)
l₁ : List α
f : (a : α) → List (σ a)
hf : ∀ (a : α), ⟦f a⟧ = t a
⊢ Nodup (Quot.mk Setoid.r l₁) → (∀ (a : α), Nodup (t a)) → Nodup (Multiset.sigma (Quot.mk Setoid.r l₁) t)

Next tactic:
simpa [← funext hf] using List.Nodup.sigma
@[simp]
theorem nodup_union [DecidableEq α] {s t : Multiset α} : Nodup (s ∪ t) ↔ Nodup s ∧ Nodup t :=
  ⟨fun h => ⟨nodup_of_le (le_union_left _ _) h, nodup_of_le (le_union_right _ _) h⟩, fun ⟨h₁, h₂⟩ =>
    nodup_iff_count_le_one.2 fun a => by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t✝ : Multiset α
a✝ : α
inst✝ : DecidableEq α
s t : Multiset α
x✝ : Nodup s ∧ Nodup t
h₁ : Nodup s
h₂ : Nodup t
a : α
⊢ count a (s ∪ t) ≤ 1

Next tactic:
rw [count_union]
@[simp]
theorem nodup_union [DecidableEq α] {s t : Multiset α} : Nodup (s ∪ t) ↔ Nodup s ∧ Nodup t :=
  ⟨fun h => ⟨nodup_of_le (le_union_left _ _) h, nodup_of_le (le_union_right _ _) h⟩, fun ⟨h₁, h₂⟩ =>
    nodup_iff_count_le_one.2 fun a => by
      rw [count_union]
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ t✝ : Multiset α
a✝ : α
inst✝ : DecidableEq α
s t : Multiset α
x✝ : Nodup s ∧ Nodup t
h₁ : Nodup s
h₂ : Nodup t
a : α
⊢ max (count a s) (count a t) ≤ 1

Next tactic:
exact max_le (nodup_iff_count_le_one.1 h₁ a) (nodup_iff_count_le_one.1 h₂ a)