[GOAL]
⊢ IsPrincipalIdealRing { x // x ∈ 𝓞 ℚ }
[PROOFSTEP]
convert
  IsPrincipalIdealRing.of_surjective (Rat.ringOfIntegersEquiv.symm : ℤ →+* ringOfIntegers ℚ)
    Rat.ringOfIntegersEquiv.symm.surjective


[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ IsRadical I ↔ IsReduced (R ⧸ I)
[PROOFSTEP]
conv_lhs => rw [← @Ideal.mk_ker R _ I]
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
| IsRadical I
[PROOFSTEP]
rw [← @Ideal.mk_ker R _ I]
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
| IsRadical I
[PROOFSTEP]
rw [← @Ideal.mk_ker R _ I]
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
| IsRadical I
[PROOFSTEP]
rw [← @Ideal.mk_ker R _ I]
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ IsRadical (RingHom.ker (Quotient.mk I)) ↔ IsReduced (R ⧸ I)
[PROOFSTEP]
exact RingHom.ker_isRadical_iff_reduced_of_surjective (@Ideal.Quotient.mk_surjective R _ I)
[GOAL]
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI : IsNilpotent I
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
⊢ P I
[PROOFSTEP]
obtain ⟨n, hI : I ^ n = ⊥⟩ := hI
[GOAL]
case intro
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n : ℕ
hI : I ^ n = ⊥
⊢ P I
[PROOFSTEP]
induction' n using Nat.strong_induction_on with n H generalizing S
[GOAL]
case intro.h
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
n : ℕ
H : ∀ (m : ℕ), m < n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI : I ^ n = ⊥
⊢ P I
[PROOFSTEP]
by_cases hI' : I = ⊥
[GOAL]
case pos
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
n : ℕ
H : ∀ (m : ℕ), m < n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI : I ^ n = ⊥
hI' : I = ⊥
⊢ P I
[PROOFSTEP]
subst hI'
[GOAL]
case pos
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I ^ n✝ = ⊥
n : ℕ
H : ∀ (m : ℕ), m < n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
hI : ⊥ ^ n = ⊥
⊢ P ⊥
[PROOFSTEP]
apply h₁
[GOAL]
case pos.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I ^ n✝ = ⊥
n : ℕ
H : ∀ (m : ℕ), m < n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
hI : ⊥ ^ n = ⊥
⊢ ⊥ ^ 2 = ⊥
[PROOFSTEP]
rw [← Ideal.zero_eq_bot, zero_pow]
[GOAL]
case pos.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I ^ n✝ = ⊥
n : ℕ
H : ∀ (m : ℕ), m < n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
hI : ⊥ ^ n = ⊥
⊢ 0 < 2
[PROOFSTEP]
exact zero_lt_two
[GOAL]
case neg
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
n : ℕ
H : ∀ (m : ℕ), m < n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI : I ^ n = ⊥
hI' : ¬I = ⊥
⊢ P I
[PROOFSTEP]
cases' n with n
[GOAL]
case neg.zero
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n : ℕ
hI✝ : I✝ ^ n = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
H : ∀ (m : ℕ), m < Nat.zero → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.zero = ⊥
⊢ P I
[PROOFSTEP]
rw [pow_zero, Ideal.one_eq_top] at hI
[GOAL]
case neg.zero
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n : ℕ
hI✝ : I✝ ^ n = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
H : ∀ (m : ℕ), m < Nat.zero → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : ⊤ = ⊥
⊢ P I
[PROOFSTEP]
haveI := subsingleton_of_bot_eq_top hI.symm
[GOAL]
case neg.zero
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n : ℕ
hI✝ : I✝ ^ n = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
H : ∀ (m : ℕ), m < Nat.zero → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : ⊤ = ⊥
this : Subsingleton (Ideal S)
⊢ P I
[PROOFSTEP]
exact (hI' (Subsingleton.elim _ _)).elim
[GOAL]
case neg.succ
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ), m < Nat.succ n → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ n = ⊥
⊢ P I
[PROOFSTEP]
cases' n with n
[GOAL]
case neg.succ.zero
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n : ℕ
hI✝ : I✝ ^ n = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
H :
  ∀ (m : ℕ),
    m < Nat.succ Nat.zero → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ Nat.zero = ⊥
⊢ P I
[PROOFSTEP]
rw [pow_one] at hI
[GOAL]
case neg.succ.zero
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n : ℕ
hI✝ : I✝ ^ n = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
H :
  ∀ (m : ℕ),
    m < Nat.succ Nat.zero → ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I = ⊥
⊢ P I
[PROOFSTEP]
exact (hI' hI).elim
[GOAL]
case neg.succ.succ
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ P I
[PROOFSTEP]
apply h₂ (I ^ 2) _ (Ideal.pow_le_self two_ne_zero)
[GOAL]
case neg.succ.succ.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ P (I ^ 2)
[PROOFSTEP]
apply H n.succ _ (I ^ 2)
[GOAL]
case neg.succ.succ.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ (I ^ 2) ^ Nat.succ n = ⊥
[PROOFSTEP]
rw [← pow_mul, eq_bot_iff, ← hI, Nat.succ_eq_add_one, Nat.succ_eq_add_one]
[GOAL]
case neg.succ.succ.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ I ^ (2 * (n + 1)) ≤ I ^ (n + 1 + 1)
[PROOFSTEP]
apply Ideal.pow_le_pow (by linarith)
[GOAL]
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ n + 1 + 1 ≤ 2 * (n + 1)
[PROOFSTEP]
linarith
[GOAL]
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ Nat.succ n < Nat.succ (Nat.succ n)
[PROOFSTEP]
exact n.succ.lt_succ_self
[GOAL]
case neg.succ.succ.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ P (map (Quotient.mk (I ^ 2)) I)
[PROOFSTEP]
apply h₁
[GOAL]
case neg.succ.succ.a.a
R : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : CommRing S✝
inst✝² : Algebra R S✝
I✝ : Ideal S✝
P : ⦃S : Type u_2⦄ → [inst : CommRing S] → Ideal S → Prop
h₁ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I : Ideal S), I ^ 2 = ⊥ → P I
h₂ : ∀ ⦃S : Type u_2⦄ [inst : CommRing S] (I J : Ideal S), I ≤ J → P I → P (map (Quotient.mk I) J) → P J
n✝ : ℕ
hI✝ : I✝ ^ n✝ = ⊥
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Algebra R S
I : Ideal S
hI' : ¬I = ⊥
n : ℕ
H :
  ∀ (m : ℕ),
    m < Nat.succ (Nat.succ n) →
      ∀ {S : Type u_2} [inst : CommRing S] [inst_1 : Algebra R S] (I : Ideal S), I ^ m = ⊥ → P I
hI : I ^ Nat.succ (Nat.succ n) = ⊥
⊢ map (Quotient.mk (I ^ 2)) I ^ 2 = ⊥
[PROOFSTEP]
rw [← Ideal.map_pow, Ideal.map_quotient_self]
[GOAL]
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_3
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
x : R
⊢ IsUnit (↑(Ideal.Quotient.mk I) x) ↔ IsUnit x
[PROOFSTEP]
refine' ⟨_, fun h => h.map <| Ideal.Quotient.mk I⟩
[GOAL]
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_3
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
x : R
⊢ IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
[PROOFSTEP]
revert x
[GOAL]
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_3
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
⊢ ∀ {x : R}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
[PROOFSTEP]
apply Ideal.IsNilpotent.induction_on (R := R) (S := R) I hI
[GOAL]
case h₁
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_3
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
⊢ ∀ ⦃S : Type u_3⦄ [inst : CommRing S] (I : Ideal S),
    I ^ 2 = ⊥ → ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
[PROOFSTEP]
clear hI I
[GOAL]
case h₂
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_3
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
⊢ ∀ ⦃S : Type u_3⦄ [inst : CommRing S] (I J : Ideal S),
    I ≤ J →
      (∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x) →
        (∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x) →
          ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk J) x) → IsUnit x
[PROOFSTEP]
clear hI I
[GOAL]
case h₁
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_3
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_3⦄ [inst : CommRing S] (I : Ideal S),
    I ^ 2 = ⊥ → ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
case h₂
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_3
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_3⦄ [inst : CommRing S] (I J : Ideal S),
    I ≤ J →
      (∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x) →
        (∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x) →
          ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk J) x) → IsUnit x
[PROOFSTEP]
swap
[GOAL]
case h₂
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_3
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_3⦄ [inst : CommRing S] (I J : Ideal S),
    I ≤ J →
      (∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x) →
        (∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x) →
          ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk J) x) → IsUnit x
[PROOFSTEP]
introv e h₁ h₂ h₃
[GOAL]
case h₂
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I J : Ideal S
e : I ≤ J
h₁ : ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
h₂ : ∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x
x : S
h₃ : IsUnit (↑(Ideal.Quotient.mk J) x)
⊢ IsUnit x
[PROOFSTEP]
apply h₁
[GOAL]
case h₂.a
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I J : Ideal S
e : I ≤ J
h₁ : ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
h₂ : ∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x
x : S
h₃ : IsUnit (↑(Ideal.Quotient.mk J) x)
⊢ IsUnit (↑(Ideal.Quotient.mk I) x)
[PROOFSTEP]
apply h₂
[GOAL]
case h₂.a.a
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I J : Ideal S
e : I ≤ J
h₁ : ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
h₂ : ∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x
x : S
h₃ : IsUnit (↑(Ideal.Quotient.mk J) x)
⊢ IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) (↑(Ideal.Quotient.mk I) x))
[PROOFSTEP]
exact h₃.map ((DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr e))).symm.toRingHom
[GOAL]
case h₁
R✝ : Type u_1
S : Type u_2
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_3
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_3⦄ [inst : CommRing S] (I : Ideal S),
    I ^ 2 = ⊥ → ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
[PROOFSTEP]
introv e H
[GOAL]
case h₁
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
⊢ IsUnit x
[PROOFSTEP]
skip
[GOAL]
case h₁
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
⊢ IsUnit x
[PROOFSTEP]
obtain ⟨y, hy⟩ := Ideal.Quotient.mk_surjective (↑H.unit⁻¹ : S ⧸ I)
[GOAL]
case h₁.intro
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
⊢ IsUnit x
[PROOFSTEP]
have : Ideal.Quotient.mk I (x * y) = Ideal.Quotient.mk I 1 := by rw [map_one, _root_.map_mul, hy, IsUnit.mul_val_inv]
[GOAL]
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
⊢ ↑(Ideal.Quotient.mk I) (x * y) = ↑(Ideal.Quotient.mk I) 1
[PROOFSTEP]
rw [map_one, _root_.map_mul, hy, IsUnit.mul_val_inv]
[GOAL]
case h₁.intro
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : ↑(Ideal.Quotient.mk I) (x * y) = ↑(Ideal.Quotient.mk I) 1
⊢ IsUnit x
[PROOFSTEP]
rw [Ideal.Quotient.eq] at this
[GOAL]
case h₁.intro
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : x * y - 1 ∈ I
⊢ IsUnit x
[PROOFSTEP]
have : (x * y - 1) ^ 2 = 0 := by
  rw [← Ideal.mem_bot, ← e]
  exact Ideal.pow_mem_pow this _
[GOAL]
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : x * y - 1 ∈ I
⊢ (x * y - 1) ^ 2 = 0
[PROOFSTEP]
rw [← Ideal.mem_bot, ← e]
[GOAL]
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : x * y - 1 ∈ I
⊢ (x * y - 1) ^ 2 ∈ I ^ 2
[PROOFSTEP]
exact Ideal.pow_mem_pow this _
[GOAL]
case h₁.intro
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝ : x * y - 1 ∈ I
this : (x * y - 1) ^ 2 = 0
⊢ IsUnit x
[PROOFSTEP]
have : x * (y * (2 - x * y)) = 1 := by
  rw [eq_comm, ← sub_eq_zero, ← this]
  ring
[GOAL]
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝ : x * y - 1 ∈ I
this : (x * y - 1) ^ 2 = 0
⊢ x * (y * (2 - x * y)) = 1
[PROOFSTEP]
rw [eq_comm, ← sub_eq_zero, ← this]
[GOAL]
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝ : x * y - 1 ∈ I
this : (x * y - 1) ^ 2 = 0
⊢ 1 - x * (y * (2 - x * y)) = (x * y - 1) ^ 2
[PROOFSTEP]
ring
[GOAL]
case h₁.intro
R✝ : Type u_1
S✝ : Type u_2
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_3
inst✝¹ : CommRing R
S : Type u_3
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝¹ : x * y - 1 ∈ I
this✝ : (x * y - 1) ^ 2 = 0
this : x * (y * (2 - x * y)) = 1
⊢ IsUnit x
[PROOFSTEP]
exact isUnit_of_mul_eq_one _ _ this


[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (↑e (some x)) = true
⊢ isSome (↑e none) = true
[PROOFSTEP]
rw [← Option.ne_none_iff_isSome]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (↑e (some x)) = true
⊢ ↑e none ≠ none
[PROOFSTEP]
intro hn
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (↑e (some x)) = true
hn : ↑e none = none
⊢ False
[PROOFSTEP]
rw [Option.not_isSome_iff_eq_none, ← hn] at h
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = ↑e none
hn : ↑e none = none
⊢ False
[PROOFSTEP]
exact
  Option.some_ne_none _
    (e.injective h)
      -- Porting note: private
      -- #align equiv.remove_none_aux Equiv.removeNone_aux
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ∃ x', ↑e (some x) = some x'
⊢ some (removeNone_aux e x) = ↑e (some x)
[PROOFSTEP]
simp [removeNone_aux, Option.isSome_iff_exists.mpr h]
  -- Porting note: private
  -- #align equiv.remove_none_aux_some Equiv.removeNone_aux_some
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = none
⊢ some (removeNone_aux e x) = ↑e none
[PROOFSTEP]
simp [removeNone_aux, Option.not_isSome_iff_eq_none.mpr h]
  -- Porting note: private
  -- #align equiv.remove_none_aux_none Equiv.removeNone_aux_none
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
cases h1 : e.symm (some (removeNone_aux e x))
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
cases h2 : e (some x)
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
cases h2 : e (some x)
[GOAL]
case none.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
h2 : ↑e (some x) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_none _ h1]
[GOAL]
case none.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
h2 : ↑e (some x) = none
⊢ ↑e.symm none = some x
[PROOFSTEP]
exact (e.eq_symm_apply.mpr h2).symm
[GOAL]
case none.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
[GOAL]
case none.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (↑e (some x)) = none
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
simp at h1
[GOAL]
case some.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝
h2 : ↑e (some x) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_none _ h2] at h1
[GOAL]
case some.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝ : α
h1 : ↑e.symm (↑e none) = some val✝
h2 : ↑e (some x) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
simp at h1
[GOAL]
case some.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝¹ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝¹
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_some _ ⟨_, h1⟩]
[GOAL]
case some.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝¹ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝¹
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ ↑e.symm (some (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_some _ ⟨_, h2⟩]
[GOAL]
case some.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝¹ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝¹
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ ↑e.symm (↑e (some x)) = some x
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
h : ↑e.symm none = none
⊢ ↑e none = none
[PROOFSTEP]
simpa using (congr_arg e h).symm
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
h : ↑e none = none
⊢ ↑e.symm none = none
[PROOFSTEP]
simpa using (congr_arg e.symm h).symm
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
⊢ some (↑(removeNone e) x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
cases' h : e (some x) with a
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = none
⊢ some (↑(removeNone e) x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
rw [removeNone_none _ h]
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = none
⊢ ↑e none = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
simpa using (congr_arg e.symm h).symm
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
⊢ some (↑(removeNone e) x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
rw [removeNone_some _ ⟨a, h⟩]
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
⊢ ↑e (some x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
have h1 := congr_arg e.symm h
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
h1 : ↑e.symm (↑e (some x)) = ↑e.symm (some a)
⊢ ↑e (some x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
rw [symm_apply_apply] at h1
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
h1 : some x = ↑e.symm (some a)
⊢ ↑e (some x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
simp only [false_iff_iff, apply_eq_iff_eq]
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
h1 : some x = ↑e.symm (some a)
⊢ ¬↑e.symm none = some x
[PROOFSTEP]
simp [h1, apply_eq_iff_eq]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e✝ : Option α ≃ Option β
e : α ≃ β
x : α
⊢ ↑(optionCongr e) (some x) = some (↑e x)
[PROOFSTEP]
simp [EquivFunctor.map]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
a : α
⊢ (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
      ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
    a
[PROOFSTEP]
rw [← some_inj, some_get]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
a : α
⊢ ↑(↑e).symm ↑((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) = some a
[PROOFSTEP]
exact symm_apply_apply (e : Option α ≃ β) a
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
      ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
    b
[PROOFSTEP]
ext
[GOAL]
case a
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ ↑((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
        ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b)) =
    ↑b
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : Option α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
    a
[PROOFSTEP]
cases a with
| none => simp
| some a =>
  simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
  exact if_neg (e a).property
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : Option α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
    a
[PROOFSTEP]
cases a with
| none => simp
| some a =>
  simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
  exact if_neg (e a).property
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) none) =
    none
[PROOFSTEP]

| none => simp
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) none) =
    none
[PROOFSTEP]
simp
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) (some a)) =
    some a
[PROOFSTEP]

| some a =>
  simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
  exact if_neg (e a).property
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) (some a)) =
    some a
[PROOFSTEP]
simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ (if ↑(↑e a) = x then none else some a) = some a
[PROOFSTEP]
exact if_neg (e a).property
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : β
⊢ (fun a => casesOn' a x (Subtype.val ∘ ↑e))
      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
    b
[PROOFSTEP]
by_cases h : b = x
[GOAL]
case pos
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : β
h : b = x
⊢ (fun a => casesOn' a x (Subtype.val ∘ ↑e))
      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
    b
[PROOFSTEP]
simp [h]
[GOAL]
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : β
h : ¬b = x
⊢ (fun a => casesOn' a x (Subtype.val ∘ ↑e))
      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
    b
[PROOFSTEP]
simp [h]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
⊢ (fun e =>
        {
          val :=
            { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
              invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
              left_inv :=
                (_ :
                  ∀ (a : Option α),
                    (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                      a),
              right_inv :=
                (_ :
                  ∀ (b : β),
                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                        ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                      b) },
          property :=
            (_ :
              ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                      invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                      left_inv :=
                        (_ :
                          ∀ (a : Option α),
                            (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : β),
                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                              b) }
                  none =
                ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                      invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                      left_inv :=
                        (_ :
                          ∀ (a : Option α),
                            (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : β),
                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                              b) }
                  none) })
      ((fun e =>
          { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
            invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
            left_inv :=
              (_ :
                ∀ (a : α),
                  (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                      ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                    a),
            right_inv :=
              (_ :
                ∀ (b : { y // y ≠ x }),
                  (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                      ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                    b) })
        e) =
    e
[PROOFSTEP]
ext a
[GOAL]
case a.H
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
a : Option α
⊢ ↑↑((fun e =>
              {
                val :=
                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                    invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                    left_inv :=
                      (_ :
                        ∀ (a : Option α),
                          (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (b : β),
                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                              ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                            b) },
                property :=
                  (_ :
                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none =
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none) })
            ((fun e =>
                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                  left_inv :=
                    (_ :
                      ∀ (a : α),
                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                          a),
                  right_inv :=
                    (_ :
                      ∀ (b : { y // y ≠ x }),
                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                          b) })
              e))
      a =
    ↑↑e a
[PROOFSTEP]
cases a
[GOAL]
case a.H.none
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
⊢ ↑↑((fun e =>
              {
                val :=
                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                    invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                    left_inv :=
                      (_ :
                        ∀ (a : Option α),
                          (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (b : β),
                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                              ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                            b) },
                property :=
                  (_ :
                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none =
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none) })
            ((fun e =>
                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                  left_inv :=
                    (_ :
                      ∀ (a : α),
                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                          a),
                  right_inv :=
                    (_ :
                      ∀ (b : { y // y ≠ x }),
                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                          b) })
              e))
      none =
    ↑↑e none
[PROOFSTEP]
simpa using e.property.symm
[GOAL]
case a.H.some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
val✝ : α
⊢ ↑↑((fun e =>
              {
                val :=
                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                    invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                    left_inv :=
                      (_ :
                        ∀ (a : Option α),
                          (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (b : β),
                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                              ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                            b) },
                property :=
                  (_ :
                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none =
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none) })
            ((fun e =>
                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                  left_inv :=
                    (_ :
                      ∀ (a : α),
                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                          a),
                  right_inv :=
                    (_ :
                      ∀ (b : { y // y ≠ x }),
                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                          b) })
              e))
      (some val✝) =
    ↑↑e (some val✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
⊢ (fun e =>
        { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
          invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
          left_inv :=
            (_ :
              ∀ (a : α),
                (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                    ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                  a),
          right_inv :=
            (_ :
              ∀ (b : { y // y ≠ x }),
                (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                    ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                  b) })
      ((fun e =>
          {
            val :=
              { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                left_inv :=
                  (_ :
                    ∀ (a : Option α),
                      (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                          ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                        a),
                right_inv :=
                  (_ :
                    ∀ (b : β),
                      (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                          ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                        b) },
            property :=
              (_ :
                ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                        invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                        left_inv :=
                          (_ :
                            ∀ (a : Option α),
                              (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                  ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                a),
                        right_inv :=
                          (_ :
                            ∀ (b : β),
                              (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                  ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                    b) =
                                b) }
                    none =
                  ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                        invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                        left_inv :=
                          (_ :
                            ∀ (a : Option α),
                              (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                  ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                a),
                        right_inv :=
                          (_ :
                            ∀ (b : β),
                              (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                  ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                    b) =
                                b) }
                    none) })
        e) =
    e
[PROOFSTEP]
ext a
[GOAL]
case H.a
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ ↑(↑((fun e =>
              { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                left_inv :=
                  (_ :
                    ∀ (a : α),
                      (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                          ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                        a),
                right_inv :=
                  (_ :
                    ∀ (b : { y // y ≠ x }),
                      (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                          ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                        b) })
            ((fun e =>
                {
                  val :=
                    { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                      invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                      left_inv :=
                        (_ :
                          ∀ (a : Option α),
                            (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : β),
                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                              b) },
                  property :=
                    (_ :
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                              invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                              left_inv :=
                                (_ :
                                  ∀ (a : Option α),
                                    (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                      a),
                              right_inv :=
                                (_ :
                                  ∀ (b : β),
                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                        ((fun b =>
                                            if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                          b) =
                                      b) }
                          none =
                        ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                              invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                              left_inv :=
                                (_ :
                                  ∀ (a : Option α),
                                    (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                      a),
                              right_inv :=
                                (_ :
                                  ∀ (b : β),
                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                        ((fun b =>
                                            if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                          b) =
                                      b) }
                          none) })
              e))
        a) =
    ↑(↑e a)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ some (↑(↑(optionSubtype x) e).symm b) = ↑(↑e).symm ↑b
[PROOFSTEP]
dsimp only [optionSubtype]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ some
      (↑(↑{
                  toFun := fun e =>
                    { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                      invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                      left_inv :=
                        (_ :
                          ∀ (a : α),
                            (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : { y // y ≠ x }),
                            (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                                ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                              b) },
                  invFun := fun e =>
                    {
                      val :=
                        { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                          invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                          left_inv :=
                            (_ :
                              ∀ (a : Option α),
                                (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                    ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                  a),
                          right_inv :=
                            (_ :
                              ∀ (b : β),
                                (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                    ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      b) =
                                  b) },
                      property :=
                        (_ :
                          ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                  invFun := fun b =>
                                    if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                  left_inv :=
                                    (_ :
                                      ∀ (a : Option α),
                                        (fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                            ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                          a),
                                  right_inv :=
                                    (_ :
                                      ∀ (b : β),
                                        (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                            ((fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                              b) =
                                          b) }
                              none =
                            ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                  invFun := fun b =>
                                    if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                  left_inv :=
                                    (_ :
                                      ∀ (a : Option α),
                                        (fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                            ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                          a),
                                  right_inv :=
                                    (_ :
                                      ∀ (b : β),
                                        (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                            ((fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                              b) =
                                          b) }
                              none) },
                  left_inv :=
                    (_ :
                      ∀ (e : { e // ↑e none = x }),
                        (fun e =>
                              {
                                val :=
                                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                    invFun := fun b =>
                                      if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                    left_inv :=
                                      (_ :
                                        ∀ (a : Option α),
                                          (fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                            a),
                                    right_inv :=
                                      (_ :
                                        ∀ (b : β),
                                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                              ((fun b =>
                                                  if h : b = x then none
                                                  else some (↑e.symm { val := b, property := h }))
                                                b) =
                                            b) },
                                property :=
                                  (_ :
                                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                            invFun := fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                            left_inv :=
                                              (_ :
                                                ∀ (a : Option α),
                                                  (fun b =>
                                                        if h : b = x then none
                                                        else some (↑e.symm { val := b, property := h }))
                                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                    a),
                                            right_inv :=
                                              (_ :
                                                ∀ (b : β),
                                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                      ((fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        b) =
                                                    b) }
                                        none =
                                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                            invFun := fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                            left_inv :=
                                              (_ :
                                                ∀ (a : Option α),
                                                  (fun b =>
                                                        if h : b = x then none
                                                        else some (↑e.symm { val := b, property := h }))
                                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                    a),
                                            right_inv :=
                                              (_ :
                                                ∀ (b : β),
                                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                      ((fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        b) =
                                                    b) }
                                        none) })
                            ((fun e =>
                                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                                  left_inv :=
                                    (_ :
                                      ∀ (a : α),
                                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                                          a),
                                  right_inv :=
                                    (_ :
                                      ∀ (b : { y // y ≠ x }),
                                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                              b) =
                                          b) })
                              e) =
                          e),
                  right_inv :=
                    (_ :
                      ∀ (e : α ≃ { y // y ≠ x }),
                        (fun e =>
                              { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                                invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                                left_inv :=
                                  (_ :
                                    ∀ (a : α),
                                      (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                          ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                                        a),
                                right_inv :=
                                  (_ :
                                    ∀ (b : { y // y ≠ x }),
                                      (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                                          ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                            b) =
                                        b) })
                            ((fun e =>
                                {
                                  val :=
                                    { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                      invFun := fun b =>
                                        if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                      left_inv :=
                                        (_ :
                                          ∀ (a : Option α),
                                            (fun b =>
                                                  if h : b = x then none
                                                  else some (↑e.symm { val := b, property := h }))
                                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                              a),
                                      right_inv :=
                                        (_ :
                                          ∀ (b : β),
                                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                ((fun b =>
                                                    if h : b = x then none
                                                    else some (↑e.symm { val := b, property := h }))
                                                  b) =
                                              b) },
                                  property :=
                                    (_ :
                                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                              invFun := fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                              left_inv :=
                                                (_ :
                                                  ∀ (a : Option α),
                                                    (fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                      a),
                                              right_inv :=
                                                (_ :
                                                  ∀ (b : β),
                                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                        ((fun b =>
                                                            if h : b = x then none
                                                            else some (↑e.symm { val := b, property := h }))
                                                          b) =
                                                      b) }
                                          none =
                                        ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                              invFun := fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                              left_inv :=
                                                (_ :
                                                  ∀ (a : Option α),
                                                    (fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                      a),
                                              right_inv :=
                                                (_ :
                                                  ∀ (b : β),
                                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                        ((fun b =>
                                                            if h : b = x then none
                                                            else some (↑e.symm { val := b, property := h }))
                                                          b) =
                                                      b) }
                                          none) })
                              e) =
                          e) }
              e).symm
        b) =
    ↑(↑e).symm ↑b
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : { y // y ≠ x }
⊢ ↑(↑(↑(optionSubtype x).symm e)).symm ↑b = some (↑e.symm b)
[PROOFSTEP]
simp only [optionSubtype, coe_fn_symm_mk, Subtype.coe_mk, Subtype.coe_eta, dite_eq_ite, ite_eq_right_iff]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : { y // y ≠ x }
⊢ ↑b = x → False
[PROOFSTEP]
exact fun h => False.elim (b.property h)


[GOAL]
M : Type u_1
N : Type u_2
α : Type u_3
inst✝³ : SMul M α
inst✝² : SMul N α
a✝ : M
b✝ : α
x✝ : Option α
inst✝¹ : SMul M N
inst✝ : IsScalarTower M N α
a : M
b : N
x : Option α
⊢ (a • b) • x = a • b • x
[PROOFSTEP]
cases x
[GOAL]
case none
M : Type u_1
N : Type u_2
α : Type u_3
inst✝³ : SMul M α
inst✝² : SMul N α
a✝ : M
b✝ : α
x : Option α
inst✝¹ : SMul M N
inst✝ : IsScalarTower M N α
a : M
b : N
⊢ (a • b) • none = a • b • none
case some
M : Type u_1
N : Type u_2
α : Type u_3
inst✝³ : SMul M α
inst✝² : SMul N α
a✝ : M
b✝ : α
x : Option α
inst✝¹ : SMul M N
inst✝ : IsScalarTower M N α
a : M
b : N
val✝ : α
⊢ (a • b) • some val✝ = a • b • some val✝
[PROOFSTEP]
exacts [rfl, congr_arg some (smul_assoc _ _ _)]
[GOAL]
M : Type u_1
N : Type u_2
α : Type u_3
inst✝³ : SMul M α
inst✝² : SMul N α
a✝ : M
b : α
x✝ : Option α
inst✝¹ : SMul Mᵐᵒᵖ α
inst✝ : IsCentralScalar M α
a : M
x : Option α
⊢ MulOpposite.op a • x = a • x
[PROOFSTEP]
cases x
[GOAL]
case none
M : Type u_1
N : Type u_2
α : Type u_3
inst✝³ : SMul M α
inst✝² : SMul N α
a✝ : M
b : α
x : Option α
inst✝¹ : SMul Mᵐᵒᵖ α
inst✝ : IsCentralScalar M α
a : M
⊢ MulOpposite.op a • none = a • none
case some
M : Type u_1
N : Type u_2
α : Type u_3
inst✝³ : SMul M α
inst✝² : SMul N α
a✝ : M
b : α
x : Option α
inst✝¹ : SMul Mᵐᵒᵖ α
inst✝ : IsCentralScalar M α
a : M
val✝ : α
⊢ MulOpposite.op a • some val✝ = a • some val✝
[PROOFSTEP]
exacts [rfl, congr_arg some (op_smul_eq_smul _ _)]
[GOAL]
M : Type u_1
N : Type u_2
α : Type u_3
inst✝² : SMul M α
inst✝¹ : SMul N α
a : M
b✝ : α
x : Option α
inst✝ : FaithfulSMul M α
m₁✝ m₂✝ : M
h : ∀ (a : Option α), m₁✝ • a = m₂✝ • a
b : α
⊢ m₁✝ • b = m₂✝ • b
[PROOFSTEP]
injection h (some b)
[GOAL]
M : Type u_1
N : Type u_2
α : Type u_3
inst✝¹ : Monoid M
inst✝ : MulAction M α
b : Option α
⊢ 1 • b = b
[PROOFSTEP]
cases b
[GOAL]
case none
M : Type u_1
N : Type u_2
α : Type u_3
inst✝¹ : Monoid M
inst✝ : MulAction M α
⊢ 1 • none = none
case some
M : Type u_1
N : Type u_2
α : Type u_3
inst✝¹ : Monoid M
inst✝ : MulAction M α
val✝ : α
⊢ 1 • some val✝ = some val✝
[PROOFSTEP]
exacts [rfl, congr_arg some (one_smul _ _)]
[GOAL]
M : Type u_1
N : Type u_2
α : Type u_3
inst✝¹ : Monoid M
inst✝ : MulAction M α
a₁ a₂ : M
b : Option α
⊢ (a₁ * a₂) • b = a₁ • a₂ • b
[PROOFSTEP]
cases b
[GOAL]
case none
M : Type u_1
N : Type u_2
α : Type u_3
inst✝¹ : Monoid M
inst✝ : MulAction M α
a₁ a₂ : M
⊢ (a₁ * a₂) • none = a₁ • a₂ • none
case some
M : Type u_1
N : Type u_2
α : Type u_3
inst✝¹ : Monoid M
inst✝ : MulAction M α
a₁ a₂ : M
val✝ : α
⊢ (a₁ * a₂) • some val✝ = a₁ • a₂ • some val✝
[PROOFSTEP]
exacts [rfl, congr_arg some (mul_smul _ _ _)]