[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
⊢ ↑(convexHull 𝕜) ↑s ⊆ space K
[PROOFSTEP]
convert subset_biUnion_of_mem hs
[GOAL]
case h.e'_3
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
⊢ ↑(convexHull 𝕜) ↑s = ↑(convexHull 𝕜) ↑s
[PROOFSTEP]
rfl
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
ht : t ∈ K.faces
⊢ Disjoint (↑(convexHull 𝕜) ↑s) (↑(convexHull 𝕜) ↑t) ∨
    ∃ u, u ∈ K.faces ∧ ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t = ↑(convexHull 𝕜) ↑u
[PROOFSTEP]
classical
by_contra' h
refine'
  h.2 (s ∩ t)
    (K.down_closed hs (inter_subset_left _ _) fun hst =>
      h.1 <| disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans _)
    _
· rw [← coe_inter, hst, coe_empty, convexHull_empty]
  rfl
· rw [coe_inter, convexHull_inter_convexHull hs ht]
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
ht : t ∈ K.faces
⊢ Disjoint (↑(convexHull 𝕜) ↑s) (↑(convexHull 𝕜) ↑t) ∨
    ∃ u, u ∈ K.faces ∧ ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t = ↑(convexHull 𝕜) ↑u
[PROOFSTEP]
by_contra' h
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
ht : t ∈ K.faces
h :
  ¬Disjoint (↑(convexHull 𝕜) ↑s) (↑(convexHull 𝕜) ↑t) ∧
    ∀ (u : Finset E), u ∈ K.faces → ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t ≠ ↑(convexHull 𝕜) ↑u
⊢ False
[PROOFSTEP]
refine'
  h.2 (s ∩ t)
    (K.down_closed hs (inter_subset_left _ _) fun hst =>
      h.1 <| disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans _)
    _
[GOAL]
case refine'_1
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
ht : t ∈ K.faces
h :
  ¬Disjoint (↑(convexHull 𝕜) ↑s) (↑(convexHull 𝕜) ↑t) ∧
    ∀ (u : Finset E), u ∈ K.faces → ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t ≠ ↑(convexHull 𝕜) ↑u
hst : s ∩ t = ∅
⊢ ↑(convexHull 𝕜) (↑s ∩ ↑t) ⊆ ⊥
[PROOFSTEP]
rw [← coe_inter, hst, coe_empty, convexHull_empty]
[GOAL]
case refine'_1
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
ht : t ∈ K.faces
h :
  ¬Disjoint (↑(convexHull 𝕜) ↑s) (↑(convexHull 𝕜) ↑t) ∧
    ∀ (u : Finset E), u ∈ K.faces → ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t ≠ ↑(convexHull 𝕜) ↑u
hst : s ∩ t = ∅
⊢ ∅ ⊆ ⊥
[PROOFSTEP]
rfl
[GOAL]
case refine'_2
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
ht : t ∈ K.faces
h :
  ¬Disjoint (↑(convexHull 𝕜) ↑s) (↑(convexHull 𝕜) ↑t) ∧
    ∀ (u : Finset E), u ∈ K.faces → ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t ≠ ↑(convexHull 𝕜) ↑u
⊢ ↑(convexHull 𝕜) ↑s ∩ ↑(convexHull 𝕜) ↑t = ↑(convexHull 𝕜) ↑(s ∩ t)
[PROOFSTEP]
rw [coe_inter, convexHull_inter_convexHull hs ht]
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
⊢ vertices K = ⋃ (k : Finset E) (_ : k ∈ K.faces), ↑k
[PROOFSTEP]
ext x
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x✝ x : E
⊢ x ∈ vertices K ↔ x ∈ ⋃ (k : Finset E) (_ : k ∈ K.faces), ↑k
[PROOFSTEP]
refine' ⟨fun h => mem_biUnion h <| mem_coe.2 <| mem_singleton_self x, fun h => _⟩
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x✝ x : E
h : x ∈ ⋃ (k : Finset E) (_ : k ∈ K.faces), ↑k
⊢ x ∈ vertices K
[PROOFSTEP]
obtain ⟨s, hs, hx⟩ := mem_iUnion₂.1 h
[GOAL]
case h.intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s✝ t : Finset E
x✝ x : E
h : x ∈ ⋃ (k : Finset E) (_ : k ∈ K.faces), ↑k
s : Finset E
hs : s ∈ K.faces
hx : x ∈ ↑s
⊢ x ∈ vertices K
[PROOFSTEP]
exact K.down_closed hs (Finset.singleton_subset_iff.2 <| mem_coe.1 hx) (singleton_ne_empty _)
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hx : x ∈ vertices K
hs : s ∈ K.faces
⊢ x ∈ ↑(convexHull 𝕜) ↑s ↔ x ∈ s
[PROOFSTEP]
refine' ⟨fun h => _, fun h => subset_convexHull 𝕜 _ h⟩
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hx : x ∈ vertices K
hs : s ∈ K.faces
h : x ∈ ↑(convexHull 𝕜) ↑s
⊢ x ∈ s
[PROOFSTEP]
classical
have h := K.inter_subset_convexHull hx hs ⟨by simp, h⟩
by_contra H
rwa [← coe_inter, Finset.disjoint_iff_inter_eq_empty.1 (Finset.disjoint_singleton_right.2 H).symm, coe_empty,
  convexHull_empty] at h
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hx : x ∈ vertices K
hs : s ∈ K.faces
h : x ∈ ↑(convexHull 𝕜) ↑s
⊢ x ∈ s
[PROOFSTEP]
have h := K.inter_subset_convexHull hx hs ⟨by simp, h⟩
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hx : x ∈ vertices K
hs : s ∈ K.faces
h : x ∈ ↑(convexHull 𝕜) ↑s
⊢ x ∈ ↑(convexHull 𝕜) ↑{x}
[PROOFSTEP]
simp
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hx : x ∈ vertices K
hs : s ∈ K.faces
h✝ : x ∈ ↑(convexHull 𝕜) ↑s
h : x ∈ ↑(convexHull 𝕜) (↑{x} ∩ ↑s)
⊢ x ∈ s
[PROOFSTEP]
by_contra H
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hx : x ∈ vertices K
hs : s ∈ K.faces
h✝ : x ∈ ↑(convexHull 𝕜) ↑s
h : x ∈ ↑(convexHull 𝕜) (↑{x} ∩ ↑s)
H : ¬x ∈ s
⊢ False
[PROOFSTEP]
rwa [← coe_inter, Finset.disjoint_iff_inter_eq_empty.1 (Finset.disjoint_singleton_right.2 H).symm, coe_empty,
  convexHull_empty] at h
[GOAL]
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
⊢ ¬s ∈ facets K ↔ ∃ t, t ∈ K.faces ∧ s ⊂ t
[PROOFSTEP]
refine' ⟨fun hs' : ¬(_ ∧ _) => _, _⟩
[GOAL]
case refine'_1
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
hs' : ¬(s ∈ K.faces ∧ ∀ ⦃t : Finset E⦄, t ∈ K.faces → s ⊆ t → s = t)
⊢ ∃ t, t ∈ K.faces ∧ s ⊂ t
[PROOFSTEP]
push_neg at hs'
[GOAL]
case refine'_1
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
hs' : s ∈ K.faces → Exists fun ⦃t⦄ => t ∈ K.faces ∧ s ⊆ t ∧ s ≠ t
⊢ ∃ t, t ∈ K.faces ∧ s ⊂ t
[PROOFSTEP]
obtain ⟨t, ht⟩ := hs' hs
[GOAL]
case refine'_1.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t✝ : Finset E
x : E
hs : s ∈ K.faces
hs' : s ∈ K.faces → Exists fun ⦃t⦄ => t ∈ K.faces ∧ s ⊆ t ∧ s ≠ t
t : Finset E
ht : t ∈ K.faces ∧ s ⊆ t ∧ s ≠ t
⊢ ∃ t, t ∈ K.faces ∧ s ⊂ t
[PROOFSTEP]
exact ⟨t, ht.1, ⟨ht.2.1, fun hts => ht.2.2 (Subset.antisymm ht.2.1 hts)⟩⟩
[GOAL]
case refine'_2
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t : Finset E
x : E
hs : s ∈ K.faces
⊢ (∃ t, t ∈ K.faces ∧ s ⊂ t) → ¬s ∈ facets K
[PROOFSTEP]
rintro ⟨t, ht⟩ ⟨hs, hs'⟩
[GOAL]
case refine'_2.intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t✝ : Finset E
x : E
hs✝ : s ∈ K.faces
t : Finset E
ht : t ∈ K.faces ∧ s ⊂ t
hs : s ∈ K.faces
hs' : ∀ ⦃t : Finset E⦄, t ∈ K.faces → s ⊆ t → s = t
⊢ False
[PROOFSTEP]
have := hs' ht.1 ht.2.1
[GOAL]
case refine'_2.intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t✝ : Finset E
x : E
hs✝ : s ∈ K.faces
t : Finset E
ht : t ∈ K.faces ∧ s ⊂ t
hs : s ∈ K.faces
hs' : ∀ ⦃t : Finset E⦄, t ∈ K.faces → s ⊆ t → s = t
this : s = t
⊢ False
[PROOFSTEP]
rw [this] at ht
[GOAL]
case refine'_2.intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : OrderedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
K : SimplicialComplex 𝕜 E
s t✝ : Finset E
x : E
hs✝ : s ∈ K.faces
t : Finset E
ht : t ∈ K.faces ∧ t ⊂ t
hs : s ∈ K.faces
hs' : ∀ ⦃t : Finset E⦄, t ∈ K.faces → s ⊆ t → s = t
this : s = t
⊢ False
[PROOFSTEP]
exact ht.2.2 (Subset.refl t)


[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : CommSemiring R
h : ∃! P, P ≠ ⊥ ∧ Ideal.IsPrime P
⊢ ∃! I, Ideal.IsMaximal I
[PROOFSTEP]
rcases h with ⟨P, ⟨hPnonzero, hPnot_top, _⟩, hPunique⟩
[GOAL]
case intro.intro.intro.mk
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : CommSemiring R
P : Ideal R
hPunique : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ Ideal.IsPrime P) y → y = P
hPnonzero : P ≠ ⊥
hPnot_top : P ≠ ⊤
mem_or_mem'✝ : ∀ {x y : R}, x * y ∈ P → x ∈ P ∨ y ∈ P
⊢ ∃! I, Ideal.IsMaximal I
[PROOFSTEP]
refine' ⟨P, ⟨⟨hPnot_top, _⟩⟩, fun M hM => hPunique _ ⟨_, Ideal.IsMaximal.isPrime hM⟩⟩
[GOAL]
case intro.intro.intro.mk.refine'_1
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : CommSemiring R
P : Ideal R
hPunique : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ Ideal.IsPrime P) y → y = P
hPnonzero : P ≠ ⊥
hPnot_top : P ≠ ⊤
mem_or_mem'✝ : ∀ {x y : R}, x * y ∈ P → x ∈ P ∨ y ∈ P
⊢ ∀ (b : Ideal R), P < b → b = ⊤
[PROOFSTEP]
refine' Ideal.maximal_of_no_maximal fun M hPM hM => ne_of_lt hPM _
[GOAL]
case intro.intro.intro.mk.refine'_1
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : CommSemiring R
P : Ideal R
hPunique : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ Ideal.IsPrime P) y → y = P
hPnonzero : P ≠ ⊥
hPnot_top : P ≠ ⊤
mem_or_mem'✝ : ∀ {x y : R}, x * y ∈ P → x ∈ P ∨ y ∈ P
M : Ideal R
hPM : P < M
hM : Ideal.IsMaximal M
⊢ P = M
[PROOFSTEP]
exact (hPunique _ ⟨ne_bot_of_gt hPM, Ideal.IsMaximal.isPrime hM⟩).symm
[GOAL]
case intro.intro.intro.mk.refine'_2
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : CommSemiring R
P : Ideal R
hPunique : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ Ideal.IsPrime P) y → y = P
hPnonzero : P ≠ ⊥
hPnot_top : P ≠ ⊤
mem_or_mem'✝ : ∀ {x y : R}, x * y ∈ P → x ∈ P ∨ y ∈ P
M : Ideal R
hM : (fun I => Ideal.IsMaximal I) M
⊢ M ≠ ⊥
[PROOFSTEP]
rintro rfl
[GOAL]
case intro.intro.intro.mk.refine'_2
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : CommSemiring R
P : Ideal R
hPunique : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ Ideal.IsPrime P) y → y = P
hPnonzero : P ≠ ⊥
hPnot_top : P ≠ ⊤
mem_or_mem'✝ : ∀ {x y : R}, x * y ∈ P → x ∈ P ∨ y ∈ P
hM : Ideal.IsMaximal ⊥
⊢ False
[PROOFSTEP]
exact hPnot_top (hM.1.2 P (bot_lt_iff_ne_bot.2 hPnonzero))
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
a b : R
h : IsUnit (a + b)
⊢ IsUnit a ∨ IsUnit b
[PROOFSTEP]
rcases h with ⟨u, hu⟩
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
a b : R
u : Rˣ
hu : ↑u = a + b
⊢ IsUnit a ∨ IsUnit b
[PROOFSTEP]
rw [← Units.inv_mul_eq_one, mul_add] at hu
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
a b : R
u : Rˣ
hu : ↑u⁻¹ * a + ↑u⁻¹ * b = 1
⊢ IsUnit a ∨ IsUnit b
[PROOFSTEP]
apply Or.imp _ _ (isUnit_or_isUnit_of_add_one hu)
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
a b : R
u : Rˣ
hu : ↑u⁻¹ * a + ↑u⁻¹ * b = 1
⊢ IsUnit (↑u⁻¹ * a) → IsUnit a
[PROOFSTEP]
exact isUnit_of_mul_isUnit_right
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
a b : R
u : Rˣ
hu : ↑u⁻¹ * a + ↑u⁻¹ * b = 1
⊢ IsUnit (↑u⁻¹ * b) → IsUnit b
[PROOFSTEP]
exact isUnit_of_mul_isUnit_right
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
⊢ Ideal.IsMaximal (maximalIdeal R)
[PROOFSTEP]
rw [Ideal.isMaximal_iff]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
⊢ ¬1 ∈ maximalIdeal R ∧ ∀ (J : Ideal R) (x : R), maximalIdeal R ≤ J → ¬x ∈ maximalIdeal R → x ∈ J → 1 ∈ J
[PROOFSTEP]
constructor
[GOAL]
case left
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
⊢ ¬1 ∈ maximalIdeal R
[PROOFSTEP]
intro h
[GOAL]
case left
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
h : 1 ∈ maximalIdeal R
⊢ False
[PROOFSTEP]
apply h
[GOAL]
case left
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
h : 1 ∈ maximalIdeal R
⊢ IsUnit 1
[PROOFSTEP]
exact isUnit_one
[GOAL]
case right
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
⊢ ∀ (J : Ideal R) (x : R), maximalIdeal R ≤ J → ¬x ∈ maximalIdeal R → x ∈ J → 1 ∈ J
[PROOFSTEP]
intro I x _ hx H
[GOAL]
case right
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
I : Ideal R
x : R
a✝ : maximalIdeal R ≤ I
hx : ¬x ∈ maximalIdeal R
H : x ∈ I
⊢ 1 ∈ I
[PROOFSTEP]
erw [Classical.not_not] at hx
[GOAL]
case right
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
I : Ideal R
x : R
a✝ : maximalIdeal R ≤ I
hx : IsUnit x
H : x ∈ I
⊢ 1 ∈ I
[PROOFSTEP]
rcases hx with ⟨u, rfl⟩
[GOAL]
case right.intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
I : Ideal R
a✝ : maximalIdeal R ≤ I
u : Rˣ
H : ↑u ∈ I
⊢ 1 ∈ I
[PROOFSTEP]
simpa using I.mul_mem_left (↑u⁻¹) H
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
J : Ideal R
hJ : J ≠ ⊤
⊢ J ≤ maximalIdeal R
[PROOFSTEP]
rcases Ideal.exists_le_maximal J hJ with ⟨M, hM1, hM2⟩
[GOAL]
case intro.intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommSemiring R
inst✝ : LocalRing R
J : Ideal R
hJ : J ≠ ⊤
M : Ideal R
hM1 : Ideal.IsMaximal M
hM2 : J ≤ M
⊢ J ≤ maximalIdeal R
[PROOFSTEP]
rwa [← eq_maximalIdeal hM1]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommRing R
inst✝² : LocalRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial S
f : R →+* S
hf : Function.Surjective ↑f
⊢ ∀ (a : S), IsUnit a ∨ IsUnit (1 - a)
[PROOFSTEP]
intro b
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommRing R
inst✝² : LocalRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial S
f : R →+* S
hf : Function.Surjective ↑f
b : S
⊢ IsUnit b ∨ IsUnit (1 - b)
[PROOFSTEP]
obtain ⟨a, rfl⟩ := hf b
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommRing R
inst✝² : LocalRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial S
f : R →+* S
hf : Function.Surjective ↑f
a : R
⊢ IsUnit (↑f a) ∨ IsUnit (1 - ↑f a)
[PROOFSTEP]
apply (isUnit_or_isUnit_one_sub_self a).imp <| RingHom.isUnit_map _
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommRing R
inst✝² : LocalRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial S
f : R →+* S
hf : Function.Surjective ↑f
a : R
⊢ IsUnit (1 - a) → IsUnit (1 - ↑f a)
[PROOFSTEP]
rw [← f.map_one, ← f.map_sub]
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommRing R
inst✝² : LocalRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial S
f : R →+* S
hf : Function.Surjective ↑f
a : R
⊢ IsUnit (1 - a) → IsUnit (↑f (1 - a))
[PROOFSTEP]
apply f.isUnit_map
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : LocalRing R
I : Ideal R
h : I ≠ ⊤
⊢ Ideal.jacobson I = maximalIdeal R
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : LocalRing R
I : Ideal R
h : I ≠ ⊤
⊢ Ideal.jacobson I ≤ maximalIdeal R
[PROOFSTEP]
exact sInf_le ⟨LocalRing.le_maximalIdeal h, LocalRing.maximalIdeal.isMaximal R⟩
[GOAL]
case a
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : LocalRing R
I : Ideal R
h : I ≠ ⊤
⊢ maximalIdeal R ≤ Ideal.jacobson I
[PROOFSTEP]
exact le_sInf fun J (hJ : I ≤ J ∧ J.IsMaximal) => le_of_eq (LocalRing.eq_maximalIdeal hJ.2).symm
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R ≃+* S
a : R
ha : IsUnit (↑↑f a)
⊢ IsUnit a
[PROOFSTEP]
convert RingHom.isUnit_map (f.symm : S →+* R) ha
[GOAL]
case h.e'_3
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R ≃+* S
a : R
ha : IsUnit (↑↑f a)
⊢ a = ↑↑(RingEquiv.symm f) (↑↑f a)
[PROOFSTEP]
exact (RingEquiv.symm_apply_apply f a).symm
[GOAL]
R✝ : Type u
S✝ : Type v
T : Type w
K : Type u'
inst✝⁵ : Semiring R✝
inst✝⁴ : Semiring S✝
inst✝³ : Semiring T
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
H : LocalRing S
f : R →+* S
inst✝ : IsLocalRingHom f
⊢ LocalRing R
[PROOFSTEP]
haveI : Nontrivial R := pullback_nonzero f f.map_zero f.map_one
[GOAL]
R✝ : Type u
S✝ : Type v
T : Type w
K : Type u'
inst✝⁵ : Semiring R✝
inst✝⁴ : Semiring S✝
inst✝³ : Semiring T
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
H : LocalRing S
f : R →+* S
inst✝ : IsLocalRingHom f
this : Nontrivial R
⊢ LocalRing R
[PROOFSTEP]
apply LocalRing.of_nonunits_add
[GOAL]
case h
R✝ : Type u
S✝ : Type v
T : Type w
K : Type u'
inst✝⁵ : Semiring R✝
inst✝⁴ : Semiring S✝
inst✝³ : Semiring T
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
H : LocalRing S
f : R →+* S
inst✝ : IsLocalRingHom f
this : Nontrivial R
⊢ ∀ (a b : R), a ∈ nonunits R → b ∈ nonunits R → a + b ∈ nonunits R
[PROOFSTEP]
intro a b
[GOAL]
case h
R✝ : Type u
S✝ : Type v
T : Type w
K : Type u'
inst✝⁵ : Semiring R✝
inst✝⁴ : Semiring S✝
inst✝³ : Semiring T
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
H : LocalRing S
f : R →+* S
inst✝ : IsLocalRingHom f
this : Nontrivial R
a b : R
⊢ a ∈ nonunits R → b ∈ nonunits R → a + b ∈ nonunits R
[PROOFSTEP]
simp_rw [← map_mem_nonunits_iff f, f.map_add]
[GOAL]
case h
R✝ : Type u
S✝ : Type v
T : Type w
K : Type u'
inst✝⁵ : Semiring R✝
inst✝⁴ : Semiring S✝
inst✝³ : Semiring T
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
H : LocalRing S
f : R →+* S
inst✝ : IsLocalRingHom f
this : Nontrivial R
a b : R
⊢ ↑f a ∈ nonunits S → ↑f b ∈ nonunits S → ↑f a + ↑f b ∈ nonunits S
[PROOFSTEP]
exact LocalRing.nonunits_add
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_have 1 → 2
[GOAL]
case tfae_1_to_2
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
⊢ IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
[PROOFSTEP]
rintro _ _ ⟨a, ha, rfl⟩
[GOAL]
case tfae_1_to_2.intro.intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
✝ : IsLocalRingHom f
a : R
ha : a ∈ ↑(maximalIdeal R).toAddSubmonoid
⊢ ↑f a ∈ ↑(maximalIdeal S)
[PROOFSTEP]
exact map_nonunit f a ha
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_have 2 → 4
[GOAL]
case tfae_2_to_4
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
⊢ ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
[PROOFSTEP]
exact Set.image_subset_iff.1
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_have 3 ↔ 4
[GOAL]
case tfae_3_iff_4
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
[PROOFSTEP]
exact Ideal.map_le_iff_le_comap
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_have 4 → 1
[GOAL]
case tfae_4_to_1
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
[PROOFSTEP]
intro h
[GOAL]
case tfae_4_to_1
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
h : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ IsLocalRingHom f
[PROOFSTEP]
constructor
[GOAL]
case tfae_4_to_1.map_nonunit
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
h : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ ∀ (a : R), IsUnit (↑f a) → IsUnit a
[PROOFSTEP]
exact fun x => not_imp_not.1 (@h x)
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_have 1 → 5
[GOAL]
case tfae_1_to_5
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
⊢ IsLocalRingHom f → Ideal.comap f (maximalIdeal S) = maximalIdeal R
[PROOFSTEP]
intro
[GOAL]
case tfae_1_to_5
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
✝ : IsLocalRingHom f
⊢ Ideal.comap f (maximalIdeal S) = maximalIdeal R
[PROOFSTEP]
ext
[GOAL]
case tfae_1_to_5.h
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
✝ : IsLocalRingHom f
x✝ : R
⊢ x✝ ∈ Ideal.comap f (maximalIdeal S) ↔ x✝ ∈ maximalIdeal R
[PROOFSTEP]
exact not_iff_not.2 (isUnit_map_iff f _)
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
tfae_1_to_5 : IsLocalRingHom f → Ideal.comap f (maximalIdeal S) = maximalIdeal R
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_have 5 → 4
[GOAL]
case tfae_5_to_4
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
tfae_1_to_5 : IsLocalRingHom f → Ideal.comap f (maximalIdeal S) = maximalIdeal R
⊢ Ideal.comap f (maximalIdeal S) = maximalIdeal R → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
[PROOFSTEP]
exact fun h => le_of_eq h.symm
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝³ : CommSemiring R
inst✝² : LocalRing R
inst✝¹ : CommSemiring S
inst✝ : LocalRing S
f : R →+* S
tfae_1_to_2 : IsLocalRingHom f → ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S)
tfae_2_to_4 :
  ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S) → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_3_iff_4 : Ideal.map f (maximalIdeal R) ≤ maximalIdeal S ↔ maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
tfae_4_to_1 : maximalIdeal R ≤ Ideal.comap f (maximalIdeal S) → IsLocalRingHom f
tfae_1_to_5 : IsLocalRingHom f → Ideal.comap f (maximalIdeal S) = maximalIdeal R
tfae_5_to_4 : Ideal.comap f (maximalIdeal S) = maximalIdeal R → maximalIdeal R ≤ Ideal.comap f (maximalIdeal S)
⊢ List.TFAE
    [IsLocalRingHom f, ↑f '' ↑(maximalIdeal R).toAddSubmonoid ⊆ ↑(maximalIdeal S),
      Ideal.map f (maximalIdeal R) ≤ maximalIdeal S, maximalIdeal R ≤ Ideal.comap f (maximalIdeal S),
      Ideal.comap f (maximalIdeal S) = maximalIdeal R]
[PROOFSTEP]
tfae_finish
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁴ : CommSemiring R
inst✝³ : LocalRing R
inst✝² : CommSemiring S
inst✝¹ : Nontrivial S
f : R →+* S
inst✝ : IsLocalRingHom f
hf : Function.Surjective ↑f
⊢ ∀ (a b : S), IsUnit (a + b) → IsUnit a ∨ IsUnit b
[PROOFSTEP]
intro a b hab
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁴ : CommSemiring R
inst✝³ : LocalRing R
inst✝² : CommSemiring S
inst✝¹ : Nontrivial S
f : R →+* S
inst✝ : IsLocalRingHom f
hf : Function.Surjective ↑f
a b : S
hab : IsUnit (a + b)
⊢ IsUnit a ∨ IsUnit b
[PROOFSTEP]
obtain ⟨a, rfl⟩ := hf a
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁴ : CommSemiring R
inst✝³ : LocalRing R
inst✝² : CommSemiring S
inst✝¹ : Nontrivial S
f : R →+* S
inst✝ : IsLocalRingHom f
hf : Function.Surjective ↑f
b : S
a : R
hab : IsUnit (↑f a + b)
⊢ IsUnit (↑f a) ∨ IsUnit b
[PROOFSTEP]
obtain ⟨b, rfl⟩ := hf b
[GOAL]
case intro.intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁴ : CommSemiring R
inst✝³ : LocalRing R
inst✝² : CommSemiring S
inst✝¹ : Nontrivial S
f : R →+* S
inst✝ : IsLocalRingHom f
hf : Function.Surjective ↑f
a b : R
hab : IsUnit (↑f a + ↑f b)
⊢ IsUnit (↑f a) ∨ IsUnit (↑f b)
[PROOFSTEP]
rw [← map_add] at hab
[GOAL]
case intro.intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁴ : CommSemiring R
inst✝³ : LocalRing R
inst✝² : CommSemiring S
inst✝¹ : Nontrivial S
f : R →+* S
inst✝ : IsLocalRingHom f
hf : Function.Surjective ↑f
a b : R
hab : IsUnit (↑f (a + b))
⊢ IsUnit (↑f a) ∨ IsUnit (↑f b)
[PROOFSTEP]
exact (isUnit_or_isUnit_of_isUnit_add <| IsLocalRingHom.map_nonunit _ hab).imp f.isUnit_map f.isUnit_map
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
⊢ Function.Surjective ↑(Units.map ↑f)
[PROOFSTEP]
intro a
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
a : Sˣ
⊢ ∃ a_1, ↑(Units.map ↑f) a_1 = a
[PROOFSTEP]
obtain ⟨b, hb⟩ := hf (a : S)
[GOAL]
case intro
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
a : Sˣ
b : R
hb : ↑f b = ↑a
⊢ ∃ a_1, ↑(Units.map ↑f) a_1 = a
[PROOFSTEP]
use(isUnit_of_map_unit f b (by rw [hb]; exact Units.isUnit _)).unit
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
a : Sˣ
b : R
hb : ↑f b = ↑a
⊢ IsUnit (↑f b)
[PROOFSTEP]
rw [hb]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
a : Sˣ
b : R
hb : ↑f b = ↑a
⊢ IsUnit ↑a
[PROOFSTEP]
exact Units.isUnit _
[GOAL]
case h
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
a : Sˣ
b : R
hb : ↑f b = ↑a
⊢ ↑(Units.map ↑f) (IsUnit.unit (_ : IsUnit b)) = a
[PROOFSTEP]
ext
[GOAL]
case h.a
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
hf : Function.Surjective ↑f
h : IsLocalRingHom f
a : Sˣ
b : R
hb : ↑f b = ↑a
⊢ ↑(↑(Units.map ↑f) (IsUnit.unit (_ : IsUnit b))) = ↑a
[PROOFSTEP]
exact hb
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁶ : CommRing R
inst✝⁵ : LocalRing R
inst✝⁴ : CommRing S
inst✝³ : LocalRing S
inst✝² : CommRing T
inst✝¹ : LocalRing T
f : R →+* S
inst✝ : IsLocalRingHom f
a : R
ha : a ∈ maximalIdeal R
⊢ ↑(RingHom.comp (Ideal.Quotient.mk (maximalIdeal S)) f) a = 0
[PROOFSTEP]
erw [Ideal.Quotient.eq_zero_iff_mem]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁶ : CommRing R
inst✝⁵ : LocalRing R
inst✝⁴ : CommRing S
inst✝³ : LocalRing S
inst✝² : CommRing T
inst✝¹ : LocalRing T
f : R →+* S
inst✝ : IsLocalRingHom f
a : R
ha : a ∈ maximalIdeal R
⊢ ↑f a ∈ maximalIdeal S
[PROOFSTEP]
exact map_nonunit f a ha
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
f : R ≃+* S
x : ResidueField R
⊢ ↑(map ↑(RingEquiv.symm f)) (↑(map ↑f) x) = x
[PROOFSTEP]
simp only [map_map, RingEquiv.symm_comp, map_id, RingHom.id_apply]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
f : R ≃+* S
x : ResidueField S
⊢ ↑(map ↑f) (↑(map ↑(RingEquiv.symm f)) x) = x
[PROOFSTEP]
simp only [map_map, RingEquiv.comp_symm, map_id, RingHom.id_apply]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
⊢ IsLocalRingHom (residue R)
[PROOFSTEP]
constructor
[GOAL]
case map_nonunit
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
⊢ ∀ (a : R), IsUnit (↑(residue R) a) → IsUnit a
[PROOFSTEP]
intro a ha
[GOAL]
case map_nonunit
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
a : R
ha : IsUnit (↑(residue R) a)
⊢ IsUnit a
[PROOFSTEP]
by_contra h
[GOAL]
case map_nonunit
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
a : R
ha : IsUnit (↑(residue R) a)
h : ¬IsUnit a
⊢ False
[PROOFSTEP]
erw [Ideal.Quotient.eq_zero_iff_mem.mpr ((LocalRing.mem_maximalIdeal _).mpr h)] at ha
[GOAL]
case map_nonunit
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝⁵ : CommRing R
inst✝⁴ : LocalRing R
inst✝³ : CommRing S
inst✝² : LocalRing S
inst✝¹ : CommRing T
inst✝ : LocalRing T
a : R
ha : IsUnit 0
h : ¬IsUnit a
⊢ False
[PROOFSTEP]
exact ha.ne_zero rfl
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : Field K
a : K
h : a = 0
⊢ IsUnit (1 - a)
[PROOFSTEP]
rw [h, sub_zero]
[GOAL]
R : Type u
S : Type v
T : Type w
K : Type u'
inst✝ : Field K
a : K
h : a = 0
⊢ IsUnit 1
[PROOFSTEP]
exact isUnit_one


[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
terminated_at_n : TerminatedAt g n
⊢ continuantsAux g (n + 2) = continuantsAux g (n + 1)
[PROOFSTEP]
rw [terminatedAt_iff_s_none] at terminated_at_n
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
terminated_at_n : Stream'.Seq.get? g.s n = none
⊢ continuantsAux g (n + 2) = continuantsAux g (n + 1)
[PROOFSTEP]
simp only [continuantsAux, Nat.add_eq, add_zero, terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_lt_m : n < m
terminated_at_n : TerminatedAt g n
⊢ continuantsAux g m = continuantsAux g (n + 1)
[PROOFSTEP]
refine' Nat.le_induction rfl (fun k hnk hk => _) _ n_lt_m
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_lt_m : n < m
terminated_at_n : TerminatedAt g n
k : ℕ
hnk : Nat.succ n ≤ k
hk : continuantsAux g k = continuantsAux g (n + 1)
⊢ continuantsAux g (k + 1) = continuantsAux g (n + 1)
[PROOFSTEP]
rcases Nat.exists_eq_add_of_lt hnk with ⟨k, rfl⟩
[GOAL]
case intro
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_lt_m : n < m
terminated_at_n : TerminatedAt g n
k : ℕ
hnk : Nat.succ n ≤ n + k + 1
hk : continuantsAux g (n + k + 1) = continuantsAux g (n + 1)
⊢ continuantsAux g (n + k + 1 + 1) = continuantsAux g (n + 1)
[PROOFSTEP]
refine' (continuantsAux_stable_step_of_terminated _).trans hk
[GOAL]
case intro
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_lt_m : n < m
terminated_at_n : TerminatedAt g n
k : ℕ
hnk : Nat.succ n ≤ n + k + 1
hk : continuantsAux g (n + k + 1) = continuantsAux g (n + 1)
⊢ TerminatedAt g (n + k)
[PROOFSTEP]
exact terminated_stable (Nat.le_add_right _ _) terminated_at_n
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.TerminatedAt s n
⊢ convergents'Aux s (n + 1) = convergents'Aux s n
[PROOFSTEP]
change s.get? n = none at terminated_at_n
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s n = none
⊢ convergents'Aux s (n + 1) = convergents'Aux s n
[PROOFSTEP]
induction' n with n IH generalizing s
[GOAL]
case zero
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n = none
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s Nat.zero = none
⊢ convergents'Aux s (Nat.zero + 1) = convergents'Aux s Nat.zero
case succ
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case zero => simp only [convergents'Aux, terminated_at_n, Stream'.Seq.head]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n = none
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s Nat.zero = none
⊢ convergents'Aux s (Nat.zero + 1) = convergents'Aux s Nat.zero
[PROOFSTEP]
case zero => simp only [convergents'Aux, terminated_at_n, Stream'.Seq.head]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n = none
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s Nat.zero = none
⊢ convergents'Aux s (Nat.zero + 1) = convergents'Aux s Nat.zero
[PROOFSTEP]
simp only [convergents'Aux, terminated_at_n, Stream'.Seq.head]
[GOAL]
case succ
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case succ =>
  cases' s_head_eq : s.head with gp_head
  case none => simp only [convergents'Aux, s_head_eq]
  case
    some =>
    have : s.tail.TerminatedAt n := by simp only [Stream'.Seq.TerminatedAt, s.get?_tail, terminated_at_n]
    have := IH this
    rw [convergents'Aux] at this
    simp [this, Nat.add_eq, add_zero, convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case succ =>
  cases' s_head_eq : s.head with gp_head
  case none => simp only [convergents'Aux, s_head_eq]
  case
    some =>
    have : s.tail.TerminatedAt n := by simp only [Stream'.Seq.TerminatedAt, s.get?_tail, terminated_at_n]
    have := IH this
    rw [convergents'Aux] at this
    simp [this, Nat.add_eq, add_zero, convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
cases' s_head_eq : s.head with gp_head
[GOAL]
case none
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
s_head_eq : Stream'.Seq.head s = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
case some
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case none => simp only [convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
s_head_eq : Stream'.Seq.head s = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case none => simp only [convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
s_head_eq : Stream'.Seq.head s = none
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
simp only [convergents'Aux, s_head_eq]
[GOAL]
case some
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case
  some =>
  have : s.tail.TerminatedAt n := by simp only [Stream'.Seq.TerminatedAt, s.get?_tail, terminated_at_n]
  have := IH this
  rw [convergents'Aux] at this
  simp [this, Nat.add_eq, add_zero, convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
case
  some =>
  have : s.tail.TerminatedAt n := by simp only [Stream'.Seq.TerminatedAt, s.get?_tail, terminated_at_n]
  have := IH this
  rw [convergents'Aux] at this
  simp [this, Nat.add_eq, add_zero, convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
have : s.tail.TerminatedAt n := by simp only [Stream'.Seq.TerminatedAt, s.get?_tail, terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
⊢ Stream'.Seq.TerminatedAt (Stream'.Seq.tail s) n
[PROOFSTEP]
simp only [Stream'.Seq.TerminatedAt, s.get?_tail, terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
this : Stream'.Seq.TerminatedAt (Stream'.Seq.tail s) n
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
have := IH this
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
this✝ : Stream'.Seq.TerminatedAt (Stream'.Seq.tail s) n
this : convergents'Aux (Stream'.Seq.tail s) (n + 1) = convergents'Aux (Stream'.Seq.tail s) n
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
rw [convergents'Aux] at this
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n✝ m : ℕ
inst✝ : DivisionRing K
s✝ : Stream'.Seq (Pair K)
terminated_at_n✝ : Stream'.Seq.get? s✝ n✝ = none
n : ℕ
IH : ∀ {s : Stream'.Seq (Pair K)}, Stream'.Seq.get? s n = none → convergents'Aux s (n + 1) = convergents'Aux s n
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.get? s (Nat.succ n) = none
gp_head : Pair K
s_head_eq : Stream'.Seq.head s = some gp_head
this✝ : Stream'.Seq.TerminatedAt (Stream'.Seq.tail s) n
this :
  (match Stream'.Seq.head (Stream'.Seq.tail s) with
    | none => 0
    | some gp => gp.a / (gp.b + convergents'Aux (Stream'.Seq.tail (Stream'.Seq.tail s)) n)) =
    convergents'Aux (Stream'.Seq.tail s) n
⊢ convergents'Aux s (Nat.succ n + 1) = convergents'Aux s (Nat.succ n)
[PROOFSTEP]
simp [this, Nat.add_eq, add_zero, convergents'Aux, s_head_eq]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s : Stream'.Seq (Pair K)
n_le_m : n ≤ m
terminated_at_n : Stream'.Seq.TerminatedAt s n
⊢ convergents'Aux s m = convergents'Aux s n
[PROOFSTEP]
induction' n_le_m with m n_le_m IH
[GOAL]
case refl
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.TerminatedAt s n
⊢ convergents'Aux s n = convergents'Aux s n
[PROOFSTEP]
rfl
[GOAL]
case step
K : Type u_1
g : GeneralizedContinuedFraction K
n m✝ : ℕ
inst✝ : DivisionRing K
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.TerminatedAt s n
m : ℕ
n_le_m : Nat.le n m
IH : convergents'Aux s m = convergents'Aux s n
⊢ convergents'Aux s (Nat.succ m) = convergents'Aux s n
[PROOFSTEP]
refine' (convergents'Aux_stable_step_of_terminated _).trans IH
[GOAL]
case step
K : Type u_1
g : GeneralizedContinuedFraction K
n m✝ : ℕ
inst✝ : DivisionRing K
s : Stream'.Seq (Pair K)
terminated_at_n : Stream'.Seq.TerminatedAt s n
m : ℕ
n_le_m : Nat.le n m
IH : convergents'Aux s m = convergents'Aux s n
⊢ Stream'.Seq.TerminatedAt s m
[PROOFSTEP]
exact s.terminated_stable n_le_m terminated_at_n
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_le_m : n ≤ m
terminated_at_n : TerminatedAt g n
⊢ continuants g m = continuants g n
[PROOFSTEP]
simp only [nth_cont_eq_succ_nth_cont_aux,
  continuantsAux_stable_of_terminated (Nat.pred_le_iff.mp n_le_m) terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_le_m : n ≤ m
terminated_at_n : TerminatedAt g n
⊢ numerators g m = numerators g n
[PROOFSTEP]
simp only [num_eq_conts_a, continuants_stable_of_terminated n_le_m terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_le_m : n ≤ m
terminated_at_n : TerminatedAt g n
⊢ denominators g m = denominators g n
[PROOFSTEP]
simp only [denom_eq_conts_b, continuants_stable_of_terminated n_le_m terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_le_m : n ≤ m
terminated_at_n : TerminatedAt g n
⊢ convergents g m = convergents g n
[PROOFSTEP]
simp only [convergents, denominators_stable_of_terminated n_le_m terminated_at_n,
  numerators_stable_of_terminated n_le_m terminated_at_n]
[GOAL]
K : Type u_1
g : GeneralizedContinuedFraction K
n m : ℕ
inst✝ : DivisionRing K
n_le_m : n ≤ m
terminated_at_n : TerminatedAt g n
⊢ convergents' g m = convergents' g n
[PROOFSTEP]
simp only [convergents', convergents'Aux_stable_of_terminated n_le_m terminated_at_n]


[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
⊢ Injective toFun
[PROOFSTEP]
rintro ⟨f₁, f₂, hf⟩ ⟨g₁, g₂, hg⟩ (rfl : f₁ = g₁)
[GOAL]
case mk.mk
α : Type u
β : Type v
γ : Type w
δ : Type x
f₁ : α → Option β
f₂ : β → Option α
hf : ∀ (a : α) (b : β), a ∈ f₂ b ↔ b ∈ f₁ a
g₂ : β → Option α
hg : ∀ (a : α) (b : β), a ∈ g₂ b ↔ b ∈ f₁ a
⊢ { toFun := f₁, invFun := f₂, inv := hf } = { toFun := f₁, invFun := g₂, inv := hg }
[PROOFSTEP]
congr with y x
[GOAL]
case mk.mk.e_invFun.h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f₁ : α → Option β
f₂ : β → Option α
hf : ∀ (a : α) (b : β), a ∈ f₂ b ↔ b ∈ f₁ a
g₂ : β → Option α
hg : ∀ (a : α) (b : β), a ∈ g₂ b ↔ b ∈ f₁ a
y : β
x : α
⊢ x ∈ f₂ y ↔ x ∈ g₂ y
[PROOFSTEP]
simp only [hf, hg]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
g : β ≃. γ
a : α
b : γ
⊢ a ∈ (fun a => Option.bind (↑(PEquiv.symm g) a) ↑(PEquiv.symm f)) b ↔ b ∈ (fun a => Option.bind (↑f a) ↑g) a
[PROOFSTEP]
simp_all [and_comm, eq_some_iff f, eq_some_iff g]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.symm (PEquiv.symm f) = f
[PROOFSTEP]
cases f
[GOAL]
case mk
α : Type u
β : Type v
γ : Type w
δ : Type x
toFun✝ : α → Option β
invFun✝ : β → Option α
inv✝ : ∀ (a : α) (b : β), a ∈ invFun✝ b ↔ b ∈ toFun✝ a
⊢ PEquiv.symm (PEquiv.symm { toFun := toFun✝, invFun := invFun✝, inv := inv✝ }) =
    { toFun := toFun✝, invFun := invFun✝, inv := inv✝ }
[PROOFSTEP]
rfl
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
g : β ≃. γ
a : α
⊢ ↑(PEquiv.trans f g) a = none ↔ ∀ (b : β) (c : γ), ¬b ∈ ↑f a ∨ ¬c ∈ ↑g b
[PROOFSTEP]
simp only [eq_none_iff_forall_not_mem, mem_trans, imp_iff_not_or.symm]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
g : β ≃. γ
a : α
⊢ (∀ (a_1 : γ), ¬∃ b, b ∈ ↑f a ∧ a_1 ∈ ↑g b) ↔ ∀ (b : β) (c : γ), b ∈ ↑f a → ¬c ∈ ↑g b
[PROOFSTEP]
push_neg
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
g : β ≃. γ
a : α
⊢ (∀ (a_1 : γ) (b : β), b ∈ ↑f a → ¬a_1 ∈ ↑g b) ↔ ∀ (b : β) (c : γ), b ∈ ↑f a → ¬c ∈ ↑g b
[PROOFSTEP]
exact forall_swap
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.trans (PEquiv.refl α) f = f
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ : α
a✝ : β
⊢ a✝ ∈ ↑(PEquiv.trans (PEquiv.refl α) f) x✝ ↔ a✝ ∈ ↑f x✝
[PROOFSTEP]
dsimp [PEquiv.trans]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ : α
a✝ : β
⊢ a✝ ∈ ↑f x✝ ↔ a✝ ∈ ↑f x✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.trans f (PEquiv.refl β) = f
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ : α
a✝ : β
⊢ a✝ ∈ ↑(PEquiv.trans f (PEquiv.refl β)) x✝ ↔ a✝ ∈ ↑f x✝
[PROOFSTEP]
dsimp [PEquiv.trans]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ : α
a✝ : β
⊢ a✝ ∈ Option.bind (↑f x✝) ↑(PEquiv.refl β) ↔ a✝ ∈ ↑f x✝
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₁ a₂ : α
b : β
h₁ : b ∈ ↑f a₁
h₂ : b ∈ ↑f a₂
⊢ a₁ = a₂
[PROOFSTEP]
rw [← mem_iff_mem] at *
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₁ a₂ : α
b : β
h₁ : a₁ ∈ ↑(PEquiv.symm f) b
h₂ : a₂ ∈ ↑(PEquiv.symm f) b
⊢ a₁ = a₂
[PROOFSTEP]
cases h : f.symm b
[GOAL]
case none
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₁ a₂ : α
b : β
h₁ : a₁ ∈ ↑(PEquiv.symm f) b
h₂ : a₂ ∈ ↑(PEquiv.symm f) b
h : ↑(PEquiv.symm f) b = none
⊢ a₁ = a₂
[PROOFSTEP]
simp_all
[GOAL]
case some
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₁ a₂ : α
b : β
h₁ : a₁ ∈ ↑(PEquiv.symm f) b
h₂ : a₂ ∈ ↑(PEquiv.symm f) b
val✝ : α
h : ↑(PEquiv.symm f) b = some val✝
⊢ a₁ = a₂
[PROOFSTEP]
simp_all
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
⊢ (fun b => Option.recOn b a₂ fun b' => Option.recOn (↑(PEquiv.symm f) b') a₂ id) (↑f x) = x
[PROOFSTEP]
classical
cases hfx : f x
· have : x = a₂ := not_imp_comm.1 (h x) (hfx.symm ▸ by simp)
  simp [this]
· dsimp only
  rw [(eq_some_iff f).2 hfx]
  rfl
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
⊢ (fun b => Option.recOn b a₂ fun b' => Option.recOn (↑(PEquiv.symm f) b') a₂ id) (↑f x) = x
[PROOFSTEP]
cases hfx : f x
[GOAL]
case none
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
hfx : ↑f x = none
⊢ (fun b => Option.recOn b a₂ fun b' => Option.recOn (↑(PEquiv.symm f) b') a₂ id) none = x
[PROOFSTEP]
have : x = a₂ := not_imp_comm.1 (h x) (hfx.symm ▸ by simp)
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
hfx : ↑f x = none
⊢ ¬isSome none = true
[PROOFSTEP]
simp
[GOAL]
case none
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
hfx : ↑f x = none
this : x = a₂
⊢ (fun b => Option.recOn b a₂ fun b' => Option.recOn (↑(PEquiv.symm f) b') a₂ id) none = x
[PROOFSTEP]
simp [this]
[GOAL]
case some
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
val✝ : β
hfx : ↑f x = some val✝
⊢ (fun b => Option.recOn b a₂ fun b' => Option.recOn (↑(PEquiv.symm f) b') a₂ id) (some val✝) = x
[PROOFSTEP]
dsimp only
[GOAL]
case some
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
val✝ : β
hfx : ↑f x = some val✝
⊢ Option.rec a₂ id (↑(PEquiv.symm f) val✝) = x
[PROOFSTEP]
rw [(eq_some_iff f).2 hfx]
[GOAL]
case some
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a₂ : α
h : ∀ (a₁ : α), a₁ ≠ a₂ → isSome (↑f a₁) = true
x : α
val✝ : β
hfx : ↑f x = some val✝
⊢ Option.rec a₂ id (some x) = x
[PROOFSTEP]
rfl
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
⊢ a ∈ (fun a => if a ∈ s then some a else none) b ↔ b ∈ (fun a => if a ∈ s then some a else none) a
[PROOFSTEP]
dsimp only
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
⊢ (a ∈ if b ∈ s then some b else none) ↔ b ∈ if a ∈ s then some a else none
[PROOFSTEP]
split_ifs with hb ha ha
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
hb : b ∈ s
ha : a ∈ s
⊢ a ∈ some b ↔ b ∈ some a
[PROOFSTEP]
simp [eq_comm]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
hb : b ∈ s
ha : ¬a ∈ s
⊢ a ∈ some b ↔ b ∈ none
[PROOFSTEP]
simp [ne_of_mem_of_not_mem hb ha]
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
hb : ¬b ∈ s
ha : a ∈ s
⊢ a ∈ none ↔ b ∈ some a
[PROOFSTEP]
simp [ne_of_mem_of_not_mem ha hb]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
hb : ¬b ∈ s
ha : ¬a ∈ s
⊢ a ∈ none ↔ b ∈ none
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a : α
⊢ a ∈ ↑(ofSet s) a ↔ a ∈ s
[PROOFSTEP]
dsimp [ofSet]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a : α
⊢ (a ∈ if a ∈ s then some a else none) ↔ a ∈ s
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a : α
h✝ : a ∈ s
⊢ a ∈ some a ↔ a ∈ s
[PROOFSTEP]
simp [*]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a : α
h✝ : ¬a ∈ s
⊢ a ∈ none ↔ a ∈ s
[PROOFSTEP]
simp [*]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
⊢ a ∈ ↑(ofSet s) b ↔ a = b ∧ a ∈ s
[PROOFSTEP]
dsimp [ofSet]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
⊢ (a ∈ if b ∈ s then some b else none) ↔ a = b ∧ a ∈ s
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
h : b ∈ s
⊢ a ∈ some b ↔ a = b ∧ a ∈ s
[PROOFSTEP]
simp only [mem_def, eq_comm, some.injEq, iff_self_and]
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
h : b ∈ s
⊢ a = b → a ∈ s
[PROOFSTEP]
rintro rfl
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a : α
h : a ∈ s
⊢ a ∈ s
[PROOFSTEP]
exact h
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
h : ¬b ∈ s
⊢ a ∈ none ↔ a = b ∧ a ∈ s
[PROOFSTEP]
simp only [mem_def, false_iff, not_and]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a b : α
h : ¬b ∈ s
⊢ a = b → ¬a ∈ s
[PROOFSTEP]
rintro rfl
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
a : α
h : ¬a ∈ s
⊢ ¬a ∈ s
[PROOFSTEP]
exact h
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
h : ofSet s = PEquiv.refl α
⊢ s = Set.univ
[PROOFSTEP]
rw [Set.eq_univ_iff_forall]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
h : ofSet s = PEquiv.refl α
⊢ ∀ (x : α), x ∈ s
[PROOFSTEP]
intro
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
h : ofSet s = PEquiv.refl α
x✝ : α
⊢ x✝ ∈ s
[PROOFSTEP]
rw [← mem_ofSet_self_iff, h]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
h : ofSet s = PEquiv.refl α
x✝ : α
⊢ x✝ ∈ ↑(PEquiv.refl α) x✝
[PROOFSTEP]
exact rfl
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
s✝ : Set α
inst✝¹ : DecidablePred fun x => x ∈ s✝
s : Set α
inst✝ : DecidablePred fun x => x ∈ s
h : s = Set.univ
⊢ ofSet s = PEquiv.refl α
[PROOFSTEP]
simp only [← ofSet_univ, h]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.trans f (PEquiv.symm f) = ofSet {a | isSome (↑f a) = true}
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ a✝ : α
⊢ a✝ ∈ ↑(PEquiv.trans f (PEquiv.symm f)) x✝ ↔ a✝ ∈ ↑(ofSet {a | isSome (↑f a) = true}) x✝
[PROOFSTEP]
dsimp [PEquiv.trans]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ a✝ : α
⊢ a✝ ∈ Option.bind (↑f x✝) ↑(PEquiv.symm f) ↔ a✝ ∈ ↑(ofSet {a | isSome (↑f a) = true}) x✝
[PROOFSTEP]
simp only [eq_some_iff f, Option.isSome_iff_exists, Option.mem_def, bind_eq_some', ofSet_eq_some_iff]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ a✝ : α
⊢ (∃ a, ↑f x✝ = some a ∧ ↑f a✝ = some a) ↔ a✝ = x✝ ∧ a✝ ∈ {a | ∃ a_1, ↑f a = some a_1}
[PROOFSTEP]
constructor
[GOAL]
case h.a.mp
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ a✝ : α
⊢ (∃ a, ↑f x✝ = some a ∧ ↑f a✝ = some a) → a✝ = x✝ ∧ a✝ ∈ {a | ∃ a_1, ↑f a = some a_1}
[PROOFSTEP]
rintro ⟨b, hb₁, hb₂⟩
[GOAL]
case h.a.mp.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ a✝ : α
b : β
hb₁ : ↑f x✝ = some b
hb₂ : ↑f a✝ = some b
⊢ a✝ = x✝ ∧ a✝ ∈ {a | ∃ a_1, ↑f a = some a_1}
[PROOFSTEP]
exact ⟨PEquiv.inj _ hb₂ hb₁, b, hb₂⟩
[GOAL]
case h.a.mpr
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ a✝ : α
⊢ a✝ = x✝ ∧ a✝ ∈ {a | ∃ a_1, ↑f a = some a_1} → ∃ a, ↑f x✝ = some a ∧ ↑f a✝ = some a
[PROOFSTEP]
simp (config := { contextual := true })
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.symm (PEquiv.trans (PEquiv.symm f) f) = PEquiv.symm (ofSet {b | isSome (↑(PEquiv.symm f) b) = true})
[PROOFSTEP]
simp [symm_trans_rev, self_trans_symm, -symm_symm]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.trans f (PEquiv.symm f) = PEquiv.refl α ↔ ∀ (a : α), isSome (↑f a) = true
[PROOFSTEP]
rw [self_trans_symm, ofSet_eq_refl, Set.eq_univ_iff_forall]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ (∀ (x : α), x ∈ {a | isSome (↑f a) = true}) ↔ ∀ (a : α), isSome (↑f a) = true
[PROOFSTEP]
rfl
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
⊢ ∀ (a : α) (b : β), a ∈ (fun x => none) b ↔ b ∈ (fun x => none) a
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
⊢ PEquiv.trans f ⊥ = ⊥
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ : α
a✝ : γ
⊢ a✝ ∈ ↑(PEquiv.trans f ⊥) x✝ ↔ a✝ ∈ ↑⊥ x✝
[PROOFSTEP]
dsimp [PEquiv.trans]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
x✝ : α
a✝ : γ
⊢ a✝ ∈ Option.bind (↑f x✝) ↑⊥ ↔ a✝ ∈ none
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : β ≃. γ
⊢ PEquiv.trans ⊥ f = ⊥
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : β ≃. γ
x✝ : α
a✝ : γ
⊢ a✝ ∈ ↑(PEquiv.trans ⊥ f) x✝ ↔ a✝ ∈ ↑⊥ x✝
[PROOFSTEP]
dsimp [PEquiv.trans]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
f : β ≃. γ
x✝ : α
a✝ : γ
⊢ a✝ ∈ none ↔ a✝ ∈ none
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f : α ≃. β
a : α
h : isSome (↑f a) = true
⊢ ↑(PEquiv.symm f) (Option.get (↑f a) h) = some a
[PROOFSTEP]
rw [f.eq_some_iff, some_get]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
⊢ x ∈ (fun x => if x = b then some a else none) y ↔ y ∈ (fun x => if x = a then some b else none) x
[PROOFSTEP]
dsimp only
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
⊢ (x ∈ if y = b then some a else none) ↔ y ∈ if x = a then some b else none
[PROOFSTEP]
split_ifs with h1 h2
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
h1 : y = b
h2 : x = a
⊢ x ∈ some a ↔ y ∈ some b
[PROOFSTEP]
simp [*]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
h1 : y = b
h2 : ¬x = a
⊢ x ∈ some a ↔ y ∈ none
[PROOFSTEP]
simp only [mem_def, some.injEq, iff_false] at *
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
h1 : y = b
h2 : ¬x = a
⊢ ¬a = x
[PROOFSTEP]
exact Ne.symm h2
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
h1 : ¬y = b
h✝ : x = a
⊢ x ∈ none ↔ y ∈ some b
[PROOFSTEP]
simp only [mem_def, some.injEq, false_iff] at *
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
h1 : ¬y = b
h✝ : x = a
⊢ ¬b = y
[PROOFSTEP]
exact Ne.symm h1
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
x : α
y : β
h1 : ¬y = b
h✝ : ¬x = a
⊢ x ∈ none ↔ y ∈ none
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a₁ a₂ : α
b₁ b₂ : β
⊢ b₁ ∈ ↑(single a₂ b₂) a₁ ↔ a₁ = a₂ ∧ b₁ = b₂
[PROOFSTEP]
dsimp [single]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a₁ a₂ : α
b₁ b₂ : β
⊢ (b₁ ∈ if a₁ = a₂ then some b₂ else none) ↔ a₁ = a₂ ∧ b₁ = b₂
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a₁ a₂ : α
b₁ b₂ : β
h✝ : a₁ = a₂
⊢ b₁ ∈ some b₂ ↔ a₁ = a₂ ∧ b₁ = b₂
[PROOFSTEP]
simp [*, eq_comm]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a₁ a₂ : α
b₁ b₂ : β
h✝ : ¬a₁ = a₂
⊢ b₁ ∈ none ↔ a₁ = a₂ ∧ b₁ = b₂
[PROOFSTEP]
simp [*, eq_comm]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
c : γ
f : β ≃. γ
h : c ∈ ↑f b
⊢ PEquiv.trans (single a b) f = single a c
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
c : γ
f : β ≃. γ
h : c ∈ ↑f b
x✝ : α
a✝ : γ
⊢ a✝ ∈ ↑(PEquiv.trans (single a b) f) x✝ ↔ a✝ ∈ ↑(single a c) x✝
[PROOFSTEP]
dsimp [single, PEquiv.trans]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
c : γ
f : β ≃. γ
h : c ∈ ↑f b
x✝ : α
a✝ : γ
⊢ a✝ ∈ Option.bind (if x✝ = a then some b else none) ↑f ↔ a✝ ∈ if x✝ = a then some c else none
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
c : γ
f : β ≃. γ
h : c ∈ ↑f b
x✝ : α
a✝ : γ
h✝ : x✝ = a
⊢ a✝ ∈ Option.bind (some b) ↑f ↔ a✝ ∈ some c
[PROOFSTEP]
simp_all
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
a : α
b : β
c : γ
f : β ≃. γ
h : c ∈ ↑f b
x✝ : α
a✝ : γ
h✝ : ¬x✝ = a
⊢ a✝ ∈ Option.bind none ↑f ↔ a✝ ∈ none
[PROOFSTEP]
simp_all
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : DecidableEq γ
inst✝ : Subsingleton α
a b : α
⊢ single a b = PEquiv.refl α
[PROOFSTEP]
ext i j
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : DecidableEq γ
inst✝ : Subsingleton α
a b i j : α
⊢ j ∈ ↑(single a b) i ↔ j ∈ ↑(PEquiv.refl α) i
[PROOFSTEP]
dsimp [single]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : DecidableEq γ
inst✝ : Subsingleton α
a b i j : α
⊢ (j ∈ if i = a then some b else none) ↔ j ∈ some i
[PROOFSTEP]
rw [if_pos (Subsingleton.elim i a), Subsingleton.elim i j, Subsingleton.elim b j]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
h : ↑(PEquiv.symm f) b = none
⊢ PEquiv.trans f (single b c) = ⊥
[PROOFSTEP]
ext
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
h : ↑(PEquiv.symm f) b = none
x✝ : δ
a✝ : γ
⊢ a✝ ∈ ↑(PEquiv.trans f (single b c)) x✝ ↔ a✝ ∈ ↑⊥ x✝
[PROOFSTEP]
simp only [eq_none_iff_forall_not_mem, Option.mem_def, f.eq_some_iff] at h
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
x✝ : δ
a✝ : γ
h : ∀ (a : δ), ¬↑f a = some b
⊢ a✝ ∈ ↑(PEquiv.trans f (single b c)) x✝ ↔ a✝ ∈ ↑⊥ x✝
[PROOFSTEP]
dsimp [PEquiv.trans, single]
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
x✝ : δ
a✝ : γ
h : ∀ (a : δ), ¬↑f a = some b
⊢ (a✝ ∈ Option.bind (↑f x✝) fun x => if x = b then some c else none) ↔ a✝ ∈ none
[PROOFSTEP]
simp
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
x✝ : δ
a✝ : γ
h : ∀ (a : δ), ¬↑f a = some b
⊢ ∀ (x : β), ↑f x✝ = some x → ¬(if x = b then some c else none) = some a✝
[PROOFSTEP]
intros
[GOAL]
case h.a
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
x✝¹ : δ
a✝¹ : γ
h : ∀ (a : δ), ¬↑f a = some b
x✝ : β
a✝ : ↑f x✝¹ = some x✝
⊢ ¬(if x✝ = b then some c else none) = some a✝¹
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
x✝¹ : δ
a✝¹ : γ
h : ∀ (a : δ), ¬↑f a = some b
x✝ : β
a✝ : ↑f x✝¹ = some x✝
h✝ : x✝ = b
⊢ ¬some c = some a✝¹
[PROOFSTEP]
simp_all
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : DecidableEq γ
b : β
c : γ
f : δ ≃. β
x✝¹ : δ
a✝¹ : γ
h : ∀ (a : δ), ¬↑f a = some b
x✝ : β
a✝ : ↑f x✝¹ = some x✝
h✝ : ¬x✝ = b
⊢ ¬False
[PROOFSTEP]
simp_all
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f g : α ≃. β
fg : f ≤ g
gf : g ≤ f
⊢ ∀ (x : α), ↑f x = ↑g x
[PROOFSTEP]
intro a
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
f g : α ≃. β
fg : f ≤ g
gf : g ≤ f
a : α
⊢ ↑f a = ↑g a
[PROOFSTEP]
cases' h : g a with b
[GOAL]
case none
α : Type u
β : Type v
γ : Type w
δ : Type x
f g : α ≃. β
fg : f ≤ g
gf : g ≤ f
a : α
h : ↑g a = none
⊢ ↑f a = none
[PROOFSTEP]
exact eq_none_iff_forall_not_mem.2 fun b hb => Option.not_mem_none b <| h ▸ fg a b hb
[GOAL]
case some
α : Type u
β : Type v
γ : Type w
δ : Type x
f g : α ≃. β
fg : f ≤ g
gf : g ≤ f
a : α
b : β
h : ↑g a = some b
⊢ ↑f a = some b
[PROOFSTEP]
exact gf _ _ h
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
⊢ a ∈ (fun b => if ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b then ↑(PEquiv.symm f) b else none) b ↔
    b ∈ (fun a => if ↑f a = ↑g a then ↑f a else none) a
[PROOFSTEP]
have hf := @mem_iff_mem _ _ f a b
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : a ∈ ↑(PEquiv.symm f) b ↔ b ∈ ↑f a
⊢ a ∈ (fun b => if ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b then ↑(PEquiv.symm f) b else none) b ↔
    b ∈ (fun a => if ↑f a = ↑g a then ↑f a else none) a
[PROOFSTEP]
have hg := @mem_iff_mem _ _ g a b
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : a ∈ ↑(PEquiv.symm f) b ↔ b ∈ ↑f a
hg : a ∈ ↑(PEquiv.symm g) b ↔ b ∈ ↑g a
⊢ a ∈ (fun b => if ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b then ↑(PEquiv.symm f) b else none) b ↔
    b ∈ (fun a => if ↑f a = ↑g a then ↑f a else none) a
[PROOFSTEP]
simp only [Option.mem_def] at *
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
⊢ (if ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b then ↑(PEquiv.symm f) b else none) = some a ↔
    (if ↑f a = ↑g a then ↑f a else none) = some b
[PROOFSTEP]
split_ifs with h1 h2 h2
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = ↑g a
⊢ ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
[PROOFSTEP]
try simp [hf]
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = ↑g a
⊢ ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
[PROOFSTEP]
simp [hf]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ¬↑f a = ↑g a
⊢ ↑(PEquiv.symm f) b = some a ↔ False
[PROOFSTEP]
try simp [hf]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ¬↑f a = ↑g a
⊢ ↑(PEquiv.symm f) b = some a ↔ False
[PROOFSTEP]
simp [hf]
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ¬↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = ↑g a
⊢ False ↔ ↑f a = some b
[PROOFSTEP]
try simp [hf]
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ¬↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = ↑g a
⊢ False ↔ ↑f a = some b
[PROOFSTEP]
simp [hf]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ¬↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ¬↑f a = ↑g a
⊢ False ↔ False
[PROOFSTEP]
try simp [hf]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ¬↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ¬↑f a = ↑g a
⊢ False ↔ False
[PROOFSTEP]
simp [hf]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ¬↑f a = ↑g a
⊢ ¬↑f a = some b
[PROOFSTEP]
contrapose! h2
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = some b
⊢ ↑f a = ↑g a
[PROOFSTEP]
rw [h2]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = some b
⊢ some b = ↑g a
[PROOFSTEP]
rw [← h1, hf, h2] at hg
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : some b = some b ↔ ↑g a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = some b
⊢ some b = ↑g a
[PROOFSTEP]
simp only [mem_def, true_iff_iff, eq_self_iff_true] at hg
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
h1 : ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = some b
hg : ↑g a = some b
⊢ some b = ↑g a
[PROOFSTEP]
rw [hg]
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h1 : ¬↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
h2 : ↑f a = ↑g a
⊢ ¬↑f a = some b
[PROOFSTEP]
contrapose! h1
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ ↑f a = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h2 : ↑f a = ↑g a
h1 : ↑f a = some b
⊢ ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
[PROOFSTEP]
rw [h1] at hf h2
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ some b = some b
hg : ↑(PEquiv.symm g) b = some a ↔ ↑g a = some b
h2 : some b = ↑g a
h1 : ↑f a = some b
⊢ ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
[PROOFSTEP]
rw [← h2] at hg
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
hf : ↑(PEquiv.symm f) b = some a ↔ some b = some b
hg : ↑(PEquiv.symm g) b = some a ↔ some b = some b
h2 : some b = ↑g a
h1 : ↑f a = some b
⊢ ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
[PROOFSTEP]
simp only [iff_true] at hf hg
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g : α ≃. β
a : α
b : β
h2 : some b = ↑g a
h1 : ↑f a = some b
hf : ↑(PEquiv.symm f) b = some a
hg : ↑(PEquiv.symm g) b = some a
⊢ ↑(PEquiv.symm f) b = ↑(PEquiv.symm g) b
[PROOFSTEP]
rw [hf, hg]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
⊢ x✝ ∈ ↑(x✝³ ⊓ x✝²) x✝¹ → x✝ ∈ ↑x✝³ x✝¹
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
⊢ (if ↑x✝³ x✝¹ = ↑x✝² x✝¹ then ↑x✝³ x✝¹ else none) = some x✝ → ↑x✝³ x✝¹ = some x✝
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
h✝ : ↑x✝³ x✝¹ = ↑x✝² x✝¹
⊢ ↑x✝³ x✝¹ = some x✝ → ↑x✝³ x✝¹ = some x✝
[PROOFSTEP]
simp [*]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
h✝ : ¬↑x✝³ x✝¹ = ↑x✝² x✝¹
⊢ False → ↑x✝³ x✝¹ = some x✝
[PROOFSTEP]
simp [*]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
⊢ x✝ ∈ ↑(x✝³ ⊓ x✝²) x✝¹ → x✝ ∈ ↑x✝² x✝¹
[PROOFSTEP]
simp
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
⊢ (if ↑x✝³ x✝¹ = ↑x✝² x✝¹ then ↑x✝³ x✝¹ else none) = some x✝ → ↑x✝² x✝¹ = some x✝
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
h✝ : ↑x✝³ x✝¹ = ↑x✝² x✝¹
⊢ ↑x✝³ x✝¹ = some x✝ → ↑x✝² x✝¹ = some x✝
[PROOFSTEP]
simp [*]
[GOAL]
case neg
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
x✝³ x✝² : α ≃. β
x✝¹ : α
x✝ : β
h✝ : ¬↑x✝³ x✝¹ = ↑x✝² x✝¹
⊢ False → ↑x✝² x✝¹ = some x✝
[PROOFSTEP]
simp [*]
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g h : α ≃. β
fg : f ≤ g
gh : f ≤ h
a : α
b : β
⊢ b ∈ ↑f a → b ∈ ↑(g ⊓ h) a
[PROOFSTEP]
intro H
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g h : α ≃. β
fg : f ≤ g
gh : f ≤ h
a : α
b : β
H : b ∈ ↑f a
⊢ b ∈ ↑(g ⊓ h) a
[PROOFSTEP]
have hf := fg a b H
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g h : α ≃. β
fg : f ≤ g
gh : f ≤ h
a : α
b : β
H : b ∈ ↑f a
hf : b ∈ ↑g a
⊢ b ∈ ↑(g ⊓ h) a
[PROOFSTEP]
have hg := gh a b H
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g h : α ≃. β
fg : f ≤ g
gh : f ≤ h
a : α
b : β
H : b ∈ ↑f a
hf : b ∈ ↑g a
hg : b ∈ ↑h a
⊢ b ∈ ↑(g ⊓ h) a
[PROOFSTEP]
simp only [Option.mem_def, PEquiv.coe_mk_apply] at *
[GOAL]
α : Type u
β : Type v
γ : Type w
δ : Type x
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
src✝ : PartialOrder (α ≃. β) := instPartialOrderPEquiv
f g h : α ≃. β
fg : f ≤ g
gh : f ≤ h
a : α
b : β
H : ↑f a = some b
hf : ↑g a = some b
hg : ↑h a = some b
⊢ (if ↑g a = ↑h a then ↑g a else none) = some b
[PROOFSTEP]
rw [hf, hg, if_pos rfl]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
f : α ≃ β
⊢ ∀ (a : α) (b : β), a ∈ (some ∘ ↑f.symm) b ↔ b ∈ (some ∘ ↑f) a
[PROOFSTEP]
simp [Equiv.eq_symm_apply, eq_comm]