l3lab/ntp-mathlib huggingface dataset:
/-- If `f` and `g` are surjective morphisms of algebras, then
  the kernel of `Algebra.TensorProduct.map f g` is generated by the kernels of `f` and `g` -/
theorem Algebra.TensorProduct.map_ker (hf : Function.Surjective f) (hg : Function.Surjective g) :
    RingHom.ker (map f g) =
      (RingHom.ker f).map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] C) ⊔
        (RingHom.ker g).map (Algebra.TensorProduct.includeRight : C →ₐ[R] A ⊗[R] C) := by
  -- rewrite map f g as the composition of two maps
  have : map f g = (map f (AlgHom.id R D)).comp (map (AlgHom.id R A) g) := ext rfl rfl
  rw [this]
  -- this needs some rewriting to RingHom
  simp only [AlgHom.coe_ker, AlgHom.comp_toRingHom]
  rw [← RingHom.comap_ker]
  simp only [← AlgHom.coe_ker]
  -- apply one step of exactness
  rw [← Algebra.TensorProduct.lTensor_ker _ hg, RingHom.ker_eq_comap_bot (map (AlgHom.id R A) g)]
  rw [← Ideal.comap_map_of_surjective _ (lTensor.surjective A hg)]
  -- apply the other step of exactness
  rw [Algebra.TensorProduct.rTensor_ker _ hf]
  

Proof state:
R✝ : Type u_1
inst✝¹³ : CommSemiring R✝
A✝ : Type u_2
B✝ : Type u_3
inst✝¹² : Semiring A✝
inst✝¹¹ : Semiring B✝
inst✝¹⁰ : Algebra R✝ A✝
inst✝⁹ : Algebra R✝ B✝
R : Type u_4
inst✝⁸ : CommRing R
A : Type u_5
B : Type u_6
C : Type u_7
D : Type u_8
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Ring C
inst✝⁴ : Ring D
inst✝³ : Algebra R A
inst✝² : Algebra R B
inst✝¹ : Algebra R C
inst✝ : Algebra R D
f : A →ₐ[R] B
g : C →ₐ[R] D
hf : Function.Surjective ⇑f
hg : Function.Surjective ⇑g
this : map f g = AlgHom.comp (map f (AlgHom.id R D)) (map (AlgHom.id R A) g)
⊢ Ideal.comap (↑(map (AlgHom.id R A) g)) (Ideal.map includeLeft (RingHom.ker f)) =
    Ideal.comap (map (AlgHom.id R A) g) (Ideal.map (map (AlgHom.id R A) g) (Ideal.map includeLeft (RingHom.ker f)))

Next tactic:
apply congr_arg₂ _ rfl
/-- If `f` and `g` are surjective morphisms of algebras, then
  the kernel of `Algebra.TensorProduct.map f g` is generated by the kernels of `f` and `g` -/
theorem Algebra.TensorProduct.map_ker (hf : Function.Surjective f) (hg : Function.Surjective g) :
    RingHom.ker (map f g) =
      (RingHom.ker f).map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] C) ⊔
        (RingHom.ker g).map (Algebra.TensorProduct.includeRight : C →ₐ[R] A ⊗[R] C) := by
  -- rewrite map f g as the composition of two maps
  have : map f g = (map f (AlgHom.id R D)).comp (map (AlgHom.id R A) g) := ext rfl rfl
  rw [this]
  -- this needs some rewriting to RingHom
  simp only [AlgHom.coe_ker, AlgHom.comp_toRingHom]
  rw [← RingHom.comap_ker]
  simp only [← AlgHom.coe_ker]
  -- apply one step of exactness
  rw [← Algebra.TensorProduct.lTensor_ker _ hg, RingHom.ker_eq_comap_bot (map (AlgHom.id R A) g)]
  rw [← Ideal.comap_map_of_surjective _ (lTensor.surjective A hg)]
  -- apply the other step of exactness
  rw [Algebra.TensorProduct.rTensor_ker _ hf]
  apply congr_arg₂ _ rfl
  

Proof state:
R✝ : Type u_1
inst✝¹³ : CommSemiring R✝
A✝ : Type u_2
B✝ : Type u_3
inst✝¹² : Semiring A✝
inst✝¹¹ : Semiring B✝
inst✝¹⁰ : Algebra R✝ A✝
inst✝⁹ : Algebra R✝ B✝
R : Type u_4
inst✝⁸ : CommRing R
A : Type u_5
B : Type u_6
C : Type u_7
D : Type u_8
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Ring C
inst✝⁴ : Ring D
inst✝³ : Algebra R A
inst✝² : Algebra R B
inst✝¹ : Algebra R C
inst✝ : Algebra R D
f : A →ₐ[R] B
g : C →ₐ[R] D
hf : Function.Surjective ⇑f
hg : Function.Surjective ⇑g
this : map f g = AlgHom.comp (map f (AlgHom.id R D)) (map (AlgHom.id R A) g)
⊢ Ideal.map includeLeft (RingHom.ker f) = Ideal.map (map (AlgHom.id R A) g) (Ideal.map includeLeft (RingHom.ker f))

Next tactic:
simp only [AlgHom.coe_ideal_map, Ideal.map_map]
/-- If `f` and `g` are surjective morphisms of algebras, then
  the kernel of `Algebra.TensorProduct.map f g` is generated by the kernels of `f` and `g` -/
theorem Algebra.TensorProduct.map_ker (hf : Function.Surjective f) (hg : Function.Surjective g) :
    RingHom.ker (map f g) =
      (RingHom.ker f).map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] C) ⊔
        (RingHom.ker g).map (Algebra.TensorProduct.includeRight : C →ₐ[R] A ⊗[R] C) := by
  -- rewrite map f g as the composition of two maps
  have : map f g = (map f (AlgHom.id R D)).comp (map (AlgHom.id R A) g) := ext rfl rfl
  rw [this]
  -- this needs some rewriting to RingHom
  simp only [AlgHom.coe_ker, AlgHom.comp_toRingHom]
  rw [← RingHom.comap_ker]
  simp only [← AlgHom.coe_ker]
  -- apply one step of exactness
  rw [← Algebra.TensorProduct.lTensor_ker _ hg, RingHom.ker_eq_comap_bot (map (AlgHom.id R A) g)]
  rw [← Ideal.comap_map_of_surjective _ (lTensor.surjective A hg)]
  -- apply the other step of exactness
  rw [Algebra.TensorProduct.rTensor_ker _ hf]
  apply congr_arg₂ _ rfl
  simp only [AlgHom.coe_ideal_map, Ideal.map_map]
  

Proof state:
R✝ : Type u_1
inst✝¹³ : CommSemiring R✝
A✝ : Type u_2
B✝ : Type u_3
inst✝¹² : Semiring A✝
inst✝¹¹ : Semiring B✝
inst✝¹⁰ : Algebra R✝ A✝
inst✝⁹ : Algebra R✝ B✝
R : Type u_4
inst✝⁸ : CommRing R
A : Type u_5
B : Type u_6
C : Type u_7
D : Type u_8
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Ring C
inst✝⁴ : Ring D
inst✝³ : Algebra R A
inst✝² : Algebra R B
inst✝¹ : Algebra R C
inst✝ : Algebra R D
f : A →ₐ[R] B
g : C →ₐ[R] D
hf : Function.Surjective ⇑f
hg : Function.Surjective ⇑g
this : map f g = AlgHom.comp (map f (AlgHom.id R D)) (map (AlgHom.id R A) g)
⊢ Ideal.map (↑includeLeft) (RingHom.ker f) =
    Ideal.map (RingHom.comp ↑(map (AlgHom.id R A) g) ↑includeLeft) (RingHom.ker f)

Next tactic:
rw [← AlgHom.comp_toRingHom, Algebra.TensorProduct.map_comp_includeLeft]
/-- If `f` and `g` are surjective morphisms of algebras, then
  the kernel of `Algebra.TensorProduct.map f g` is generated by the kernels of `f` and `g` -/
theorem Algebra.TensorProduct.map_ker (hf : Function.Surjective f) (hg : Function.Surjective g) :
    RingHom.ker (map f g) =
      (RingHom.ker f).map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] C) ⊔
        (RingHom.ker g).map (Algebra.TensorProduct.includeRight : C →ₐ[R] A ⊗[R] C) := by
  -- rewrite map f g as the composition of two maps
  have : map f g = (map f (AlgHom.id R D)).comp (map (AlgHom.id R A) g) := ext rfl rfl
  rw [this]
  -- this needs some rewriting to RingHom
  simp only [AlgHom.coe_ker, AlgHom.comp_toRingHom]
  rw [← RingHom.comap_ker]
  simp only [← AlgHom.coe_ker]
  -- apply one step of exactness
  rw [← Algebra.TensorProduct.lTensor_ker _ hg, RingHom.ker_eq_comap_bot (map (AlgHom.id R A) g)]
  rw [← Ideal.comap_map_of_surjective _ (lTensor.surjective A hg)]
  -- apply the other step of exactness
  rw [Algebra.TensorProduct.rTensor_ker _ hf]
  apply congr_arg₂ _ rfl
  simp only [AlgHom.coe_ideal_map, Ideal.map_map]
  rw [← AlgHom.comp_toRingHom, Algebra.TensorProduct.map_comp_includeLeft]
  

Proof state:
R✝ : Type u_1
inst✝¹³ : CommSemiring R✝
A✝ : Type u_2
B✝ : Type u_3
inst✝¹² : Semiring A✝
inst✝¹¹ : Semiring B✝
inst✝¹⁰ : Algebra R✝ A✝
inst✝⁹ : Algebra R✝ B✝
R : Type u_4
inst✝⁸ : CommRing R
A : Type u_5
B : Type u_6
C : Type u_7
D : Type u_8
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Ring C
inst✝⁴ : Ring D
inst✝³ : Algebra R A
inst✝² : Algebra R B
inst✝¹ : Algebra R C
inst✝ : Algebra R D
f : A →ₐ[R] B
g : C →ₐ[R] D
hf : Function.Surjective ⇑f
hg : Function.Surjective ⇑g
this : map f g = AlgHom.comp (map f (AlgHom.id R D)) (map (AlgHom.id R A) g)
⊢ Ideal.map (↑includeLeft) (RingHom.ker f) = Ideal.map (↑(AlgHom.comp includeLeft (AlgHom.id R A))) (RingHom.ker f)

Next tactic:
rfl
theorem covby_sup_of_inf_covby_of_inf_covby_right : a ⊓ b ⋖ a → a ⊓ b ⋖ b → b ⋖ a ⊔ b := by
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakUpperModularLattice α
a b : α
⊢ a ⊓ b ⋖ a → a ⊓ b ⋖ b → b ⋖ a ⊔ b

Next tactic:
rw [inf_comm, sup_comm]
theorem covby_sup_of_inf_covby_of_inf_covby_right : a ⊓ b ⋖ a → a ⊓ b ⋖ b → b ⋖ a ⊔ b := by
  rw [inf_comm, sup_comm]
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakUpperModularLattice α
a b : α
⊢ b ⊓ a ⋖ a → b ⊓ a ⋖ b → b ⋖ b ⊔ a

Next tactic:
exact fun ha hb => covby_sup_of_inf_covby_of_inf_covby_left hb ha
theorem inf_covby_of_covby_sup_of_covby_sup_right : a ⋖ a ⊔ b → b ⋖ a ⊔ b → a ⊓ b ⋖ b := by
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakLowerModularLattice α
a b : α
⊢ a ⋖ a ⊔ b → b ⋖ a ⊔ b → a ⊓ b ⋖ b

Next tactic:
rw [sup_comm, inf_comm]
theorem inf_covby_of_covby_sup_of_covby_sup_right : a ⋖ a ⊔ b → b ⋖ a ⊔ b → a ⊓ b ⋖ b := by
  rw [sup_comm, inf_comm]
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakLowerModularLattice α
a b : α
⊢ a ⋖ b ⊔ a → b ⋖ b ⊔ a → b ⊓ a ⋖ b

Next tactic:
exact fun ha hb => inf_covby_of_covby_sup_of_covby_sup_left hb ha
theorem covby_sup_of_inf_covby_right : a ⊓ b ⋖ b → a ⋖ a ⊔ b := by
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsUpperModularLattice α
a b : α
⊢ a ⊓ b ⋖ b → a ⋖ a ⊔ b

Next tactic:
rw [sup_comm, inf_comm]
theorem covby_sup_of_inf_covby_right : a ⊓ b ⋖ b → a ⋖ a ⊔ b := by
  rw [sup_comm, inf_comm]
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsUpperModularLattice α
a b : α
⊢ b ⊓ a ⋖ b → a ⋖ b ⊔ a

Next tactic:
exact covby_sup_of_inf_covby_left
theorem inf_covby_of_covby_sup_right : b ⋖ a ⊔ b → a ⊓ b ⋖ a := by
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsLowerModularLattice α
a b : α
⊢ b ⋖ a ⊔ b → a ⊓ b ⋖ a

Next tactic:
rw [inf_comm, sup_comm]
theorem inf_covby_of_covby_sup_right : b ⋖ a ⊔ b → a ⊓ b ⋖ a := by
  rw [inf_comm, sup_comm]
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsLowerModularLattice α
a b : α
⊢ b ⋖ b ⊔ a → b ⊓ a ⋖ a

Next tactic:
exact inf_covby_of_covby_sup_left
theorem inf_sup_assoc_of_le {x : α} (y : α) {z : α} (h : z ≤ x) : x ⊓ y ⊔ z = x ⊓ (y ⊔ z) := by
  

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x y z : α
h : z ≤ x
⊢ x ⊓ y ⊔ z = x ⊓ (y ⊔ z)

Next tactic:
rw [inf_comm, sup_comm, ← sup_inf_assoc_of_le y h, inf_comm, sup_comm]
instance : IsModularLattice αᵒᵈ :=
  ⟨fun y z xz =>
    le_of_eq
      (by
        

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y z : αᵒᵈ
xz : x✝ ≤ z
⊢ (x✝ ⊔ y) ⊓ z = x✝ ⊔ y ⊓ z

Next tactic:
rw [inf_comm, sup_comm, eq_comm, inf_comm, sup_comm]
instance : IsModularLattice αᵒᵈ :=
  ⟨fun y z xz =>
    le_of_eq
      (by
        rw [inf_comm, sup_comm, eq_comm, inf_comm, sup_comm]
        

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y z : αᵒᵈ
xz : x✝ ≤ z
⊢ z ⊓ y ⊔ x✝ = z ⊓ (y ⊔ x✝)

Next tactic:
exact @sup_inf_assoc_of_le α _ _ _ y _ xz
theorem eq_of_le_of_inf_le_of_sup_le (hxy : x ≤ y) (hinf : y ⊓ z ≤ x ⊓ z) (hsup : y ⊔ z ≤ x ⊔ z) :
    x = y :=
  le_antisymm hxy <|
    have h : y ≤ x ⊔ z :=
      calc
        y ≤ y ⊔ z := le_sup_left
        _ ≤ x ⊔ z := hsup
    calc
      y ≤ (x ⊔ z) ⊓ y := le_inf h le_rfl
      _ = x ⊔ z ⊓ y := sup_inf_assoc_of_le _ hxy
      _ ≤ x ⊔ z ⊓ x := sup_le_sup_left (by 

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x y z : α
hxy : x ≤ y
hinf : y ⊓ z ≤ x ⊓ z
hsup : y ⊔ z ≤ x ⊔ z
h : y ≤ x ⊔ z
⊢ z ⊓ y ≤ z ⊓ x

Next tactic:
rw [inf_comm, @inf_comm _ _ z]
theorem eq_of_le_of_inf_le_of_sup_le (hxy : x ≤ y) (hinf : y ⊓ z ≤ x ⊓ z) (hsup : y ⊔ z ≤ x ⊔ z) :
    x = y :=
  le_antisymm hxy <|
    have h : y ≤ x ⊔ z :=
      calc
        y ≤ y ⊔ z := le_sup_left
        _ ≤ x ⊔ z := hsup
    calc
      y ≤ (x ⊔ z) ⊓ y := le_inf h le_rfl
      _ = x ⊔ z ⊓ y := sup_inf_assoc_of_le _ hxy
      _ ≤ x ⊔ z ⊓ x := sup_le_sup_left (by rw [inf_comm, @inf_comm _ _ z]; 

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x y z : α
hxy : x ≤ y
hinf : y ⊓ z ≤ x ⊓ z
hsup : y ⊔ z ≤ x ⊔ z
h : y ≤ x ⊔ z
⊢ y ⊓ z ≤ x ⊓ z

Next tactic:
exact hinf
/-- A generalization of the theorem that if `N` is a submodule of `M` and
  `N` and `M / N` are both Artinian, then `M` is Artinian. -/
theorem wellFounded_lt_exact_sequence {β γ : Type*} [PartialOrder β] [Preorder γ]
    (h₁ : WellFounded ((· < ·) : β → β → Prop)) (h₂ : WellFounded ((· < ·) : γ → γ → Prop)) (K : α)
    (f₁ : β → α) (f₂ : α → β) (g₁ : γ → α) (g₂ : α → γ) (gci : GaloisCoinsertion f₁ f₂)
    (gi : GaloisInsertion g₂ g₁) (hf : ∀ a, f₁ (f₂ a) = a ⊓ K) (hg : ∀ a, g₁ (g₂ a) = a ⊔ K) :
    WellFounded ((· < ·) : α → α → Prop) :=
  Subrelation.wf
    (@fun A B hAB =>
      show Prod.Lex (· < ·) (· < ·) (f₂ A, g₂ A) (f₂ B, g₂ B) by
        

Proof state:
α : Type u_1
inst✝³ : Lattice α
inst✝² : IsModularLattice α
x y z : α
β : Type u_2
γ : Type u_3
inst✝¹ : PartialOrder β
inst✝ : Preorder γ
h₁ : WellFounded fun x x_1 => x < x_1
h₂ : WellFounded fun x x_1 => x < x_1
K : α
f₁ : β → α
f₂ : α → β
g₁ : γ → α
g₂ : α → γ
gci : GaloisCoinsertion f₁ f₂
gi : GaloisInsertion g₂ g₁
hf : ∀ (a : α), f₁ (f₂ a) = a ⊓ K
hg : ∀ (a : α), g₁ (g₂ a) = a ⊔ K
A B : α
hAB : A < B
⊢ Prod.Lex (fun x x_1 => x < x_1) (fun x x_1 => x < x_1) (f₂ A, g₂ A) (f₂ B, g₂ B)

Next tactic:
simp only [Prod.lex_def, lt_iff_le_not_le, ← gci.l_le_l_iff, ← gi.u_le_u_iff, hf, hg,
          le_antisymm_iff]
/-- A generalization of the theorem that if `N` is a submodule of `M` and
  `N` and `M / N` are both Artinian, then `M` is Artinian. -/
theorem wellFounded_lt_exact_sequence {β γ : Type*} [PartialOrder β] [Preorder γ]
    (h₁ : WellFounded ((· < ·) : β → β → Prop)) (h₂ : WellFounded ((· < ·) : γ → γ → Prop)) (K : α)
    (f₁ : β → α) (f₂ : α → β) (g₁ : γ → α) (g₂ : α → γ) (gci : GaloisCoinsertion f₁ f₂)
    (gi : GaloisInsertion g₂ g₁) (hf : ∀ a, f₁ (f₂ a) = a ⊓ K) (hg : ∀ a, g₁ (g₂ a) = a ⊔ K) :
    WellFounded ((· < ·) : α → α → Prop) :=
  Subrelation.wf
    (@fun A B hAB =>
      show Prod.Lex (· < ·) (· < ·) (f₂ A, g₂ A) (f₂ B, g₂ B) by
        simp only [Prod.lex_def, lt_iff_le_not_le, ← gci.l_le_l_iff, ← gi.u_le_u_iff, hf, hg,
          le_antisymm_iff]
        

Proof state:
α : Type u_1
inst✝³ : Lattice α
inst✝² : IsModularLattice α
x y z : α
β : Type u_2
γ : Type u_3
inst✝¹ : PartialOrder β
inst✝ : Preorder γ
h₁ : WellFounded fun x x_1 => x < x_1
h₂ : WellFounded fun x x_1 => x < x_1
K : α
f₁ : β → α
f₂ : α → β
g₁ : γ → α
g₂ : α → γ
gci : GaloisCoinsertion f₁ f₂
gi : GaloisInsertion g₂ g₁
hf : ∀ (a : α), f₁ (f₂ a) = a ⊓ K
hg : ∀ (a : α), g₁ (g₂ a) = a ⊔ K
A B : α
hAB : A < B
⊢ A ⊓ K ≤ B ⊓ K ∧ ¬B ⊓ K ≤ A ⊓ K ∨ (A ⊓ K ≤ B ⊓ K ∧ B ⊓ K ≤ A ⊓ K) ∧ A ⊔ K ≤ B ⊔ K ∧ ¬B ⊔ K ≤ A ⊔ K

Next tactic:
simp only [gci.l_le_l_iff, gi.u_le_u_iff, ← lt_iff_le_not_le, ← le_antisymm_iff]
/-- A generalization of the theorem that if `N` is a submodule of `M` and
  `N` and `M / N` are both Artinian, then `M` is Artinian. -/
theorem wellFounded_lt_exact_sequence {β γ : Type*} [PartialOrder β] [Preorder γ]
    (h₁ : WellFounded ((· < ·) : β → β → Prop)) (h₂ : WellFounded ((· < ·) : γ → γ → Prop)) (K : α)
    (f₁ : β → α) (f₂ : α → β) (g₁ : γ → α) (g₂ : α → γ) (gci : GaloisCoinsertion f₁ f₂)
    (gi : GaloisInsertion g₂ g₁) (hf : ∀ a, f₁ (f₂ a) = a ⊓ K) (hg : ∀ a, g₁ (g₂ a) = a ⊔ K) :
    WellFounded ((· < ·) : α → α → Prop) :=
  Subrelation.wf
    (@fun A B hAB =>
      show Prod.Lex (· < ·) (· < ·) (f₂ A, g₂ A) (f₂ B, g₂ B) by
        simp only [Prod.lex_def, lt_iff_le_not_le, ← gci.l_le_l_iff, ← gi.u_le_u_iff, hf, hg,
          le_antisymm_iff]
        simp only [gci.l_le_l_iff, gi.u_le_u_iff, ← lt_iff_le_not_le, ← le_antisymm_iff]
        

Proof state:
α : Type u_1
inst✝³ : Lattice α
inst✝² : IsModularLattice α
x y z : α
β : Type u_2
γ : Type u_3
inst✝¹ : PartialOrder β
inst✝ : Preorder γ
h₁ : WellFounded fun x x_1 => x < x_1
h₂ : WellFounded fun x x_1 => x < x_1
K : α
f₁ : β → α
f₂ : α → β
g₁ : γ → α
g₂ : α → γ
gci : GaloisCoinsertion f₁ f₂
gi : GaloisInsertion g₂ g₁
hf : ∀ (a : α), f₁ (f₂ a) = a ⊓ K
hg : ∀ (a : α), g₁ (g₂ a) = a ⊔ K
A B : α
hAB : A < B
⊢ A ⊓ K < B ⊓ K ∨ A ⊓ K = B ⊓ K ∧ A ⊔ K < B ⊔ K

Next tactic:
rcases lt_or_eq_of_le (inf_le_inf_right K (le_of_lt hAB)) with h | h
/-- A generalization of the theorem that if `N` is a submodule of `M` and
  `N` and `M / N` are both Artinian, then `M` is Artinian. -/
theorem wellFounded_lt_exact_sequence {β γ : Type*} [PartialOrder β] [Preorder γ]
    (h₁ : WellFounded ((· < ·) : β → β → Prop)) (h₂ : WellFounded ((· < ·) : γ → γ → Prop)) (K : α)
    (f₁ : β → α) (f₂ : α → β) (g₁ : γ → α) (g₂ : α → γ) (gci : GaloisCoinsertion f₁ f₂)
    (gi : GaloisInsertion g₂ g₁) (hf : ∀ a, f₁ (f₂ a) = a ⊓ K) (hg : ∀ a, g₁ (g₂ a) = a ⊔ K) :
    WellFounded ((· < ·) : α → α → Prop) :=
  Subrelation.wf
    (@fun A B hAB =>
      show Prod.Lex (· < ·) (· < ·) (f₂ A, g₂ A) (f₂ B, g₂ B) by
        simp only [Prod.lex_def, lt_iff_le_not_le, ← gci.l_le_l_iff, ← gi.u_le_u_iff, hf, hg,
          le_antisymm_iff]
        simp only [gci.l_le_l_iff, gi.u_le_u_iff, ← lt_iff_le_not_le, ← le_antisymm_iff]
        rcases lt_or_eq_of_le (inf_le_inf_right K (le_of_lt hAB)) with h | h
        · 

Proof state:
case inl
α : Type u_1
inst✝³ : Lattice α
inst✝² : IsModularLattice α
x y z : α
β : Type u_2
γ : Type u_3
inst✝¹ : PartialOrder β
inst✝ : Preorder γ
h₁ : WellFounded fun x x_1 => x < x_1
h₂ : WellFounded fun x x_1 => x < x_1
K : α
f₁ : β → α
f₂ : α → β
g₁ : γ → α
g₂ : α → γ
gci : GaloisCoinsertion f₁ f₂
gi : GaloisInsertion g₂ g₁
hf : ∀ (a : α), f₁ (f₂ a) = a ⊓ K
hg : ∀ (a : α), g₁ (g₂ a) = a ⊔ K
A B : α
hAB : A < B
h : A ⊓ K < B ⊓ K
⊢ A ⊓ K < B ⊓ K ∨ A ⊓ K = B ⊓ K ∧ A ⊔ K < B ⊔ K

Next tactic:
exact Or.inl h
/-- A generalization of the theorem that if `N` is a submodule of `M` and
  `N` and `M / N` are both Artinian, then `M` is Artinian. -/
theorem wellFounded_lt_exact_sequence {β γ : Type*} [PartialOrder β] [Preorder γ]
    (h₁ : WellFounded ((· < ·) : β → β → Prop)) (h₂ : WellFounded ((· < ·) : γ → γ → Prop)) (K : α)
    (f₁ : β → α) (f₂ : α → β) (g₁ : γ → α) (g₂ : α → γ) (gci : GaloisCoinsertion f₁ f₂)
    (gi : GaloisInsertion g₂ g₁) (hf : ∀ a, f₁ (f₂ a) = a ⊓ K) (hg : ∀ a, g₁ (g₂ a) = a ⊔ K) :
    WellFounded ((· < ·) : α → α → Prop) :=
  Subrelation.wf
    (@fun A B hAB =>
      show Prod.Lex (· < ·) (· < ·) (f₂ A, g₂ A) (f₂ B, g₂ B) by
        simp only [Prod.lex_def, lt_iff_le_not_le, ← gci.l_le_l_iff, ← gi.u_le_u_iff, hf, hg,
          le_antisymm_iff]
        simp only [gci.l_le_l_iff, gi.u_le_u_iff, ← lt_iff_le_not_le, ← le_antisymm_iff]
        rcases lt_or_eq_of_le (inf_le_inf_right K (le_of_lt hAB)) with h | h
        · exact Or.inl h
        · 

Proof state:
case inr
α : Type u_1
inst✝³ : Lattice α
inst✝² : IsModularLattice α
x y z : α
β : Type u_2
γ : Type u_3
inst✝¹ : PartialOrder β
inst✝ : Preorder γ
h₁ : WellFounded fun x x_1 => x < x_1
h₂ : WellFounded fun x x_1 => x < x_1
K : α
f₁ : β → α
f₂ : α → β
g₁ : γ → α
g₂ : α → γ
gci : GaloisCoinsertion f₁ f₂
gi : GaloisInsertion g₂ g₁
hf : ∀ (a : α), f₁ (f₂ a) = a ⊓ K
hg : ∀ (a : α), g₁ (g₂ a) = a ⊔ K
A B : α
hAB : A < B
h : A ⊓ K = B ⊓ K
⊢ A ⊓ K < B ⊓ K ∨ A ⊓ K = B ⊓ K ∧ A ⊔ K < B ⊔ K

Next tactic:
exact Or.inr ⟨h, sup_lt_sup_of_lt_of_inf_le_inf hAB (le_of_eq h.symm)⟩
/-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/
@[simps]
def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b) where
  toFun x := ⟨x ⊔ b, ⟨le_sup_right, sup_le_sup_right x.prop.2 b⟩⟩
  invFun x := ⟨a ⊓ x, ⟨inf_le_inf_left a x.prop.1, inf_le_left⟩⟩
  left_inv x :=
    Subtype.ext
      (by
        

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y z a b : α
x : ↑(Icc (a ⊓ b) a)
⊢ ↑((fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) })
        ((fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) }) x)) =
    ↑x

Next tactic:
change a ⊓ (↑x ⊔ b) = ↑x
/-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/
@[simps]
def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b) where
  toFun x := ⟨x ⊔ b, ⟨le_sup_right, sup_le_sup_right x.prop.2 b⟩⟩
  invFun x := ⟨a ⊓ x, ⟨inf_le_inf_left a x.prop.1, inf_le_left⟩⟩
  left_inv x :=
    Subtype.ext
      (by
        change a ⊓ (↑x ⊔ b) = ↑x
        

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y z a b : α
x : ↑(Icc (a ⊓ b) a)
⊢ a ⊓ (↑x ⊔ b) = ↑x

Next tactic:
rw [sup_comm, ← inf_sup_assoc_of_le _ x.prop.2, sup_eq_right.2 x.prop.1]
/-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/
@[simps]
def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b) where
  toFun x := ⟨x ⊔ b, ⟨le_sup_right, sup_le_sup_right x.prop.2 b⟩⟩
  invFun x := ⟨a ⊓ x, ⟨inf_le_inf_left a x.prop.1, inf_le_left⟩⟩
  left_inv x :=
    Subtype.ext
      (by
        change a ⊓ (↑x ⊔ b) = ↑x
        rw [sup_comm, ← inf_sup_assoc_of_le _ x.prop.2, sup_eq_right.2 x.prop.1])
  right_inv x :=
    Subtype.ext
      (by
        

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y z a b : α
x : ↑(Icc b (a ⊔ b))
⊢ ↑((fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) })
        ((fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) }) x)) =
    ↑x

Next tactic:
change a ⊓ ↑x ⊔ b = ↑x
/-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/
@[simps]
def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b) where
  toFun x := ⟨x ⊔ b, ⟨le_sup_right, sup_le_sup_right x.prop.2 b⟩⟩
  invFun x := ⟨a ⊓ x, ⟨inf_le_inf_left a x.prop.1, inf_le_left⟩⟩
  left_inv x :=
    Subtype.ext
      (by
        change a ⊓ (↑x ⊔ b) = ↑x
        rw [sup_comm, ← inf_sup_assoc_of_le _ x.prop.2, sup_eq_right.2 x.prop.1])
  right_inv x :=
    Subtype.ext
      (by
        change a ⊓ ↑x ⊔ b = ↑x
        

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y z a b : α
x : ↑(Icc b (a ⊔ b))
⊢ a ⊓ ↑x ⊔ b = ↑x

Next tactic:
rw [inf_comm, inf_sup_assoc_of_le _ x.prop.1, inf_eq_left.2 x.prop.2]
/-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/
@[simps]
def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b) where
  toFun x := ⟨x ⊔ b, ⟨le_sup_right, sup_le_sup_right x.prop.2 b⟩⟩
  invFun x := ⟨a ⊓ x, ⟨inf_le_inf_left a x.prop.1, inf_le_left⟩⟩
  left_inv x :=
    Subtype.ext
      (by
        change a ⊓ (↑x ⊔ b) = ↑x
        rw [sup_comm, ← inf_sup_assoc_of_le _ x.prop.2, sup_eq_right.2 x.prop.1])
  right_inv x :=
    Subtype.ext
      (by
        change a ⊓ ↑x ⊔ b = ↑x
        rw [inf_comm, inf_sup_assoc_of_le _ x.prop.1, inf_eq_left.2 x.prop.2])
  map_rel_iff' := @fun x y => by
    

Proof state:
α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsModularLattice α
x✝ y✝ z a b : α
x y : ↑(Icc (a ⊓ b) a)
⊢ { toFun := fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) },
          invFun := fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) },
          left_inv :=
            (_ :
              ∀ (x : ↑(Icc (a ⊓ b) a)),
                (fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) })
                    ((fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) }) x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : ↑(Icc b (a ⊔ b))),
                (fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) })
                    ((fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) }) x) =
                  x) }
        x ≤
      { toFun := fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) },
          invFun := fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) },
          left_inv :=
            (_ :
              ∀ (x : ↑(Icc (a ⊓ b) a)),
                (fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) })
                    ((fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) }) x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : ↑(Icc b (a ⊔ b))),
                (fun x => { val := ↑x ⊔ b, property := (_ : b ≤ ↑x ⊔ b ∧ ↑x ⊔ b ≤ a ⊔ b) })
                    ((fun x => { val := a ⊓ ↑x, property := (_ : a ⊓ b ≤ a ⊓ ↑x ∧ a ⊓ ↑x ≤ a) }) x) =
                  x) }
        y ↔
    x ≤ y

Next tactic:
simp only [Subtype.mk_le_mk, Equiv.coe_fn_mk, and_true_iff, le_sup_right]