l3lab/ntp-mathlib huggingface dataset:
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { 

Proof state:
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 1 = a

Next tactic:
intros
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; 

Proof state:
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ : Num
⊢ a✝ * 1 = a✝

Next tactic:
rfl
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    

Proof state:
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (x : Num), npowRec 0 x = 1

Next tactic:
try { intros; rfl }
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try 

Proof state:
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (x : Num), npowRec 0 x = 1

Next tactic:
{ intros; rfl }
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { 

Proof state:
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (x : Num), npowRec 0 x = 1

Next tactic:
intros
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; 

Proof state:
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
x✝ : Num
⊢ npowRec 0 x✝ = 1

Next tactic:
rfl
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    

Proof state:
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (n : ℕ) (x : Num), npowRec (n + 1) x = x * npowRec n x

Next tactic:
try { intros; rfl }
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try 

Proof state:
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (n : ℕ) (x : Num), npowRec (n + 1) x = x * npowRec n x

Next tactic:
{ intros; rfl }
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { 

Proof state:
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (n : ℕ) (x : Num), npowRec (n + 1) x = x * npowRec n x

Next tactic:
intros
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; 

Proof state:
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
n✝ : ℕ
x✝ : Num
⊢ npowRec (n✝ + 1) x✝ = x✝ * npowRec n✝ x✝

Next tactic:
rfl
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    

Proof state:
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a

Next tactic:
try { intros; rfl }
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try 

Proof state:
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a

Next tactic:
{ intros; rfl }
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { 

Proof state:
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a

Next tactic:
intros
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; 

Proof state:
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ a✝ * b✝ = b✝ * a✝

Next tactic:
rfl
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a + b = b + a

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * (b + c) = a * b + a * c

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), (a + b) * c = a * c + b * c

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_4
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 0 * a = 0

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_5
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 0 = 0

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * b * c = a * (b * c)

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_7
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 1 * a = a

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 1 = a

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    

Proof state:
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a

Next tactic:
transfer
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    transfer <;>
    

Proof state:
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ ↑a✝ + ↑b✝ = ↑b✝ + ↑a✝

Next tactic:
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    transfer <;>
    

Proof state:
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ ↑a✝ * (↑b✝ + ↑c✝) = ↑a✝ * ↑b✝ + ↑a✝ * ↑c✝

Next tactic:
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    transfer <;>
    

Proof state:
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ (↑a✝ + ↑b✝) * ↑c✝ = ↑a✝ * ↑c✝ + ↑b✝ * ↑c✝

Next tactic:
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    transfer <;>
    

Proof state:
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ ↑a✝ * ↑b✝ * ↑c✝ = ↑a✝ * (↑b✝ * ↑c✝)

Next tactic:
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
instance commSemiring : CommSemiring Num := by
  refine'
    { Num.addMonoid,
      Num.addMonoidWithOne with
      mul := (· * ·)
      npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. } <;>
    try { intros; rfl } <;>
    transfer <;>
    

Proof state:
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ ↑a✝ * ↑b✝ = ↑b✝ * ↑a✝

Next tactic:
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by 

Proof state:
⊢ ∀ (a : Num), a ≤ a

Next tactic:
transfer
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by 

Proof state:
a b c : Num
⊢ a ≤ b → b ≤ c → a ≤ c

Next tactic:
transfer_rw
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; 

Proof state:
a b c : Num
⊢ ↑a ≤ ↑b → ↑b ≤ ↑c → ↑a ≤ ↑c

Next tactic:
apply le_trans
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by 

Proof state:
a b : Num
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a

Next tactic:
simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by 

Proof state:
a b : Num
⊢ a ≤ b → b ≤ a → a = b

Next tactic:
transfer_rw
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by transfer_rw; 

Proof state:
a b : Num
⊢ ↑a ≤ ↑b → ↑b ≤ ↑a → ↑a = ↑b

Next tactic:
apply le_antisymm
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by transfer_rw; apply le_antisymm
  add_le_add_left a b h c := by 

Proof state:
a b : Num
h : a ≤ b
c : Num
⊢ c + a ≤ c + b

Next tactic:
revert h
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by transfer_rw; apply le_antisymm
  add_le_add_left a b h c := by revert h; 

Proof state:
a b c : Num
⊢ a ≤ b → c + a ≤ c + b

Next tactic:
transfer_rw
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by transfer_rw; apply le_antisymm
  add_le_add_left a b h c := by revert h; transfer_rw; 

Proof state:
a b c : Num
⊢ ↑a ≤ ↑b → ↑c + ↑a ≤ ↑c + ↑b

Next tactic:
exact fun h => add_le_add_left h c
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by transfer_rw; apply le_antisymm
  add_le_add_left a b h c := by revert h; transfer_rw; exact fun h => add_le_add_left h c
  le_of_add_le_add_left a b c := by 

Proof state:
a b c : Num
⊢ a + b ≤ a + c → b ≤ c

Next tactic:
transfer_rw
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid Num where
  le := (· ≤ ·)
  lt := (· < ·)
  lt_iff_le_not_le a b := by simp only [← lt_to_nat, ← le_to_nat, lt_iff_le_not_le]
  le_refl := by transfer
  le_trans a b c := by transfer_rw; apply le_trans
  le_antisymm a b := by transfer_rw; apply le_antisymm
  add_le_add_left a b h c := by revert h; transfer_rw; exact fun h => add_le_add_left h c
  le_of_add_le_add_left a b c := by transfer_rw; 

Proof state:
a b c : Num
⊢ ↑a + ↑b ≤ ↑a + ↑c → ↑b ≤ ↑c

Next tactic:
apply le_of_add_le_add_left
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      intro a b c
      transfer_rw
      apply mul_lt_mul_of_pos_left
    mul_lt_mul_of_pos_right := by
      intro a b c
      transfer_rw
      apply mul_lt_mul_of_pos_right
    decidableLT := Num.decidableLT
    decidableLE := Num.decidableLE
    -- This is relying on an automatically generated instance name,
    -- generated in a `deriving` handler.
    -- See https://github.com/leanprover/lean4/issues/2343
    decidableEq := instDecidableEqNum
    exists_pair_ne := ⟨0, 1, by 

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ 0 ≠ 1

Next tactic:
decide
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by 

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ 0 ≤ 1

Next tactic:
decide
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ ∀ (a b c : Num), a < b → 0 < c → c * a < c * b

Next tactic:
intro a b c
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      intro a b c
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ a < b → 0 < c → c * a < c * b

Next tactic:
transfer_rw
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      intro a b c
      transfer_rw
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ ↑a < ↑b → 0 < ↑c → ↑c * ↑a < ↑c * ↑b

Next tactic:
apply mul_lt_mul_of_pos_left
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      intro a b c
      transfer_rw
      apply mul_lt_mul_of_pos_left
    mul_lt_mul_of_pos_right := by
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ ∀ (a b c : Num), a < b → 0 < c → a * c < b * c

Next tactic:
intro a b c
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      intro a b c
      transfer_rw
      apply mul_lt_mul_of_pos_left
    mul_lt_mul_of_pos_right := by
      intro a b c
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ a < b → 0 < c → a * c < b * c

Next tactic:
transfer_rw
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      apply le_total
    zero_le_one := by decide
    mul_lt_mul_of_pos_left := by
      intro a b c
      transfer_rw
      apply mul_lt_mul_of_pos_left
    mul_lt_mul_of_pos_right := by
      intro a b c
      transfer_rw
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ ↑a < ↑b → 0 < ↑c → ↑a * ↑c < ↑b * ↑c

Next tactic:
apply mul_lt_mul_of_pos_right
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ ∀ (a b : Num), a ≤ b ∨ b ≤ a

Next tactic:
intro a b
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b : Num
⊢ a ≤ b ∨ b ≤ a

Next tactic:
transfer_rw
instance linearOrderedSemiring : LinearOrderedSemiring Num :=
  { Num.commSemiring,
    Num.orderedCancelAddCommMonoid with
    le_total := by
      intro a b
      transfer_rw
      

Proof state:
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b : Num
⊢ ↑a ≤ ↑b ∨ ↑b ≤ ↑a

Next tactic:
apply le_total
@[simp, norm_cast]
theorem cast_to_int {α} [AddGroupWithOne α] (n : Num) : ((n : ℤ) : α) = n := by
  

Proof state:
α : Type u_1
inst✝ : AddGroupWithOne α
n : Num
⊢ ↑↑n = ↑n

Next tactic:
rw [← to_nat_to_int, Int.cast_ofNat, cast_to_nat]
theorem to_of_nat : ∀ n : ℕ, ((n : Num) : ℕ) = n
  | 0 => by 

Proof state:
⊢ ↑↑0 = 0

Next tactic:
rw [Nat.cast_zero, cast_zero]
theorem to_of_nat : ∀ n : ℕ, ((n : Num) : ℕ) = n
  | 0 => by rw [Nat.cast_zero, cast_zero]
  | n + 1 => by 

Proof state:
n : ℕ
⊢ ↑↑(n + 1) = n + 1

Next tactic:
rw [Nat.cast_succ, add_one, succ_to_nat, to_of_nat n]
@[simp, norm_cast]
theorem of_nat_cast {α} [AddMonoidWithOne α] (n : ℕ) : ((n : Num) : α) = n := by
  

Proof state:
α : Type u_1
inst✝ : AddMonoidWithOne α
n : ℕ
⊢ ↑↑n = ↑n

Next tactic:
rw [← cast_to_nat, to_of_nat]
@[norm_cast]
theorem dvd_to_nat (m n : Num) : (m : ℕ) ∣ n ↔ m ∣ n :=
  ⟨fun ⟨k, e⟩ => ⟨k, by 

Proof state:
m n : Num
x✝ : ↑m ∣ ↑n
k : ℕ
e : ↑n = ↑m * k
⊢ n = m * ↑k

Next tactic:
rw [← of_to_nat n, e]
@[norm_cast]
theorem dvd_to_nat (m n : Num) : (m : ℕ) ∣ n ↔ m ∣ n :=
  ⟨fun ⟨k, e⟩ => ⟨k, by rw [← of_to_nat n, e]; 

Proof state:
m n : Num
x✝ : ↑m ∣ ↑n
k : ℕ
e : ↑n = ↑m * k
⊢ ↑(↑m * k) = m * ↑k

Next tactic:
simp
@[norm_cast]
theorem dvd_to_nat (m n : Num) : (m : ℕ) ∣ n ↔ m ∣ n :=
  ⟨fun ⟨k, e⟩ => ⟨k, by rw [← of_to_nat n, e]; simp⟩, fun ⟨k, e⟩ => ⟨k, by 

Proof state:
m n : Num
x✝ : m ∣ n
k : Num
e : n = m * k
⊢ ↑n = ↑m * ↑k

Next tactic:
simp [e, mul_to_nat]
@[norm_cast]
theorem to_nat_inj {m n : PosNum} : (m : ℕ) = n ↔ m = n :=
  ⟨fun h => Num.pos.inj <| by 

Proof state:
α : Type u_1
m n : PosNum
h : ↑m = ↑n
⊢ pos m = pos n

Next tactic:
rw [← PosNum.of_to_nat, ← PosNum.of_to_nat, h]
theorem pred'_to_nat : ∀ n, (pred' n : ℕ) = Nat.pred n
  | 1 => rfl
  | bit0 n =>
    have : Nat.succ ↑(pred' n) = ↑n := by
      

Proof state:
α : Type u_1
n : PosNum
⊢ Nat.succ ↑(pred' n) = ↑n

Next tactic:
rw [pred'_to_nat n, Nat.succ_pred_eq_of_pos (to_nat_pos n)]
theorem pred'_to_nat : ∀ n, (pred' n : ℕ) = Nat.pred n
  | 1 => rfl
  | bit0 n =>
    have : Nat.succ ↑(pred' n) = ↑n := by
      rw [pred'_to_nat n, Nat.succ_pred_eq_of_pos (to_nat_pos n)]
    match (motive :=
        ∀ k : Num, Nat.succ ↑k = ↑n → ↑(Num.casesOn k 1 bit1 : PosNum) = Nat.pred (_root_.bit0 n))
      pred' n, this with
    | 0, (h : ((1 : Num) : ℕ) = n) => by 

Proof state:
α : Type u_1
n : PosNum
this : Nat.succ ↑(pred' n) = ↑n
h : ↑1 = ↑n
⊢ ↑(Num.casesOn 0 1 bit1) = Nat.pred (_root_.bit0 ↑n)

Next tactic:
rw [← to_nat_inj.1 h]
theorem pred'_to_nat : ∀ n, (pred' n : ℕ) = Nat.pred n
  | 1 => rfl
  | bit0 n =>
    have : Nat.succ ↑(pred' n) = ↑n := by
      rw [pred'_to_nat n, Nat.succ_pred_eq_of_pos (to_nat_pos n)]
    match (motive :=
        ∀ k : Num, Nat.succ ↑k = ↑n → ↑(Num.casesOn k 1 bit1 : PosNum) = Nat.pred (_root_.bit0 n))
      pred' n, this with
    | 0, (h : ((1 : Num) : ℕ) = n) => by rw [← to_nat_inj.1 h]; 

Proof state:
α : Type u_1
n : PosNum
this : Nat.succ ↑(pred' n) = ↑n
h : ↑1 = ↑n
⊢ ↑(Num.casesOn 0 1 bit1) = Nat.pred (_root_.bit0 ↑1)

Next tactic:
rfl