You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
theoremle_of_min_eq [Ord α] [TransOrd α] [LE α] [Min α] [Std.LawfulOrderOrd α] [Std.LawfulOrderMin α] [Std.LawfulOrderLeftLeaningMin α] (a b : α) (h1 : min a b = a) (h2 : a ≠ b) : a ≤ b := by
8254
+
apply Classical.byContradiction
8255
+
intro hyp
8256
+
rw [LawfulOrderLeftLeaningMin.min_eq_right a b hyp] at h1
8257
+
rw [eq_comm] at h1
8258
+
exact h2 h1
8259
+
8260
+
theoremle_of_min_eq2 [Ord α] [TransOrd α] [LE α] [Min α] [Std.LawfulOrderOrd α] [Std.LawfulOrderMin α] [Std.LawfulOrderLeftLeaningMin α] (a b : α) (h1 : min a b = b) (h2 : a ≠ b) : ¬ a ≤ b := by
8261
+
intro hyp
8262
+
rw [LawfulOrderLeftLeaningMin.min_eq_left a b hyp] at h1
8263
+
exact h2 h1
8264
+
8265
+
theoremtrans_lemma [Ord α] [TransOrd α] [LE α] [Std.LawfulOrderOrd α] {a b c : α} : a ≤ b → b ≤ c → a ≤ c := by
8266
+
intro h1 h2
8267
+
exact (LawfulOrderOrd.isLE_compare a c).1 <| TransOrd.isLE_trans ((LawfulOrderOrd.isLE_compare a b).2 h1) ((LawfulOrderOrd.isLE_compare b c).2 h2)
8268
+
8269
+
theoremtotal [Ord α] [OrientedOrd α] [LE α] [Std.LawfulOrderOrd α] (a b : α) : a ≤ b ∨ b ≤ a := by
8270
+
rw [← LawfulOrderOrd.isLE_compare a b, ← LawfulOrderOrd.isLE_compare b a]
(apply Or.elim <| MinEqOr.min_eq_or b b) <;> (intro; trivial)
8318
+
rw [this]
8319
+
apply Or.elim <| MinEqOr.min_eq_or b c
8320
+
case left =>
8321
+
intro h2
8322
+
simp [h2, IdempotentOp.idempotent]
8323
+
case right =>
8324
+
intro h3
8325
+
simp [h3]
8326
+
case neg =>
8327
+
rw [h1]
8328
+
apply Or.elim <| MinEqOr.min_eq_or b c
8329
+
case left =>
8330
+
intro h2
8331
+
rw [h2, h1]
8332
+
by_cases hbc : b = c
8333
+
case pos =>
8334
+
rw [← hbc, h1]
8335
+
case neg =>
8336
+
have w1 := le_of_min_eq a b h1 hab
8337
+
have w2 := le_of_min_eq b c h2 hbc
8338
+
exact LawfulOrderLeftLeaningMin.min_eq_left a c (trans_lemma w1 w2)
8339
+
case right =>
8340
+
intro h2
8341
+
rw [h2]
8342
+
case right =>
8343
+
intro h1
8344
+
rw [h1]
8345
+
by_cases hab : (a = b)
8346
+
case pos =>
8347
+
rw [hab]
8348
+
apply Or.elim <| MinEqOr.min_eq_or b c
8349
+
case left =>
8350
+
intro h2
8351
+
rw [h2]
8352
+
simp [IdempotentOp.idempotent]
8353
+
case right =>
8354
+
intro h2
8355
+
simp [h2]
8356
+
case neg =>
8357
+
by_cases hbc : (b = c)
8358
+
case pos =>
8359
+
rw [← hbc]
8360
+
simp [IdempotentOp.idempotent, h1]
8361
+
case neg =>
8362
+
apply Or.elim <| MinEqOr.min_eq_or b c
8363
+
case left =>
8364
+
intro h2
8365
+
rw [h2, h1]
8366
+
case right =>
8367
+
intro h2
8368
+
rw [h2]
8369
+
apply Or.elim <| MinEqOr.min_eq_or a c
8370
+
case left =>
8371
+
intro h3
8372
+
rw [h3]
8373
+
have w1 := le_of_min_eq2 a b h1 hab
8374
+
have w2 := le_of_min_eq2 b c h2 hbc
8375
+
have w3 := le_of_min_eq a c h3
8376
+
apply Classical.byContradiction
8377
+
intro hn
8378
+
specialize w3 (Ne.symm hn)
8379
+
have v1 := total a b
8380
+
have v2 := total b c
8381
+
simp [w1] at v1
8382
+
simp [w2] at v2
8383
+
have a_leq_b := (LawfulOrderOrd.isLE_compare a b).1 <| TransOrd.isLE_trans ((LawfulOrderOrd.isLE_compare a c).2 w3) ((LawfulOrderOrd.isLE_compare c b).2 v2)
8384
+
rw [LawfulOrderLeftLeaningMin.min_eq_left a b a_leq_b] at h1
0 commit comments