Theorem: FractionalIdeal.le_one_iff_exists_coeIdeal
File: Mathlib/RingTheory/FractionalIdeal.lean

tactic: constructor
state_before: R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
⊢ J ≤ 1 ↔ ∃ I, ↑I = J

tactic: intro hJ
state_before: case mp
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
⊢ J ≤ 1 → ∃ I, ↑I = J

tactic: refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
state_before: case mp
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ∃ I, ↑I = J

tactic: intro a b ha hb
state_before: case mp.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ∀ {a b : R},
    a ∈ {x | ↑(algebraMap R P) x ∈ J} → b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}

tactic: rw [mem_setOf, RingHom.map_add]
state_before: case mp.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
a b : R
ha : a ∈ {x | ↑(algebraMap R P) x ∈ J}
hb : b ∈ {x | ↑(algebraMap R P) x ∈ J}
⊢ a + b ∈ {x | ↑(algebraMap R P) x ∈ J}

tactic: exact J.val.add_mem ha hb
state_before: case mp.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
a b : R
ha : a ∈ {x | ↑(algebraMap R P) x ∈ J}
hb : b ∈ {x | ↑(algebraMap R P) x ∈ J}
⊢ ↑(algebraMap R P) a + ↑(algebraMap R P) b ∈ J

tactic: rw [mem_setOf, RingHom.map_zero]
state_before: case mp.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ 0 ∈
    { carrier := {x | ↑(algebraMap R P) x ∈ J},
        add_mem' :=
          (_ :
            ∀ {a b : R},
              a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier

tactic: exact J.val.zero_mem
state_before: case mp.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ 0 ∈ J

tactic: intro c x hx
state_before: case mp.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ∀ (c : R) {x : R},
    x ∈
        {
              toAddSubsemigroup :=
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                  add_mem' :=
                    (_ :
                      ∀ {a b : R},
                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                          b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := {x | ↑(algebraMap R P) x ∈ J},
                        add_mem' :=
                          (_ :
                            ∀ {a b : R},
                              a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                  a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
      c • x ∈
        {
              toAddSubsemigroup :=
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                  add_mem' :=
                    (_ :
                      ∀ {a b : R},
                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                          b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := {x | ↑(algebraMap R P) x ∈ J},
                        add_mem' :=
                          (_ :
                            ∀ {a b : R},
                              a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                  a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier

tactic: rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
state_before: case mp.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
c x : R
hx :
  x ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | ↑(algebraMap R P) x ∈ J},
              add_mem' :=
                (_ :
                  ∀ {a b : R},
                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
          zero_mem' :=
            (_ :
              0 ∈
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                    add_mem' :=
                      (_ :
                        ∀ {a b : R},
                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier
⊢ c • x ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | ↑(algebraMap R P) x ∈ J},
              add_mem' :=
                (_ :
                  ∀ {a b : R},
                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
          zero_mem' :=
            (_ :
              0 ∈
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                    add_mem' :=
                      (_ :
                        ∀ {a b : R},
                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier

tactic: exact J.val.smul_mem c hx
state_before: case mp.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
c x : R
hx :
  x ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | ↑(algebraMap R P) x ∈ J},
              add_mem' :=
                (_ :
                  ∀ {a b : R},
                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
          zero_mem' :=
            (_ :
              0 ∈
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                    add_mem' :=
                      (_ :
                        ∀ {a b : R},
                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier
⊢ c • ↑(algebraMap R P) x ∈ J

tactic: ext x
state_before: case mp.refine'_4
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ↑{
        toAddSubmonoid :=
          {
            toAddSubsemigroup :=
              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                add_mem' :=
                  (_ :
                    ∀ {a b : R},
                      a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                        b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
            zero_mem' :=
              (_ :
                0 ∈
                  { carrier := {x | ↑(algebraMap R P) x ∈ J},
                      add_mem' :=
                        (_ :
                          ∀ {a b : R},
                            a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
        smul_mem' :=
          (_ :
            ∀ (c : R) {x : R},
              x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                c • x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } =
    J

tactic: constructor
state_before: case mp.refine'_4.a
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
⊢ x ∈
      ↑{
          toAddSubmonoid :=
            {
              toAddSubsemigroup :=
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                  add_mem' :=
                    (_ :
                      ∀ {a b : R},
                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                          b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := {x | ↑(algebraMap R P) x ∈ J},
                        add_mem' :=
                          (_ :
                            ∀ {a b : R},
                              a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
          smul_mem' :=
            (_ :
              ∀ (c : R) {x : R},
                x ∈
                    {
                          toAddSubsemigroup :=
                            { carrier := {x | ↑(algebraMap R P) x ∈ J},
                              add_mem' :=
                                (_ :
                                  ∀ {a b : R},
                                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                          zero_mem' :=
                            (_ :
                              0 ∈
                                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                    add_mem' :=
                                      (_ :
                                        ∀ {a b : R},
                                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                              a + b ∈
                                                {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                  c • x ∈
                    {
                          toAddSubsemigroup :=
                            { carrier := {x | ↑(algebraMap R P) x ∈ J},
                              add_mem' :=
                                (_ :
                                  ∀ {a b : R},
                                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                          zero_mem' :=
                            (_ :
                              0 ∈
                                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                    add_mem' :=
                                      (_ :
                                        ∀ {a b : R},
                                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                              a + b ∈
                                                {x |
                                                  ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } ↔
    x ∈ J

tactic: rintro ⟨y, hy, eq_y⟩
state_before: case mp.refine'_4.a.mp
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
⊢ x ∈
      ↑{
          toAddSubmonoid :=
            {
              toAddSubsemigroup :=
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                  add_mem' :=
                    (_ :
                      ∀ {a b : R},
                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                          b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := {x | ↑(algebraMap R P) x ∈ J},
                        add_mem' :=
                          (_ :
                            ∀ {a b : R},
                              a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
          smul_mem' :=
            (_ :
              ∀ (c : R) {x : R},
                x ∈
                    {
                          toAddSubsemigroup :=
                            { carrier := {x | ↑(algebraMap R P) x ∈ J},
                              add_mem' :=
                                (_ :
                                  ∀ {a b : R},
                                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                          zero_mem' :=
                            (_ :
                              0 ∈
                                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                    add_mem' :=
                                      (_ :
                                        ∀ {a b : R},
                                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                              a + b ∈
                                                {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                  c • x ∈
                    {
                          toAddSubsemigroup :=
                            { carrier := {x | ↑(algebraMap R P) x ∈ J},
                              add_mem' :=
                                (_ :
                                  ∀ {a b : R},
                                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                          zero_mem' :=
                            (_ :
                              0 ∈
                                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                    add_mem' :=
                                      (_ :
                                        ∀ {a b : R},
                                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                              a + b ∈
                                                {x |
                                                  ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } →
    x ∈ J

tactic: rwa [← eq_y]
state_before: case mp.refine'_4.a.mp.intro.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
y : R
hy :
  y ∈
    ↑{
        toAddSubmonoid :=
          {
            toAddSubsemigroup :=
              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                add_mem' :=
                  (_ :
                    ∀ {a b : R},
                      a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                        b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
            zero_mem' :=
              (_ :
                0 ∈
                  { carrier := {x | ↑(algebraMap R P) x ∈ J},
                      add_mem' :=
                        (_ :
                          ∀ {a b : R},
                            a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
        smul_mem' :=
          (_ :
            ∀ (c : R) {x : R},
              x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                c • x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) }
eq_y : ↑(Algebra.linearMap R P) y = x
⊢ x ∈ J

tactic: intro hx
state_before: case mp.refine'_4.a.mpr
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
⊢ x ∈ J →
    x ∈
      ↑{
          toAddSubmonoid :=
            {
              toAddSubsemigroup :=
                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                  add_mem' :=
                    (_ :
                      ∀ {a b : R},
                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                          b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := {x | ↑(algebraMap R P) x ∈ J},
                        add_mem' :=
                          (_ :
                            ∀ {a b : R},
                              a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
          smul_mem' :=
            (_ :
              ∀ (c : R) {x : R},
                x ∈
                    {
                          toAddSubsemigroup :=
                            { carrier := {x | ↑(algebraMap R P) x ∈ J},
                              add_mem' :=
                                (_ :
                                  ∀ {a b : R},
                                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                          zero_mem' :=
                            (_ :
                              0 ∈
                                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                    add_mem' :=
                                      (_ :
                                        ∀ {a b : R},
                                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                              a + b ∈
                                                {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                  c • x ∈
                    {
                          toAddSubsemigroup :=
                            { carrier := {x | ↑(algebraMap R P) x ∈ J},
                              add_mem' :=
                                (_ :
                                  ∀ {a b : R},
                                    a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                      b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                          zero_mem' :=
                            (_ :
                              0 ∈
                                { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                    add_mem' :=
                                      (_ :
                                        ∀ {a b : R},
                                          a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                              a + b ∈
                                                {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) }

tactic: obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
state_before: case mp.refine'_4.a.mpr
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
hx : x ∈ J
⊢ x ∈
    ↑{
        toAddSubmonoid :=
          {
            toAddSubsemigroup :=
              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                add_mem' :=
                  (_ :
                    ∀ {a b : R},
                      a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                        b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
            zero_mem' :=
              (_ :
                0 ∈
                  { carrier := {x | ↑(algebraMap R P) x ∈ J},
                      add_mem' :=
                        (_ :
                          ∀ {a b : R},
                            a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
        smul_mem' :=
          (_ :
            ∀ (c : R) {x : R},
              x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                c • x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) }

tactic: exact mem_setOf.mpr ⟨y, hx, rfl⟩
state_before: case mp.refine'_4.a.mpr.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
y : R
hx : ↑(algebraMap R P) y ∈ J
⊢ ↑(algebraMap R P) y ∈
    ↑{
        toAddSubmonoid :=
          {
            toAddSubsemigroup :=
              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                add_mem' :=
                  (_ :
                    ∀ {a b : R},
                      a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                        b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
            zero_mem' :=
              (_ :
                0 ∈
                  { carrier := {x | ↑(algebraMap R P) x ∈ J},
                      add_mem' :=
                        (_ :
                          ∀ {a b : R},
                            a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                              b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) }.carrier) },
        smul_mem' :=
          (_ :
            ∀ (c : R) {x : R},
              x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
                c • x ∈
                  {
                        toAddSubsemigroup :=
                          { carrier := {x | ↑(algebraMap R P) x ∈ J},
                            add_mem' :=
                              (_ :
                                ∀ {a b : R},
                                  a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                    b ∈ {x | ↑(algebraMap R P) x ∈ J} → a + b ∈ {x | ↑(algebraMap R P) x ∈ J}) },
                        zero_mem' :=
                          (_ :
                            0 ∈
                              { carrier := {x | ↑(algebraMap R P) x ∈ J},
                                  add_mem' :=
                                    (_ :
                                      ∀ {a b : R},
                                        a ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                          b ∈ {x | ↑(algebraMap R P) x ∈ J} →
                                            a + b ∈
                                              {x | ↑(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) }

tactic: rintro ⟨I, hI⟩
state_before: case mpr
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
⊢ (∃ I, ↑I = J) → J ≤ 1

tactic: rw [← hI]
state_before: case mpr.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
I : Ideal R
hI : ↑I = J
⊢ J ≤ 1

tactic: apply coeIdeal_le_one
state_before: case mpr.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
I : Ideal R
hI : ↑I = J
⊢ ↑I ≤ 1