l3lab/ntp-mathlib huggingface dataset:
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
    (hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
    C r := by
  simp only [mul_def] at hr
  

Proof state:
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
I J : FractionalIdeal S P
C : P → Prop
r : P
hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)
ha : ∀ (x y : P), C x → C y → C (x + y)
hr : r ∈ { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) }
⊢ C r

Next tactic:
exact Submodule.mul_induction_on hr hm ha
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
  show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
  by 

Proof state:
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
n : ℕ
⊢ ↑(Nat.unaryCast n) = ↑n

Next tactic:
induction n
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
  show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
  by induction n <;> 

Proof state:
case zero
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
⊢ ↑(Nat.unaryCast Nat.zero) = ↑Nat.zero

Next tactic:
simp [*, Nat.unaryCast]
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
  show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
  by induction n <;> 

Proof state:
case succ
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
n✝ : ℕ
n_ih✝ : ↑(Nat.unaryCast n✝) = ↑n✝
⊢ ↑(Nat.unaryCast (Nat.succ n✝)) = ↑(Nat.succ n✝)

Next tactic:
simp [*, Nat.unaryCast]
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
  

Proof state:
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
I : FractionalIdeal S P
hI : 1 ≤ I
⊢ I ≤ I * I

Next tactic:
convert mul_left_mono I hI
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
  convert mul_left_mono I hI
  

Proof state:
case h.e'_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
I : FractionalIdeal S P
hI : 1 ≤ I
⊢ I = (fun x => I * x) 1

Next tactic:
exact (mul_one I).symm
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
  

Proof state:
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
I : FractionalIdeal S P
hI : I ≤ 1
⊢ I * I ≤ I

Next tactic:
convert mul_left_mono I hI
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
  convert mul_left_mono I hI
  

Proof state:
case h.e'_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
I : FractionalIdeal S P
hI : I ≤ 1
⊢ I = (fun x => I * x) 1

Next tactic:
exact (mul_one I).symm
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  

Proof state:
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

Next tactic:
constructor
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · 

Proof state:
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

Next tactic:
intro hJ
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    

Proof state:
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

Next tactic:
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · 

Proof state:
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}

Next tactic:
intro a b ha hb
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      

Proof state:
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}

Next tactic:
rw [mem_setOf, RingHom.map_add]
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      

Proof state:
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

Next tactic:
exact J.val.add_mem ha hb
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · 

Proof state:
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

Next tactic:
rw [mem_setOf, RingHom.map_zero]
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      

Proof state:
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

Next tactic:
exact J.val.zero_mem
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      exact J.val.zero_mem
    · 

Proof state:
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

Next tactic:
intro c x hx
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      exact J.val.zero_mem
    · intro c x hx
      

Proof state:
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

Next tactic:
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      exact J.val.zero_mem
    · intro c x hx
      rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
      

Proof state:
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

Next tactic:
exact J.val.smul_mem c hx
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      exact J.val.zero_mem
    · intro c x hx
      rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
      exact J.val.smul_mem c hx
    · ext x
      constructor
      · rintro ⟨y, hy, eq_y⟩
        rwa [← eq_y]
      · intro hx
        obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
        exact mem_setOf.mpr ⟨y, hx, rfl⟩
  · 

Proof state:
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

Next tactic:
rintro ⟨I, hI⟩
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      exact J.val.zero_mem
    · intro c x hx
      rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
      exact J.val.smul_mem c hx
    · ext x
      constructor
      · rintro ⟨y, hy, eq_y⟩
        rwa [← eq_y]
      · intro hx
        obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
        exact mem_setOf.mpr ⟨y, hx, rfl⟩
  · rintro ⟨I, hI⟩
    

Proof state:
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

Next tactic:
rw [← hI]
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
    J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
  constructor
  · intro hJ
    refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
    · intro a b ha hb
      rw [mem_setOf, RingHom.map_add]
      exact J.val.add_mem ha hb
    · rw [mem_setOf, RingHom.map_zero]
      exact J.val.zero_mem
    · intro c x hx
      rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
      exact J.val.smul_mem c hx
    · ext x
      constructor
      · rintro ⟨y, hy, eq_y⟩
        rwa [← eq_y]
      · intro hx
        obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
        exact mem_setOf.mpr ⟨y, hx, rfl⟩
  · rintro ⟨I, hI⟩
    rw [← hI]
    

Proof state:
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

Next tactic:
apply coeIdeal_le_one
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
  

Proof state:
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
I : FractionalIdeal S P
⊢ 1 ≤ I ↔ 1 ∈ I

Next tactic:
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
  toFun := coeIdeal
  map_add' := coeIdeal_sup
  map_mul' := coeIdeal_mul
  map_one' := by 

Proof state:
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
⊢ ↑1 = 1

Next tactic:
rw [Ideal.one_eq_top, coeIdeal_top]
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
    IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
  | ⟨a, a_nonzero, hI⟩ =>
    ⟨a, a_nonzero, fun b hb => by
      

Proof state:
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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
⊢ IsInteger R (a • b)

Next tactic:
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
    IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
  | ⟨a, a_nonzero, hI⟩ =>
    ⟨a, a_nonzero, fun b hb => by
      obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
      

Proof state:
case 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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : (AlgHom.toLinearMap g) b' = b
⊢ IsInteger R (a • b)

Next tactic:
rw [AlgHom.toLinearMap_apply] at hb'
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
    IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
  | ⟨a, a_nonzero, hI⟩ =>
    ⟨a, a_nonzero, fun b hb => by
      obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
      rw [AlgHom.toLinearMap_apply] at hb'
      

Proof state:
case 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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : g b' = b
⊢ IsInteger R (a • b)

Next tactic:
obtain ⟨x, hx⟩ := hI b' b'_mem
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
    IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
  | ⟨a, a_nonzero, hI⟩ =>
    ⟨a, a_nonzero, fun b hb => by
      obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
      rw [AlgHom.toLinearMap_apply] at hb'
      obtain ⟨x, hx⟩ := hI b' b'_mem
      

Proof state:
case intro.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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : g b' = b
x : R
hx : (algebraMap R P) x = a • b'
⊢ IsInteger R (a • b)

Next tactic:
use x
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
    IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
  | ⟨a, a_nonzero, hI⟩ =>
    ⟨a, a_nonzero, fun b hb => by
      obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
      rw [AlgHom.toLinearMap_apply] at hb'
      obtain ⟨x, hx⟩ := hI b' b'_mem
      use x
      

Proof state:
case h
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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : g b' = b
x : R
hx : (algebraMap R P) x = a • b'
⊢ (algebraMap R P') x = a • b

Next tactic:
rw [← g.commutes, hx, g.map_smul, hb']
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
  

Proof state:
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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
⊢ map g ↑I = ↑I

Next tactic:
ext x
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
  ext x
  

Proof state:
case 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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ x ∈ map g ↑I ↔ x ∈ ↑I

Next tactic:
simp only [mem_coeIdeal]
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
  ext x
  simp only [mem_coeIdeal]
  

Proof state:
case 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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ x ∈ map g ↑I ↔ ∃ x' ∈ I, (algebraMap R P') x' = x

Next tactic:
constructor
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
  ext x
  simp only [mem_coeIdeal]
  constructor
  · 

Proof state:
case 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
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ x ∈ map g ↑I → ∃ x' ∈ I, (algebraMap R P') x' = x

Next tactic:
rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩