l3lab/ntp-mathlib huggingface dataset:
theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →ₗ[R] P) (x) :
    F x =
      lift R ι G f (fun i => F.comp <| of R ι G f i)
        (fun i j hij x => by rw [LinearMap.comp_apply, of_f]; rfl) x := by
  cases isEmpty_or_nonempty ι
  · simp_rw [Subsingleton.elim x 0, _root_.map_zero]
  · exact DirectLimit.induction_on x fun i x => by 

Proof state:
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →ₗ[R] P
x✝ : DirectLimit G f
h✝ : Nonempty ι
i : ι
x : G i
⊢ F ((of R ι G f i) x) =
    (lift R ι G f (fun i => F ∘ₗ of R ι G f i)
        (_ :
          ∀ (i j : ι) (hij : i ≤ j) (x : G i),
            ((fun i => F ∘ₗ of R ι G f i) j) ((f i j hij) x) = ((fun i => F ∘ₗ of R ι G f i) i) x))
      ((of R ι G f i) x)

Next tactic:
rw [lift_of]
theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →ₗ[R] P) (x) :
    F x =
      lift R ι G f (fun i => F.comp <| of R ι G f i)
        (fun i j hij x => by rw [LinearMap.comp_apply, of_f]; rfl) x := by
  cases isEmpty_or_nonempty ι
  · simp_rw [Subsingleton.elim x 0, _root_.map_zero]
  · exact DirectLimit.induction_on x fun i x => by rw [lift_of]; 

Proof state:
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →ₗ[R] P
x✝ : DirectLimit G f
h✝ : Nonempty ι
i : ι
x : G i
⊢ F ((of R ι G f i) x) = (F ∘ₗ of R ι G f i) x

Next tactic:
rfl
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  

Proof state:
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
injective : ∀ (i : ι), Function.Injective ⇑(g i)
⊢ Function.Injective ⇑(lift R ι G f g Hg)

Next tactic:
cases isEmpty_or_nonempty ι
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  cases isEmpty_or_nonempty ι
  · 

Proof state:
case inl
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
injective : ∀ (i : ι), Function.Injective ⇑(g i)
h✝ : IsEmpty ι
⊢ Function.Injective ⇑(lift R ι G f g Hg)

Next tactic:
apply Function.injective_of_subsingleton
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  cases isEmpty_or_nonempty ι
  · apply Function.injective_of_subsingleton
  

Proof state:
case inr
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
injective : ∀ (i : ι), Function.Injective ⇑(g i)
h✝ : Nonempty ι
⊢ Function.Injective ⇑(lift R ι G f g Hg)

Next tactic:
simp_rw [injective_iff_map_eq_zero] at injective ⊢
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  cases isEmpty_or_nonempty ι
  · apply Function.injective_of_subsingleton
  simp_rw [injective_iff_map_eq_zero] at injective ⊢
  

Proof state:
case inr
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
h✝ : Nonempty ι
injective : ∀ (i : ι) (a : G i), (g i) a = 0 → a = 0
⊢ ∀ (a : DirectLimit G f), (lift R ι G f g Hg) a = 0 → a = 0

Next tactic:
intros z hz
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  cases isEmpty_or_nonempty ι
  · apply Function.injective_of_subsingleton
  simp_rw [injective_iff_map_eq_zero] at injective ⊢
  intros z hz
  

Proof state:
case inr
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
h✝ : Nonempty ι
injective : ∀ (i : ι) (a : G i), (g i) a = 0 → a = 0
z : DirectLimit G f
hz : (lift R ι G f g Hg) z = 0
⊢ z = 0

Next tactic:
induction' z using DirectLimit.induction_on with _ g
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  cases isEmpty_or_nonempty ι
  · apply Function.injective_of_subsingleton
  simp_rw [injective_iff_map_eq_zero] at injective ⊢
  intros z hz
  induction' z using DirectLimit.induction_on with _ g
  

Proof state:
case inr.ih
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g✝ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝ j) ((f i j hij) x) = (g✝ i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
h✝ : Nonempty ι
injective : ∀ (i : ι) (a : G i), (g✝ i) a = 0 → a = 0
i✝ : ι
g : G i✝
hz : (lift R ι G f g✝ Hg) ((of R ι G f i✝) g) = 0
⊢ (of R ι G f i✝) g = 0

Next tactic:
rw [lift_of] at hz
lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) := by
  cases isEmpty_or_nonempty ι
  · apply Function.injective_of_subsingleton
  simp_rw [injective_iff_map_eq_zero] at injective ⊢
  intros z hz
  induction' z using DirectLimit.induction_on with _ g
  rw [lift_of] at hz
  

Proof state:
case inr.ih
R : Type u
inst✝⁶ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type w
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝² : AddCommGroup P
inst✝¹ : Module R P
g✝ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝ j) ((f i j hij) x) = (g✝ i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
h✝ : Nonempty ι
injective : ∀ (i : ι) (a : G i), (g✝ i) a = 0 → a = 0
i✝ : ι
g : G i✝
hz : (g✝ i✝) g = 0
⊢ (of R ι G f i✝) g = 0

Next tactic:
rw [injective _ g hz, _root_.map_zero]
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of linear maps `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a linear map
`lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →ₗ[R] G' i) (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i) :
    DirectLimit G f →ₗ[R] DirectLimit G' f' :=
  lift _ _ _ _ (fun i ↦ of _ _ _ _ _ ∘ₗ g i) fun i j h g ↦ by
    

Proof state:
R : Type u
inst✝⁹ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁸ : Preorder ι
G : ι → Type w
inst✝⁷ : (i : ι) → AddCommGroup (G i)
inst✝⁶ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁵ : AddCommGroup P
inst✝⁴ : Module R P
g✝¹ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝¹ j) ((f i j hij) x) = (g✝¹ i) x
G' : ι → Type v'
inst✝³ : (i : ι) → AddCommGroup (G' i)
inst✝² : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝¹ : (i : ι) → AddCommGroup (G'' i)
inst✝ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
g✝ : (i : ι) → G i →ₗ[R] G' i
hg : ∀ (i j : ι) (h : i ≤ j), g✝ j ∘ₗ f i j h = f' i j h ∘ₗ g✝ i
i j : ι
h : i ≤ j
g : G i
⊢ ((fun i => of R ι G' f' i ∘ₗ g✝ i) j) ((f i j h) g) = ((fun i => of R ι G' f' i ∘ₗ g✝ i) i) g

Next tactic:
cases isEmpty_or_nonempty ι
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of linear maps `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a linear map
`lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →ₗ[R] G' i) (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i) :
    DirectLimit G f →ₗ[R] DirectLimit G' f' :=
  lift _ _ _ _ (fun i ↦ of _ _ _ _ _ ∘ₗ g i) fun i j h g ↦ by
    cases isEmpty_or_nonempty ι
    · 

Proof state:
case inl
R : Type u
inst✝⁹ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁸ : Preorder ι
G : ι → Type w
inst✝⁷ : (i : ι) → AddCommGroup (G i)
inst✝⁶ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁵ : AddCommGroup P
inst✝⁴ : Module R P
g✝¹ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝¹ j) ((f i j hij) x) = (g✝¹ i) x
G' : ι → Type v'
inst✝³ : (i : ι) → AddCommGroup (G' i)
inst✝² : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝¹ : (i : ι) → AddCommGroup (G'' i)
inst✝ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
g✝ : (i : ι) → G i →ₗ[R] G' i
hg : ∀ (i j : ι) (h : i ≤ j), g✝ j ∘ₗ f i j h = f' i j h ∘ₗ g✝ i
i j : ι
h : i ≤ j
g : G i
h✝ : IsEmpty ι
⊢ ((fun i => of R ι G' f' i ∘ₗ g✝ i) j) ((f i j h) g) = ((fun i => of R ι G' f' i ∘ₗ g✝ i) i) g

Next tactic:
exact Subsingleton.elim _ _
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of linear maps `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a linear map
`lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →ₗ[R] G' i) (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i) :
    DirectLimit G f →ₗ[R] DirectLimit G' f' :=
  lift _ _ _ _ (fun i ↦ of _ _ _ _ _ ∘ₗ g i) fun i j h g ↦ by
    cases isEmpty_or_nonempty ι
    · exact Subsingleton.elim _ _
    · 

Proof state:
case inr
R : Type u
inst✝⁹ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁸ : Preorder ι
G : ι → Type w
inst✝⁷ : (i : ι) → AddCommGroup (G i)
inst✝⁶ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁵ : AddCommGroup P
inst✝⁴ : Module R P
g✝¹ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝¹ j) ((f i j hij) x) = (g✝¹ i) x
G' : ι → Type v'
inst✝³ : (i : ι) → AddCommGroup (G' i)
inst✝² : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝¹ : (i : ι) → AddCommGroup (G'' i)
inst✝ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
g✝ : (i : ι) → G i →ₗ[R] G' i
hg : ∀ (i j : ι) (h : i ≤ j), g✝ j ∘ₗ f i j h = f' i j h ∘ₗ g✝ i
i j : ι
h : i ≤ j
g : G i
h✝ : Nonempty ι
⊢ ((fun i => of R ι G' f' i ∘ₗ g✝ i) j) ((f i j h) g) = ((fun i => of R ι G' f' i ∘ₗ g✝ i) i) g

Next tactic:
have eq1 := LinearMap.congr_fun (hg i j h) g
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of linear maps `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a linear map
`lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →ₗ[R] G' i) (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i) :
    DirectLimit G f →ₗ[R] DirectLimit G' f' :=
  lift _ _ _ _ (fun i ↦ of _ _ _ _ _ ∘ₗ g i) fun i j h g ↦ by
    cases isEmpty_or_nonempty ι
    · exact Subsingleton.elim _ _
    · have eq1 := LinearMap.congr_fun (hg i j h) g
      

Proof state:
case inr
R : Type u
inst✝⁹ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁸ : Preorder ι
G : ι → Type w
inst✝⁷ : (i : ι) → AddCommGroup (G i)
inst✝⁶ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁵ : AddCommGroup P
inst✝⁴ : Module R P
g✝¹ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝¹ j) ((f i j hij) x) = (g✝¹ i) x
G' : ι → Type v'
inst✝³ : (i : ι) → AddCommGroup (G' i)
inst✝² : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝¹ : (i : ι) → AddCommGroup (G'' i)
inst✝ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
g✝ : (i : ι) → G i →ₗ[R] G' i
hg : ∀ (i j : ι) (h : i ≤ j), g✝ j ∘ₗ f i j h = f' i j h ∘ₗ g✝ i
i j : ι
h : i ≤ j
g : G i
h✝ : Nonempty ι
eq1 : (g✝ j ∘ₗ f i j h) g = (f' i j h ∘ₗ g✝ i) g
⊢ ((fun i => of R ι G' f' i ∘ₗ g✝ i) j) ((f i j h) g) = ((fun i => of R ι G' f' i ∘ₗ g✝ i) i) g

Next tactic:
simp only [LinearMap.coe_comp, Function.comp_apply] at eq1 ⊢
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of linear maps `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a linear map
`lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →ₗ[R] G' i) (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i) :
    DirectLimit G f →ₗ[R] DirectLimit G' f' :=
  lift _ _ _ _ (fun i ↦ of _ _ _ _ _ ∘ₗ g i) fun i j h g ↦ by
    cases isEmpty_or_nonempty ι
    · exact Subsingleton.elim _ _
    · have eq1 := LinearMap.congr_fun (hg i j h) g
      simp only [LinearMap.coe_comp, Function.comp_apply] at eq1 ⊢
      

Proof state:
case inr
R : Type u
inst✝⁹ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁸ : Preorder ι
G : ι → Type w
inst✝⁷ : (i : ι) → AddCommGroup (G i)
inst✝⁶ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁵ : AddCommGroup P
inst✝⁴ : Module R P
g✝¹ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝¹ j) ((f i j hij) x) = (g✝¹ i) x
G' : ι → Type v'
inst✝³ : (i : ι) → AddCommGroup (G' i)
inst✝² : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝¹ : (i : ι) → AddCommGroup (G'' i)
inst✝ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
g✝ : (i : ι) → G i →ₗ[R] G' i
hg : ∀ (i j : ι) (h : i ≤ j), g✝ j ∘ₗ f i j h = f' i j h ∘ₗ g✝ i
i j : ι
h : i ≤ j
g : G i
h✝ : Nonempty ι
eq1 : (g✝ j) ((f i j h) g) = (f' i j h) ((g✝ i) g)
⊢ (of R ι G' f' j) ((g✝ j) ((f i j h) g)) = (of R ι G' f' i) ((g✝ i) g)

Next tactic:
rw [eq1, of_f]
@[simp] lemma map_id [IsDirected ι (· ≤ ·)] :
    map (fun i ↦ LinearMap.id) (fun _ _ _ ↦ rfl) = LinearMap.id (R := R) (M := DirectLimit G f) :=
  FunLike.ext _ _ fun x ↦ (isEmpty_or_nonempty ι).elim (fun _ ↦ Subsingleton.elim _ _) fun _ ↦
    x.induction_on fun i g ↦ by 

Proof state:
R : Type u
inst✝¹⁰ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁹ : Preorder ι
G : ι → Type w
inst✝⁸ : (i : ι) → AddCommGroup (G i)
inst✝⁷ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁶ : AddCommGroup P
inst✝⁵ : Module R P
g✝ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝ j) ((f i j hij) x) = (g✝ i) x
G' : ι → Type v'
inst✝⁴ : (i : ι) → AddCommGroup (G' i)
inst✝³ : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝² : (i : ι) → AddCommGroup (G'' i)
inst✝¹ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x : DirectLimit G f
x✝ : Nonempty ι
i : ι
g : G i
⊢ (map (fun i => LinearMap.id)
        (_ :
          ∀ (x x_1 : ι) (x_2 : x ≤ x_1),
            (fun i => LinearMap.id) x_1 ∘ₗ f x x_1 x_2 = (fun i => LinearMap.id) x_1 ∘ₗ f x x_1 x_2))
      ((of R ι G f i) g) =
    LinearMap.id ((of R ι G f i) g)

Next tactic:
simp
lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →ₗ[R] G' i) (g₂ : (i : ι) → G' i →ₗ[R] G'' i)
    (hg₁ : ∀ i j h, g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i)
    (hg₂ : ∀ i j h, g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i) :
    (map g₂ hg₂ ∘ₗ map g₁ hg₁ :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'') =
    (map (fun i ↦ g₂ i ∘ₗ g₁ i) fun i j h ↦ by
        

Proof state:
R : Type u
inst✝¹⁰ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁹ : Preorder ι
G : ι → Type w
inst✝⁸ : (i : ι) → AddCommGroup (G i)
inst✝⁷ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁶ : AddCommGroup P
inst✝⁵ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
G' : ι → Type v'
inst✝⁴ : (i : ι) → AddCommGroup (G' i)
inst✝³ : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝² : (i : ι) → AddCommGroup (G'' i)
inst✝¹ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
g₁ : (i : ι) → G i →ₗ[R] G' i
g₂ : (i : ι) → G' i →ₗ[R] G'' i
hg₁ : ∀ (i j : ι) (h : i ≤ j), g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i
hg₂ : ∀ (i j : ι) (h : i ≤ j), g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i
i j : ι
h : i ≤ j
⊢ (fun i => g₂ i ∘ₗ g₁ i) j ∘ₗ f i j h = f'' i j h ∘ₗ (fun i => g₂ i ∘ₗ g₁ i) i

Next tactic:
rw [LinearMap.comp_assoc, hg₁ i, ← LinearMap.comp_assoc, hg₂ i, LinearMap.comp_assoc]
lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →ₗ[R] G' i) (g₂ : (i : ι) → G' i →ₗ[R] G'' i)
    (hg₁ : ∀ i j h, g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i)
    (hg₂ : ∀ i j h, g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i) :
    (map g₂ hg₂ ∘ₗ map g₁ hg₁ :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'') =
    (map (fun i ↦ g₂ i ∘ₗ g₁ i) fun i j h ↦ by
        rw [LinearMap.comp_assoc, hg₁ i, ← LinearMap.comp_assoc, hg₂ i, LinearMap.comp_assoc] :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'') :=
  FunLike.ext _ _ fun x ↦ (isEmpty_or_nonempty ι).elim (fun _ ↦ Subsingleton.elim _ _) fun _ ↦
    x.induction_on fun i g ↦ by 

Proof state:
R : Type u
inst✝¹⁰ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁹ : Preorder ι
G : ι → Type w
inst✝⁸ : (i : ι) → AddCommGroup (G i)
inst✝⁷ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁶ : AddCommGroup P
inst✝⁵ : Module R P
g✝ : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g✝ j) ((f i j hij) x) = (g✝ i) x
G' : ι → Type v'
inst✝⁴ : (i : ι) → AddCommGroup (G' i)
inst✝³ : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝² : (i : ι) → AddCommGroup (G'' i)
inst✝¹ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
g₁ : (i : ι) → G i →ₗ[R] G' i
g₂ : (i : ι) → G' i →ₗ[R] G'' i
hg₁ : ∀ (i j : ι) (h : i ≤ j), g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i
hg₂ : ∀ (i j : ι) (h : i ≤ j), g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i
x : DirectLimit G f
x✝ : Nonempty ι
i : ι
g : G i
⊢ (map g₂ hg₂ ∘ₗ map g₁ hg₁) ((of R ι G f i) g) =
    (map (fun i => g₂ i ∘ₗ g₁ i)
        (_ : ∀ (i j : ι) (h : i ≤ j), (fun i => g₂ i ∘ₗ g₁ i) j ∘ₗ f i j h = f'' i j h ∘ₗ (fun i => g₂ i ∘ₗ g₁ i) i))
      ((of R ι G f i) g)

Next tactic:
simp
open LinearEquiv LinearMap in
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence
`lim G ≅ lim G'`.
-/
def congr [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃ₗ[R] G' i) (he : ∀ i j h, e j ∘ₗ f i j h = f' i j h ∘ₗ e i) :
    DirectLimit G f ≃ₗ[R] DirectLimit G' f' :=
  LinearEquiv.ofLinear (map (e ·) he)
    (map (fun i ↦ (e i).symm) fun i j h ↦ by
      

Proof state:
R : Type u
inst✝¹⁰ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁹ : Preorder ι
G : ι → Type w
inst✝⁸ : (i : ι) → AddCommGroup (G i)
inst✝⁷ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁶ : AddCommGroup P
inst✝⁵ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
G' : ι → Type v'
inst✝⁴ : (i : ι) → AddCommGroup (G' i)
inst✝³ : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝² : (i : ι) → AddCommGroup (G'' i)
inst✝¹ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
e : (i : ι) → G i ≃ₗ[R] G' i
he : ∀ (i j : ι) (h : i ≤ j), ↑(e j) ∘ₗ f i j h = f' i j h ∘ₗ ↑(e i)
i j : ι
h : i ≤ j
⊢ (fun i => ↑(LinearEquiv.symm (e i))) j ∘ₗ f' i j h = f i j h ∘ₗ (fun i => ↑(LinearEquiv.symm (e i))) i

Next tactic:
rw [toLinearMap_symm_comp_eq, ← comp_assoc, he i, comp_assoc, comp_coe, symm_trans_self,
        refl_toLinearMap, comp_id]
open LinearEquiv LinearMap in
/--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence
`lim G ≅ lim G'`.
-/
def congr [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃ₗ[R] G' i) (he : ∀ i j h, e j ∘ₗ f i j h = f' i j h ∘ₗ e i) :
    DirectLimit G f ≃ₗ[R] DirectLimit G' f' :=
  LinearEquiv.ofLinear (map (e ·) he)
    (map (fun i ↦ (e i).symm) fun i j h ↦ by
      rw [toLinearMap_symm_comp_eq, ← comp_assoc, he i, comp_assoc, comp_coe, symm_trans_self,
        refl_toLinearMap, comp_id])
    (by 

Proof state:
R : Type u
inst✝¹⁰ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝⁹ : Preorder ι
G : ι → Type w
inst✝⁸ : (i : ι) → AddCommGroup (G i)
inst✝⁷ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
P : Type u₁
inst✝⁶ : AddCommGroup P
inst✝⁵ : Module R P
g : (i : ι) → G i →ₗ[R] P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x
G' : ι → Type v'
inst✝⁴ : (i : ι) → AddCommGroup (G' i)
inst✝³ : (i : ι) → Module R (G' i)
f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j
G'' : ι → Type v''
inst✝² : (i : ι) → AddCommGroup (G'' i)
inst✝¹ : (i : ι) → Module R (G'' i)
f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
e : (i : ι) → G i ≃ₗ[R] G' i
he : ∀ (i j : ι) (h : i ≤ j), ↑(e j) ∘ₗ f i j h = f' i j h ∘ₗ ↑(e i)
⊢ comp (map (fun x => ↑(e x)) he)
      (map (fun i => ↑(LinearEquiv.symm (e i)))
        (_ :
          ∀ (i j : ι) (h : i ≤ j),
            (fun i => ↑(LinearEquiv.symm (e i))) j ∘ₗ f' i j h = f i j h ∘ₗ (fun i => ↑(LinearEquiv.symm (e i))) i)) =
    LinearMap.id

Next tactic:
simp [map_comp]