order.circularMathlib.Order.Circular

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

feat(algebra/order/to_interval_mod): add circular_order instance for add_circle (#17743)

This also provides us with the same instance for real.angle.

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -70,7 +70,7 @@ What is the correct generality of "rolling the necklace" open? At least, this wo
 `β × α` where `α` is a circular order and `β` is a linear order.
 
 What's next is to define circular groups and provide instances for `zmod n`, the usual circle group
-`circle`, `real.angle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
+`circle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
 to work?
 
 We should have circular order homomorphisms. The typical example is

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -487,7 +487,7 @@ def Preorder.toCircularPreorder (α : Type _) [Preorder α] : CircularPreorder 
   btw_refl a := Or.inl ⟨le_rfl, le_rfl⟩
   btw_cyclic_left a b c h := by
     unfold btw at h ⊢
-    rwa [← or_assoc, or_comm']
+    rwa [← or_assoc, or_comm]
   sbtw_trans_left a b c d :=
     by
     rintro (⟨hab, hbc⟩ | ⟨hbc, hca⟩ | ⟨hca, hab⟩) (⟨hbd, hdc⟩ | ⟨hdc, hcb⟩ | ⟨hcb, hbd⟩)
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Set.Basic
+import Data.Set.Basic
 
 #align_import order.circular from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec"
 
Diff
@@ -175,7 +175,7 @@ theorem btw_cyclic_right {a b c : α} (h : Btw a b c) : Btw c a b :=
 #align btw_cyclic_right btw_cyclic_right
 -/
 
-alias btw_cyclic_right ← Btw.btw.cyclic_right
+alias Btw.btw.cyclic_right := btw_cyclic_right
 #align has_btw.btw.cyclic_right Btw.btw.cyclic_right
 
 #print btw_cyclic /-
@@ -198,7 +198,7 @@ theorem btw_of_sbtw {a b c : α} (h : Sbtw a b c) : Btw a b c :=
 #align btw_of_sbtw btw_of_sbtw
 -/
 
-alias btw_of_sbtw ← SBtw.sbtw.btw
+alias SBtw.sbtw.btw := btw_of_sbtw
 #align has_sbtw.sbtw.btw SBtw.sbtw.btw
 
 #print not_btw_of_sbtw /-
@@ -207,7 +207,7 @@ theorem not_btw_of_sbtw {a b c : α} (h : Sbtw a b c) : ¬Btw c b a :=
 #align not_btw_of_sbtw not_btw_of_sbtw
 -/
 
-alias not_btw_of_sbtw ← SBtw.sbtw.not_btw
+alias SBtw.sbtw.not_btw := not_btw_of_sbtw
 #align has_sbtw.sbtw.not_btw SBtw.sbtw.not_btw
 
 #print not_sbtw_of_btw /-
@@ -215,7 +215,7 @@ theorem not_sbtw_of_btw {a b c : α} (h : Btw a b c) : ¬Sbtw c b a := fun h' =>
 #align not_sbtw_of_btw not_sbtw_of_btw
 -/
 
-alias not_sbtw_of_btw ← Btw.btw.not_sbtw
+alias Btw.btw.not_sbtw := not_sbtw_of_btw
 #align has_btw.btw.not_sbtw Btw.btw.not_sbtw
 
 #print sbtw_of_btw_not_btw /-
@@ -224,7 +224,7 @@ theorem sbtw_of_btw_not_btw {a b c : α} (habc : Btw a b c) (hcba : ¬Btw c b a)
 #align sbtw_of_btw_not_btw sbtw_of_btw_not_btw
 -/
 
-alias sbtw_of_btw_not_btw ← Btw.btw.sbtw_of_not_btw
+alias Btw.btw.sbtw_of_not_btw := sbtw_of_btw_not_btw
 #align has_btw.btw.sbtw_of_not_btw Btw.btw.sbtw_of_not_btw
 
 #print sbtw_cyclic_left /-
@@ -233,7 +233,7 @@ theorem sbtw_cyclic_left {a b c : α} (h : Sbtw a b c) : Sbtw b c a :=
 #align sbtw_cyclic_left sbtw_cyclic_left
 -/
 
-alias sbtw_cyclic_left ← SBtw.sbtw.cyclic_left
+alias SBtw.sbtw.cyclic_left := sbtw_cyclic_left
 #align has_sbtw.sbtw.cyclic_left SBtw.sbtw.cyclic_left
 
 #print sbtw_cyclic_right /-
@@ -242,7 +242,7 @@ theorem sbtw_cyclic_right {a b c : α} (h : Sbtw a b c) : Sbtw c a b :=
 #align sbtw_cyclic_right sbtw_cyclic_right
 -/
 
-alias sbtw_cyclic_right ← SBtw.sbtw.cyclic_right
+alias SBtw.sbtw.cyclic_right := sbtw_cyclic_right
 #align has_sbtw.sbtw.cyclic_right SBtw.sbtw.cyclic_right
 
 #print sbtw_cyclic /-
@@ -267,7 +267,7 @@ theorem sbtw_trans_right {a b c d : α} (hbc : Sbtw a b c) (hcd : Sbtw a c d) :
 #align sbtw_trans_right sbtw_trans_right
 -/
 
-alias sbtw_trans_right ← SBtw.sbtw.trans_right
+alias SBtw.sbtw.trans_right := sbtw_trans_right
 #align has_sbtw.sbtw.trans_right SBtw.sbtw.trans_right
 
 #print sbtw_asymm /-
@@ -276,7 +276,7 @@ theorem sbtw_asymm {a b c : α} (h : Sbtw a b c) : ¬Sbtw c b a :=
 #align sbtw_asymm sbtw_asymm
 -/
 
-alias sbtw_asymm ← SBtw.sbtw.not_sbtw
+alias SBtw.sbtw.not_sbtw := sbtw_asymm
 #align has_sbtw.sbtw.not_sbtw SBtw.sbtw.not_sbtw
 
 #print sbtw_irrefl_left_right /-
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module order.circular
-! leanprover-community/mathlib commit 213b0cff7bc5ab6696ee07cceec80829ce42efec
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Set.Basic
 
+#align_import order.circular from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec"
+
 /-!
 # Circular order hierarchy
 
Diff
@@ -436,19 +436,23 @@ theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b :=
 #align set.right_mem_cIcc Set.right_mem_cIcc
 -/
 
+#print Set.compl_cIcc /-
 theorem compl_cIcc {a b : α} : cIcc a bᶜ = cIoo b a :=
   by
   ext
   rw [Set.mem_cIoo, sbtw_iff_not_btw]
   rfl
 #align set.compl_cIcc Set.compl_cIcc
+-/
 
+#print Set.compl_cIoo /-
 theorem compl_cIoo {a b : α} : cIoo a bᶜ = cIcc b a :=
   by
   ext
   rw [Set.mem_cIcc, btw_iff_not_sbtw]
   rfl
 #align set.compl_cIoo Set.compl_cIoo
+-/
 
 end CircularOrder
 
Diff
@@ -393,14 +393,14 @@ variable {α : Type _} [CircularPreorder α]
 #print Set.cIcc /-
 /-- Closed-closed circular interval -/
 def cIcc (a b : α) : Set α :=
-  { x | Btw a x b }
+  {x | Btw a x b}
 #align set.cIcc Set.cIcc
 -/
 
 #print Set.cIoo /-
 /-- Open-open circular interval -/
 def cIoo (a b : α) : Set α :=
-  { x | Sbtw a x b }
+  {x | Sbtw a x b}
 #align set.cIoo Set.cIoo
 -/
 
Diff
@@ -485,7 +485,7 @@ def Preorder.toCircularPreorder (α : Type _) [Preorder α] : CircularPreorder 
   Sbtw a b c := a < b ∧ b < c ∨ b < c ∧ c < a ∨ c < a ∧ a < b
   btw_refl a := Or.inl ⟨le_rfl, le_rfl⟩
   btw_cyclic_left a b c h := by
-    unfold btw at h⊢
+    unfold btw at h ⊢
     rwa [← or_assoc, or_comm']
   sbtw_trans_left a b c d :=
     by
Diff
@@ -436,12 +436,6 @@ theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b :=
 #align set.right_mem_cIcc Set.right_mem_cIcc
 -/
 
-/- warning: set.compl_cIcc -> Set.compl_cIcc is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CircularOrder.{u1} α] {a : α} {b : α}, Eq.{succ u1} (Set.{u1} α) (HasCompl.compl.{u1} (Set.{u1} α) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} α) (Set.booleanAlgebra.{u1} α)) (Set.cIcc.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) a b)) (Set.cIoo.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) b a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CircularOrder.{u1} α] {a : α} {b : α}, Eq.{succ u1} (Set.{u1} α) (HasCompl.compl.{u1} (Set.{u1} α) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} α) (Set.instBooleanAlgebraSet.{u1} α)) (Set.cIcc.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) a b)) (Set.cIoo.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) b a)
-Case conversion may be inaccurate. Consider using '#align set.compl_cIcc Set.compl_cIccₓ'. -/
 theorem compl_cIcc {a b : α} : cIcc a bᶜ = cIoo b a :=
   by
   ext
@@ -449,12 +443,6 @@ theorem compl_cIcc {a b : α} : cIcc a bᶜ = cIoo b a :=
   rfl
 #align set.compl_cIcc Set.compl_cIcc
 
-/- warning: set.compl_cIoo -> Set.compl_cIoo is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CircularOrder.{u1} α] {a : α} {b : α}, Eq.{succ u1} (Set.{u1} α) (HasCompl.compl.{u1} (Set.{u1} α) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} α) (Set.booleanAlgebra.{u1} α)) (Set.cIoo.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) a b)) (Set.cIcc.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) b a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CircularOrder.{u1} α] {a : α} {b : α}, Eq.{succ u1} (Set.{u1} α) (HasCompl.compl.{u1} (Set.{u1} α) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} α) (Set.instBooleanAlgebraSet.{u1} α)) (Set.cIoo.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) a b)) (Set.cIcc.{u1} α (CircularPartialOrder.toCircularPreorder.{u1} α (CircularOrder.toCircularPartialOrder.{u1} α _inst_1)) b a)
-Case conversion may be inaccurate. Consider using '#align set.compl_cIoo Set.compl_cIooₓ'. -/
 theorem compl_cIoo {a b : α} : cIoo a bᶜ = cIcc b a :=
   by
   ext
Diff
@@ -120,10 +120,10 @@ class CircularPreorder (α : Type _) extends Btw α, SBtw α where
   btw_refl (a : α) : btw a a a
   btw_cyclic_left {a b c : α} : btw a b c → btw b c a
   Sbtw := fun a b c => btw a b c ∧ ¬btw c b a
-  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by
+  sbtw_iff_btw_not_btw {a b c : α} : Sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by
     run_tac
       order_laws_tac
-  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c
+  sbtw_trans_left {a b c d : α} : Sbtw a b c → Sbtw b d c → Sbtw a d c
 #align circular_preorder CircularPreorder
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.circular
-! leanprover-community/mathlib commit f2f413b9d4be3a02840d0663dace76e8fe3da053
+! leanprover-community/mathlib commit 213b0cff7bc5ab6696ee07cceec80829ce42efec
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -75,7 +75,7 @@ What is the correct generality of "rolling the necklace" open? At least, this wo
 `β × α` where `α` is a circular order and `β` is a linear order.
 
 What's next is to define circular groups and provide instances for `zmod n`, the usual circle group
-`circle`, `real.angle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
+`circle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
 to work?
 
 We should have circular order homomorphisms. The typical example is
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.circular
-! leanprover-community/mathlib commit 213b0cff7bc5ab6696ee07cceec80829ce42efec
+! leanprover-community/mathlib commit f2f413b9d4be3a02840d0663dace76e8fe3da053
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -75,7 +75,7 @@ What is the correct generality of "rolling the necklace" open? At least, this wo
 `β × α` where `α` is a circular order and `β` is a linear order.
 
 What's next is to define circular groups and provide instances for `zmod n`, the usual circle group
-`circle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
+`circle`, `real.angle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
 to work?
 
 We should have circular order homomorphisms. The typical example is
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.circular
-! leanprover-community/mathlib commit f2f413b9d4be3a02840d0663dace76e8fe3da053
+! leanprover-community/mathlib commit 213b0cff7bc5ab6696ee07cceec80829ce42efec
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -75,7 +75,7 @@ What is the correct generality of "rolling the necklace" open? At least, this wo
 `β × α` where `α` is a circular order and `β` is a linear order.
 
 What's next is to define circular groups and provide instances for `zmod n`, the usual circle group
-`circle`, `real.angle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
+`circle`, and `roots_of_unity M`. What conditions do we need on `M` for this last one
 to work?
 
 We should have circular order homomorphisms. The typical example is
Diff
@@ -112,7 +112,7 @@ class SBtw (α : Type _) where
 export SBtw (Sbtw)
 
 #print CircularPreorder /-
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic order_laws_tac -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic order_laws_tac -/
 /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
 replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
 -/

Changes in mathlib4

mathlib3
mathlib4
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -457,8 +457,8 @@ See note [reducible non-instances]. -/
 def LinearOrder.toCircularOrder (α : Type*) [LinearOrder α] : CircularOrder α :=
   { PartialOrder.toCircularPartialOrder α with
     btw_total := fun a b c => by
-      cases' le_total a b with hab hba <;> cases' le_total b c with hbc hcb <;>
-        cases' le_total c a with hca hac
+      rcases le_total a b with hab | hba <;> rcases le_total b c with hbc | hcb <;>
+        rcases le_total c a with hca | hac
       · exact Or.inl (Or.inl ⟨hab, hbc⟩)
       · exact Or.inl (Or.inl ⟨hab, hbc⟩)
       · exact Or.inl (Or.inr <| Or.inr ⟨hca, hab⟩)
chore: bump Std to Std#340 (#8104)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -289,7 +289,7 @@ section CircularOrder
 variable {α : Type*} [CircularOrder α]
 
 theorem btw_refl_left_right (a b : α) : btw a b a :=
-  (or_self_iff _).1 (btw_total a b a)
+  or_self_iff.1 (btw_total a b a)
 #align btw_refl_left_right btw_refl_left_right
 
 theorem btw_rfl_left_right {a b : α} : btw a b a :=
feat: patch for new alias command (#6172)
Diff
@@ -171,7 +171,7 @@ theorem btw_cyclic_right {a b c : α} (h : btw a b c) : btw c a b :=
   h.cyclic_left.cyclic_left
 #align btw_cyclic_right btw_cyclic_right
 
-alias btw_cyclic_right ← Btw.btw.cyclic_right
+alias Btw.btw.cyclic_right := btw_cyclic_right
 #align has_btw.btw.cyclic_right Btw.btw.cyclic_right
 
 /-- The order of the `↔` has been chosen so that `rw [btw_cyclic]` cycles to the right while
@@ -188,41 +188,41 @@ theorem btw_of_sbtw {a b c : α} (h : sbtw a b c) : btw a b c :=
   (sbtw_iff_btw_not_btw.1 h).1
 #align btw_of_sbtw btw_of_sbtw
 
-alias btw_of_sbtw ← SBtw.sbtw.btw
+alias SBtw.sbtw.btw := btw_of_sbtw
 #align has_sbtw.sbtw.btw SBtw.sbtw.btw
 
 theorem not_btw_of_sbtw {a b c : α} (h : sbtw a b c) : ¬btw c b a :=
   (sbtw_iff_btw_not_btw.1 h).2
 #align not_btw_of_sbtw not_btw_of_sbtw
 
-alias not_btw_of_sbtw ← SBtw.sbtw.not_btw
+alias SBtw.sbtw.not_btw := not_btw_of_sbtw
 #align has_sbtw.sbtw.not_btw SBtw.sbtw.not_btw
 
 theorem not_sbtw_of_btw {a b c : α} (h : btw a b c) : ¬sbtw c b a := fun h' => h'.not_btw h
 #align not_sbtw_of_btw not_sbtw_of_btw
 
-alias not_sbtw_of_btw ← Btw.btw.not_sbtw
+alias Btw.btw.not_sbtw := not_sbtw_of_btw
 #align has_btw.btw.not_sbtw Btw.btw.not_sbtw
 
 theorem sbtw_of_btw_not_btw {a b c : α} (habc : btw a b c) (hcba : ¬btw c b a) : sbtw a b c :=
   sbtw_iff_btw_not_btw.2 ⟨habc, hcba⟩
 #align sbtw_of_btw_not_btw sbtw_of_btw_not_btw
 
-alias sbtw_of_btw_not_btw ← Btw.btw.sbtw_of_not_btw
+alias Btw.btw.sbtw_of_not_btw := sbtw_of_btw_not_btw
 #align has_btw.btw.sbtw_of_not_btw Btw.btw.sbtw_of_not_btw
 
 theorem sbtw_cyclic_left {a b c : α} (h : sbtw a b c) : sbtw b c a :=
   h.btw.cyclic_left.sbtw_of_not_btw fun h' => h.not_btw h'.cyclic_left
 #align sbtw_cyclic_left sbtw_cyclic_left
 
-alias sbtw_cyclic_left ← SBtw.sbtw.cyclic_left
+alias SBtw.sbtw.cyclic_left := sbtw_cyclic_left
 #align has_sbtw.sbtw.cyclic_left SBtw.sbtw.cyclic_left
 
 theorem sbtw_cyclic_right {a b c : α} (h : sbtw a b c) : sbtw c a b :=
   h.cyclic_left.cyclic_left
 #align sbtw_cyclic_right sbtw_cyclic_right
 
-alias sbtw_cyclic_right ← SBtw.sbtw.cyclic_right
+alias SBtw.sbtw.cyclic_right := sbtw_cyclic_right
 #align has_sbtw.sbtw.cyclic_right SBtw.sbtw.cyclic_right
 
 /-- The order of the `↔` has been chosen so that `rw [sbtw_cyclic]` cycles to the right while
@@ -241,14 +241,14 @@ theorem sbtw_trans_right {a b c d : α} (hbc : sbtw a b c) (hcd : sbtw a c d) :
   (hbc.cyclic_left.trans_left hcd.cyclic_left).cyclic_right
 #align sbtw_trans_right sbtw_trans_right
 
-alias sbtw_trans_right ← SBtw.sbtw.trans_right
+alias SBtw.sbtw.trans_right := sbtw_trans_right
 #align has_sbtw.sbtw.trans_right SBtw.sbtw.trans_right
 
 theorem sbtw_asymm {a b c : α} (h : sbtw a b c) : ¬sbtw c b a :=
   h.btw.not_sbtw
 #align sbtw_asymm sbtw_asymm
 
-alias sbtw_asymm ← SBtw.sbtw.not_sbtw
+alias SBtw.sbtw.not_sbtw := sbtw_asymm
 #align has_sbtw.sbtw.not_sbtw SBtw.sbtw.not_sbtw
 
 theorem sbtw_irrefl_left_right {a b : α} : ¬sbtw a b a := fun h => h.not_btw h.btw
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -88,7 +88,7 @@ circular order, cyclic order, circularly ordered set, cyclically ordered set
 
 
 /-- Syntax typeclass for a betweenness relation. -/
-class Btw (α : Type _) where
+class Btw (α : Type*) where
   /-- Betweenness for circular orders. `btw a b c` states that `b` is between `a` and `c` (in that
   order). -/
   btw : α → α → α → Prop
@@ -97,7 +97,7 @@ class Btw (α : Type _) where
 export Btw (btw)
 
 /-- Syntax typeclass for a strict betweenness relation. -/
-class SBtw (α : Type _) where
+class SBtw (α : Type*) where
   /-- Strict betweenness for circular orders. `sbtw a b c` states that `b` is strictly between `a`
   and `c` (in that order). -/
   sbtw : α → α → α → Prop
@@ -108,7 +108,7 @@ export SBtw (sbtw)
 /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
 replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
 -/
-class CircularPreorder (α : Type _) extends Btw α, SBtw α where
+class CircularPreorder (α : Type*) extends Btw α, SBtw α where
   /-- `a` is between `a` and `a`. -/
   btw_refl (a : α) : btw a a a
   /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
@@ -132,7 +132,7 @@ export CircularPreorder (btw_refl btw_cyclic_left sbtw_trans_left)
 /-- A circular partial order is the analogue of a partial order where you can loop around. `≤` and
 `<` are replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic and
 antisymmetric. `sbtw` is transitive. -/
-class CircularPartialOrder (α : Type _) extends CircularPreorder α where
+class CircularPartialOrder (α : Type*) extends CircularPreorder α where
   /-- If `b` is between `a` and `c` and also between `c` and `a`, then at least one pair of points
   among `a`, `b`, `c` are identical. -/
   btw_antisymm {a b c : α} : btw a b c → btw c b a → a = b ∨ b = c ∨ c = a
@@ -143,7 +143,7 @@ export CircularPartialOrder (btw_antisymm)
 /-- A circular order is the analogue of a linear order where you can loop around. `≤` and `<` are
 replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic, antisymmetric and total.
 `sbtw` is transitive. -/
-class CircularOrder (α : Type _) extends CircularPartialOrder α where
+class CircularOrder (α : Type*) extends CircularPartialOrder α where
   /-- For any triple of points, the second is between the other two one way or another. -/
   btw_total : ∀ a b c : α, btw a b c ∨ btw c b a
 #align circular_order CircularOrder
@@ -155,7 +155,7 @@ export CircularOrder (btw_total)
 
 section CircularPreorder
 
-variable {α : Type _} [CircularPreorder α]
+variable {α : Type*} [CircularPreorder α]
 
 theorem btw_rfl {a : α} : btw a a a :=
   btw_refl _
@@ -271,7 +271,7 @@ end CircularPreorder
 
 section CircularPartialOrder
 
-variable {α : Type _} [CircularPartialOrder α]
+variable {α : Type*} [CircularPartialOrder α]
 
 -- TODO: `alias` creates a def instead of a lemma (because `btw_antisymm` is a def).
 -- alias btw_antisymm        ← Btw.btw.antisymm
@@ -286,7 +286,7 @@ end CircularPartialOrder
 
 section CircularOrder
 
-variable {α : Type _} [CircularOrder α]
+variable {α : Type*} [CircularOrder α]
 
 theorem btw_refl_left_right (a b : α) : btw a b a :=
   (or_self_iff _).1 (btw_total a b a)
@@ -330,7 +330,7 @@ namespace Set
 
 section CircularPreorder
 
-variable {α : Type _} [CircularPreorder α]
+variable {α : Type*} [CircularPreorder α]
 
 /-- Closed-closed circular interval -/
 def cIcc (a b : α) : Set α :=
@@ -356,7 +356,7 @@ end CircularPreorder
 
 section CircularOrder
 
-variable {α : Type _} [CircularOrder α]
+variable {α : Type*} [CircularOrder α]
 
 theorem left_mem_cIcc (a b : α) : a ∈ cIcc a b :=
   btw_rfl_left
@@ -386,21 +386,21 @@ end Set
 /-- The betweenness relation obtained from "looping around" `≤`.
 See note [reducible non-instances]. -/
 @[reducible]
-def LE.toBtw (α : Type _) [LE α] : Btw α where
+def LE.toBtw (α : Type*) [LE α] : Btw α where
   btw a b c := a ≤ b ∧ b ≤ c ∨ b ≤ c ∧ c ≤ a ∨ c ≤ a ∧ a ≤ b
 #align has_le.to_has_btw LE.toBtw
 
 /-- The strict betweenness relation obtained from "looping around" `<`.
 See note [reducible non-instances]. -/
 @[reducible]
-def LT.toSBtw (α : Type _) [LT α] : SBtw α where
+def LT.toSBtw (α : Type*) [LT α] : SBtw α where
   sbtw a b c := a < b ∧ b < c ∨ b < c ∧ c < a ∨ c < a ∧ a < b
 #align has_lt.to_has_sbtw LT.toSBtw
 
 /-- The circular preorder obtained from "looping around" a preorder.
 See note [reducible non-instances]. -/
 @[reducible]
-def Preorder.toCircularPreorder (α : Type _) [Preorder α] : CircularPreorder α where
+def Preorder.toCircularPreorder (α : Type*) [Preorder α] : CircularPreorder α where
   btw a b c := a ≤ b ∧ b ≤ c ∨ b ≤ c ∧ c ≤ a ∨ c ≤ a ∧ a ≤ b
   sbtw a b c := a < b ∧ b < c ∨ b < c ∧ c < a ∨ c < a ∧ a < b
   btw_refl a := Or.inl ⟨le_rfl, le_rfl⟩
@@ -436,7 +436,7 @@ def Preorder.toCircularPreorder (α : Type _) [Preorder α] : CircularPreorder 
 /-- The circular partial order obtained from "looping around" a partial order.
 See note [reducible non-instances]. -/
 @[reducible]
-def PartialOrder.toCircularPartialOrder (α : Type _) [PartialOrder α] : CircularPartialOrder α :=
+def PartialOrder.toCircularPartialOrder (α : Type*) [PartialOrder α] : CircularPartialOrder α :=
   { Preorder.toCircularPreorder α with
     btw_antisymm := fun {a b c} => by
       rintro (⟨hab, hbc⟩ | ⟨hbc, hca⟩ | ⟨hca, hab⟩) (⟨hcb, hba⟩ | ⟨hba, hac⟩ | ⟨hac, hcb⟩)
@@ -454,7 +454,7 @@ def PartialOrder.toCircularPartialOrder (α : Type _) [PartialOrder α] : Circul
 /-- The circular order obtained from "looping around" a linear order.
 See note [reducible non-instances]. -/
 @[reducible]
-def LinearOrder.toCircularOrder (α : Type _) [LinearOrder α] : CircularOrder α :=
+def LinearOrder.toCircularOrder (α : Type*) [LinearOrder α] : CircularOrder α :=
   { PartialOrder.toCircularPartialOrder α with
     btw_total := fun a b c => by
       cases' le_total a b with hab hba <;> cases' le_total b c with hbc hcb <;>
@@ -474,13 +474,13 @@ def LinearOrder.toCircularOrder (α : Type _) [LinearOrder α] : CircularOrder 
 
 namespace OrderDual
 
-instance btw (α : Type _) [Btw α] : Btw αᵒᵈ :=
+instance btw (α : Type*) [Btw α] : Btw αᵒᵈ :=
   ⟨fun a b c : α => Btw.btw c b a⟩
 
-instance sbtw (α : Type _) [SBtw α] : SBtw αᵒᵈ :=
+instance sbtw (α : Type*) [SBtw α] : SBtw αᵒᵈ :=
   ⟨fun a b c : α => SBtw.sbtw c b a⟩
 
-instance circularPreorder (α : Type _) [CircularPreorder α] : CircularPreorder αᵒᵈ :=
+instance circularPreorder (α : Type*) [CircularPreorder α] : CircularPreorder αᵒᵈ :=
   { OrderDual.btw α,
     OrderDual.sbtw α with
     btw_refl := fun _ => @btw_refl α _ _
@@ -488,11 +488,11 @@ instance circularPreorder (α : Type _) [CircularPreorder α] : CircularPreorder
     sbtw_trans_left := fun {_ _ _ _} habc hbdc => hbdc.trans_right habc
     sbtw_iff_btw_not_btw := fun {a b c} => @sbtw_iff_btw_not_btw α _ c b a }
 
-instance circularPartialOrder (α : Type _) [CircularPartialOrder α] : CircularPartialOrder αᵒᵈ :=
+instance circularPartialOrder (α : Type*) [CircularPartialOrder α] : CircularPartialOrder αᵒᵈ :=
   { OrderDual.circularPreorder α with
     btw_antisymm := fun {_ _ _} habc hcba => @btw_antisymm α _ _ _ _ hcba habc }
 
-instance (α : Type _) [CircularOrder α] : CircularOrder αᵒᵈ :=
+instance (α : Type*) [CircularOrder α] : CircularOrder αᵒᵈ :=
   { OrderDual.circularPartialOrder α with
     btw_total := fun {a b c} => @btw_total α _ c b a }
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module order.circular
-! leanprover-community/mathlib commit 213b0cff7bc5ab6696ee07cceec80829ce42efec
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Basic
 
+#align_import order.circular from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec"
+
 /-!
 # Circular order hierarchy
 
chore: tidy various files (#5971)
Diff
@@ -164,8 +164,8 @@ theorem btw_rfl {a : α} : btw a a a :=
   btw_refl _
 #align btw_rfl btw_rfl
 
--- TODO: `alias` creates a def instead of a lemma.
--- alias btw_cyclic_left        ← has_btw.btw.cyclic_left
+-- TODO: `alias` creates a def instead of a lemma (because `btw_cyclic_left` is a def).
+-- alias btw_cyclic_left        ← Btw.btw.cyclic_left
 theorem Btw.btw.cyclic_left {a b c : α} (h : btw a b c) : btw b c a :=
   btw_cyclic_left h
 #align has_btw.btw.cyclic_left Btw.btw.cyclic_left
@@ -177,8 +177,8 @@ theorem btw_cyclic_right {a b c : α} (h : btw a b c) : btw c a b :=
 alias btw_cyclic_right ← Btw.btw.cyclic_right
 #align has_btw.btw.cyclic_right Btw.btw.cyclic_right
 
-/-- The order of the `↔` has been chosen so that `rw btw_cyclic` cycles to the right while
-`rw ←btw_cyclic` cycles to the left (thus following the prepended arrow). -/
+/-- The order of the `↔` has been chosen so that `rw [btw_cyclic]` cycles to the right while
+`rw [← btw_cyclic]` cycles to the left (thus following the prepended arrow). -/
 theorem btw_cyclic {a b c : α} : btw a b c ↔ btw c a b :=
   ⟨btw_cyclic_right, btw_cyclic_left⟩
 #align btw_cyclic btw_cyclic
@@ -228,14 +228,14 @@ theorem sbtw_cyclic_right {a b c : α} (h : sbtw a b c) : sbtw c a b :=
 alias sbtw_cyclic_right ← SBtw.sbtw.cyclic_right
 #align has_sbtw.sbtw.cyclic_right SBtw.sbtw.cyclic_right
 
-/-- The order of the `↔` has been chosen so that `rw sbtw_cyclic` cycles to the right while
-`rw ←sbtw_cyclic` cycles to the left (thus following the prepended arrow). -/
+/-- The order of the `↔` has been chosen so that `rw [sbtw_cyclic]` cycles to the right while
+`rw [← sbtw_cyclic]` cycles to the left (thus following the prepended arrow). -/
 theorem sbtw_cyclic {a b c : α} : sbtw a b c ↔ sbtw c a b :=
   ⟨sbtw_cyclic_right, sbtw_cyclic_left⟩
 #align sbtw_cyclic sbtw_cyclic
 
--- TODO: `alias` creates a def instead of a lemma.
--- alias btw_trans_left        ← has_btw.btw.trans_left
+-- TODO: `alias` creates a def instead of a lemma (because `sbtw_trans_left` is a def).
+-- alias btw_trans_left        ← SBtw.sbtw.trans_left
 theorem SBtw.sbtw.trans_left {a b c d : α} (h : sbtw a b c) : sbtw b d c → sbtw a d c :=
   sbtw_trans_left h
 #align has_sbtw.sbtw.trans_left SBtw.sbtw.trans_left
@@ -276,8 +276,8 @@ section CircularPartialOrder
 
 variable {α : Type _} [CircularPartialOrder α]
 
--- TODO: `alias` creates a def instead of a lemma.
--- alias btw_antisymm        ← has_btw.btw.antisymm
+-- TODO: `alias` creates a def instead of a lemma (because `btw_antisymm` is a def).
+-- alias btw_antisymm        ← Btw.btw.antisymm
 theorem Btw.btw.antisymm {a b c : α} (h : btw a b c) : btw c b a → a = b ∨ b = c ∨ c = a :=
   btw_antisymm h
 #align has_btw.btw.antisymm Btw.btw.antisymm
@@ -371,14 +371,12 @@ theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b :=
 
 theorem compl_cIcc {a b : α} : (cIcc a b)ᶜ = cIoo b a := by
   ext
-  rw [Set.mem_cIoo, sbtw_iff_not_btw]
-  rfl
+  rw [Set.mem_cIoo, sbtw_iff_not_btw, cIcc, mem_compl_iff, mem_setOf]
 #align set.compl_cIcc Set.compl_cIcc
 
 theorem compl_cIoo {a b : α} : (cIoo a b)ᶜ = cIcc b a := by
   ext
-  rw [Set.mem_cIcc, btw_iff_not_sbtw]
-  rfl
+  rw [Set.mem_cIcc, btw_iff_not_sbtw, cIoo, mem_compl_iff, mem_setOf]
 #align set.compl_cIoo Set.compl_cIoo
 
 end CircularOrder
fix: change compl precedence (#5586)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -369,13 +369,13 @@ theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b :=
   btw_rfl_right
 #align set.right_mem_cIcc Set.right_mem_cIcc
 
-theorem compl_cIcc {a b : α} : cIcc a bᶜ = cIoo b a := by
+theorem compl_cIcc {a b : α} : (cIcc a b)ᶜ = cIoo b a := by
   ext
   rw [Set.mem_cIoo, sbtw_iff_not_btw]
   rfl
 #align set.compl_cIcc Set.compl_cIcc
 
-theorem compl_cIoo {a b : α} : cIoo a bᶜ = cIcc b a := by
+theorem compl_cIoo {a b : α} : (cIoo a b)ᶜ = cIcc b a := by
   ext
   rw [Set.mem_cIcc, btw_iff_not_sbtw]
   rfl
fix: have tauto use Lean.Meta.isProp rather than Lean.Expr.isProp (#5565)

Lean.Expr.isProp can't handle metavariables but Lean.Meta.isProp can.

Bug reported by @negiizhao

Diff
@@ -425,10 +425,17 @@ def Preorder.toCircularPreorder (α : Type _) [Preorder α] : CircularPreorder 
     · exact Or.inr (Or.inr ⟨hca, hab.trans hbd⟩)
   sbtw_iff_btw_not_btw {a b c} := by
     simp_rw [lt_iff_le_not_le]
-    have := le_trans a b c
-    have := le_trans b c a
-    have := le_trans c a b
-    tauto
+    have h1 := le_trans a b c
+    have h2 := le_trans b c a
+    have h3 := le_trans c a b
+    -- Porting note: was `tauto`, but this is a much faster tactic proof
+    revert h1 h2 h3
+    generalize (a ≤ b) = p1
+    generalize (b ≤ a) = p2
+    generalize (a ≤ c) = p3
+    generalize (c ≤ a) = p4
+    generalize (b ≤ c) = p5
+    by_cases p1 <;> by_cases p2 <;> by_cases p3 <;> by_cases p4 <;> by_cases p5 <;> simp [*]
 #align preorder.to_circular_preorder Preorder.toCircularPreorder
 
 /-- The circular partial order obtained from "looping around" a partial order.
feat: add Mathlib.Tactic.Common, and import (#4056)

This makes a mathlib4 version of mathlib3's tactic.basic, now called Mathlib.Tactic.Common, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.

This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -9,7 +9,6 @@ Authors: Yaël Dillies
 ! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Basic
-import Mathlib.Tactic.Set
 
 /-!
 # Circular order hierarchy
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.circular
-! leanprover-community/mathlib commit a2d2e18906e2b62627646b5d5be856e6a642062f
+! leanprover-community/mathlib commit 213b0cff7bc5ab6696ee07cceec80829ce42efec
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -73,7 +73,7 @@ What is the correct generality of "rolling the necklace" open? At least, this wo
 `β × α` where `α` is a circular order and `β` is a linear order.
 
 What's next is to define circular groups and provide instances for `ZMod n`, the usual circle group
-`Circle`, `Real.Angle`, and `RootsOfUnity M`. What conditions do we need on `M` for this last one
+`Circle`, and `RootsOfUnity M`. What conditions do we need on `M` for this last one
 to work?
 
 We should have circular order homomorphisms. The typical example is
chore: format by line breaks (#1523)

During porting, I usually fix the desired format we seem to want for the line breaks around by with

awk '{do {{if (match($0, "^  by$") && length(p) < 98) {p=p " by";} else {if (NR!=1) {print p}; p=$0}}} while (getline == 1) if (getline==0) print p}' Mathlib/File/Im/Working/On.lean

I noticed there are some more files that slipped through.

This pull request is the result of running this command:

grep -lr "^  by\$" Mathlib | xargs -n 1 awk -i inplace '{do {{if (match($0, "^  by$") && length(p) < 98 && not (match(p, "^[ \t]*--"))) {p=p " by";} else {if (NR!=1) {print p}; p=$0}}} while (getline == 1) if (getline==0) print p}'

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -316,8 +316,7 @@ theorem btw_rfl_right {a b : α} : btw a b b :=
   btw_refl_right _ _
 #align btw_rfl_right btw_rfl_right
 
-theorem sbtw_iff_not_btw {a b c : α} : sbtw a b c ↔ ¬btw c b a :=
-  by
+theorem sbtw_iff_not_btw {a b c : α} : sbtw a b c ↔ ¬btw c b a := by
   rw [sbtw_iff_btw_not_btw]
   exact and_iff_right_of_imp (btw_total _ _ _).resolve_left
 #align sbtw_iff_not_btw sbtw_iff_not_btw
@@ -371,15 +370,13 @@ theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b :=
   btw_rfl_right
 #align set.right_mem_cIcc Set.right_mem_cIcc
 
-theorem compl_cIcc {a b : α} : cIcc a bᶜ = cIoo b a :=
-  by
+theorem compl_cIcc {a b : α} : cIcc a bᶜ = cIoo b a := by
   ext
   rw [Set.mem_cIoo, sbtw_iff_not_btw]
   rfl
 #align set.compl_cIcc Set.compl_cIcc
 
-theorem compl_cIoo {a b : α} : cIoo a bᶜ = cIcc b a :=
-  by
+theorem compl_cIoo {a b : α} : cIoo a bᶜ = cIcc b a := by
   ext
   rw [Set.mem_cIcc, btw_iff_not_sbtw]
   rfl
feat: port Order.Circular (#1489)

Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>

Dependencies 36

37 files ported (100.0%)
19913 lines ported (100.0%)

All dependencies are ported!