In my tex document I have 3 environments for Definition, Theorem and Lemma.
The numbering of them should be continuous as follows:
Definition 1.1
Theorem 1.2
Lemma 1.3
Definition 1.4
...
I got it by the following:
\newtheorem{defn}{Definition}[chapter]
\newtheorem{theorem}[defn]{Theorem}
\newtheorem{lemma}[defn]{Lemma}
\def\defnautorefname{Def.}
\def\theoremautorefname{Thm.}
\def\lemmaautorefname{Lem.}
So far so good. Then I want to make reference to each of them using \autoref, for instance:
\autoref{defn:1}
\autoref{theorem:1}
\autoref{lemma:1}
But what I obtain is only:
Def. 1.1
Def. 1.2
Def. 1.3
and NOT as I would like to have:
Def. 1.1
Thm. 1.2
Lem. 1.3
My full code:
\documentclass[a4paper,11pt]{report}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{hyperref}
\newtheorem{defn}{Definition}[chapter]
\newtheorem{theorem}[defn]{Theorem}
\newtheorem{lemma}[defn]{Lemma}
\def\defnautorefname{Def.}
\def\theoremautorefname{Thm.}
\def\lemmaautorefname{Lem.}
\parindent0pt
\begin{document}
\chapter{Chapter 1}
\begin{defn}
\label{defn:1}
Def 1
\end{defn}
\begin{theorem}
\label{theorem:1}
Theorem 1
\end{theorem}
\begin{lemma}
\label{lemma:1}
Lemma 1
\end{lemma}
\begin{defn}
\label{defn:2}
Lemma 1
\end{defn}
Here should be Definition: \autoref{defn:1}
Here should be Theorem: \autoref{theorem:1}
Here should be Lemma: \autoref{lemma:1}
\end{document}

\autorefin thehyperrefmanual is useful. – Torbjørn T. Nov 08 '15 at 13:58cleveref? – egreg Nov 08 '15 at 14:00