l3lab/ntp-mathlib huggingface dataset:
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. See `LinearOrder.lift'` for a version that autogenerates `min` and
`max` fields, and `LinearOrder.liftWithOrd` for one that does not auto-generate `compare`
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.lift {α β} [LinearOrder β] [Sup α] [Inf α] (f : α → β) (inj : Injective f)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
    LinearOrder α :=
  letI instOrdα : Ord α := ⟨fun a b ↦ compare (f a) (f b)⟩
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj, instOrdα with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      

Proof state:
case a
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.95427
β : Type ?u.95424
inst✝² : LinearOrder β
inst✝¹ : Sup α
inst✝ : Inf α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
instOrdα : Ord α := { compare := fun a b => compare (f a) (f b) }
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ f (min x y) = if x ≤ y then f x else f y

Next tactic:
exact (hinf _ _).trans (min_def _ _)
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. See `LinearOrder.lift'` for a version that autogenerates `min` and
`max` fields, and `LinearOrder.liftWithOrd` for one that does not auto-generate `compare`
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.lift {α β} [LinearOrder β] [Sup α] [Inf α] (f : α → β) (inj : Injective f)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
    LinearOrder α :=
  letI instOrdα : Ord α := ⟨fun a b ↦ compare (f a) (f b)⟩
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj, instOrdα with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      exact (hinf _ _).trans (min_def _ _)
    max_def := by
      

Proof state:
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.95427
β : Type ?u.95424
inst✝² : LinearOrder β
inst✝¹ : Sup α
inst✝ : Inf α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
instOrdα : Ord α := { compare := fun a b => compare (f a) (f b) }
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
⊢ ∀ (a b : α), max a b = if a ≤ b then b else a

Next tactic:
intros x y
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. See `LinearOrder.lift'` for a version that autogenerates `min` and
`max` fields, and `LinearOrder.liftWithOrd` for one that does not auto-generate `compare`
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.lift {α β} [LinearOrder β] [Sup α] [Inf α] (f : α → β) (inj : Injective f)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
    LinearOrder α :=
  letI instOrdα : Ord α := ⟨fun a b ↦ compare (f a) (f b)⟩
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj, instOrdα with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      exact (hinf _ _).trans (min_def _ _)
    max_def := by
      intros x y
      

Proof state:
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.95427
β : Type ?u.95424
inst✝² : LinearOrder β
inst✝¹ : Sup α
inst✝ : Inf α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
instOrdα : Ord α := { compare := fun a b => compare (f a) (f b) }
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ max x y = if x ≤ y then y else x

Next tactic:
apply inj
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. See `LinearOrder.lift'` for a version that autogenerates `min` and
`max` fields, and `LinearOrder.liftWithOrd` for one that does not auto-generate `compare`
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.lift {α β} [LinearOrder β] [Sup α] [Inf α] (f : α → β) (inj : Injective f)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
    LinearOrder α :=
  letI instOrdα : Ord α := ⟨fun a b ↦ compare (f a) (f b)⟩
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj, instOrdα with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      exact (hinf _ _).trans (min_def _ _)
    max_def := by
      intros x y
      apply inj
      

Proof state:
case a
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.95427
β : Type ?u.95424
inst✝² : LinearOrder β
inst✝¹ : Sup α
inst✝ : Inf α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
instOrdα : Ord α := { compare := fun a b => compare (f a) (f b) }
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ f (max x y) = f (if x ≤ y then y else x)

Next tactic:
rw [apply_ite f]
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. See `LinearOrder.lift'` for a version that autogenerates `min` and
`max` fields, and `LinearOrder.liftWithOrd` for one that does not auto-generate `compare`
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.lift {α β} [LinearOrder β] [Sup α] [Inf α] (f : α → β) (inj : Injective f)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
    LinearOrder α :=
  letI instOrdα : Ord α := ⟨fun a b ↦ compare (f a) (f b)⟩
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj, instOrdα with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      exact (hinf _ _).trans (min_def _ _)
    max_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      

Proof state:
case a
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.95427
β : Type ?u.95424
inst✝² : LinearOrder β
inst✝¹ : Sup α
inst✝ : Inf α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
instOrdα : Ord α := { compare := fun a b => compare (f a) (f b) }
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ f (max x y) = if x ≤ y then f y else f x

Next tactic:
exact (hsup _ _).trans (max_def _ _)
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. It also takes `[Ord α]` as an argument and uses them for `compare`
fields. See `LinearOrder.lift` for a version that autogenerates `compare` fields, and
`LinearOrder.liftWithOrd'` for one that auto-generates `min` and `max` fields.
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.liftWithOrd {α β} [LinearOrder β] [Sup α] [Inf α] [Ord α] (f : α → β)
    (inj : Injective f) (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y))
    (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (compare_f : ∀ a b : α, compare a b = compare (f a) (f b)) : LinearOrder α :=
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      

Proof state:
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.96919
β : Type ?u.96916
inst✝³ : LinearOrder β
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : Ord α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
compare_f : ∀ (a b : α), compare a b = compare (f a) (f b)
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
⊢ ∀ (a b : α), min a b = if a ≤ b then a else b

Next tactic:
intros x y
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. It also takes `[Ord α]` as an argument and uses them for `compare`
fields. See `LinearOrder.lift` for a version that autogenerates `compare` fields, and
`LinearOrder.liftWithOrd'` for one that auto-generates `min` and `max` fields.
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.liftWithOrd {α β} [LinearOrder β] [Sup α] [Inf α] [Ord α] (f : α → β)
    (inj : Injective f) (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y))
    (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (compare_f : ∀ a b : α, compare a b = compare (f a) (f b)) : LinearOrder α :=
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      

Proof state:
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.96919
β : Type ?u.96916
inst✝³ : LinearOrder β
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : Ord α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
compare_f : ∀ (a b : α), compare a b = compare (f a) (f b)
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ min x y = if x ≤ y then x else y

Next tactic:
apply inj
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. It also takes `[Ord α]` as an argument and uses them for `compare`
fields. See `LinearOrder.lift` for a version that autogenerates `compare` fields, and
`LinearOrder.liftWithOrd'` for one that auto-generates `min` and `max` fields.
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.liftWithOrd {α β} [LinearOrder β] [Sup α] [Inf α] [Ord α] (f : α → β)
    (inj : Injective f) (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y))
    (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (compare_f : ∀ a b : α, compare a b = compare (f a) (f b)) : LinearOrder α :=
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      

Proof state:
case a
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.96919
β : Type ?u.96916
inst✝³ : LinearOrder β
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : Ord α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
compare_f : ∀ (a b : α), compare a b = compare (f a) (f b)
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ f (min x y) = f (if x ≤ y then x else y)

Next tactic:
rw [apply_ite f]
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. It also takes `[Ord α]` as an argument and uses them for `compare`
fields. See `LinearOrder.lift` for a version that autogenerates `compare` fields, and
`LinearOrder.liftWithOrd'` for one that auto-generates `min` and `max` fields.
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.liftWithOrd {α β} [LinearOrder β] [Sup α] [Inf α] [Ord α] (f : α → β)
    (inj : Injective f) (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y))
    (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (compare_f : ∀ a b : α, compare a b = compare (f a) (f b)) : LinearOrder α :=
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      

Proof state:
case a
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.96919
β : Type ?u.96916
inst✝³ : LinearOrder β
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : Ord α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
compare_f : ∀ (a b : α), compare a b = compare (f a) (f b)
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ f (min x y) = if x ≤ y then f x else f y

Next tactic:
exact (hinf _ _).trans (min_def _ _)
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. It also takes `[Ord α]` as an argument and uses them for `compare`
fields. See `LinearOrder.lift` for a version that autogenerates `compare` fields, and
`LinearOrder.liftWithOrd'` for one that auto-generates `min` and `max` fields.
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.liftWithOrd {α β} [LinearOrder β] [Sup α] [Inf α] [Ord α] (f : α → β)
    (inj : Injective f) (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y))
    (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (compare_f : ∀ a b : α, compare a b = compare (f a) (f b)) : LinearOrder α :=
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      exact (hinf _ _).trans (min_def _ _)
    max_def := by
      

Proof state:
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.96919
β : Type ?u.96916
inst✝³ : LinearOrder β
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : Ord α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
compare_f : ∀ (a b : α), compare a b = compare (f a) (f b)
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
⊢ ∀ (a b : α), max a b = if a ≤ b then b else a

Next tactic:
intros x y
/-- Transfer a `LinearOrder` on `β` to a `LinearOrder` on `α` using an injective
function `f : α → β`. This version takes `[Sup α]` and `[Inf α]` as arguments, then uses
them for `max` and `min` fields. It also takes `[Ord α]` as an argument and uses them for `compare`
fields. See `LinearOrder.lift` for a version that autogenerates `compare` fields, and
`LinearOrder.liftWithOrd'` for one that auto-generates `min` and `max` fields.
fields. See note [reducible non-instances]. -/
@[reducible]
def LinearOrder.liftWithOrd {α β} [LinearOrder β] [Sup α] [Inf α] [Ord α] (f : α → β)
    (inj : Injective f) (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y))
    (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (compare_f : ∀ a b : α, compare a b = compare (f a) (f b)) : LinearOrder α :=
  letI decidableLE := fun x y ↦ (inferInstance : Decidable (f x ≤ f y))
  letI decidableLT := fun x y ↦ (inferInstance : Decidable (f x < f y))
  letI decidableEq := fun x y ↦ decidable_of_iff (f x = f y) inj.eq_iff
  { PartialOrder.lift f inj with
    le_total := fun x y ↦ le_total (f x) (f y)
    decidableLE := decidableLE
    decidableLT := decidableLT
    decidableEq := decidableEq
    min := (· ⊓ ·)
    max := (· ⊔ ·)
    min_def := by
      intros x y
      apply inj
      rw [apply_ite f]
      exact (hinf _ _).trans (min_def _ _)
    max_def := by
      intros x y
      

Proof state:
ι : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
π : ι → Type u_2
r : α✝ → α✝ → Prop
α : Type ?u.96919
β : Type ?u.96916
inst✝³ : LinearOrder β
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : Ord α
f : α → β
inj : Injective f
hsup : ∀ (x y : α), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : α), f (x ⊓ y) = min (f x) (f y)
compare_f : ∀ (a b : α), compare a b = compare (f a) (f b)
decidableLE : (x y : α) → Decidable (f x ≤ f y) := fun x y => inferInstance
decidableLT : (x y : α) → Decidable (f x < f y) := fun x y => inferInstance
decidableEq : (x y : α) → Decidable (x = y) := fun x y => decidable_of_iff (f x = f y) (_ : f x = f y ↔ x = y)
src✝ : PartialOrder α := PartialOrder.lift f inj
x y : α
⊢ max x y = if x ≤ y then y else x

Next tactic:
apply inj