l3lab/ntp-mathlib huggingface dataset:
/-- Construct limit data for a product in `ModuleCat R`, using `ModuleCat.of R (∀ j, F.obj j)`.
-/
@[simps]
def productLimitCone : Limits.LimitCone (Discrete.functor f) where
  cone :=
    { pt := ModuleCat.of R (∀ j, f j)
      π := Discrete.natTrans fun j => (LinearMap.proj j.as : (∀ j, f j) →ₗ[R] f j.as) }
  isLimit :=
    { lift := lift.{_, v} f
      fac := fun s j => rfl
      uniq := fun s m w => by
        ext x
        funext j
        

Proof state:
case h.h
R : Type u
inst✝ : Ring R
J : Type w
f : J → ModuleCat R
s : Cone (Discrete.functor f)
m : s.pt ⟶ { pt := of R ((j : J) → ↑(f j)), π := Discrete.natTrans fun j => LinearMap.proj j.as }.pt
w :
  ∀ (j : Discrete J),
    m ≫ { pt := of R ((j : J) → ↑(f j)), π := Discrete.natTrans fun j => LinearMap.proj j.as }.π.app j = s.π.app j
x : ↑s.pt
j : J
⊢ m x j = (lift f s) x j

Next tactic:
exact congr_arg (fun g : s.pt ⟶ f j => (g : s.pt → f j) x) (w ⟨j⟩)
/-- The isomorphism `A × B ≃ₗ[R] M` coming from a right split exact sequence `0 ⟶ A ⟶ M ⟶ B ⟶ 0`
of modules.-/
noncomputable def lequivProdOfRightSplitExact {f : B →ₗ[R] M} (hj : Function.Injective j)
    (exac : LinearMap.range j = LinearMap.ker g) (h : g.comp f = LinearMap.id) : (A × B) ≃ₗ[R] M :=
  ((ShortComplex.Splitting.ofExactOfSection _
    (ShortComplex.Exact.moduleCat_of_range_eq_ker (ModuleCat.ofHom j)
    (ModuleCat.ofHom g) exac) (asHom f) h
    (by 

Proof state:
R : Type u
A M B : Type v
inst✝⁶ : Ring R
inst✝⁵ : AddCommGroup A
inst✝⁴ : Module R A
inst✝³ : AddCommGroup B
inst✝² : Module R B
inst✝¹ : AddCommGroup M
inst✝ : Module R M
j : A →ₗ[R] M
g : M →ₗ[R] B
f : B →ₗ[R] M
hj : Function.Injective ⇑j
exac : LinearMap.range j = LinearMap.ker g
h : g ∘ₗ f = LinearMap.id
⊢ Mono
    (ShortComplex.moduleCatMkOfKerLERange (ofHom j) (ofHom g)
        (_ : LinearMap.range (ofHom j) ≤ LinearMap.ker (ofHom g))).f

Next tactic:
simpa only [ModuleCat.mono_iff_injective]
/-- The isomorphism `A × B ≃ₗ[R] M` coming from a left split exact sequence `0 ⟶ A ⟶ M ⟶ B ⟶ 0`
of modules.-/
noncomputable def lequivProdOfLeftSplitExact {f : M →ₗ[R] A} (hg : Function.Surjective g)
    (exac : LinearMap.range j = LinearMap.ker g) (h : f.comp j = LinearMap.id) : (A × B) ≃ₗ[R] M :=
  ((ShortComplex.Splitting.ofExactOfRetraction _
    (ShortComplex.Exact.moduleCat_of_range_eq_ker (ModuleCat.ofHom j)
    (ModuleCat.ofHom g) exac) (ModuleCat.ofHom f) h
    (by 

Proof state:
R : Type u
A M B : Type v
inst✝⁶ : Ring R
inst✝⁵ : AddCommGroup A
inst✝⁴ : Module R A
inst✝³ : AddCommGroup B
inst✝² : Module R B
inst✝¹ : AddCommGroup M
inst✝ : Module R M
j : A →ₗ[R] M
g : M →ₗ[R] B
f : M →ₗ[R] A
hg : Function.Surjective ⇑g
exac : LinearMap.range j = LinearMap.ker g
h : f ∘ₗ j = LinearMap.id
⊢ Epi
    (ShortComplex.moduleCatMkOfKerLERange (ofHom j) (ofHom g)
        (_ : LinearMap.range (ofHom j) ≤ LinearMap.ker (ofHom g))).g

Next tactic:
simpa only [ModuleCat.epi_iff_surjective] using hg
/-- An order is (noncomputably) either an `OrderTop` or a `NoTopOrder`. Use as
`casesI topOrderOrNoTopOrder α`. -/
noncomputable def topOrderOrNoTopOrder (α : Type*) [LE α] : PSum (OrderTop α) (NoTopOrder α) := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
⊢ OrderTop α ⊕' NoTopOrder α

Next tactic:
by_cases H : ∀ a : α, ∃ b, ¬b ≤ a
/-- An order is (noncomputably) either an `OrderTop` or a `NoTopOrder`. Use as
`casesI topOrderOrNoTopOrder α`. -/
noncomputable def topOrderOrNoTopOrder (α : Type*) [LE α] : PSum (OrderTop α) (NoTopOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬b ≤ a
  · 

Proof state:
case pos
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ∀ (a : α), ∃ b, ¬b ≤ a
⊢ OrderTop α ⊕' NoTopOrder α

Next tactic:
exact PSum.inr ⟨H⟩
/-- An order is (noncomputably) either an `OrderTop` or a `NoTopOrder`. Use as
`casesI topOrderOrNoTopOrder α`. -/
noncomputable def topOrderOrNoTopOrder (α : Type*) [LE α] : PSum (OrderTop α) (NoTopOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬b ≤ a
  · exact PSum.inr ⟨H⟩
  · 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ¬∀ (a : α), ∃ b, ¬b ≤ a
⊢ OrderTop α ⊕' NoTopOrder α

Next tactic:
push_neg at H
/-- An order is (noncomputably) either an `OrderTop` or a `NoTopOrder`. Use as
`casesI topOrderOrNoTopOrder α`. -/
noncomputable def topOrderOrNoTopOrder (α : Type*) [LE α] : PSum (OrderTop α) (NoTopOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬b ≤ a
  · exact PSum.inr ⟨H⟩
  · push_neg at H
    

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ∃ a, ∀ (b : α), b ≤ a
⊢ OrderTop α ⊕' NoTopOrder α

Next tactic:
letI : Top α := ⟨Classical.choose H⟩
/-- An order is (noncomputably) either an `OrderTop` or a `NoTopOrder`. Use as
`casesI topOrderOrNoTopOrder α`. -/
noncomputable def topOrderOrNoTopOrder (α : Type*) [LE α] : PSum (OrderTop α) (NoTopOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬b ≤ a
  · exact PSum.inr ⟨H⟩
  · push_neg at H
    letI : Top α := ⟨Classical.choose H⟩
    

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ∃ a, ∀ (b : α), b ≤ a
this : Top α := { top := Classical.choose H }
⊢ OrderTop α ⊕' NoTopOrder α

Next tactic:
exact PSum.inl ⟨Classical.choose_spec H⟩
theorem StrictMono.maximal_preimage_top [LinearOrder α] [Preorder β] [OrderTop β] {f : α → β}
    (H : StrictMono f) {a} (h_top : f a = ⊤) (x : α) : x ≤ a :=
  H.maximal_of_maximal_image
    (fun p => by
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝² : LinearOrder α
inst✝¹ : Preorder β
inst✝ : OrderTop β
f : α → β
H : StrictMono f
a : α
h_top : f a = ⊤
x : α
p : β
⊢ p ≤ f a

Next tactic:
rw [h_top]
theorem StrictMono.maximal_preimage_top [LinearOrder α] [Preorder β] [OrderTop β] {f : α → β}
    (H : StrictMono f) {a} (h_top : f a = ⊤) (x : α) : x ≤ a :=
  H.maximal_of_maximal_image
    (fun p => by
      rw [h_top]
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝² : LinearOrder α
inst✝¹ : Preorder β
inst✝ : OrderTop β
f : α → β
H : StrictMono f
a : α
h_top : f a = ⊤
x : α
p : β
⊢ p ≤ ⊤

Next tactic:
exact le_top
theorem OrderTop.ext_top {α} {hA : PartialOrder α} (A : OrderTop α) {hB : PartialOrder α}
    (B : OrderTop α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Top.top α (@OrderTop.toTop α hA.toLE A)) = (@Top.top α (@OrderTop.toTop α hB.toLE B)) := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
hA : PartialOrder α
A : OrderTop α
hB : PartialOrder α
B : OrderTop α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ ⊤ = ⊤

Next tactic:
cases PartialOrder.ext H
theorem OrderTop.ext_top {α} {hA : PartialOrder α} (A : OrderTop α) {hB : PartialOrder α}
    (B : OrderTop α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Top.top α (@OrderTop.toTop α hA.toLE A)) = (@Top.top α (@OrderTop.toTop α hB.toLE B)) := by
  cases PartialOrder.ext H
  

Proof state:
case refl
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
hA : PartialOrder α
A B : OrderTop α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ ⊤ = ⊤

Next tactic:
apply top_unique
theorem OrderTop.ext_top {α} {hA : PartialOrder α} (A : OrderTop α) {hB : PartialOrder α}
    (B : OrderTop α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Top.top α (@OrderTop.toTop α hA.toLE A)) = (@Top.top α (@OrderTop.toTop α hB.toLE B)) := by
  cases PartialOrder.ext H
  apply top_unique
  

Proof state:
case refl.h
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
hA : PartialOrder α
A B : OrderTop α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ ⊤ ≤ ⊤

Next tactic:
exact @le_top _ _ A _
/-- An order is (noncomputably) either an `OrderBot` or a `NoBotOrder`. Use as
`casesI botOrderOrNoBotOrder α`. -/
noncomputable def botOrderOrNoBotOrder (α : Type*) [LE α] : PSum (OrderBot α) (NoBotOrder α) := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
⊢ OrderBot α ⊕' NoBotOrder α

Next tactic:
by_cases H : ∀ a : α, ∃ b, ¬a ≤ b
/-- An order is (noncomputably) either an `OrderBot` or a `NoBotOrder`. Use as
`casesI botOrderOrNoBotOrder α`. -/
noncomputable def botOrderOrNoBotOrder (α : Type*) [LE α] : PSum (OrderBot α) (NoBotOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬a ≤ b
  · 

Proof state:
case pos
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ∀ (a : α), ∃ b, ¬a ≤ b
⊢ OrderBot α ⊕' NoBotOrder α

Next tactic:
exact PSum.inr ⟨H⟩
/-- An order is (noncomputably) either an `OrderBot` or a `NoBotOrder`. Use as
`casesI botOrderOrNoBotOrder α`. -/
noncomputable def botOrderOrNoBotOrder (α : Type*) [LE α] : PSum (OrderBot α) (NoBotOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬a ≤ b
  · exact PSum.inr ⟨H⟩
  · 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ¬∀ (a : α), ∃ b, ¬a ≤ b
⊢ OrderBot α ⊕' NoBotOrder α

Next tactic:
push_neg at H
/-- An order is (noncomputably) either an `OrderBot` or a `NoBotOrder`. Use as
`casesI botOrderOrNoBotOrder α`. -/
noncomputable def botOrderOrNoBotOrder (α : Type*) [LE α] : PSum (OrderBot α) (NoBotOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬a ≤ b
  · exact PSum.inr ⟨H⟩
  · push_neg at H
    

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ∃ a, ∀ (b : α), a ≤ b
⊢ OrderBot α ⊕' NoBotOrder α

Next tactic:
letI : Bot α := ⟨Classical.choose H⟩
/-- An order is (noncomputably) either an `OrderBot` or a `NoBotOrder`. Use as
`casesI botOrderOrNoBotOrder α`. -/
noncomputable def botOrderOrNoBotOrder (α : Type*) [LE α] : PSum (OrderBot α) (NoBotOrder α) := by
  by_cases H : ∀ a : α, ∃ b, ¬a ≤ b
  · exact PSum.inr ⟨H⟩
  · push_neg at H
    letI : Bot α := ⟨Classical.choose H⟩
    

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
inst✝ : LE α
H : ∃ a, ∀ (b : α), a ≤ b
this : Bot α := { bot := Classical.choose H }
⊢ OrderBot α ⊕' NoBotOrder α

Next tactic:
exact PSum.inl ⟨Classical.choose_spec H⟩
theorem StrictMono.minimal_preimage_bot [LinearOrder α] [PartialOrder β] [OrderBot β] {f : α → β}
    (H : StrictMono f) {a} (h_bot : f a = ⊥) (x : α) : a ≤ x :=
  H.minimal_of_minimal_image
    (fun p => by
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝² : LinearOrder α
inst✝¹ : PartialOrder β
inst✝ : OrderBot β
f : α → β
H : StrictMono f
a : α
h_bot : f a = ⊥
x : α
p : β
⊢ f a ≤ p

Next tactic:
rw [h_bot]
theorem StrictMono.minimal_preimage_bot [LinearOrder α] [PartialOrder β] [OrderBot β] {f : α → β}
    (H : StrictMono f) {a} (h_bot : f a = ⊥) (x : α) : a ≤ x :=
  H.minimal_of_minimal_image
    (fun p => by
      rw [h_bot]
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝² : LinearOrder α
inst✝¹ : PartialOrder β
inst✝ : OrderBot β
f : α → β
H : StrictMono f
a : α
h_bot : f a = ⊥
x : α
p : β
⊢ ⊥ ≤ p

Next tactic:
exact bot_le
theorem OrderBot.ext_bot {α} {hA : PartialOrder α} (A : OrderBot α) {hB : PartialOrder α}
    (B : OrderBot α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Bot.bot α (@OrderBot.toBot α hA.toLE A)) = (@Bot.bot α (@OrderBot.toBot α hB.toLE B)) := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
hA : PartialOrder α
A : OrderBot α
hB : PartialOrder α
B : OrderBot α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ ⊥ = ⊥

Next tactic:
cases PartialOrder.ext H
theorem OrderBot.ext_bot {α} {hA : PartialOrder α} (A : OrderBot α) {hB : PartialOrder α}
    (B : OrderBot α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Bot.bot α (@OrderBot.toBot α hA.toLE A)) = (@Bot.bot α (@OrderBot.toBot α hB.toLE B)) := by
  cases PartialOrder.ext H
  

Proof state:
case refl
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
hA : PartialOrder α
A B : OrderBot α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ ⊥ = ⊥

Next tactic:
apply bot_unique
theorem OrderBot.ext_bot {α} {hA : PartialOrder α} (A : OrderBot α) {hB : PartialOrder α}
    (B : OrderBot α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Bot.bot α (@OrderBot.toBot α hA.toLE A)) = (@Bot.bot α (@OrderBot.toBot α hB.toLE B)) := by
  cases PartialOrder.ext H
  apply bot_unique
  

Proof state:
case refl.h
α✝ : Type u
β : Type v
γ : Type u_1
δ : Type u_2
α : Type u_3
hA : PartialOrder α
A B : OrderBot α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ ⊥ ≤ ⊥

Next tactic:
exact @bot_le _ _ A _
@[simp]
theorem sup_eq_bot_iff : a ⊔ b = ⊥ ↔ a = ⊥ ∧ b = ⊥ := by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝¹ : SemilatticeSup α
inst✝ : OrderBot α
a b : α
⊢ a ⊔ b = ⊥ ↔ a = ⊥ ∧ b = ⊥

Next tactic:
rw [eq_bot_iff, sup_le_iff]
@[simp]
theorem sup_eq_bot_iff : a ⊔ b = ⊥ ↔ a = ⊥ ∧ b = ⊥ := by rw [eq_bot_iff, sup_le_iff]; 

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝¹ : SemilatticeSup α
inst✝ : OrderBot α
a b : α
⊢ a ≤ ⊥ ∧ b ≤ ⊥ ↔ a = ⊥ ∧ b = ⊥

Next tactic:
simp
instance OrderBot.instSubsingleton : Subsingleton (OrderBot α) where
  allEq := by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
⊢ ∀ (a b : OrderBot α), a = b

Next tactic:
rintro @⟨⟨a⟩, ha⟩ @⟨⟨b⟩, hb⟩
instance OrderBot.instSubsingleton : Subsingleton (OrderBot α) where
  allEq := by rintro @⟨⟨a⟩, ha⟩ @⟨⟨b⟩, hb⟩; 

Proof state:
case mk.mk.mk.mk
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
a : α
ha : ∀ (a_1 : α), ⊥ ≤ a_1
b : α
hb : ∀ (a : α), ⊥ ≤ a
⊢ mk ha = mk hb

Next tactic:
congr
instance OrderBot.instSubsingleton : Subsingleton (OrderBot α) where
  allEq := by rintro @⟨⟨a⟩, ha⟩ @⟨⟨b⟩, hb⟩; congr; 

Proof state:
case mk.mk.mk.mk.e_toBot.e_bot
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
a : α
ha : ∀ (a_1 : α), ⊥ ≤ a_1
b : α
hb : ∀ (a : α), ⊥ ≤ a
⊢ a = b

Next tactic:
exact le_antisymm (ha _) (hb _)
instance OrderTop.instSubsingleton : Subsingleton (OrderTop α) where
  allEq := by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
⊢ ∀ (a b : OrderTop α), a = b

Next tactic:
rintro @⟨⟨a⟩, ha⟩ @⟨⟨b⟩, hb⟩
instance OrderTop.instSubsingleton : Subsingleton (OrderTop α) where
  allEq := by rintro @⟨⟨a⟩, ha⟩ @⟨⟨b⟩, hb⟩; 

Proof state:
case mk.mk.mk.mk
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
a : α
ha : ∀ (a_1 : α), a_1 ≤ ⊤
b : α
hb : ∀ (a : α), a ≤ ⊤
⊢ mk ha = mk hb

Next tactic:
congr
instance OrderTop.instSubsingleton : Subsingleton (OrderTop α) where
  allEq := by rintro @⟨⟨a⟩, ha⟩ @⟨⟨b⟩, hb⟩; congr; 

Proof state:
case mk.mk.mk.mk.e_toTop.e_top
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
a : α
ha : ∀ (a_1 : α), a_1 ≤ ⊤
b : α
hb : ∀ (a : α), a ≤ ⊤
⊢ a = b

Next tactic:
exact le_antisymm (hb _) (ha _)
instance BoundedOrder.instSubsingleton : Subsingleton (BoundedOrder α) where
  allEq := by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
⊢ ∀ (a b : BoundedOrder α), a = b

Next tactic:
rintro ⟨⟩ ⟨⟩
instance BoundedOrder.instSubsingleton : Subsingleton (BoundedOrder α) where
  allEq := by rintro ⟨⟩ ⟨⟩; 

Proof state:
case mk.mk
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
toOrderTop✝¹ : OrderTop α
toOrderBot✝¹ : OrderBot α
toOrderTop✝ : OrderTop α
toOrderBot✝ : OrderBot α
⊢ mk = mk

Next tactic:
congr
instance BoundedOrder.instSubsingleton : Subsingleton (BoundedOrder α) where
  allEq := by rintro ⟨⟩ ⟨⟩; congr <;> 

Proof state:
case mk.mk.e_toOrderTop
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
toOrderTop✝¹ : OrderTop α
toOrderBot✝¹ : OrderBot α
toOrderTop✝ : OrderTop α
toOrderBot✝ : OrderBot α
⊢ toOrderTop✝¹ = toOrderTop✝

Next tactic:
exact Subsingleton.elim _ _
instance BoundedOrder.instSubsingleton : Subsingleton (BoundedOrder α) where
  allEq := by rintro ⟨⟩ ⟨⟩; congr <;> 

Proof state:
case mk.mk.e_toOrderBot
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝ : PartialOrder α
toOrderTop✝¹ : OrderTop α
toOrderBot✝¹ : OrderBot α
toOrderTop✝ : OrderTop α
toOrderBot✝ : OrderBot α
⊢ toOrderBot✝¹ = toOrderBot✝

Next tactic:
exact Subsingleton.elim _ _
/-- Pullback an `OrderTop`. -/
@[reducible]
def OrderTop.lift [LE α] [Top α] [LE β] [OrderTop β] (f : α → β)
    (map_le : ∀ a b, f a ≤ f b → a ≤ b) (map_top : f ⊤ = ⊤) : OrderTop α :=
  ⟨fun a =>
    map_le _ _ <| by
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝³ : LE α
inst✝² : Top α
inst✝¹ : LE β
inst✝ : OrderTop β
f : α → β
map_le : ∀ (a b : α), f a ≤ f b → a ≤ b
map_top : f ⊤ = ⊤
a : α
⊢ f a ≤ f ⊤

Next tactic:
rw [map_top]
/-- Pullback an `OrderTop`. -/
@[reducible]
def OrderTop.lift [LE α] [Top α] [LE β] [OrderTop β] (f : α → β)
    (map_le : ∀ a b, f a ≤ f b → a ≤ b) (map_top : f ⊤ = ⊤) : OrderTop α :=
  ⟨fun a =>
    map_le _ _ <| by
      rw [map_top]
      -- Porting note: lean3 didn't need the type annotation
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝³ : LE α
inst✝² : Top α
inst✝¹ : LE β
inst✝ : OrderTop β
f : α → β
map_le : ∀ (a b : α), f a ≤ f b → a ≤ b
map_top : f ⊤ = ⊤
a : α
⊢ f a ≤ ⊤

Next tactic:
exact @le_top β _ _ _
/-- Pullback an `OrderBot`. -/
@[reducible]
def OrderBot.lift [LE α] [Bot α] [LE β] [OrderBot β] (f : α → β)
    (map_le : ∀ a b, f a ≤ f b → a ≤ b) (map_bot : f ⊥ = ⊥) : OrderBot α :=
  ⟨fun a =>
    map_le _ _ <| by
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝³ : LE α
inst✝² : Bot α
inst✝¹ : LE β
inst✝ : OrderBot β
f : α → β
map_le : ∀ (a b : α), f a ≤ f b → a ≤ b
map_bot : f ⊥ = ⊥
a : α
⊢ f ⊥ ≤ f a

Next tactic:
rw [map_bot]
/-- Pullback an `OrderBot`. -/
@[reducible]
def OrderBot.lift [LE α] [Bot α] [LE β] [OrderBot β] (f : α → β)
    (map_le : ∀ a b, f a ≤ f b → a ≤ b) (map_bot : f ⊥ = ⊥) : OrderBot α :=
  ⟨fun a =>
    map_le _ _ <| by
      rw [map_bot]
      -- Porting note: lean3 didn't need the type annotation
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝³ : LE α
inst✝² : Bot α
inst✝¹ : LE β
inst✝ : OrderBot β
f : α → β
map_le : ∀ (a b : α), f a ≤ f b → a ≤ b
map_bot : f ⊥ = ⊥
a : α
⊢ ⊥ ≤ f a

Next tactic:
exact @bot_le β _ _ _
@[simp]
theorem coe_eq_bot_iff [OrderBot α] [OrderBot (Subtype p)] (hbot : p ⊥) {x : { x // p x }} :
    (x : α) = ⊥ ↔ x = ⊥ := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
p : α → Prop
inst✝² : PartialOrder α
inst✝¹ : OrderBot α
inst✝ : OrderBot (Subtype p)
hbot : p ⊥
x : { x // p x }
⊢ ↑x = ⊥ ↔ x = ⊥

Next tactic:
rw [← coe_bot hbot, ext_iff]
@[simp]
theorem coe_eq_top_iff [OrderTop α] [OrderTop (Subtype p)] (htop : p ⊤) {x : { x // p x }} :
    (x : α) = ⊤ ↔ x = ⊤ := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
p : α → Prop
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : OrderTop (Subtype p)
htop : p ⊤
x : { x // p x }
⊢ ↑x = ⊤ ↔ x = ⊤

Next tactic:
rw [← coe_top htop, ext_iff]
@[simp]
theorem min_eq_bot [OrderBot α] {a b : α} : min a b = ⊥ ↔ a = ⊥ ∨ b = ⊥ := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
δ : Type u_2
inst✝¹ : LinearOrder α
inst✝ : OrderBot α
a b : α
⊢ min a b = ⊥ ↔ a = ⊥ ∨ b = ⊥

Next tactic:
simp only [← inf_eq_min, ← le_bot_iff, inf_le_iff]
/-- The completion of a module with respect to an ideal. This is not necessarily Hausdorff.
In fact, this is only complete if the ideal is finitely generated. -/
def adicCompletion : Submodule R (∀ n : ℕ, M ⧸ (I ^ n • ⊤ : Submodule R M)) where
  carrier := { f | ∀ {m n} (h : m ≤ n), liftQ _ (mkQ _) (by
      

Proof state:
R : Type u_1
inst✝⁴ : CommRing R
I : Ideal R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
f : (n : ℕ) → M ⧸ I ^ n • ⊤
m n : ℕ
h : m ≤ n
⊢ I ^ n • ⊤ ≤ LinearMap.ker (mkQ (I ^ m • ⊤))

Next tactic:
rw [ker_mkQ]
/-- The completion of a module with respect to an ideal. This is not necessarily Hausdorff.
In fact, this is only complete if the ideal is finitely generated. -/
def adicCompletion : Submodule R (∀ n : ℕ, M ⧸ (I ^ n • ⊤ : Submodule R M)) where
  carrier := { f | ∀ {m n} (h : m ≤ n), liftQ _ (mkQ _) (by
      rw [ker_mkQ]
      

Proof state:
R : Type u_1
inst✝⁴ : CommRing R
I : Ideal R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
f : (n : ℕ) → M ⧸ I ^ n • ⊤
m n : ℕ
h : m ≤ n
⊢ I ^ n • ⊤ ≤ I ^ m • ⊤

Next tactic:
exact smul_mono (Ideal.pow_le_pow_right h) le_rfl
/-- The completion of a module with respect to an ideal. This is not necessarily Hausdorff.
In fact, this is only complete if the ideal is finitely generated. -/
def adicCompletion : Submodule R (∀ n : ℕ, M ⧸ (I ^ n • ⊤ : Submodule R M)) where
  carrier := { f | ∀ {m n} (h : m ≤ n), liftQ _ (mkQ _) (by
      rw [ker_mkQ]
      exact smul_mono (Ideal.pow_le_pow_right h) le_rfl)
    (f n) = f m }
  zero_mem' hmn := by rw [Pi.zero_apply, Pi.zero_apply, LinearMap.map_zero]
  add_mem' hf hg m n hmn := by
    

Proof state:
R : Type u_1
inst✝⁴ : CommRing R
I : Ideal R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
a✝ b✝ : (n : ℕ) → M ⧸ I ^ n • ⊤
hf :
  a✝ ∈
    {f |
      ∀ {m n : ℕ} (h : m ≤ n),
        (liftQ (I ^ n • ⊤) (mkQ (I ^ m • ⊤)) (_ : I ^ n • ⊤ ≤ LinearMap.ker (mkQ (I ^ m • ⊤)))) (f n) = f m}
hg :
  b✝ ∈
    {f |
      ∀ {m n : ℕ} (h : m ≤ n),
        (liftQ (I ^ n • ⊤) (mkQ (I ^ m • ⊤)) (_ : I ^ n • ⊤ ≤ LinearMap.ker (mkQ (I ^ m • ⊤)))) (f n) = f m}
m n : ℕ
hmn : m ≤ n
⊢ (liftQ (I ^ n • ⊤) (mkQ (I ^ m • ⊤)) (_ : I ^ n • ⊤ ≤ LinearMap.ker (mkQ (I ^ m • ⊤)))) ((a✝ + b✝) n) = (a✝ + b✝) m

Next tactic:
rw [Pi.add_apply, Pi.add_apply, LinearMap.map_add, hf hmn, hg hmn]
/-- The completion of a module with respect to an ideal. This is not necessarily Hausdorff.
In fact, this is only complete if the ideal is finitely generated. -/
def adicCompletion : Submodule R (∀ n : ℕ, M ⧸ (I ^ n • ⊤ : Submodule R M)) where
  carrier := { f | ∀ {m n} (h : m ≤ n), liftQ _ (mkQ _) (by
      rw [ker_mkQ]
      exact smul_mono (Ideal.pow_le_pow_right h) le_rfl)
    (f n) = f m }
  zero_mem' hmn := by 

Proof state:
R : Type u_1
inst✝⁴ : CommRing R
I : Ideal R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
m✝ n✝ : ℕ
hmn : m✝ ≤ n✝
⊢ (liftQ (I ^ n✝ • ⊤) (mkQ (I ^ m✝ • ⊤)) (_ : I ^ n✝ • ⊤ ≤ LinearMap.ker (mkQ (I ^ m✝ • ⊤)))) (OfNat.ofNat 0 n✝) =
    OfNat.ofNat 0 m✝

Next tactic:
rw [Pi.zero_apply, Pi.zero_apply, LinearMap.map_zero]