With or without theorem name, without the proof. QED compares it as text with the statements it has verified. The theorem name, the names of bound variables and spellings such as Nat for ℕ do not count. QED does not run Lean on it. So a match is a candidate to read, and no match does not mean the statement is unproved.