l3lab/ntp-mathlib huggingface dataset:
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    

Proof state:
case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : Partition G
hf : Set.Finite P.parts
this : Fintype ↑P.parts
hc : Fintype.card ↑P.parts ≤ n
⊢ Colorable G n

Next tactic:
apply P.to_colorable.mono hc
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    apply P.to_colorable.mono hc
  · 

Proof state:
case mpr
V : Type u
G : SimpleGraph V
n : ℕ
⊢ Colorable G n → Partitionable G n

Next tactic:
rintro ⟨C⟩
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    apply P.to_colorable.mono hc
  · rintro ⟨C⟩
    

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : Coloring G (Fin n)
⊢ Partitionable G n

Next tactic:
refine' ⟨C.toPartition, C.colorClasses_finite, le_trans _ (Fintype.card_fin n).le⟩
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    apply P.to_colorable.mono hc
  · rintro ⟨C⟩
    refine' ⟨C.toPartition, C.colorClasses_finite, le_trans _ (Fintype.card_fin n).le⟩
    

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : Coloring G (Fin n)
⊢ Finset.card (Set.Finite.toFinset (_ : Set.Finite (Coloring.colorClasses C))) ≤ Fintype.card (Fin n)

Next tactic:
generalize_proofs h
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    apply P.to_colorable.mono hc
  · rintro ⟨C⟩
    refine' ⟨C.toPartition, C.colorClasses_finite, le_trans _ (Fintype.card_fin n).le⟩
    generalize_proofs h
    

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : Coloring G (Fin n)
h : Set.Finite (Coloring.colorClasses C)
⊢ Finset.card (Set.Finite.toFinset h) ≤ Fintype.card (Fin n)

Next tactic:
haveI : Fintype C.colorClasses := C.colorClasses_finite.fintype
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    apply P.to_colorable.mono hc
  · rintro ⟨C⟩
    refine' ⟨C.toPartition, C.colorClasses_finite, le_trans _ (Fintype.card_fin n).le⟩
    generalize_proofs h
    haveI : Fintype C.colorClasses := C.colorClasses_finite.fintype
    

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : Coloring G (Fin n)
h : Set.Finite (Coloring.colorClasses C)
this : Fintype ↑(Coloring.colorClasses C)
⊢ Finset.card (Set.Finite.toFinset h) ≤ Fintype.card (Fin n)

Next tactic:
rw [h.card_toFinset]
theorem partitionable_iff_colorable {n : ℕ} : G.Partitionable n ↔ G.Colorable n := by
  constructor
  · rintro ⟨P, hf, hc⟩
    have : Fintype P.parts := hf.fintype
    rw [Set.Finite.card_toFinset hf] at hc
    apply P.to_colorable.mono hc
  · rintro ⟨C⟩
    refine' ⟨C.toPartition, C.colorClasses_finite, le_trans _ (Fintype.card_fin n).le⟩
    generalize_proofs h
    haveI : Fintype C.colorClasses := C.colorClasses_finite.fintype
    rw [h.card_toFinset]
    

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : Coloring G (Fin n)
h : Set.Finite (Coloring.colorClasses C)
this : Fintype ↑(Coloring.colorClasses C)
⊢ Fintype.card ↑(Coloring.colorClasses C) ≤ Fintype.card (Fin n)

Next tactic:
exact C.card_colorClasses_le
theorem continuousAt_sign_of_pos {a : α} (h : 0 < a) : ContinuousAt SignType.sign a := by
  

Proof state:
α : Type u_1
inst✝⁴ : Zero α
inst✝³ : TopologicalSpace α
inst✝² : PartialOrder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : OrderTopology α
a : α
h : 0 < a
⊢ ContinuousAt (⇑SignType.sign) a

Next tactic:
refine' (continuousAt_const : ContinuousAt (fun _ => (1 : SignType)) a).congr _
theorem continuousAt_sign_of_pos {a : α} (h : 0 < a) : ContinuousAt SignType.sign a := by
  refine' (continuousAt_const : ContinuousAt (fun _ => (1 : SignType)) a).congr _
  

Proof state:
α : Type u_1
inst✝⁴ : Zero α
inst✝³ : TopologicalSpace α
inst✝² : PartialOrder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : OrderTopology α
a : α
h : 0 < a
⊢ (fun x => 1) =ᶠ[nhds a] ⇑SignType.sign

Next tactic:
rw [Filter.EventuallyEq, eventually_nhds_iff]
theorem continuousAt_sign_of_pos {a : α} (h : 0 < a) : ContinuousAt SignType.sign a := by
  refine' (continuousAt_const : ContinuousAt (fun _ => (1 : SignType)) a).congr _
  rw [Filter.EventuallyEq, eventually_nhds_iff]
  

Proof state:
α : Type u_1
inst✝⁴ : Zero α
inst✝³ : TopologicalSpace α
inst✝² : PartialOrder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : OrderTopology α
a : α
h : 0 < a
⊢ ∃ t, (∀ x ∈ t, 1 = SignType.sign x) ∧ IsOpen t ∧ a ∈ t

Next tactic:
exact ⟨{ x | 0 < x }, fun x hx => (sign_pos hx).symm, isOpen_lt' 0, h⟩
theorem continuousAt_sign_of_neg {a : α} (h : a < 0) : ContinuousAt SignType.sign a := by
  

Proof state:
α : Type u_1
inst✝⁴ : Zero α
inst✝³ : TopologicalSpace α
inst✝² : PartialOrder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : OrderTopology α
a : α
h : a < 0
⊢ ContinuousAt (⇑SignType.sign) a

Next tactic:
refine' (continuousAt_const : ContinuousAt (fun x => (-1 : SignType)) a).congr _
theorem continuousAt_sign_of_neg {a : α} (h : a < 0) : ContinuousAt SignType.sign a := by
  refine' (continuousAt_const : ContinuousAt (fun x => (-1 : SignType)) a).congr _
  

Proof state:
α : Type u_1
inst✝⁴ : Zero α
inst✝³ : TopologicalSpace α
inst✝² : PartialOrder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : OrderTopology α
a : α
h : a < 0
⊢ (fun x => -1) =ᶠ[nhds a] ⇑SignType.sign

Next tactic:
rw [Filter.EventuallyEq, eventually_nhds_iff]
theorem continuousAt_sign_of_neg {a : α} (h : a < 0) : ContinuousAt SignType.sign a := by
  refine' (continuousAt_const : ContinuousAt (fun x => (-1 : SignType)) a).congr _
  rw [Filter.EventuallyEq, eventually_nhds_iff]
  

Proof state:
α : Type u_1
inst✝⁴ : Zero α
inst✝³ : TopologicalSpace α
inst✝² : PartialOrder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : OrderTopology α
a : α
h : a < 0
⊢ ∃ t, (∀ x ∈ t, -1 = SignType.sign x) ∧ IsOpen t ∧ a ∈ t

Next tactic:
exact ⟨{ x | x < 0 }, fun x hx => (sign_neg hx).symm, isOpen_gt' 0, h⟩
theorem continuousAt_sign_of_ne_zero {a : α} (h : a ≠ 0) : ContinuousAt SignType.sign a := by
  

Proof state:
α : Type u_1
inst✝³ : Zero α
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
h : a ≠ 0
⊢ ContinuousAt (⇑SignType.sign) a

Next tactic:
rcases h.lt_or_lt with (h_neg | h_pos)
theorem continuousAt_sign_of_ne_zero {a : α} (h : a ≠ 0) : ContinuousAt SignType.sign a := by
  rcases h.lt_or_lt with (h_neg | h_pos)
  · 

Proof state:
case inl
α : Type u_1
inst✝³ : Zero α
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
h : a ≠ 0
h_neg : a < 0
⊢ ContinuousAt (⇑SignType.sign) a

Next tactic:
exact continuousAt_sign_of_neg h_neg
theorem continuousAt_sign_of_ne_zero {a : α} (h : a ≠ 0) : ContinuousAt SignType.sign a := by
  rcases h.lt_or_lt with (h_neg | h_pos)
  · exact continuousAt_sign_of_neg h_neg
  · 

Proof state:
case inr
α : Type u_1
inst✝³ : Zero α
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
h : a ≠ 0
h_pos : 0 < a
⊢ ContinuousAt (⇑SignType.sign) a

Next tactic:
exact continuousAt_sign_of_pos h_pos
/-- Pullback a `LinearOrderedCommMonoidWithZero` under an injective map.
See note [reducible non-instances]. -/
@[reducible]
def Function.Injective.linearOrderedCommMonoidWithZero {β : Type*} [Zero β] [One β] [Mul β]
    [Pow β ℕ] [Sup β] [Inf β] (f : β → α) (hf : Function.Injective f) (zero : f 0 = 0)
    (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
    LinearOrderedCommMonoidWithZero β :=
  { LinearOrder.lift f hf hsup hinf, hf.orderedCommMonoid f one mul npow,
    hf.commMonoidWithZero f zero one mul npow with
    zero_le_one :=
      show f 0 ≤ f 1 by 

Proof state:
α : Type u_1
a b c d x y z : α
inst✝⁶ : LinearOrderedCommMonoidWithZero α
β : Type u_2
inst✝⁵ : Zero β
inst✝⁴ : One β
inst✝³ : Mul β
inst✝² : Pow β ℕ
inst✝¹ : Sup β
inst✝ : Inf β
f : β → α
hf : Injective f
zero : f 0 = 0
one : f 1 = 1
mul : ∀ (x y : β), f (x * y) = f x * f y
npow : ∀ (x : β) (n : ℕ), f (x ^ n) = f x ^ n
hsup : ∀ (x y : β), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : β), f (x ⊓ y) = min (f x) (f y)
src✝² : LinearOrder β := LinearOrder.lift f hf hsup hinf
src✝¹ : OrderedCommMonoid β := orderedCommMonoid f hf one mul npow
src✝ : CommMonoidWithZero β := Injective.commMonoidWithZero f hf zero one mul npow
⊢ f 0 ≤ f 1

Next tactic:
simp only [zero, one, LinearOrderedCommMonoidWithZero.zero_le_one]
@[simp]
theorem zero_le' : 0 ≤ a := by 

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommMonoidWithZero α
⊢ 0 ≤ a

Next tactic:
simpa only [mul_zero, mul_one] using mul_le_mul_left' zero_le_one a
theorem le_of_le_mul_right (h : c ≠ 0) (hab : a * c ≤ b * c) : a ≤ b := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : c ≠ 0
hab : a * c ≤ b * c
⊢ a ≤ b

Next tactic:
simpa only [mul_inv_cancel_right₀ h] using mul_le_mul_right' hab c⁻¹
theorem le_mul_inv_of_mul_le (h : c ≠ 0) (hab : a * c ≤ b) : a ≤ b * c⁻¹ :=
  le_of_le_mul_right h (by 

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : c ≠ 0
hab : a * c ≤ b
⊢ a * c ≤ b * c⁻¹ * c

Next tactic:
simpa [h] using hab
theorem mul_inv_le_of_le_mul (hab : a ≤ b * c) : a * c⁻¹ ≤ b := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
⊢ a * c⁻¹ ≤ b

Next tactic:
by_cases h : c = 0
theorem mul_inv_le_of_le_mul (hab : a ≤ b * c) : a * c⁻¹ ≤ b := by
  by_cases h : c = 0
  · 

Proof state:
case pos
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
h : c = 0
⊢ a * c⁻¹ ≤ b

Next tactic:
simp [h]
theorem mul_inv_le_of_le_mul (hab : a ≤ b * c) : a * c⁻¹ ≤ b := by
  by_cases h : c = 0
  · simp [h]
  · 

Proof state:
case neg
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
h : ¬c = 0
⊢ a * c⁻¹ ≤ b

Next tactic:
exact le_of_le_mul_right h (by simpa [h] using hab)
theorem mul_inv_le_of_le_mul (hab : a ≤ b * c) : a * c⁻¹ ≤ b := by
  by_cases h : c = 0
  · simp [h]
  · exact le_of_le_mul_right h (by 

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
h : ¬c = 0
⊢ a * c⁻¹ * c ≤ b * c

Next tactic:
simpa [h] using hab
theorem div_le_div₀ (a b c d : α) (hb : b ≠ 0) (hd : d ≠ 0) : a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b :=
  by 

Proof state:
α : Type u_1
a✝ b✝ c✝ d✝ x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a b c d : α
hb : b ≠ 0
hd : d ≠ 0
⊢ a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b

Next tactic:
rw [mul_inv_le_iff₀ hb, mul_right_comm, le_mul_inv_iff₀ hd]
theorem mul_lt_mul_of_lt_of_le₀ (hab : a ≤ b) (hb : b ≠ 0) (hcd : c < d) : a * c < b * d :=
  have hd : d ≠ 0 := ne_zero_of_lt hcd
  if ha : a = 0 then by
    

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : a = 0
⊢ a * c < b * d

Next tactic:
rw [ha, zero_mul, zero_lt_iff]
theorem mul_lt_mul_of_lt_of_le₀ (hab : a ≤ b) (hb : b ≠ 0) (hcd : c < d) : a * c < b * d :=
  have hd : d ≠ 0 := ne_zero_of_lt hcd
  if ha : a = 0 then by
    rw [ha, zero_mul, zero_lt_iff]
    

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : a = 0
⊢ b * d ≠ 0

Next tactic:
exact mul_ne_zero hb hd
theorem mul_lt_mul_of_lt_of_le₀ (hab : a ≤ b) (hb : b ≠ 0) (hcd : c < d) : a * c < b * d :=
  have hd : d ≠ 0 := ne_zero_of_lt hcd
  if ha : a = 0 then by
    rw [ha, zero_mul, zero_lt_iff]
    exact mul_ne_zero hb hd
  else
    if hc : c = 0 then by
      

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : ¬a = 0
hc : c = 0
⊢ a * c < b * d

Next tactic:
rw [hc, mul_zero, zero_lt_iff]
theorem mul_lt_mul_of_lt_of_le₀ (hab : a ≤ b) (hb : b ≠ 0) (hcd : c < d) : a * c < b * d :=
  have hd : d ≠ 0 := ne_zero_of_lt hcd
  if ha : a = 0 then by
    rw [ha, zero_mul, zero_lt_iff]
    exact mul_ne_zero hb hd
  else
    if hc : c = 0 then by
      rw [hc, mul_zero, zero_lt_iff]
      

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : ¬a = 0
hc : c = 0
⊢ b * d ≠ 0

Next tactic:
exact mul_ne_zero hb hd
theorem mul_inv_lt_of_lt_mul₀ (h : x < y * z) : x * z⁻¹ < y := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : x < y * z
⊢ x * z⁻¹ < y

Next tactic:
contrapose! h
theorem mul_inv_lt_of_lt_mul₀ (h : x < y * z) : x * z⁻¹ < y := by
  contrapose! h
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : y ≤ x * z⁻¹
⊢ y * z ≤ x

Next tactic:
simpa only [inv_inv] using mul_inv_le_of_le_mul h
theorem inv_mul_lt_of_lt_mul₀ (h : x < y * z) : y⁻¹ * x < z := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : x < y * z
⊢ y⁻¹ * x < z

Next tactic:
rw [mul_comm] at *
theorem inv_mul_lt_of_lt_mul₀ (h : x < y * z) : y⁻¹ * x < z := by
  rw [mul_comm] at *
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : x < z * y
⊢ x * y⁻¹ < z

Next tactic:
exact mul_inv_lt_of_lt_mul₀ h
theorem mul_lt_right₀ (c : α) (h : a < b) (hc : c ≠ 0) : a * c < b * c := by
  

Proof state:
α : Type u_1
a b c✝ d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
c : α
h : a < b
hc : c ≠ 0
⊢ a * c < b * c

Next tactic:
contrapose! h
theorem mul_lt_right₀ (c : α) (h : a < b) (hc : c ≠ 0) : a * c < b * c := by
  contrapose! h
  

Proof state:
α : Type u_1
a b c✝ d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
c : α
hc : c ≠ 0
h : b * c ≤ a * c
⊢ b ≤ a

Next tactic:
exact le_of_le_mul_right hc h
theorem lt_of_mul_lt_mul_of_le₀ (h : a * b < c * d) (hc : 0 < c) (hh : c ≤ a) : b < d := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
hh : c ≤ a
⊢ b < d

Next tactic:
have ha : a ≠ 0 := ne_of_gt (lt_of_lt_of_le hc hh)
theorem lt_of_mul_lt_mul_of_le₀ (h : a * b < c * d) (hc : 0 < c) (hh : c ≤ a) : b < d := by
  have ha : a ≠ 0 := ne_of_gt (lt_of_lt_of_le hc hh)
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
hh : c ≤ a
ha : a ≠ 0
⊢ b < d

Next tactic:
simp_rw [← inv_le_inv₀ ha (ne_of_gt hc)] at hh
theorem lt_of_mul_lt_mul_of_le₀ (h : a * b < c * d) (hc : 0 < c) (hh : c ≤ a) : b < d := by
  have ha : a ≠ 0 := ne_of_gt (lt_of_lt_of_le hc hh)
  simp_rw [← inv_le_inv₀ ha (ne_of_gt hc)] at hh
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
ha : a ≠ 0
hh : a⁻¹ ≤ c⁻¹
⊢ b < d

Next tactic:
have := mul_lt_mul_of_lt_of_le₀ hh (inv_ne_zero (ne_of_gt hc)) h
theorem lt_of_mul_lt_mul_of_le₀ (h : a * b < c * d) (hc : 0 < c) (hh : c ≤ a) : b < d := by
  have ha : a ≠ 0 := ne_of_gt (lt_of_lt_of_le hc hh)
  simp_rw [← inv_le_inv₀ ha (ne_of_gt hc)] at hh
  have := mul_lt_mul_of_lt_of_le₀ hh (inv_ne_zero (ne_of_gt hc)) h
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
ha : a ≠ 0
hh : a⁻¹ ≤ c⁻¹
this : a⁻¹ * (a * b) < c⁻¹ * (c * d)
⊢ b < d

Next tactic:
simpa [inv_mul_cancel_left₀ ha, inv_mul_cancel_left₀ (ne_of_gt hc)] using this
theorem mul_le_mul_left₀ (ha : a ≠ 0) : a * b ≤ a * c ↔ b ≤ c := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
ha : a ≠ 0
⊢ a * b ≤ a * c ↔ b ≤ c

Next tactic:
simp only [mul_comm a]
theorem mul_le_mul_left₀ (ha : a ≠ 0) : a * b ≤ a * c ↔ b ≤ c := by
  simp only [mul_comm a]
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
ha : a ≠ 0
⊢ b * a ≤ c * a ↔ b ≤ c

Next tactic:
exact mul_le_mul_right₀ ha
theorem div_le_div_right₀ (hc : c ≠ 0) : a / c ≤ b / c ↔ a ≤ b := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hc : c ≠ 0
⊢ a / c ≤ b / c ↔ a ≤ b

Next tactic:
rw [div_eq_mul_inv, div_eq_mul_inv, mul_le_mul_right₀ (inv_ne_zero hc)]
theorem div_le_div_left₀ (ha : a ≠ 0) (hb : b ≠ 0) (hc : c ≠ 0) : a / b ≤ a / c ↔ c ≤ b := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
ha : a ≠ 0
hb : b ≠ 0
hc : c ≠ 0
⊢ a / b ≤ a / c ↔ c ≤ b

Next tactic:
simp only [div_eq_mul_inv, mul_le_mul_left₀ ha, inv_le_inv₀ hb hc]
theorem le_div_iff₀ (hc : c ≠ 0) : a ≤ b / c ↔ a * c ≤ b := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hc : c ≠ 0
⊢ a ≤ b / c ↔ a * c ≤ b

Next tactic:
rw [div_eq_mul_inv, le_mul_inv_iff₀ hc]
theorem div_le_iff₀ (hc : c ≠ 0) : a / c ≤ b ↔ a ≤ b * c := by
  

Proof state:
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hc : c ≠ 0
⊢ a / c ≤ b ↔ a ≤ b * c

Next tactic:
rw [div_eq_mul_inv, mul_inv_le_iff₀ hc]
theorem OrderIso.mulLeft₀'_symm {a : α} (ha : a ≠ 0) :
    (OrderIso.mulLeft₀' ha).symm = OrderIso.mulLeft₀' (inv_ne_zero ha) := by
  

Proof state:
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
⊢ symm (mulLeft₀' ha) = mulLeft₀' (_ : a⁻¹ ≠ 0)

Next tactic:
ext
theorem OrderIso.mulLeft₀'_symm {a : α} (ha : a ≠ 0) :
    (OrderIso.mulLeft₀' ha).symm = OrderIso.mulLeft₀' (inv_ne_zero ha) := by
  ext
  

Proof state:
case h.h
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
x✝ : α
⊢ (symm (mulLeft₀' ha)) x✝ = (mulLeft₀' (_ : a⁻¹ ≠ 0)) x✝

Next tactic:
rfl
theorem OrderIso.mulRight₀'_symm {a : α} (ha : a ≠ 0) :
    (OrderIso.mulRight₀' ha).symm = OrderIso.mulRight₀' (inv_ne_zero ha) := by
  

Proof state:
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
⊢ symm (mulRight₀' ha) = mulRight₀' (_ : a⁻¹ ≠ 0)

Next tactic:
ext
theorem OrderIso.mulRight₀'_symm {a : α} (ha : a ≠ 0) :
    (OrderIso.mulRight₀' ha).symm = OrderIso.mulRight₀' (inv_ne_zero ha) := by
  ext
  

Proof state:
case h.h
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
x✝ : α
⊢ (symm (mulRight₀' ha)) x✝ = (mulRight₀' (_ : a⁻¹ ≠ 0)) x✝

Next tactic:
rfl
@[simp]
lemma gaussianPdfReal_zero_var (m : ℝ) : gaussianPdfReal m 0 = 0 := by
  

Proof state:
m : ℝ
⊢ gaussianPdfReal m 0 = 0

Next tactic:
ext1 x
@[simp]
lemma gaussianPdfReal_zero_var (m : ℝ) : gaussianPdfReal m 0 = 0 := by
  ext1 x
  

Proof state:
case h
m x : ℝ
⊢ gaussianPdfReal m 0 x = OfNat.ofNat 0 x

Next tactic:
simp [gaussianPdfReal]
/-- The gaussian pdf is positive when the variance is not zero. -/
lemma gaussianPdfReal_pos (μ : ℝ) (v : ℝ≥0) (x : ℝ) (hv : v ≠ 0) : 0 < gaussianPdfReal μ v x := by
  

Proof state:
μ : ℝ
v : ℝ≥0
x : ℝ
hv : v ≠ 0
⊢ 0 < gaussianPdfReal μ v x

Next tactic:
rw [gaussianPdfReal]
/-- The gaussian pdf is positive when the variance is not zero. -/
lemma gaussianPdfReal_pos (μ : ℝ) (v : ℝ≥0) (x : ℝ) (hv : v ≠ 0) : 0 < gaussianPdfReal μ v x := by
  rw [gaussianPdfReal]
  

Proof state:
μ : ℝ
v : ℝ≥0
x : ℝ
hv : v ≠ 0
⊢ 0 < (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))

Next tactic:
positivity
/--The gaussian pdf is nonnegative. -/
lemma gaussianPdfReal_nonneg (μ : ℝ) (v : ℝ≥0) (x : ℝ) : 0 ≤ gaussianPdfReal μ v x := by
  

Proof state:
μ : ℝ
v : ℝ≥0
x : ℝ
⊢ 0 ≤ gaussianPdfReal μ v x

Next tactic:
rw [gaussianPdfReal]
/--The gaussian pdf is nonnegative. -/
lemma gaussianPdfReal_nonneg (μ : ℝ) (v : ℝ≥0) (x : ℝ) : 0 ≤ gaussianPdfReal μ v x := by
  rw [gaussianPdfReal]
  

Proof state:
μ : ℝ
v : ℝ≥0
x : ℝ
⊢ 0 ≤ (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))

Next tactic:
positivity
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  

Proof state:
μ : ℝ
v : ℝ≥0
⊢ Integrable (gaussianPdfReal μ v)

Next tactic:
rw [gaussianPdfReal_def]
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  rw [gaussianPdfReal_def]
  

Proof state:
μ : ℝ
v : ℝ≥0
⊢ Integrable fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))

Next tactic:
by_cases hv : v = 0
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  rw [gaussianPdfReal_def]
  by_cases hv : v = 0
  · 

Proof state:
case pos
μ : ℝ
v : ℝ≥0
hv : v = 0
⊢ Integrable fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))

Next tactic:
simp [hv]
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  rw [gaussianPdfReal_def]
  by_cases hv : v = 0
  · simp [hv]
  

Proof state:
case neg
μ : ℝ
v : ℝ≥0
hv : ¬v = 0
⊢ Integrable fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))

Next tactic:
let g : ℝ → ℝ := fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- x ^ 2 / (2 * v))
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  rw [gaussianPdfReal_def]
  by_cases hv : v = 0
  · simp [hv]
  let g : ℝ → ℝ := fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- x ^ 2 / (2 * v))
  

Proof state:
case neg
μ : ℝ
v : ℝ≥0
hv : ¬v = 0
g : ℝ → ℝ := fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-x ^ 2 / (2 * ↑v))
⊢ Integrable fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-(x - μ) ^ 2 / (2 * ↑v))

Next tactic:
have hg : Integrable g := by
    suffices g = fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- (2 * v)⁻¹ * x ^ 2) by
      rw [this]
      refine (integrable_exp_neg_mul_sq ?_).const_mul (Real.sqrt (2 * π * v))⁻¹
      simp [lt_of_le_of_ne (zero_le _) (Ne.symm hv)]
    ext x
    simp only [gt_iff_lt, zero_lt_two, zero_le_mul_left, NNReal.zero_le_coe, Real.sqrt_mul',
      mul_inv_rev, NNReal.coe_mul, NNReal.coe_inv, NNReal.coe_ofNat, neg_mul, mul_eq_mul_left_iff,
      Real.exp_eq_exp, mul_eq_zero, inv_eq_zero, Real.sqrt_eq_zero, NNReal.coe_eq_zero, hv,
      false_or]
    rw [mul_comm]
    left
    field_simp
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  rw [gaussianPdfReal_def]
  by_cases hv : v = 0
  · simp [hv]
  let g : ℝ → ℝ := fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- x ^ 2 / (2 * v))
  have hg : Integrable g := by
    

Proof state:
μ : ℝ
v : ℝ≥0
hv : ¬v = 0
g : ℝ → ℝ := fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-x ^ 2 / (2 * ↑v))
⊢ Integrable g

Next tactic:
suffices g = fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- (2 * v)⁻¹ * x ^ 2) by
      rw [this]
      refine (integrable_exp_neg_mul_sq ?_).const_mul (Real.sqrt (2 * π * v))⁻¹
      simp [lt_of_le_of_ne (zero_le _) (Ne.symm hv)]
lemma integrable_gaussianPdfReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPdfReal μ v) := by
  rw [gaussianPdfReal_def]
  by_cases hv : v = 0
  · simp [hv]
  let g : ℝ → ℝ := fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- x ^ 2 / (2 * v))
  have hg : Integrable g := by
    suffices g = fun x ↦ (Real.sqrt (2 * π * v))⁻¹ * rexp (- (2 * v)⁻¹ * x ^ 2) by
      

Proof state:
μ : ℝ
v : ℝ≥0
hv : ¬v = 0
g : ℝ → ℝ := fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-x ^ 2 / (2 * ↑v))
this : g = fun x => (Real.sqrt (2 * π * ↑v))⁻¹ * rexp (-↑(2 * v)⁻¹ * x ^ 2)
⊢ Integrable g

Next tactic:
rw [this]