l3lab/ntp-mathlib huggingface dataset:
theorem subset_mapRange_neLocus [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (M a)] (f g : Π₀ a, N a)
    {F : ∀ a, N a → M a} (F0 : ∀ a, F a 0 = 0) :
    (f.mapRange F F0).neLocus (g.mapRange F F0) ⊆ f.neLocus g := fun a ↦ by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → DecidableEq (M a)
f g : Π₀ (a : α), N a
F : (a : α) → N a → M a
F0 : ∀ (a : α), F a 0 = 0
a : α
⊢ a ∈ neLocus (mapRange F F0 f) (mapRange F F0 g) → a ∈ neLocus f g

Next tactic:
simpa only [mem_neLocus, mapRange_apply, not_imp_not] using congr_arg (F a)
theorem zipWith_neLocus_eq_left [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (P a)]
    {F : ∀ a, M a → N a → P a} (F0 : ∀ a, F a 0 0 = 0) (f : Π₀ a, M a) (g₁ g₂ : Π₀ a, N a)
    (hF : ∀ a f, Function.Injective fun g ↦ F a f g) :
    (zipWith F F0 f g₁).neLocus (zipWith F F0 f g₂) = g₁.neLocus g₂ := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → DecidableEq (P a)
F : (a : α) → M a → N a → P a
F0 : ∀ (a : α), F a 0 0 = 0
f : Π₀ (a : α), M a
g₁ g₂ : Π₀ (a : α), N a
hF : ∀ (a : α) (f : M a), Function.Injective fun g => F a f g
⊢ neLocus (zipWith F F0 f g₁) (zipWith F F0 f g₂) = neLocus g₁ g₂

Next tactic:
ext a
theorem zipWith_neLocus_eq_left [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (P a)]
    {F : ∀ a, M a → N a → P a} (F0 : ∀ a, F a 0 0 = 0) (f : Π₀ a, M a) (g₁ g₂ : Π₀ a, N a)
    (hF : ∀ a f, Function.Injective fun g ↦ F a f g) :
    (zipWith F F0 f g₁).neLocus (zipWith F F0 f g₂) = g₁.neLocus g₂ := by
  ext a
  

Proof state:
case a
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → DecidableEq (P a)
F : (a : α) → M a → N a → P a
F0 : ∀ (a : α), F a 0 0 = 0
f : Π₀ (a : α), M a
g₁ g₂ : Π₀ (a : α), N a
hF : ∀ (a : α) (f : M a), Function.Injective fun g => F a f g
a : α
⊢ a ∈ neLocus (zipWith F F0 f g₁) (zipWith F F0 f g₂) ↔ a ∈ neLocus g₁ g₂

Next tactic:
simpa only [mem_neLocus] using (hF a _).ne_iff
theorem zipWith_neLocus_eq_right [∀ a, DecidableEq (M a)] [∀ a, DecidableEq (P a)]
    {F : ∀ a, M a → N a → P a} (F0 : ∀ a, F a 0 0 = 0) (f₁ f₂ : Π₀ a, M a) (g : Π₀ a, N a)
    (hF : ∀ a g, Function.Injective fun f ↦ F a f g) :
    (zipWith F F0 f₁ g).neLocus (zipWith F F0 f₂ g) = f₁.neLocus f₂ := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (M a)
inst✝ : (a : α) → DecidableEq (P a)
F : (a : α) → M a → N a → P a
F0 : ∀ (a : α), F a 0 0 = 0
f₁ f₂ : Π₀ (a : α), M a
g : Π₀ (a : α), N a
hF : ∀ (a : α) (g : N a), Function.Injective fun f => F a f g
⊢ neLocus (zipWith F F0 f₁ g) (zipWith F F0 f₂ g) = neLocus f₁ f₂

Next tactic:
ext a
theorem zipWith_neLocus_eq_right [∀ a, DecidableEq (M a)] [∀ a, DecidableEq (P a)]
    {F : ∀ a, M a → N a → P a} (F0 : ∀ a, F a 0 0 = 0) (f₁ f₂ : Π₀ a, M a) (g : Π₀ a, N a)
    (hF : ∀ a g, Function.Injective fun f ↦ F a f g) :
    (zipWith F F0 f₁ g).neLocus (zipWith F F0 f₂ g) = f₁.neLocus f₂ := by
  ext a
  

Proof state:
case a
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (M a)
inst✝ : (a : α) → DecidableEq (P a)
F : (a : α) → M a → N a → P a
F0 : ∀ (a : α), F a 0 0 = 0
f₁ f₂ : Π₀ (a : α), M a
g : Π₀ (a : α), N a
hF : ∀ (a : α) (g : N a), Function.Injective fun f => F a f g
a : α
⊢ a ∈ neLocus (zipWith F F0 f₁ g) (zipWith F F0 f₂ g) ↔ a ∈ neLocus f₁ f₂

Next tactic:
simpa only [mem_neLocus] using (hF a _).ne_iff
theorem mapRange_neLocus_eq [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (M a)] (f g : Π₀ a, N a)
    {F : ∀ a, N a → M a} (F0 : ∀ a, F a 0 = 0) (hF : ∀ a, Function.Injective (F a)) :
    (f.mapRange F F0).neLocus (g.mapRange F F0) = f.neLocus g := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → DecidableEq (M a)
f g : Π₀ (a : α), N a
F : (a : α) → N a → M a
F0 : ∀ (a : α), F a 0 = 0
hF : ∀ (a : α), Function.Injective (F a)
⊢ neLocus (mapRange F F0 f) (mapRange F F0 g) = neLocus f g

Next tactic:
ext a
theorem mapRange_neLocus_eq [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (M a)] (f g : Π₀ a, N a)
    {F : ∀ a, N a → M a} (F0 : ∀ a, F a 0 = 0) (hF : ∀ a, Function.Injective (F a)) :
    (f.mapRange F F0).neLocus (g.mapRange F F0) = f.neLocus g := by
  ext a
  

Proof state:
case a
α : Type u_1
N : α → Type u_2
inst✝⁵ : DecidableEq α
M : α → Type u_3
P : α → Type u_4
inst✝⁴ : (a : α) → Zero (N a)
inst✝³ : (a : α) → Zero (M a)
inst✝² : (a : α) → Zero (P a)
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → DecidableEq (M a)
f g : Π₀ (a : α), N a
F : (a : α) → N a → M a
F0 : ∀ (a : α), F a 0 = 0
hF : ∀ (a : α), Function.Injective (F a)
a : α
⊢ a ∈ neLocus (mapRange F F0 f) (mapRange F F0 g) ↔ a ∈ neLocus f g

Next tactic:
simpa only [mem_neLocus] using (hF a).ne_iff
theorem neLocus_neg : neLocus (-f) g = f.neLocus (-g) := by 

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus (-f) g = neLocus f (-g)

Next tactic:
rw [← neLocus_neg_neg, neg_neg]
theorem neLocus_eq_support_sub : f.neLocus g = (f - g).support := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus f g = support (f - g)

Next tactic:
rw [← @neLocus_add_right α N _ _ _ _ _ (-g), add_right_neg, neLocus_zero_right, sub_eq_add_neg]
@[simp]
theorem neLocus_sub_left : neLocus (f - g₁) (f - g₂) = neLocus g₁ g₂ := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus (f - g₁) (f - g₂) = neLocus g₁ g₂

Next tactic:
simp only [sub_eq_add_neg, @neLocus_add_left α N _ _ _, neLocus_neg_neg]
@[simp]
theorem neLocus_sub_right : neLocus (f₁ - g) (f₂ - g) = neLocus f₁ f₂ := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus (f₁ - g) (f₂ - g) = neLocus f₁ f₂

Next tactic:
simpa only [sub_eq_add_neg] using @neLocus_add_right α N _ _ _ _ _ _
@[simp]
theorem neLocus_self_add_right : neLocus f (f + g) = g.support := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus f (f + g) = support g

Next tactic:
rw [← neLocus_zero_left, ← @neLocus_add_left α N _ _ _ f 0 g, add_zero]
@[simp]
theorem neLocus_self_add_left : neLocus (f + g) f = g.support := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus (f + g) f = support g

Next tactic:
rw [neLocus_comm, neLocus_self_add_right]
@[simp]
theorem neLocus_self_sub_right : neLocus f (f - g) = g.support := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus f (f - g) = support g

Next tactic:
rw [sub_eq_add_neg, neLocus_self_add_right, support_neg]
@[simp]
theorem neLocus_self_sub_left : neLocus (f - g) f = g.support := by
  

Proof state:
α : Type u_1
N : α → Type u_2
inst✝² : DecidableEq α
inst✝¹ : (a : α) → DecidableEq (N a)
inst✝ : (a : α) → AddGroup (N a)
f f₁ f₂ g g₁ g₂ : Π₀ (a : α), N a
⊢ neLocus (f - g) f = support g

Next tactic:
rw [neLocus_comm, neLocus_self_sub_right]
@[to_additive]
theorem exists_one_lt_mul_of_lt' (h : a < b) : ∃ c, 1 < c ∧ a * c = b := by
  

Proof state:
α : Type u
inst✝³ : MulOneClass α
inst✝² : Preorder α
inst✝¹ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ExistsMulOfLE α
a b : α
h : a < b
⊢ ∃ c, 1 < c ∧ a * c = b

Next tactic:
obtain ⟨c, rfl⟩ := exists_mul_of_le h.le
@[to_additive]
theorem exists_one_lt_mul_of_lt' (h : a < b) : ∃ c, 1 < c ∧ a * c = b := by
  obtain ⟨c, rfl⟩ := exists_mul_of_le h.le
  

Proof state:
case intro
α : Type u
inst✝³ : MulOneClass α
inst✝² : Preorder α
inst✝¹ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ExistsMulOfLE α
a c : α
h : a < a * c
⊢ ∃ c_1, 1 < c_1 ∧ a * c_1 = a * c

Next tactic:
exact ⟨c, one_lt_of_lt_mul_right h, rfl⟩
@[to_additive]
theorem le_of_forall_one_lt_le_mul (h : ∀ ε : α, 1 < ε → a ≤ b * ε) : a ≤ b :=
  le_of_forall_le_of_dense fun x hxb => by
    

Proof state:
α : Type u
inst✝⁵ : LinearOrder α
inst✝⁴ : DenselyOrdered α
inst✝³ : Monoid α
inst✝² : ExistsMulOfLE α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
h : ∀ (ε : α), 1 < ε → a ≤ b * ε
x : α
hxb : b < x
⊢ a ≤ x

Next tactic:
obtain ⟨ε, rfl⟩ := exists_mul_of_le hxb.le
@[to_additive]
theorem le_of_forall_one_lt_le_mul (h : ∀ ε : α, 1 < ε → a ≤ b * ε) : a ≤ b :=
  le_of_forall_le_of_dense fun x hxb => by
    obtain ⟨ε, rfl⟩ := exists_mul_of_le hxb.le
    

Proof state:
case intro
α : Type u
inst✝⁵ : LinearOrder α
inst✝⁴ : DenselyOrdered α
inst✝³ : Monoid α
inst✝² : ExistsMulOfLE α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
h : ∀ (ε : α), 1 < ε → a ≤ b * ε
ε : α
hxb : b < b * ε
⊢ a ≤ b * ε

Next tactic:
exact h _ ((lt_mul_iff_one_lt_right' b).1 hxb)
@[to_additive]
theorem le_mul_self : a ≤ b * a := by
  

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
⊢ a ≤ b * a

Next tactic:
rw [mul_comm]
@[to_additive]
theorem le_mul_self : a ≤ b * a := by
  rw [mul_comm]
  

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
⊢ a ≤ a * b

Next tactic:
exact le_self_mul
@[to_additive]
theorem le_iff_exists_mul : a ≤ b ↔ ∃ c, b = a * c :=
  ⟨exists_mul_of_le, by
    

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
⊢ (∃ c, b = a * c) → a ≤ b

Next tactic:
rintro ⟨c, rfl⟩
@[to_additive]
theorem le_iff_exists_mul : a ≤ b ↔ ∃ c, b = a * c :=
  ⟨exists_mul_of_le, by
    rintro ⟨c, rfl⟩
    

Proof state:
case intro
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a c✝ d c : α
⊢ a ≤ a * c

Next tactic:
exact le_self_mul
@[to_additive]
theorem le_iff_exists_mul' : a ≤ b ↔ ∃ c, b = c * a := by
  

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
⊢ a ≤ b ↔ ∃ c, b = c * a

Next tactic:
simp only [mul_comm _ a, le_iff_exists_mul]
@[to_additive (attr := simp) add_pos_iff]
theorem one_lt_mul_iff : 1 < a * b ↔ 1 < a ∨ 1 < b := by
  

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
⊢ 1 < a * b ↔ 1 < a ∨ 1 < b

Next tactic:
simp only [one_lt_iff_ne_one, Ne.def, mul_eq_one_iff, not_and_or]
@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b := by
  

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
h : a < b
⊢ ∃ c x, a * c = b

Next tactic:
obtain ⟨c, hc⟩ := le_iff_exists_mul.1 h.le
@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b := by
  obtain ⟨c, hc⟩ := le_iff_exists_mul.1 h.le
  

Proof state:
case intro
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c✝ d : α
h : a < b
c : α
hc : b = a * c
⊢ ∃ c x, a * c = b

Next tactic:
refine' ⟨c, one_lt_iff_ne_one.2 _, hc.symm⟩
@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b := by
  obtain ⟨c, hc⟩ := le_iff_exists_mul.1 h.le
  refine' ⟨c, one_lt_iff_ne_one.2 _, hc.symm⟩
  

Proof state:
case intro
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c✝ d : α
h : a < b
c : α
hc : b = a * c
⊢ c ≠ 1

Next tactic:
rintro rfl
@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b := by
  obtain ⟨c, hc⟩ := le_iff_exists_mul.1 h.le
  refine' ⟨c, one_lt_iff_ne_one.2 _, hc.symm⟩
  rintro rfl
  

Proof state:
case intro
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
h : a < b
hc : b = a * 1
⊢ False

Next tactic:
simp [hc, lt_irrefl] at h
@[to_additive]
theorem le_mul_left (h : a ≤ c) : a ≤ b * c :=
  calc
    a = 1 * a := by 

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
h : a ≤ c
⊢ a = 1 * a

Next tactic:
simp
@[to_additive]
theorem le_mul_right (h : a ≤ b) : a ≤ b * c :=
  calc
    a = a * 1 := by 

Proof state:
α : Type u
inst✝ : CanonicallyOrderedCommMonoid α
a b c d : α
h : a ≤ b
⊢ a = a * 1

Next tactic:
simp
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  

Proof state:
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a b c d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
⊢ a < b ↔ ∃ c, c > 1 ∧ b = a * c

Next tactic:
rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  

Proof state:
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a b c d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
⊢ (∃ x, b = a * x ∧ a ≠ b) ↔ ∃ c, c > 1 ∧ b = a * c

Next tactic:
apply exists_congr
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  

Proof state:
case h
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a b c d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
⊢ ∀ (a_1 : α), b = a * a_1 ∧ a ≠ b ↔ a_1 > 1 ∧ b = a * a_1

Next tactic:
intro c
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  

Proof state:
case h
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a b c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ b = a * c ∧ a ≠ b ↔ c > 1 ∧ b = a * c

Next tactic:
rw [and_comm, and_congr_left_iff, gt_iff_lt]
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  

Proof state:
case h
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a b c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ b = a * c → (a ≠ b ↔ 1 < c)

Next tactic:
rintro rfl
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  

Proof state:
case h
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ a ≠ a * c ↔ 1 < c

Next tactic:
constructor
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  constructor
  · 

Proof state:
case h.mp
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ a ≠ a * c → 1 < c

Next tactic:
rw [one_lt_iff_ne_one]
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  constructor
  · rw [one_lt_iff_ne_one]
    

Proof state:
case h.mp
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ a ≠ a * c → c ≠ 1

Next tactic:
apply mt
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  constructor
  · rw [one_lt_iff_ne_one]
    apply mt
    

Proof state:
case h.mp.h₁
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ c = 1 → a = a * c

Next tactic:
rintro rfl
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  constructor
  · rw [one_lt_iff_ne_one]
    apply mt
    rintro rfl
    

Proof state:
case h.mp.h₁
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
⊢ a = a * 1

Next tactic:
rw [mul_one]
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  constructor
  · rw [one_lt_iff_ne_one]
    apply mt
    rintro rfl
    rw [mul_one]
  · 

Proof state:
case h.mpr
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ 1 < c → a ≠ a * c

Next tactic:
rw [← (self_le_mul_right a c).lt_iff_ne]
@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c := by
  rw [lt_iff_le_and_ne, le_iff_exists_mul, ← exists_and_right]
  apply exists_congr
  intro c
  rw [and_comm, and_congr_left_iff, gt_iff_lt]
  rintro rfl
  constructor
  · rw [one_lt_iff_ne_one]
    apply mt
    rintro rfl
    rw [mul_one]
  · rw [← (self_le_mul_right a c).lt_iff_ne]
    

Proof state:
case h.mpr
α : Type u
inst✝¹ : CanonicallyOrderedCommMonoid α
a c✝ d : α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
c : α
⊢ 1 < c → a < a * c

Next tactic:
apply lt_mul_of_one_lt_right'
@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c) := by
  

Proof state:
α : Type u
inst✝ : CanonicallyLinearOrderedCommMonoid α
a b c : α
⊢ min a (b * c) = min a (min a b * min a c)

Next tactic:
rcases le_total a b with hb | hb
@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c) := by
  rcases le_total a b with hb | hb
  · 

Proof state:
case inl
α : Type u
inst✝ : CanonicallyLinearOrderedCommMonoid α
a b c : α
hb : a ≤ b
⊢ min a (b * c) = min a (min a b * min a c)

Next tactic:
simp [hb, le_mul_right]
@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c) := by
  rcases le_total a b with hb | hb
  · simp [hb, le_mul_right]
  · 

Proof state:
case inr
α : Type u
inst✝ : CanonicallyLinearOrderedCommMonoid α
a b c : α
hb : b ≤ a
⊢ min a (b * c) = min a (min a b * min a c)

Next tactic:
rcases le_total a c with hc | hc
@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c) := by
  rcases le_total a b with hb | hb
  · simp [hb, le_mul_right]
  · rcases le_total a c with hc | hc
    · 

Proof state:
case inr.inl
α : Type u
inst✝ : CanonicallyLinearOrderedCommMonoid α
a b c : α
hb : b ≤ a
hc : a ≤ c
⊢ min a (b * c) = min a (min a b * min a c)

Next tactic:
simp [hc, le_mul_left]
@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c) := by
  rcases le_total a b with hb | hb
  · simp [hb, le_mul_right]
  · rcases le_total a c with hc | hc
    · simp [hc, le_mul_left]
    · 

Proof state:
case inr.inr
α : Type u
inst✝ : CanonicallyLinearOrderedCommMonoid α
a b c : α
hb : b ≤ a
hc : c ≤ a
⊢ min a (b * c) = min a (min a b * min a c)

Next tactic:
simp [hb, hc]
@[to_additive]
theorem min_mul_distrib' (a b c : α) : min (a * b) c = min (min a c * min b c) c := by
  

Proof state:
α : Type u
inst✝ : CanonicallyLinearOrderedCommMonoid α
a b c : α
⊢ min (a * b) c = min (min a c * min b c) c

Next tactic:
simpa [min_comm _ c] using min_mul_distrib c a b
protected theorem irrational {x : ℝ} (h : Liouville x) : Irrational x := by
  -- By contradiction, `x = a / b`, with `a ∈ ℤ`, `0 < b ∈ ℕ` is a Liouville number,
  

Proof state:
x : ℝ
h : Liouville x
⊢ Irrational x

Next tactic:
rintro ⟨⟨a, b, bN0, cop⟩, rfl⟩
protected theorem irrational {x : ℝ} (h : Liouville x) : Irrational x := by
  -- By contradiction, `x = a / b`, with `a ∈ ℤ`, `0 < b ∈ ℕ` is a Liouville number,
  rintro ⟨⟨a, b, bN0, cop⟩, rfl⟩
  -- clear up the mess of constructions of rationals
  

Proof state:
case intro.mk'
a : ℤ
b : ℕ
bN0 : b ≠ 0
cop : Nat.Coprime (Int.natAbs a) b
h : Liouville ↑(Rat.mk' a b)
⊢ False

Next tactic:
rw [Rat.cast_mk', ← div_eq_mul_inv] at h
protected theorem irrational {x : ℝ} (h : Liouville x) : Irrational x := by
  -- By contradiction, `x = a / b`, with `a ∈ ℤ`, `0 < b ∈ ℕ` is a Liouville number,
  rintro ⟨⟨a, b, bN0, cop⟩, rfl⟩
  -- clear up the mess of constructions of rationals
  rw [Rat.cast_mk', ← div_eq_mul_inv] at h
  -- Since `a / b` is a Liouville number, there are `p, q ∈ ℤ`, with `q1 : 1 < q`,
  -- `a0 : a / b ≠ p / q` and `a1 : |a / b - p / q| < 1 / q ^ (b + 1)`
  

Proof state:
case intro.mk'
a : ℤ
b : ℕ
bN0 : b ≠ 0
cop : Nat.Coprime (Int.natAbs a) b
h : Liouville (↑a / ↑b)
⊢ False

Next tactic:
rcases h (b + 1) with ⟨p, q, q1, a0, a1⟩
protected theorem irrational {x : ℝ} (h : Liouville x) : Irrational x := by
  -- By contradiction, `x = a / b`, with `a ∈ ℤ`, `0 < b ∈ ℕ` is a Liouville number,
  rintro ⟨⟨a, b, bN0, cop⟩, rfl⟩
  -- clear up the mess of constructions of rationals
  rw [Rat.cast_mk', ← div_eq_mul_inv] at h
  -- Since `a / b` is a Liouville number, there are `p, q ∈ ℤ`, with `q1 : 1 < q`,
  -- `a0 : a / b ≠ p / q` and `a1 : |a / b - p / q| < 1 / q ^ (b + 1)`
  rcases h (b + 1) with ⟨p, q, q1, a0, a1⟩
  -- A few useful inequalities
  

Proof state:
case intro.mk'.intro.intro.intro.intro
a : ℤ
b : ℕ
bN0 : b ≠ 0
cop : Nat.Coprime (Int.natAbs a) b
h : Liouville (↑a / ↑b)
p q : ℤ
q1 : 1 < q
a0 : ↑a / ↑b ≠ ↑p / ↑q
a1 : |↑a / ↑b - ↑p / ↑q| < 1 / ↑q ^ (b + 1)
⊢ False

Next tactic:
have qR0 : (0 : ℝ) < q := Int.cast_pos.mpr (zero_lt_one.trans q1)