Skip to content

Commit 38482cd

Browse files
SnirBroshibryangingechen
authored andcommitted
refactor(Order/Basic): move Pi & Prop orders to a new file (leanprover-community#40658)
Move the `LE` instances of `Pi` & `Prop` from `Order/Basic.lean` to a new `Order/Defs/Prop.lean`. This lets `Logic/Relation.lean` import them so that it can use `≤` between relations.
1 parent 5947139 commit 38482cd

3 files changed

Lines changed: 34 additions & 17 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5979,6 +5979,7 @@ public import Mathlib.Order.CountableSupClosed
59795979
public import Mathlib.Order.Cover
59805980
public import Mathlib.Order.Defs.LinearOrder
59815981
public import Mathlib.Order.Defs.PartialOrder
5982+
public import Mathlib.Order.Defs.Prop
59825983
public import Mathlib.Order.Defs.Unbundled
59835984
public import Mathlib.Order.DirSupClosed
59845985
public import Mathlib.Order.Directed

Mathlib/Order/Basic.lean

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module
77

88
public import Mathlib.Data.Subtype
99
public import Mathlib.Order.Defs.LinearOrder
10+
public import Mathlib.Order.Defs.Prop
1011
public import Mathlib.Order.Notation
1112
public import Mathlib.Tactic.Spread
1213
public import Mathlib.Tactic.Convert
@@ -549,15 +550,6 @@ instance Ne.instIsEquiv_compl : IsEquiv α (· ≠ ·)ᶜ := by
549550

550551
/-! ### Order instances on the function space -/
551552

552-
553-
instance Pi.hasLe [∀ i, LE (π i)] :
554-
LE (∀ i, π i) where le x y := ∀ i, x i ≤ y i
555-
556-
@[to_dual self]
557-
theorem Pi.le_def [∀ i, LE (π i)] {x y : ∀ i, π i} :
558-
x ≤ y ↔ ∀ i, x i ≤ y i :=
559-
Iff.rfl
560-
561553
instance Pi.preorder [∀ i, Preorder (π i)] : Preorder (∀ i, π i) where
562554
__ := (inferInstance : LE (∀ i, π i))
563555
le_refl := fun a i ↦ le_refl (a i)
@@ -1098,14 +1090,6 @@ end PUnit
10981090

10991091
section «Prop»
11001092

1101-
/-- Propositions form a complete Boolean algebra, where the `≤` relation is given by implication. -/
1102-
instance Prop.le : LE Prop :=
1103-
⟨(· → ·)⟩
1104-
1105-
@[simp]
1106-
theorem le_Prop_eq : ((· ≤ ·) : PropPropProp) = (· → ·) :=
1107-
rfl
1108-
11091093
theorem subrelation_iff_le {r s : α → α → Prop} : Subrelation r s ↔ r ≤ s :=
11101094
Iff.rfl
11111095

Mathlib/Order/Defs/Prop.lean

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/-
2+
Copyright (c) 2016 Johannes Hölzl. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Johannes Hölzl, Yury Kudryashov
5+
-/
6+
module
7+
8+
import Mathlib.Tactic.ToDual
9+
10+
/-!
11+
# Order definitions for propositions
12+
13+
This file defines orders on `Pi` and `Prop`.
14+
-/
15+
16+
public section
17+
18+
instance Pi.hasLe {ι : Type*} {π : ι → Type*} [∀ i, LE (π i)] : LE (∀ i, π i) where
19+
le x y := ∀ i, x i ≤ y i
20+
21+
@[to_dual self]
22+
theorem Pi.le_def {ι : Type*} {π : ι → Type*} [∀ i, LE (π i)] {x y : ∀ i, π i} :
23+
x ≤ y ↔ ∀ i, x i ≤ y i :=
24+
.rfl
25+
26+
/-- Propositions form a complete Boolean algebra, where the `≤` relation is given by implication. -/
27+
instance Prop.le : LE Prop :=
28+
⟨(· → ·)⟩
29+
30+
@[simp]
31+
theorem le_Prop_eq : ((· ≤ ·) : PropPropProp) = (· → ·) :=
32+
rfl

0 commit comments

Comments
 (0)