l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem basisRepr_apply (Q : QuadraticForm R M) (w : ι → R) :
    Q.basisRepr v w = Q (∑ i : ι, w i • v i) := by
  

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
M : Type u_4
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
ι : Type u_5
inst✝ : Fintype ι
v : Basis ι R M
Q : QuadraticForm R M
w : ι → R
⊢ (basisRepr Q v) w = Q (∑ i : ι, w i • v i)

Next tactic:
rw [← v.equivFun_symm_apply]
@[simp]
theorem basisRepr_apply (Q : QuadraticForm R M) (w : ι → R) :
    Q.basisRepr v w = Q (∑ i : ι, w i • v i) := by
  rw [← v.equivFun_symm_apply]
  

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
M : Type u_4
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
ι : Type u_5
inst✝ : Fintype ι
v : Basis ι R M
Q : QuadraticForm R M
w : ι → R
⊢ (basisRepr Q v) w = Q ((LinearEquiv.symm (Basis.equivFun v)) fun i => w i)

Next tactic:
rfl
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  

Proof state:
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
⊢ basisRepr Q v = weightedSumSquares R fun i => Q (v i)

Next tactic:
ext w
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
⊢ (basisRepr Q v) w = (weightedSumSquares R fun i => Q (v i)) w

Next tactic:
rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
  

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
⊢ ∑ i : ι, bilin ((associatedHom R) Q) (w i • v i) (∑ i : ι, w i • v i) = ∑ i : ι, Q (v i) • (w i * w i)

Next tactic:
refine' sum_congr rfl fun j hj => _
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
  refine' sum_congr rfl fun j hj => _
  

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
j : ι
hj : j ∈ univ
⊢ bilin ((associatedHom R) Q) (w j • v j) (∑ i : ι, w i • v i) = Q (v j) • (w j * w j)

Next tactic:
rw [← @associated_eq_self_apply R, sum_right, sum_eq_single_of_mem j hj]
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
  refine' sum_congr rfl fun j hj => _
  rw [← @associated_eq_self_apply R, sum_right, sum_eq_single_of_mem j hj]
  · 

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
j : ι
hj : j ∈ univ
⊢ bilin ((associatedHom R) Q) (w j • v j) (w j • v j) = bilin ((associatedHom R) Q) (v j) (v j) • (w j * w j)

Next tactic:
rw [smul_left, smul_right, smul_eq_mul]
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
  refine' sum_congr rfl fun j hj => _
  rw [← @associated_eq_self_apply R, sum_right, sum_eq_single_of_mem j hj]
  · rw [smul_left, smul_right, smul_eq_mul]
    

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
j : ι
hj : j ∈ univ
⊢ w j * (w j * bilin ((associatedHom R) Q) (v j) (v j)) = bilin ((associatedHom R) Q) (v j) (v j) * (w j * w j)

Next tactic:
ring
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
  refine' sum_congr rfl fun j hj => _
  rw [← @associated_eq_self_apply R, sum_right, sum_eq_single_of_mem j hj]
  · rw [smul_left, smul_right, smul_eq_mul]
    ring
  · 

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
j : ι
hj : j ∈ univ
⊢ ∀ b ∈ univ, b ≠ j → bilin ((associatedHom R) Q) (w j • v j) (w b • v b) = 0

Next tactic:
intro i _ hij
/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticForm R M) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).iIsOrtho v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i) := by
  ext w
  rw [basisRepr_apply, ← @associated_eq_self_apply R, sum_left, weightedSumSquares_apply]
  refine' sum_congr rfl fun j hj => _
  rw [← @associated_eq_self_apply R, sum_right, sum_eq_single_of_mem j hj]
  · rw [smul_left, smul_right, smul_eq_mul]
    ring
  · intro i _ hij
    

Proof state:
case H
S : Type u_1
T : Type u_2
R✝ : Type u_3
M✝ : Type u_4
inst✝⁷ : CommSemiring R✝
inst✝⁶ : AddCommMonoid M✝
inst✝⁵ : Module R✝ M✝
ι : Type u_5
inst✝⁴ : Fintype ι
v✝ : Basis ι R✝ M✝
R : Type u_6
M : Type u_7
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : Invertible 2
Q : QuadraticForm R M
v : Basis ι R M
hv₂ : iIsOrtho (associated Q) ⇑v
w : ι → R
j : ι
hj : j ∈ univ
i : ι
a✝ : i ∈ univ
hij : i ≠ j
⊢ bilin ((associatedHom R) Q) (w j • v j) (w i • v i) = 0

Next tactic:
rw [smul_left, smul_right, show associatedHom R Q (v j) (v i) = 0 from hv₂ hij.symm,
      mul_zero, mul_zero]
instance [IsIrrefl α r] [IsIrrefl β s] : IsIrrefl (Sum α β) (LiftRel r s) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsIrrefl α r
inst✝ : IsIrrefl β s
⊢ ∀ (a : α ⊕ β), ¬LiftRel r s a a

Next tactic:
rintro _ (⟨h⟩ | ⟨h⟩)
instance [IsIrrefl α r] [IsIrrefl β s] : IsIrrefl (Sum α β) (LiftRel r s) :=
  ⟨by rintro _ (⟨h⟩ | ⟨h⟩) <;> 

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsIrrefl α r
inst✝ : IsIrrefl β s
a✝ : α
h : r a✝ a✝
⊢ False

Next tactic:
exact irrefl _ h
instance [IsIrrefl α r] [IsIrrefl β s] : IsIrrefl (Sum α β) (LiftRel r s) :=
  ⟨by rintro _ (⟨h⟩ | ⟨h⟩) <;> 

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsIrrefl α r
inst✝ : IsIrrefl β s
b✝ : β
h : s b✝ b✝
⊢ False

Next tactic:
exact irrefl _ h
instance [IsAntisymm α r] [IsAntisymm β s] : IsAntisymm (Sum α β) (LiftRel r s) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsAntisymm α r
inst✝ : IsAntisymm β s
⊢ ∀ (a b : α ⊕ β), LiftRel r s a b → LiftRel r s b a → a = b

Next tactic:
rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩)
instance [IsAntisymm α r] [IsAntisymm β s] : IsAntisymm (Sum α β) (LiftRel r s) :=
  ⟨by rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩) <;> 

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsAntisymm α r
inst✝ : IsAntisymm β s
a✝ c✝ : α
hab : r a✝ c✝
hba : r c✝ a✝
⊢ inl a✝ = inl c✝

Next tactic:
rw [antisymm hab hba]
instance [IsAntisymm α r] [IsAntisymm β s] : IsAntisymm (Sum α β) (LiftRel r s) :=
  ⟨by rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩) <;> 

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsAntisymm α r
inst✝ : IsAntisymm β s
b✝ d✝ : β
hab : s b✝ d✝
hba : s d✝ b✝
⊢ inr b✝ = inr d✝

Next tactic:
rw [antisymm hab hba]
instance [IsRefl α r] [IsRefl β s] : IsRefl (Sum α β) (Lex r s) :=
  ⟨by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsRefl α r
inst✝ : IsRefl β s
⊢ ∀ (a : α ⊕ β), Lex r s a a

Next tactic:
rintro (a | a)
instance [IsRefl α r] [IsRefl β s] : IsRefl (Sum α β) (Lex r s) :=
  ⟨by
    rintro (a | a)
    

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsRefl α r
inst✝ : IsRefl β s
a : α
⊢ Lex r s (inl a) (inl a)
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsRefl α r
inst✝ : IsRefl β s
a : β
⊢ Lex r s (inr a) (inr a)

Next tactic:
exacts [Lex.inl (refl _), Lex.inr (refl _)]
instance [IsIrrefl α r] [IsIrrefl β s] : IsIrrefl (Sum α β) (Lex r s) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsIrrefl α r
inst✝ : IsIrrefl β s
⊢ ∀ (a : α ⊕ β), ¬Lex r s a a

Next tactic:
rintro _ (⟨h⟩ | ⟨h⟩)
instance [IsIrrefl α r] [IsIrrefl β s] : IsIrrefl (Sum α β) (Lex r s) :=
  ⟨by rintro _ (⟨h⟩ | ⟨h⟩) <;> 

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsIrrefl α r
inst✝ : IsIrrefl β s
a₁✝ : α
h : r a₁✝ a₁✝
⊢ False

Next tactic:
exact irrefl _ h
instance [IsIrrefl α r] [IsIrrefl β s] : IsIrrefl (Sum α β) (Lex r s) :=
  ⟨by rintro _ (⟨h⟩ | ⟨h⟩) <;> 

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsIrrefl α r
inst✝ : IsIrrefl β s
b₁✝ : β
h : s b₁✝ b₁✝
⊢ False

Next tactic:
exact irrefl _ h
instance [IsTrans α r] [IsTrans β s] : IsTrans (Sum α β) (Lex r s) :=
  ⟨by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsTrans α r
inst✝ : IsTrans β s
⊢ ∀ (a b c : α ⊕ β), Lex r s a b → Lex r s b c → Lex r s a c

Next tactic:
rintro _ _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hbc⟩ | ⟨hbc⟩)
instance [IsTrans α r] [IsTrans β s] : IsTrans (Sum α β) (Lex r s) :=
  ⟨by
    rintro _ _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hbc⟩ | ⟨hbc⟩)
    

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsTrans α r
inst✝ : IsTrans β s
a₁✝ a₂✝¹ : α
hab : r a₁✝ a₂✝¹
a₂✝ : α
hbc : r a₂✝¹ a₂✝
⊢ Lex r s (inl a₁✝) (inl a₂✝)
case inl.sep
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsTrans α r
inst✝ : IsTrans β s
a₁✝ a₂✝ : α
hab : r a₁✝ a₂✝
b✝ : β
⊢ Lex r s (inl a₁✝) (inr b✝)
case inr.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsTrans α r
inst✝ : IsTrans β s
b₁✝ b₂✝¹ : β
hab : s b₁✝ b₂✝¹
b₂✝ : β
hbc : s b₂✝¹ b₂✝
⊢ Lex r s (inr b₁✝) (inr b₂✝)
case sep.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsTrans α r
inst✝ : IsTrans β s
a✝ : α
b✝ b₂✝ : β
hbc : s b✝ b₂✝
⊢ Lex r s (inl a✝) (inr b₂✝)

Next tactic:
exacts [.inl (_root_.trans hab hbc), .sep _ _, .inr (_root_.trans hab hbc), .sep _ _]
instance [IsAntisymm α r] [IsAntisymm β s] : IsAntisymm (Sum α β) (Lex r s) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsAntisymm α r
inst✝ : IsAntisymm β s
⊢ ∀ (a b : α ⊕ β), Lex r s a b → Lex r s b a → a = b

Next tactic:
rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩)
instance [IsAntisymm α r] [IsAntisymm β s] : IsAntisymm (Sum α β) (Lex r s) :=
  ⟨by rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩) <;> 

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsAntisymm α r
inst✝ : IsAntisymm β s
a₁✝ a₂✝ : α
hab : r a₁✝ a₂✝
hba : r a₂✝ a₁✝
⊢ inl a₁✝ = inl a₂✝

Next tactic:
rw [antisymm hab hba]
instance [IsAntisymm α r] [IsAntisymm β s] : IsAntisymm (Sum α β) (Lex r s) :=
  ⟨by rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩) <;> 

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
r : α → α → Prop
s : β → β → Prop
inst✝¹ : IsAntisymm α r
inst✝ : IsAntisymm β s
b₁✝ b₂✝ : β
hab : s b₁✝ b₂✝
hba : s b₂✝ b₁✝
⊢ inr b₁✝ = inr b₂✝

Next tactic:
rw [antisymm hab hba]
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
a b : α ⊕ β
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a

Next tactic:
refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
      · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
a b : α ⊕ β
hab : a < b
⊢ ¬b ≤ a

Next tactic:
rintro (⟨hba⟩ | ⟨hba⟩)
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
      · rintro (⟨hba⟩ | ⟨hba⟩)
        · 

Proof state:
case refine'_1.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
a✝ c✝ : α
hba : a✝ ≤ c✝
hab : inl c✝ < inl a✝
⊢ False

Next tactic:
exact hba.not_lt (inl_lt_inl_iff.1 hab)
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
      · rintro (⟨hba⟩ | ⟨hba⟩)
        · exact hba.not_lt (inl_lt_inl_iff.1 hab)
        · 

Proof state:
case refine'_1.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
b✝ d✝ : β
hba : b✝ ≤ d✝
hab : inr d✝ < inr b✝
⊢ False

Next tactic:
exact hba.not_lt (inr_lt_inr_iff.1 hab)
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
      · rintro (⟨hba⟩ | ⟨hba⟩)
        · exact hba.not_lt (inl_lt_inl_iff.1 hab)
        · exact hba.not_lt (inr_lt_inr_iff.1 hab)
      · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
a b : α ⊕ β
⊢ a ≤ b ∧ ¬b ≤ a → a < b

Next tactic:
rintro ⟨⟨hab⟩ | ⟨hab⟩, hba⟩
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
      · rintro (⟨hba⟩ | ⟨hba⟩)
        · exact hba.not_lt (inl_lt_inl_iff.1 hab)
        · exact hba.not_lt (inr_lt_inr_iff.1 hab)
      · rintro ⟨⟨hab⟩ | ⟨hab⟩, hba⟩
        · 

Proof state:
case refine'_2.intro.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
a✝ c✝ : α
hab : a✝ ≤ c✝
hba : ¬inl c✝ ≤ inl a✝
⊢ inl a✝ < inl c✝

Next tactic:
exact LiftRel.inl (hab.lt_of_not_le fun h => hba <| LiftRel.inl h)
instance instPreorderSum : Preorder (Sum α β) :=
  { instLESum, instLTSum with
    le_refl := fun x => LiftRel.refl _ _ _,
    le_trans := fun _ _ _ => LiftRel.trans _ _,
    lt_iff_le_not_le := fun a b => by
      refine' ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, _⟩, _⟩
      · rintro (⟨hba⟩ | ⟨hba⟩)
        · exact hba.not_lt (inl_lt_inl_iff.1 hab)
        · exact hba.not_lt (inr_lt_inr_iff.1 hab)
      · rintro ⟨⟨hab⟩ | ⟨hab⟩, hba⟩
        · exact LiftRel.inl (hab.lt_of_not_le fun h => hba <| LiftRel.inl h)
        · 

Proof state:
case refine'_2.intro.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : Preorder α
inst✝ : Preorder β
src✝¹ : LE (α ⊕ β) := instLESum
src✝ : LT (α ⊕ β) := instLTSum
b✝ d✝ : β
hab : b✝ ≤ d✝
hba : ¬inr d✝ ≤ inr b✝
⊢ inr b✝ < inr d✝

Next tactic:
exact LiftRel.inr (hab.lt_of_not_le fun h => hba <| LiftRel.inr h)
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (Sum α β) ↔ NoMinOrder α ∧ NoMinOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMinOrder (α ⊕ β)
a : α
⊢ ∃ b, b < a

Next tactic:
obtain ⟨b | b, h⟩ := exists_lt (inl a : Sum α β)
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (Sum α β) ↔ NoMinOrder α ∧ NoMinOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inl a : Sum α β)
        · 

Proof state:
case intro.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMinOrder (α ⊕ β)
a b : α
h : inl b < inl a
⊢ ∃ b, b < a

Next tactic:
exact ⟨b, inl_lt_inl_iff.1 h⟩
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (Sum α β) ↔ NoMinOrder α ∧ NoMinOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inl a : Sum α β)
        · exact ⟨b, inl_lt_inl_iff.1 h⟩
        · 

Proof state:
case intro.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMinOrder (α ⊕ β)
a : α
b : β
h : inr b < inl a
⊢ ∃ b, b < a

Next tactic:
exact (not_inr_lt_inl h).elim
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (Sum α β) ↔ NoMinOrder α ∧ NoMinOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inl a : Sum α β)
        · exact ⟨b, inl_lt_inl_iff.1 h⟩
        · exact (not_inr_lt_inl h).elim⟩,
      ⟨fun a => by
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMinOrder (α ⊕ β)
a : β
⊢ ∃ b, b < a

Next tactic:
obtain ⟨b | b, h⟩ := exists_lt (inr a : Sum α β)
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (Sum α β) ↔ NoMinOrder α ∧ NoMinOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inl a : Sum α β)
        · exact ⟨b, inl_lt_inl_iff.1 h⟩
        · exact (not_inr_lt_inl h).elim⟩,
      ⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inr a : Sum α β)
        · 

Proof state:
case intro.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMinOrder (α ⊕ β)
a : β
b : α
h : inl b < inr a
⊢ ∃ b, b < a

Next tactic:
exact (not_inl_lt_inr h).elim
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (Sum α β) ↔ NoMinOrder α ∧ NoMinOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inl a : Sum α β)
        · exact ⟨b, inl_lt_inl_iff.1 h⟩
        · exact (not_inr_lt_inl h).elim⟩,
      ⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_lt (inr a : Sum α β)
        · exact (not_inl_lt_inr h).elim
        · 

Proof state:
case intro.inr
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMinOrder (α ⊕ β)
a b : β
h : inr b < inr a
⊢ ∃ b, b < a

Next tactic:
exact ⟨b, inr_lt_inr_iff.1 h⟩
@[simp]
theorem noMaxOrder_iff [LT α] [LT β] : NoMaxOrder (Sum α β) ↔ NoMaxOrder α ∧ NoMaxOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMaxOrder (α ⊕ β)
a : α
⊢ ∃ b, a < b

Next tactic:
obtain ⟨b | b, h⟩ := exists_gt (inl a : Sum α β)
@[simp]
theorem noMaxOrder_iff [LT α] [LT β] : NoMaxOrder (Sum α β) ↔ NoMaxOrder α ∧ NoMaxOrder β :=
  ⟨fun _ =>
    ⟨⟨fun a => by
        obtain ⟨b | b, h⟩ := exists_gt (inl a : Sum α β)
        · 

Proof state:
case intro.inl
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : LT α
inst✝ : LT β
x✝ : NoMaxOrder (α ⊕ β)
a b : α
h : inl a < inl b
⊢ ∃ b, a < b

Next tactic:
exact ⟨b, inl_lt_inl_iff.1 h⟩