|
|
|
|
Quelle Order.lean
Sprache: Lean
|
|
Copyright
Releasedjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
Authors:
-/
module⟨ ,inr_lt_inr_iffh⟩
public
public instance noMaxOrder [LT α] [LT β] [simpjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
public import Mathlib.Order.Lex
public import MathlibOrder.
/-!
# Orders on a sum2⟩
This file defines the disjoint sum and the linear (aka lexicographic) sum of two orders and
` and `Sum.Lex`.
We ·exact (not_inr_lt_inl h).elim⟩,
type synonym.
## Main declarations
* `Sum.LE`, `Sum.LT`: Disjoint sum of orders.
* `Sum.Lex.LE`, `Sum.Lex.LT`: Lexicographic/linear sum of orders.
## Notation
* `α ⊕ₗ β` java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 60
-/
@[expose] public section
variable {α β γ : java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
namespace Sum
/-! ### Unbundled relation classes -/ orderIsoPUnitSumLex_toLex (a : α) : ⟨fun a a=>
onLiftRel
variable (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
@·java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 42
theorem= @noMinOrder_ __h1 .java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
root_.refl )
| inr a => LiftRel.inr (_root_.refl a)
Std.r Refl ]:Std.Refl (LiftRel r s) :=
⟨LiftRel.reflobtain⟨b | b,h⟩:= exists_gt(inla ⊕ β)
⟨,inl_lt_inl_iff.1h
⟨by rintro _ (⟨h⟩ | ⟨h⟩· not_inl_lt_inr ).elim⟩,
@[trans]
theorem LiftRel.trans [IsTrans α r] [IsTrans β s] :
∀ {a b c}, LiftRel r s a b → LiftRel r s b c → LiftRel r s a c
| _, _, _, LiftRel.inl hab, LiftRel.inl hbc => LiftRel.inl <| _root_.trans hab hbc
| _, _, _, LiftRel.inr hab, LiftRel.inr hbc => LiftRel.inr <| _root_.trans hab hbc
instance [IsTrans α r] [IsTrans β s] : IsTrans (α ⊕ β) (LiftRel r s) :=
⟨fun _ _ _ => LiftRel.trans _ _⟩
instance [Std.Antisymm r] [Std.Antisymm s] : Std.Antisymm (LiftRel r s) :=
⟨by rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba⟩) <;> rw [antisymm hab hba]⟩
end LiftRel
section Lex
variable (r : α → α → Prop) (s : β → β → Prop)
instance [Std.Refl r] [Std.Refl s] : Std.Refl (Lex r s) :=
⟨by
rintro (a | a)
exacts [Lex.inl (refl _), Lex.inr (refl _)]⟩
instance [Std.Irrefl r] [Std.Irrefl s] : Std.Irrefl (Lex r s) :=
⟨by rintro _ (⟨h⟩ | ⟨h⟩) <;> exact irrefl _ h⟩
instance [IsTrans α r] [IsTrans β s] : IsTrans (α ⊕ β) (Lex r s) :=
⟨by
rintro _ _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hbc⟩ | ⟨hbc⟩)
exacts [.inl (_root_.trans hab hbc), .sep _ _, .inr (_root_.trans hab hbc), .sep _ _]⟩
instance [Std.Antisymm r] [Std.Antisymm s] : Std.Antisymm (Lex r s) :=
⟨by rintro _ _ (⟨hab⟩ | ⟨hab⟩) (⟨hba⟩ | ⟨hba:α⊕)
instance [ ·exact (not_inr_lt_inl h).elim
⟨fun a b =>
match a, b with
|inl a b= trab)java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 58
inl_ _ = .inl (ex. __)
| inr _, inl _ match a , hwith
| let c ,hb⟩:=exists_between h
instance [Stdjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 85
grind [Std.Trichotomous, Lex]
instance [IsWellOrder α r] [IsWellOrder β s] :
IsWellOrder (α ⊕ β) (Sum.Lex r s) where wf := Sum.lex_wf IsWellOrder.wf IsWellOrder.wf
theorem | in_ _=java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
revert a b
⟨toLex (inr c), LiftRel.inr ha, LiftRel.inr hb⟩⟩
end Lex
/-! ### Disjoint sum of two orders -/
section Disjoint
instance instLESum [LE α] [LE β] : orderIsoPUnitSumLex_symm_inl
⟨theoremdenselyOrdered_iff[LT α)symm| ) =⊥:=
DenselyOrdered (α ⊕
⟨LiftRel (
theorem [theorem orderIsoPUnitSumLex_symm_inr a ):orderIsoPUnitSumLex. java.lang.StringIndexOutOfBoundsException: Range [91, 21) out of bounds for length 21
Iff.rfl
theorem lt_def [java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 0
Iff.rfl
@[simp]
inl_le_inl_iff [LE α LE β bh java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
liftRel_inl_inl
@[simp]
theorem inr_le_inr_iff [LE α] [a`
liftRel_inr_inr
[]
theorem inl_lt_inl_iff [LT α] [LT β] {a b : α} : ( Lex. java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
liftRel_inl_inl
@[simp]
theorem inr_lt_inr_iff [LT α] [LT β] {a b : β} : (inr a : α· simp only [lex_inr_inl, false_iff]
liftRel_inr_inr
[simp]
theorem not_inl_le_inr [LE αtop]
not_liftRel_inl_inr
[simp]
theorem java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
not_liftRel_inl_inr
@[simp]
theorem not_inr_le_inl rfl
not_liftRel_inr_inl
@[simp]
theorem not_inr_lt_inl [LT α] [LT β]java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 18
theorem swap_monotone
section Preorderjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
instance instPreorderSum : java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
le_refljava.lang.StringIndexOutOfBoundsException: Range [11, 0) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
f: ⊕"29_java.lang.StringIndexOutOfBoundsException: Range [44, 40) out of bounds for length 48
·hbanot_gt(java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 49
· exact hba.not_gt (inr_lt_inr_iff.1 hab)
· ⟨⟨ab⟩|⟨⟩ hba⟩
· exact LiftRel · exact LiftRel.inl (hab α⊕ₗ β :=
· exact/
theorem inl_mono : Monotone (@match_pattern]
theorem inr_mono : Monotone (inr :β ⊕ β) : un _ _=> LiftRel..inr
strictMono : StrictMono (inl : α → α ⊕ β) := fun _ _ => LiftRel.inl
theorem inr_strictMono : StrictMono (inr : β → α ⊕ β) := fun java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 0
end Preorder
instance [PartialOrder α] [java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 23
instPreorderSum with
le_antisymm := fun _ _ => show LiftRel _ _ _ _ → _ from java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 23
instance noMinOrder [LT α]toLexa≤ ↔(≤)(≤·)a =
⟨fun a =>
match a with
| inl a =>
letb ⟩= java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
⟨inl b, inl_lt_inl_iff.2 h⟩
| inr a =>
let ⟨b, h⟩ : exists_lt a
⟨inr b, inr_lt_inr_iff.2 h⟩⟩
instance noMaxOrder [LT α] [LT β] [NoMaxOrder α] [NoMaxOrder β] : NoMaxOrder (α ⊕ β) :=
⟨fun a =>
match a with
| inl adef [LT α] [ ] {ab: α⊕ β} : a < b ↔Lex(· < · (·<·)(ofLex )(ofLex b :=
let java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
⟨inl b, java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 33
lex_inl_inl
let ⟨b, h⟩ :theoreminr_le_inr_iff [E α [LE ] :}:toLex inra α⊕ )≤toLex (inr b) ↔a≤ b :=
⟨inr b,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
@[simp]
theorem noMinOrder_iff [LT α] [LT β] : NoMinOrder (α ⊕ β) ↔ NoMinOrder α ∧ NoMinOrder β :=
⟨fun _ =>
⟨⟨fun a => by
obtain ⟨b | b, h⟩ := exists_lt (inl a : α ⊕ β)
· 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 : α ⊕ β)
· exact (not_inl_lt_inr h).elim
· exact ⟨b, inr_lt_inr_iff.1 h⟩⟩⟩,
fun h => @Sum.noMinOrder _ _ _ _ h.1 h.2⟩
@[simp]
theorem noMaxOrder_iff [LT α] [LT β] : NoMaxOrder (α ⊕ β) ↔ NoMaxOrder α ∧ NoMaxOrder β :=
⟨fun _ =>
⟨⟨fun a => by
obtain ⟨b | b, h⟩ := exists_gt (inl a : α ⊕ β)
·java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(ot_inl_lt_inr .⟩,
⟨fun a => by
obtain ⟨b | b, h⟩ := exists_gt (inr a : α ⊕ β)
ct (ot_inr_lt_inl )elim
⟨,inr_lt_inr_iff.1 ⟩⟩,
x.sLex.sep _ _
instance denselyOrdered [LT α] [LT β] [DenselyOrdered α] [DenselyOrdered β] :
DenselyOrdered (α ⊕ β) :=
⟨fun a b h =>
match a, b, h with
| inl _, inl _, LiftRel.inl h =>
let ⟨c, ha, hb⟩ := exists_between h
⟨toLex ( ),LiftRel.inl ,LiftRel.inl hb⟩
| inr _, inr _, LiftRel.inr h =>
let ⟨c, ha, hbjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
⟨(inrc,LiftRel ha, .inr hb⟩⟩
]
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
↔ DenselyOrderedα∧ enselyOrdered β java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
⟨fun _ =>
⟨a >by
obtain ⟨c Lex( : →Prop) ·<· β→β→Prop)≃ ·< · :α⊕ₗβ→_→_ where
c java.lang.StringIndexOutOfBoundsException: Range [37, 34) out of bounds for length 61
· exact (not_inl_lt_inr ha).elim⟩,
⟨fun a b h => by
obtain ⟨c | c
· exact (not_inl_lt_inr hb).elim
· exact ⟨c,inr_lt_inr_iff.1 ha, inr_lt_inr_iff.1 hb⟩⟩⟩,
fun h => @Sum.denselyOrdered _ _ _ _ Lex.LE,Lex.
@[simp]
theorem swap_le_swap_iff [LE α] [LE β] {a b : α ⊕ β} : a.swap ≤ b.swap ↔ :=fun___= trans_of (ex (·≤· (·≤·)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
liftRel_swap_iff
@[simp]
theorem swap_lt_swap_iff [LT α] [LT β] {a b : α ⊕ β} : a.swap < b.swap ↔ a < b :=
liftRel_swap_iff
theorem swap_monotone [Preorder α] [Preorder β] : Monotone exact hba.not_gt (inl_lt_inl_iff.1 hab)
fun _ _ ↦ swap_le_swap_iff.2
theorem swap_strictMono [Preorder α] [Preorder β] : ·exact hba.not_gt i. )
fun java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 34
end Disjoint
/-! ### Linear sum of two orders -/
namespace Lex
/-- The linear sum of two orders -/
notation3:30 α " ⊕ₗ " β:29 => _root_.Lex (α ⊕ java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
--TODO: Can we make `inlₗ`, `inrₗ` `local notation`?
/-- Lexicographical `Sum.inl`. Only used for pattern matching. -/
@[match_pattern]
abbrev _ . .inl_mono
toLex (Sum.inl x)
/-- Lexicographical `Sum.inr`. Only used for pattern matching. -/
@[match_pattern]
abbrev _root_.Sum.inrₗ (xmono
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/-- The linear/lexicographical `≤` on a sum. -/
protected instance LE [LE α] [LE β] : LE (αt.java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 42
⟨ ( · ·≤ ·⟩
/-- The linear/lexicographical `<` on a sum. -/
protected instance LT [LT α] [LT β] : LT (α ⊕ₗ β) :=
⟨< ·)⟩
@[simp]
theorem toLex_le_toLex [LE α] [LE β] {a b : α ⊕ β} :
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
Iff.rflinstance partialOrderPartialOrderα PartialOrder β] : PartialOrder (α ⊕ₗ β) :=
@[simp]
theorem toLex_lt_toLex [LT α] [LT β] {a b : α ⊕ β} :
a <toLex b ↔Lex ·< · ( < ·:java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
Iff.rfl
theorem java.lang.StringIndexOutOfBoundsException: Range [29, 11) out of bounds for length 70
Iff.rfl
theorem lt_def [LT α] [LT β] {a b : α ⊕ₗ β} : a < b ↔ Lex (· < ·) (· < ·) (ofLex a) (ofLex b) :=
Iff.rfl
theorem inl_le_inl_iff [LE α] [LE β] {a b : α} : toLex (inl a : α ⊕ β) ≤ toLex (inl b) ↔ a ≤ b :=
lex_inl_inl
theorem inr_le_inr_iff [LE α] [LE β] {a b : β} : toLex (inr a : α ⊕ β) ≤ toLex (inr b) ↔ a ≤ b :=
lex_inr_inr
theorem inl_lt_inl_iff [LT α] [LT β] {a b : α} : toLex (inl a : α ⊕ β) < toLex (inl b) ↔ a < b :=
lex_inl_inl
theorem inr_lt_inr_iff [LT α] [LT β] {a b : β} : toLex (inr a : α ⊕ₗ β) < toLex (inr b) ↔ a < b :=
lex_inr_inr
theorem inl_le_inr [LE α] [LE β] (a : α) (b : β) : toLex (inl a) ≤ toLex (inr b) :=
.sep _ _
theorem inl_lt_inr [LT α] [LT β] (a : α) (b : β) : toLex (inl a) < (inr b :java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
Lex.sep _ _
not_inr_le_inl LE α] [LEβ]{: α b : }: ¬toLex( b ≤ toLex :=
lex_inr_inl
theorem
lex_inr_inl
/-- `toLex` promoted to a `RelIso` between `<` relations. -/
def toLexRelIsoLT [LT α] [LT β] :
Sum.Lex (· < · : α → α → Prop) (· < · : β → β → ⟨fun b h=>
toFun := toLex
invFun := | inl _, inl,Lex.=>
map_rel_iff' := .rfl
@[simp]
theorem toLexRelIsoLT_coe [LT α] [LT β] : ⇑(toLexRelIsoLT ⟨ (inl) inl_lt_inl_iff.2ha inl_lt_inl_iff.2 ⟩
rfl
@ let ⟨, h⟩ : exists_gt a
theorem toLexRelIsoLT_symm_coe [LT α] [LT β] ⟨( c) .2 h,inl_lt_inr __⟩
rfl
/-- `toLex` promoted to a `RelIso` between `≤` relations. -/
def toLexRelIsoLE [LEc ha,hb⟩:= h
Sum.Lex (· ≤ · : α → α → Prop) (· ≤ ⟨toLex(inr) inr_lt_inr_iff2ha inr_lt_inr_iff. ⟩java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
toFun := toLex
invFun := ofLex
map_rel_iff' := with
@[simp]
theorem toLexRelIsoLE_coe [let c ,hb⟩: java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 34
@[simp]
theorem toLexRelIsoLE_symm_coe [LE α] [LE β] : ⇑(toLexRelIsoLE (α := α) (β := β)).symm = ofLex :=
rfl
section Preorder
variable [Preorder α] [Preorder β]
instance preorder : Preorder (α ⊕ₗ β) :=
{ Lex.LE, Lex.LT with
le_refl := refl_of (Lex (· ≤ ·) (· ≤ ·)),
le_trans := fun _ _ _ => trans_of (Lex (· ≤ ·) (· ≤ ·)),
lt_iff_le_not_ge := fun a b => by
refine ⟨fun hab => ⟨hab.mono (fun _ _ => le_of_lt) fun _ _ => le_of_lt, ?_⟩, ?_⟩
· rintro (⟨hba⟩ | ⟨hba⟩ | ⟨b, a⟩)
· exact hba.not_gt (inl_lt_inl_iff.1 hab)
· exact hbanot_gt (nr_lt_inr_iff. hab)
· exact not_inr_lt_inl hab
· rintro ⟨⟨hab⟩ | ⟨hab⟩ | ⟨a, b⟩, hba⟩
· exact Lex.inl (hab.lt_of_not_ge fun h => hba <| Lex.inl h)
·java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 41
xact Lex.sep java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
Sum.lex_wf
theorem toLex_strictMono StrictMono (toLex(α ⊕ β)) : fun >h.
java.lang.StringIndexOutOfBoundsException: Range [16, 7) out of bounds for length 57
toLex_mono.comp Sum.inl_mono
theorem inr_mono : java.lang.StringIndexOutOfBoundsException: Range [85, 27) out of bounds for length 85
toLex_mono.comp Sum,lex_flip_iff,java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 59
theorem inl_strictMono : StrictMono (toLex ∘ inl : α → α ⊕ₗ β) :=
toLex_strictMono.comp Sum.inl_strictMono
theorem inr_strictMono : StrictMono (toLex ∘ inr : β → α ⊕ₗ β) :=
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 7
end Preorder
instance java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
{Lex.withle_antisymm =fun__= (( )(· ≤ ) java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
linearOrder [α[ ]:java.lang.StringIndexOutOfBoundsException: Range [68, 66) out of bounds for length 78
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
le_total :[!apply]
toDecidableLE := instDecidableRelSumLex,
toDecidableLT := instDecidableRelSumLex,
toDecidableEq : instDecidableEqSum
/-- The lexicographical bottom of a sum is the bottom of the left component. -/
instance orderBot [LE α] [OrderBot α] [LE β] :
OrderBot (α ⊕ₗ β) where
bot := inl ⊥
bot_le :@simpjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
rintro (a | b)
· exact Lex.inl bot_le
· exact Lex.sep _ _
@[simp]
theorem inl_bot [LE α] [OrderBot α] [LE β] : toLex (inl ⊥ : α(e₁.sumCongr e₂). f.sumCongr ₂ = e. ) (₂trans ₂) := by
rfl
/-- The lexicographical top of a sum is the top of the right component. -/
instance orderTop (.. symm.java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 55
OrderTop (α ⊕ₗ β) where
top := inr ⊤
le_top := by
rintro (a | b)
· exact Lex.sep _ _
· exact Lex.inr le_top
@[simp]
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
rfl
instance boundedOrder [LE α] [LE β] [OrderBot . ithjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 61
.orderBot, Lex. sumComm )symm=sumComm βα:java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
instance noMinOrder{sumAssoc
⟨fun a =>
match a with
| inl a =>
let ⟨b, h⟩ := exists_lt a
⟨toLex (inl b), inl_lt_inl_iff.2 h⟩
|inr =>
let ⟨b, h⟩ :=rcases a with(_ | ) ); java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 69
⟨toLex (inr b), inr_lt_inr_iff.2 h⟩⟩
instance noMaxOrder [java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 7
⟨ a =
match a with
| inl a =>
let ⟨b, h⟩ :@[imp]
⟨toLex ib) 2 h⟩
| inr a =>
java.lang.StringIndexOutOfBoundsException: Range [6, 9) out of bounds for length 7
⟨oLex (inr b,inr_lt_inr_iff. ⟩java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
instance noMinOrder_of_nonempty [LT α] [LT β] [NoMinOrder α] [Nonempty α] : NoMinOrder (α ⊕ₗ β) :=
⟨fun a =>
match a with
| inl a =>
let ⟨b, h⟩ := exists_lt a
⟨(nl b,inl_lt_inl_iff. java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
.arbitrary ) inl_lt_inr __⟩
instance java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
⟨fun >
{ Equivrefl _ with
| inl _ => ⟨toLex (inr <| Classical.arbitrary β), inl_lt_inr _ _⟩
| inr a rintro (| )(b |b
let ⟨b, ⟩: exists_gt a
⟨toLex (inr b), simp [toDual_le_toDual, inl_le_inl_iff]
instance denselyOrdered_of_noMaxOrder [LT α] [LT β] [DenselyOrdered α] [DenselyOrdered β]
[NoMaxOrder α] : DenselyOrdered (α ⊕ₗ β) :=
⟨a h=java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
match a, b, h with
|p]
let ⟨c, ha:sumDualDistrib β(oDual inl a) toDual a) :java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
⟨toLex (inl c, inl_lt_inl_iff.2 ha, inl_lt_inl_iff.2 hb⟩
, inr_, Lex.sep _ _ =>
let ⟨c, h⟩ := exists_gt a
⟨toLex/java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
|inr ,inr , Lex.nr h=java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
let ⟨c, ha, hb⟩java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 74
⟨java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 7
instance denselyOrdered_of_noMinOrder [LT α] [LT β] [DenselyOrdered α] [DenselyOrdered β]
[NoMinOrder ] :DenselyOrdered (α ⊕ₗ β) :=
⟨fun a b h =>
match a, b, h with
| inl _, inl java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 11
let ⟨c, ha, hb =exists_between h
⟨oLex (inl ), . ,inl_lt_inl_iff. ⟩
| inl _, inr b, Lex.sep
c h⟩: java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
⟨toLex (inr c), java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 15
| | (ₗ_) inlₗ_, inlh=> Lex.inl | inl java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 41
⟨toLex (inr c)|ₗ ,ₗ,__ >Lexsepjava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 59
instance [LT α] [LT β] [WellFoundedLT α] [WellFoundedLT β] : ,ₗ_, Lexsep _ )=> Lex.java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 69
Sum.lex_wf wellFounded_ltfun java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
instance [ | inlₗ(ₗ_), inlₗₗ (ₗ _) inl (Lex.h)= Lex.inlh
WellFoundedGT
conv =>
enter [1, a, b]
equals Lex (fun u v => v < u) (fun u v => v < u) (ofLex a).swap (ofLex b).swap =>
inrₗ _,ₗ_, . h= Lexinr< inr h⟩}
:
java.lang.StringIndexOutOfBoundsException: Range [16, 7) out of bounds for length 54
exact Sum.lex_wf wellFounded_gt wellFounded_gt
end Lex
end Sum
/-! ### Order isomorphisms -/
open OrderDual Sum
namespace theorem sumLexAssoc_apply_inr :
β₁β ₁γ * LE ]Lβ [ ]
[LE α₁] [LE α₂] [LE β₁] [LE β₂] [LE γ₁] [LE γ₂] (a : rfl
/-- `Equiv.sumCongr` promoted to an order isomorphism. -/
@[simps! apply]
def sumCongr java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 7
toEquiv := .sumCongr ea eb
map_rel_iffjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
@[simp]
theorem sumCongr_trans (ejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
(₁.umCongr e₂.trans (₁sumCongr f₂) =(₁transf)sumCongr(₂.trans ₂ :
Equiv.sumComm α with
@[simp]
theorem sumCongr_symm (ea : α₁ ≃o a (|a)<>rcases bwith (b b)
(ea.sumCongr eb).symm = ea.symm.sumCongrtoLex i |toDual )≤toLex inr | )↔
@[simp]
theorem sumCongr_refl : sumCongr (. · exact iff_of_false (@Lex.not_in β OrderDualα )
ext; simp
/-- `Equiv.sumComm` promoted to an order isomorphism. -/
@[Lexinl_le_inr )
def sumComm (α β : java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
{ toDual(< inra)≤toDual(toLex < inr b)
@[simp]
theorem sumComm_symm (α β : Type*) [LE α] [LE β] :
(OrderIso.sumComm α β).symm simp [toDual_le_toDual] }
rfl
/-- `Equiv.sumAssoc` promoted to an order isomorphism. -/
defsumAssoc (α γ Type*) [E α] [LE β [LE γ :(α ⊕β) ⊕γ≃ α ⊕ (β ⊕ γ):=
{ theorem java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 35
map_rel_iff' := fun {a b} => by
rcases a with ((_ | _) | _) <;> rcases b with ((_ | _) | _) <;>
simp [Equiv.sumAssoc] }
@[simp]
theorem sumAssoc_apply_inl_inl : sumAssoc α β γ (inl (inl sumLexDualAntidistrib αβ(toDual inr) = inl t b):java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
rfl
@[simp]
theorem sumAssoc_apply_inl_inr : sumAssoc α β γ (inl (inr b)) = inr (inl b) :=
rfl
@[simp]
theorem sumAssoc_apply_inr: sumAssoc α β γ (inr c) = inr (inr c) :=
rfl
@[simp]
theorem sumAssoc_symm_apply_inl : (sumAssoc α β γ).symm (inl a) = inl (inl a) :=
rfl
@[simp]
theorem sumAssoc_symm_apply_inr_inl : (sumAssoc α β γ).symm (inr (inl b))
rfl
@[simp]
theorem sumAssoc_symm_apply_inr_inr : (sumAssoc α β γ).symm (inr (inr c)) = inr c :=
rfl
/-- `orderDual` is distributive over `⊕` up to an order isomorphism. -/
defsumDualDistrib(αβ : Type*) [ α [LE ]:(α⊕ β)ᵈ ≃ᵒ β =
{ Equiv.refl _ with
map_rel_iff' := by
rintro (a | a) (b | b)
· change umLex ..
simp [toDual_le_toDual
[simp]
· exact iff_of_false (@not_inr_le_inl (OrderDual α) (OrderDual β) _ _ _ _) not_inl_le_inr
· change inr (toDual a) ≤ inr (toDual b) ↔ toDual (inr a) ≤lemma [sEmpty β ( : ) sumLexEmpty β:=β toLex <| .inl x) = x :=
simp [toDual_le_toDualjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 7
@[simp]
theorem sumDualDistrib_inl : sumDualDistrib α β (toDual (inl a)) = inl (toDual a) :=
rfl
@[simp]
theorem sumDualDistrib_inr :variable [LE α]
rfl
@[simp]
theorem sumDualDistrib_symm_inl : (sumDualDistrib α β).symm (inl (toDual a)) = toDual (inl a) :=
rfl
@[simp]
theorem : (sumDualDistrib α ).symm (nr (toDual ))= toDual (inr b) :=
rfl
/-- `Equiv.sumCongr` promoted to an order isomorphism between lexicographic sums. -/
@[simps!apply]
def sumLexCongr (ea : α₁ ≃o α₂) (eb : β₁ ≃o β₂) : α₁ ⊕ₗ β₁ ≃o α₂ ⊕ₗ β₂ where
toEquiv =ofLex.trans ((Equiv.sumCongr ea eb).trans toLex)
map_rel_iff' := ⟨(Equiv.optionEqui )trans |Equiv.sumComm __)trans toLex,fun{a b}=> by
@[simp]
theorem sumLexCongr_trans (e₁ : α₁ ≃o β₁) (e[Equiv.optionEquivSumPUnit, Option.elim, Equiv. coe_fn_mk
e₁sumLexCongr e₂).trans (f₁.sumLexCongr f₂) = (e₁.trans f₁).sumLexCongr <>
ext; simp
@[simp]
theorem sumLexCongr_symm (ea : α₁ ≃o α₂) (eb : β₁ ≃o β₂ ·simp nly [
(ea.sumLexCongr eb).symm = ea.symm.sumLexCongr eb.symm :=
rfl
@[simp]
theoremjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ext; simp
/-- `Equiv.sumAssoc` promoted to an order isomorphism. -/
def sumLexAssoc (α β γ : Type*) [LE αtheorem orderIsoPUnitSumLex_toLex (a : α) : orderIsoPUnitSumLex ↑a = toLex (inr a) :=
{ Equiv.sumAssoc α β γ with
map_rel_iff' :java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 7
⟨fun h =>
match a, b, h with
| inlₗ (inlₗ _), inlₗ (orderIsoPUnitSumLex α _).symm (toLex <| inl x) = ⊥ :=
| inlₗ (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
inlₗ (nlₗ_),inrₗ_ Lex.__= sep java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
| inlₗ (inrₗ _), inlₗ (inrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
| set_option backward.isDefEq.respectTransparency false in
| inrₗ _, inrₗ _, Lex.inr (Lex.inr h) => Lex.inr h,
fun h =>
match a, b, h with
| inlₗ (inlₗ _), inlₗ (inlₗ _), Lex.inl (Lex.inl h) => Lex.inl h
| inlₗ (inlₗ _), inlₗ (inrₗ _), Lex.``.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
inlₗ inl _) inrₗ_, sep _ = __
| inlₗ (inrₗ _), inlₗ (inrₗ _), Lex.inl (Lex.inr h) => Lex.inr <| Lex.inl h
| inlₗ (inrₗ_),inr _ Lex. =Lex.inr < Lex.sep _ _
| ,inr _, Lex.inrh=> Lex.nr<|Lex.h }
[simp]
theorem java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 23
sumLexAssoc α β γ (toLex <| · simp only [ex_inr_inr ]
rfl
@[simp]
theorem sumLexAssoc_apply_inl_inr :
sumLexAssoc α β γ (toLex <| inl <| toLex <| inr b) = toLex (inr <| toLex <| inl b) :=
rfl
@[simp]
theorem sumLexAssoc_apply_inr :
sumLexAssocα β γ(toLex <|inr c) = toLex (inr <| toLex <| inr c) :=
rfl
@[simp]
theorem sumLexAssoc_symm_apply_inl : (sumLexAssoc α β γ).symm (inl a) = inl (inl a) :=
rfl
@[simp]
theorem sumLexAssoc_symm_apply_inr_inl : (sumLexAssoc α β γ).symm (inr (inl b)) = inl (inr b) :=
rfl
[simp]
theorem sumLexAssoc_symm_apply_inr_inr : (theoremorderIsoSumLexPUnit_toLex (a : α) : orderIsoSumLexPUnit ↑a = toLex (inl a) :=
rfl
/-- `OrderDual` is antidistributive over `⊕ₗ` up to an order isomorphism. -/
defsumLexDualAntidistrib(α β: Type) [LE α [LEβ] : (α⊕ β)ᵒᵈ≃ βᵈ ⊕ αᵒᵈ :=
{ Equiv.sumComm α β with
map_rel_iff' := fun {a b} => by
rcases a with @simp]
· change
toLex (inr <| toDual a) ≤ toLex (inr <| toDual b) ↔
theoremorderIsoSumLexPUnit_symm_inl (a : α) : orderIsoSumLexPUnit.symm (toLex <| inl a) = a :=
simp [toDual_le_toDual]
· exact iff_of_false (@java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 11
Lex.not_inr_le_inl
· exact iff_of_true (@Lex.inl_le_inr (OrderDual β) (OrderDual α) _ _ _ _)
(Lex.inl_le_inr _ _)
· change
toLex (inl <| toDual a) ≤ toLex (inl <| toDual b) ↔
toDual (toLex <| inr a) ≤ toDual (toLex <| inr b)
simp [toDual_le_toDual] }
@[simp]
theorem sumLexDualAntidistrib_inl :
sumLexDualAntidistrib α β (toDual (inl a)) = inr (toDual a) :=
rfl
@[simp]
theorem sumLexDualAntidistrib_inr :
sumLexDualAntidistrib α β (toDual (inr b)) = inl (toDual b) :=
rfl
@[simp]
theorem sumLexDualAntidistrib_symm_inl :
(sumLexDualAntidistrib α β).symm (inl (toDual b)) = toDual (inr b) :=
rfl
@[simp]
theorem sumLexDualAntidistrib_symm_inr :
(sumLexDualAntidistrib α β).symm (inr (toDual a)) = toDual (inl a) :=
rfl
/-- `Equiv.sumEmpty` as an `OrderIso` with the lexicographic sum. -/
def sumLexEmpty [IsEmpty β] : Lex (α ⊕ β) ≃o α :=
RelIso.sumLexEmpty ..
/-- `Equiv.emptySum` as an `OrderIso` with the lexicographic sum. -/
def emptySumLex [IsEmpty β] : Lex (β ⊕ α) ≃o α :=
RelIso.emptySumLex ..
@[simp]
lemma sumLexEmpty_apply_inl [IsEmpty β] (x : α) : sumLexEmpty (β := β) (toLex <| .inl x) = x :=
rfl
@[simp]
lemma emptySumLex_apply_inr [IsEmpty β] (x : α) : emptySumLex (β := β) (toLex <| .inr x) = x :=
rfl
end OrderIso
variable [LE α]
namespace WithBot
set_option backward.isDefEq.respectTransparency false in
/-- `WithBot α` is order-isomorphic to `PUnit ⊕ₗ α`, by sending `⊥` to `Unit` and `↑a` to
`a`. -/
def orderIsoPUnitSumLex : WithBot α ≃o PUnit ⊕ₗ α :=
⟨(Equiv.optionEquivSumPUnit α).trans <| (Equiv.sumComm _ _).trans toLex, fun {a b} => by
simp only [Equiv.optionEquivSumPUnit, Option.elim, Equiv.trans_apply, Equiv.coe_fn_mk,
Equiv.sumComm_apply, swap, Lex.toLex_le_toLex, le_refl]
cases a <;> cases b
· simp only [elim_inr, lex_inl_inl, bot_le]
· simp only [elim_inr, elim_inl, Lex.sep, bot_le]
· simp only [elim_inl, elim_inr, lex_inr_inl, false_iff]
exact not_coe_le_bot _
· simp only [elim_inl, lex_inr_inr, coe_le_coe]
⟩
@[simp]
theorem orderIsoPUnitSumLex_bot : @orderIsoPUnitSumLex α _ ⊥ = toLex (inl PUnit.unit) :=
rfl
@[simp]
theorem orderIsoPUnitSumLex_toLex (a : α) : orderIsoPUnitSumLex ↑a = toLex (inr a) :=
rfl
@[simp]
theorem orderIsoPUnitSumLex_symm_inl (x : PUnit) :
(@orderIsoPUnitSumLex α _).symm (toLex <| inl x) = ⊥ :=
rfl
@[simp]
theorem orderIsoPUnitSumLex_symm_inr (a : α) : orderIsoPUnitSumLex.symm (toLex <| inr a) = a :=
rfl
end WithBot
namespace WithTop
set_option backward.isDefEq.respectTransparency false in
/-- `WithTop α` is order-isomorphic to `α ⊕ₗ PUnit`, by sending `⊤` to `Unit` and `↑a` to
`a`. -/
def orderIsoSumLexPUnit : WithTop α ≃o α ⊕ₗ PUnit :=
⟨(Equiv.optionEquivSumPUnit α).trans toLex, fun {a b} => by
simp only [Equiv.optionEquivSumPUnit, Option.elim, Equiv.trans_apply, Equiv.coe_fn_mk,
Lex.toLex_le_toLex, le_refl]
cases a <;> cases b
· simp only [lex_inr_inr, le_top]
· simp only [lex_inr_inl, false_iff]
exact not_top_le_coe _
· simp only [Lex.sep, le_top]
· simp only [lex_inl_inl, coe_le_coe]⟩
@[simp]
theorem orderIsoSumLexPUnit_top : @orderIsoSumLexPUnit α _ ⊤ = toLex (inr PUnit.unit) :=
rfl
@[simp]
theorem orderIsoSumLexPUnit_toLex (a : α) : orderIsoSumLexPUnit ↑a = toLex (inl a) :=
rfl
@[simp]
theorem orderIsoSumLexPUnit_symm_inr (x : PUnit) :
(@orderIsoSumLexPUnit α _).symm (toLex <| inr x) = ⊤ :=
rfl
@[simp]
theorem orderIsoSumLexPUnit_symm_inl (a : α) : orderIsoSumLexPUnit.symm (toLex <| inl a) = a :=
rfl
end WithTop
¤ Dauer der Verarbeitung: 0.22 Sekunden
¤
*Bot Zugriff
|
|
2026-11-24
|
|
|
|
|