l3lab/ntp-mathlib huggingface dataset:
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    

Proof state:
case refl.refl
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_max : α → α → α
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
⊢ mk le_total✝¹ A_decidableLE A_decidableEq A_decidableLT = mk le_total✝ A_decidableLE A_decidableEq A_decidableLT

Next tactic:
have : A_max = B_max := by
      funext a b
      exact (A_max_def _ _).trans (B_max_def _ _).symm
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_max : α → α → α
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
⊢ A_max = B_max

Next tactic:
funext a b
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      funext a b
      

Proof state:
case h.h
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_max : α → α → α
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
a b : α
⊢ A_max a b = B_max a b

Next tactic:
exact (A_max_def _ _).trans (B_max_def _ _).symm
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      funext a b
      exact (A_max_def _ _).trans (B_max_def _ _).symm
    

Proof state:
case refl.refl
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_max : α → α → α
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
this : A_max = B_max
⊢ mk le_total✝¹ A_decidableLE A_decidableEq A_decidableLT = mk le_total✝ A_decidableLE A_decidableEq A_decidableLT

Next tactic:
cases this
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      funext a b
      exact (A_max_def _ _).trans (B_max_def _ _).symm
    cases this
    

Proof state:
case refl.refl.refl
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
⊢ mk le_total✝¹ A_decidableLE A_decidableEq A_decidableLT = mk le_total✝ A_decidableLE A_decidableEq A_decidableLT

Next tactic:
have : A_compare = B_compare := by
      funext a b
      exact (A_compare_canonical _ _).trans (B_compare_canonical _ _).symm
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      funext a b
      exact (A_max_def _ _).trans (B_max_def _ _).symm
    cases this
    have : A_compare = B_compare := by
      

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
⊢ A_compare = B_compare

Next tactic:
funext a b
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      funext a b
      exact (A_max_def _ _).trans (B_max_def _ _).symm
    cases this
    have : A_compare = B_compare := by
      funext a b
      

Proof state:
case h.h
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
a b : α
⊢ A_compare a b = B_compare a b

Next tactic:
exact (A_compare_canonical _ _).trans (B_compare_canonical _ _).symm
@[ext]
theorem LinearOrder.toPartialOrder_injective {α : Type*} :
    Function.Injective (@LinearOrder.toPartialOrder α) :=
  fun A B h ↦ match A, B with
  | { le := A_le, lt := A_lt,
      decidableLE := A_decidableLE, decidableEq := A_decidableEq, decidableLT := A_decidableLT
      min := A_min, max := A_max, min_def := A_min_def, max_def := A_max_def,
      compare := A_compare, compare_eq_compareOfLessAndEq := A_compare_canonical, .. },
    { le := B_le, lt := B_lt,
      decidableLE := B_decidableLE, decidableEq := B_decidableEq, decidableLT := B_decidableLT
      min := B_min, max := B_max, min_def := B_min_def, max_def := B_max_def,
      compare := B_compare, compare_eq_compareOfLessAndEq := B_compare_canonical, .. } => by
    cases h
    obtain rfl : A_decidableLE = B_decidableLE := Subsingleton.elim _ _
    obtain rfl : A_decidableEq = B_decidableEq := Subsingleton.elim _ _
    obtain rfl : A_decidableLT = B_decidableLT := Subsingleton.elim _ _
    have : A_min = B_min := by
      funext a b
      exact (A_min_def _ _).trans (B_min_def _ _).symm
    cases this
    have : A_max = B_max := by
      funext a b
      exact (A_max_def _ _).trans (B_max_def _ _).symm
    cases this
    have : A_compare = B_compare := by
      funext a b
      exact (A_compare_canonical _ _).trans (B_compare_canonical _ _).symm
    

Proof state:
case refl.refl.refl
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
A_le A_lt : α → α → Prop
le_refl✝¹ : ∀ (a : α), a ≤ a
le_trans✝¹ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝¹ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝¹ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
A_min A_max : α → α → α
A_compare : α → α → Ordering
le_total✝¹ : ∀ (a b : α), a ≤ b ∨ b ≤ a
A_decidableLE : DecidableRel fun x x_1 => x ≤ x_1
A_decidableEq : DecidableEq α
A_decidableLT : DecidableRel fun x x_1 => x < x_1
A_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
A_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
A_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_compare : α → α → Ordering
le_refl✝ : ∀ (a : α), a ≤ a
le_trans✝ : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
lt_iff_le_not_le✝ : ∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a
le_antisymm✝ : ∀ (a b : α), a ≤ b → b ≤ a → a = b
le_total✝ : ∀ (a b : α), a ≤ b ∨ b ≤ a
B_compare_canonical : ∀ (a b : α), compare a b = compareOfLessAndEq a b
B_min_def : ∀ (a b : α), min a b = if a ≤ b then a else b
B_max_def : ∀ (a b : α), max a b = if a ≤ b then b else a
this : A_compare = B_compare
⊢ mk le_total✝¹ A_decidableLE A_decidableEq A_decidableLT = mk le_total✝ A_decidableLE A_decidableEq A_decidableLT

Next tactic:
congr
theorem Preorder.ext {α} {A B : Preorder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B := by
  

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : Preorder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B

Next tactic:
ext x y
theorem Preorder.ext {α} {A B : Preorder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B := by
  ext x y
  

Proof state:
case a.le.h.h.a
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : Preorder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
x y : α
⊢ x ≤ y ↔ x ≤ y

Next tactic:
exact H x y
theorem PartialOrder.ext {α} {A B : PartialOrder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B := by
  

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : PartialOrder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B

Next tactic:
ext x y
theorem PartialOrder.ext {α} {A B : PartialOrder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B := by
  ext x y
  

Proof state:
case a.a.le.h.h.a
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : PartialOrder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
x y : α
⊢ x ≤ y ↔ x ≤ y

Next tactic:
exact H x y
theorem LinearOrder.ext {α} {A B : LinearOrder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B := by
  

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B

Next tactic:
ext x y
theorem LinearOrder.ext {α} {A B : LinearOrder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B := by
  ext x y
  

Proof state:
case a.a.a.le.h.h.a
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
A B : LinearOrder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
x y : α
⊢ x ≤ y ↔ x ≤ y

Next tactic:
exact H x y
instance instLinearOrder (α : Type*) [LinearOrder α] : LinearOrder αᵒᵈ where
  __ := inferInstanceAs (PartialOrder αᵒᵈ)
  le_total := λ a b : α => le_total b a
  max := fun a b ↦ (min a b : α)
  min := fun a b ↦ (max a b : α)
  min_def := fun a b ↦ show (max .. : α) = _ by 

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
inst✝ : LinearOrder α
src✝ : PartialOrder αᵒᵈ := inferInstanceAs (PartialOrder αᵒᵈ)
a b : αᵒᵈ
⊢ max a b = if a ≤ b then a else b

Next tactic:
rw [max_comm, max_def]
instance instLinearOrder (α : Type*) [LinearOrder α] : LinearOrder αᵒᵈ where
  __ := inferInstanceAs (PartialOrder αᵒᵈ)
  le_total := λ a b : α => le_total b a
  max := fun a b ↦ (min a b : α)
  min := fun a b ↦ (max a b : α)
  min_def := fun a b ↦ show (max .. : α) = _ by rw [max_comm, max_def]; 

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
inst✝ : LinearOrder α
src✝ : PartialOrder αᵒᵈ := inferInstanceAs (PartialOrder αᵒᵈ)
a b : αᵒᵈ
⊢ (if b ≤ a then a else b) = if a ≤ b then a else b

Next tactic:
rfl
instance instLinearOrder (α : Type*) [LinearOrder α] : LinearOrder αᵒᵈ where
  __ := inferInstanceAs (PartialOrder αᵒᵈ)
  le_total := λ a b : α => le_total b a
  max := fun a b ↦ (min a b : α)
  min := fun a b ↦ (max a b : α)
  min_def := fun a b ↦ show (max .. : α) = _ by rw [max_comm, max_def]; rfl
  max_def := fun a b ↦ show (min .. : α) = _ by 

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type u_3
inst✝ : LinearOrder α
src✝ : PartialOrder αᵒᵈ := inferInstanceAs (PartialOrder αᵒᵈ)
a b : αᵒᵈ
⊢ min a b = if a ≤ b then b else a

Next tactic:
rw [min_comm, min_def]